개정판 d39b9d01
fix size
Change-Id: Icfd95e4c9f39c53b0e173ddf26b16ff54d21c3b8
DTI_PID/DTI_PID/ImportTextFromCADDialog.py | ||
---|---|---|
313 | 313 |
self.ui.checkBoxGenDrawing.setChecked(False) |
314 | 314 | |
315 | 315 |
# disabel manual cal. |
316 |
''' |
|
316 | 317 |
self.ui.label.setVisible(False) |
317 | 318 |
self.ui.spinBoxX.setVisible(False) |
318 | 319 |
self.ui.spinBoxY.setVisible(False) |
... | ... | |
332 | 333 |
self.ui.doubleSpinBox.setVisible(False) |
333 | 334 |
self.ui.doubleSpinBox_2.setVisible(False) |
334 | 335 |
self.ui.checkBoxAuto.setVisible(False) |
336 |
''' |
|
335 | 337 | |
336 | 338 |
def importClicked(self): |
337 | 339 |
if self.ui.checkBoxLegend.isChecked(): |
DTI_PID/DTI_PID/Shapes/EngineeringAbstractItem.py | ||
---|---|---|
1295 | 1295 |
def inch_to_number(self, inch_str): |
1296 | 1296 |
from AppDocData import AppDocData |
1297 | 1297 |
|
1298 |
app_doc_data = AppDocData.instance() |
|
1299 |
configs = app_doc_data.getConfigs('Size', 'Symbol') |
|
1300 |
size_symbols = configs[0].value.replace(' ', '').split(',') if 1 == len(configs) else ['"'] |
|
1301 | ||
1302 |
inch_str = str(inch_str) |
|
1303 |
for symbol in size_symbols: |
|
1304 |
inchs = inch_str.replace(symbol, '') |
|
1305 |
inchs = inchs.replace('"', '').split('-') |
|
1306 | ||
1307 |
number = 0 |
|
1308 |
for inch in inchs: |
|
1309 |
if '/' not in inch: |
|
1310 |
number += float(inch) |
|
1311 |
else: |
|
1312 |
fraction = inch.split('/') |
|
1313 |
number += float(fraction[0]) / float(fraction[1]) |
|
1298 |
try: |
|
1299 |
app_doc_data = AppDocData.instance() |
|
1300 |
configs = app_doc_data.getConfigs('Size', 'Symbol') |
|
1301 |
size_symbols = configs[0].value.replace(' ', '').split(',') if 1 == len(configs) else ['"'] |
|
1302 | ||
1303 |
inchs = str(inch_str) |
|
1304 |
for symbol in size_symbols: |
|
1305 |
inchs = inchs.replace(symbol, '') |
|
1306 |
inchs = inchs.replace('"', '').split('-') |
|
1307 | ||
1308 |
number = 0 |
|
1309 |
for inch in inchs: |
|
1310 |
if '/' not in inch: |
|
1311 |
number += float(inch) |
|
1312 |
else: |
|
1313 |
fraction = inch.split('/') |
|
1314 |
number += float(fraction[0]) / float(fraction[1]) |
|
1315 |
except Exception as ex: |
|
1316 |
from App import App |
|
1317 |
from AppDocData import MessageType |
|
1318 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
|
1319 |
sys.exc_info()[-1].tb_lineno) |
|
1320 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
|
1321 | ||
1322 |
return 0 |
|
1314 | 1323 | |
1315 | 1324 |
return number |
1316 | 1325 |
DTI_PID/DTI_PID/TextItemFactory.py | ||
---|---|---|
428 | 428 |
number += float(fraction[0]) / float(fraction[1]) |
429 | 429 |
except Exception as ex: |
430 | 430 |
from App import App |
431 |
from AppDocData import MessageType |
|
431 | 432 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
432 |
sys.exc_info()[-1].tb_lineno)
|
|
433 |
sys.exc_info()[-1].tb_lineno) |
|
433 | 434 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
434 | 435 | |
435 | 436 |
return 0 |
내보내기 Unified diff