개정판 10182ed5
ff ui test
Change-Id: Id58bdc6ad10a1d1e9654ece553c8f8a63c48c0ed
DTI_PID/DTI_PID/ConfigurationDialog.py | ||
---|---|---|
43 | 43 |
self.currentIndex = 0 |
44 | 44 |
self.lineNoAttributeUID = [] |
45 | 45 |
self.tempLineColorUID = [] |
46 |
self.project = docData.getCurrentProject() |
|
46 | 47 |
|
47 | 48 |
docData = AppDocData.instance() |
48 | 49 |
self.ui.comboBoxOCRData.addItem('eng') |
49 | 50 |
tessdata_path = os.path.join(os.getenv('USERPROFILE'), 'Digital PID', 'Tesseract-OCR', 'tessdata') |
50 |
if os.path.isfile(os.path.join(tessdata_path, docData.getCurrentProject().name + '.traineddata')):
|
|
51 |
self.ui.comboBoxOCRData.addItem(docData.getCurrentProject().name)
|
|
51 |
if os.path.isfile(os.path.join(tessdata_path, self.project.name + '.traineddata')):
|
|
52 |
self.ui.comboBoxOCRData.addItem(self.project.name)
|
|
52 | 53 |
|
53 | 54 |
configs = docData.getConfigs('Text Recognition', 'OCR Data') |
54 | 55 |
value = configs[0].value if 1 == len(configs) else '' |
... | ... | |
560 | 561 |
else: |
561 | 562 |
self.ui.radioButtonOCRLocal.setChecked(True) |
562 | 563 |
self.ui.radioButtonOCRServer.setChecked(False) |
563 |
configs = docData.getConfigs('Project', 'Operation') |
|
564 |
if configs: |
|
565 |
size = int(configs[0].value) |
|
566 |
self.ui.radioButtonOpModeGeneral.setChecked(True if size == 1 else False) |
|
567 |
self.ui.radioButtonOpModeInst.setChecked(True if size == -1 else False) |
|
564 |
#configs = docData.getConfigs('Project', 'Operation') |
|
565 |
#if configs: |
|
566 |
# size = int(configs[0].value) |
|
567 |
# self.ui.radioButtonOpModeGeneral.setChecked(True if size == 1 else False) |
|
568 |
# self.ui.radioButtonOpModeInst.setChecked(True if size == -1 else False) |
|
569 |
#else: |
|
570 |
# self.ui.radioButtonOpModeGeneral.setChecked(True) |
|
571 |
# self.ui.radioButtonOpModeInst.setChecked(False) |
|
572 |
_desc = self.project.desc.split(self.lineNoDelimiter) |
|
573 |
if len(_desc) == 2: |
|
574 |
if _desc[0] == 'General': |
|
575 |
self.ui.radioButtonOpModeGeneral.setChecked(True) |
|
576 |
elif _desc[0] == 'FireFighting': |
|
577 |
self.ui.radioButtonOpModeFF.setChecked(True) |
|
578 |
elif _desc[0] == 'Instrument': |
|
579 |
self.ui.radioButtonOpModeInst.setChecked(True) |
|
580 |
else: |
|
581 |
self.ui.radioButtonOpModeGeneral.setChecked(True) |
|
582 |
elif len(_desc) == 1: |
|
583 |
if _desc[0] == 'General': |
|
584 |
self.ui.radioButtonOpModeGeneral.setChecked(True) |
|
585 |
elif _desc[0] == 'FireFighting': |
|
586 |
self.ui.radioButtonOpModeFF.setChecked(True) |
|
587 |
elif _desc[0] == 'Instrument': |
|
588 |
self.ui.radioButtonOpModeInst.setChecked(True) |
|
589 |
else: |
|
590 |
self.ui.radioButtonOpModeGeneral.setChecked(True) |
|
568 | 591 |
else: |
569 | 592 |
self.ui.radioButtonOpModeGeneral.setChecked(True) |
570 |
self.ui.radioButtonOpModeInst.setChecked(False) |
|
571 | 593 |
|
572 | 594 |
# app config for individual user |
573 | 595 |
configs = docData.getAppConfigs('app', 'port') |
... | ... | |
1323 | 1345 |
# ai mode |
1324 | 1346 |
configs.append(Config('Engine', 'AI', '1' if self.ui.radioButtonAI1.isChecked() else ('2' if self.ui.radioButtonAI2.isChecked() else '3'))) |
1325 | 1347 |
configs.append(Config('Engine', 'OCR', '1' if self.ui.radioButtonOCRLocal.isChecked() else '-1')) |
1326 |
configs.append(Config('Project', 'Operation', '1' if self.ui.radioButtonOpModeGeneral.isChecked() else '-1')) |
|
1348 |
#configs.append(Config('Project', 'Operation', '1' if self.ui.radioButtonOpModeGeneral.isChecked() else '-1'))
|
|
1327 | 1349 |
|
1328 | 1350 |
# app config |
1329 | 1351 |
app_configs = [] |
1330 | 1352 |
app_configs.append(Config('app', 'port', self.ui.spinBoxListeningPort.value())) |
1331 | 1353 |
|
1354 |
_desc = self.project.desc.split(self.lineNoDelimiter) |
|
1355 |
if len(_desc) == 2: |
|
1356 |
if self.ui.radioButtonOpModeGeneral.isChecked(): |
|
1357 |
self.project.desc = 'General' + self.lineNoDelimiter + _desc[1] |
|
1358 |
elif self.ui.radioButtonOpModeFF.isChecked(): |
|
1359 |
self.project.desc = 'FireFighting' + self.lineNoDelimiter + _desc[1] |
|
1360 |
elif self.ui.radioButtonOpModeInst.isChecked(): |
|
1361 |
self.project.desc = 'Instrument' + self.lineNoDelimiter + _desc[1] |
|
1362 |
else: |
|
1363 |
self.project.desc = 'General' + self.lineNoDelimiter + _desc[1] |
|
1364 |
elif len(_desc) == 1: |
|
1365 |
if self.ui.radioButtonOpModeGeneral.isChecked(): |
|
1366 |
self.project.desc = 'General' + self.lineNoDelimiter + _desc[0] |
|
1367 |
elif self.ui.radioButtonOpModeFF.isChecked(): |
|
1368 |
self.project.desc = 'FireFighting' + self.lineNoDelimiter + _desc[0] |
|
1369 |
elif self.ui.radioButtonOpModeInst.isChecked(): |
|
1370 |
self.project.desc = 'Instrument' + self.lineNoDelimiter + _desc[0] |
|
1371 |
else: |
|
1372 |
self.project.desc = 'General' + self.lineNoDelimiter + _desc[0] |
|
1373 |
else: |
|
1374 |
self.project.desc = 'General' + self.lineNoDelimiter + '' |
|
1375 |
|
|
1376 |
docData.updateProjectUpdatedDate(self.project) |
|
1377 |
|
|
1332 | 1378 |
docData.saveAppConfigs(app_configs) |
1333 | 1379 |
docData.saveConfigs(configs) |
1334 | 1380 |
docData.updateProjectUnit('Imperial' if self.ui.radioButtonSizeUnitImaperial.isChecked() else 'Metric') |
DTI_PID/DTI_PID/ConnectAttrDialog.py | ||
---|---|---|
99 | 99 |
else: |
100 | 100 |
self.ui.checkBoxStreamNo.setHidden(True) |
101 | 101 |
|
102 |
configs = app_doc_data.getConfigs('Project', 'Operation') |
|
103 |
self.instrument = int(configs[0].value) if configs else 1 |
|
104 |
|
|
105 |
if self.instrument != 1: |
|
102 |
#configs = app_doc_data.getConfigs('Project', 'Operation') |
|
103 |
_desc = app_doc_data.getCurrentProject().desc.split('!-!') |
|
104 |
if len(_desc) == 2 and _desc[0] == 'Instrument': |
|
106 | 105 |
self.ui.checkBoxUpdateFlowMark.setHidden(True) |
107 | 106 |
self.ui.checkBoxUpdateSpec.setHidden(True) |
108 | 107 |
self.ui.checkBoxUpdateLineType.setHidden(True) |
... | ... | |
174 | 173 |
|
175 | 174 |
# 1 - create Worker and Thread inside the Form |
176 | 175 |
|
177 |
if self.instrument == 1:
|
|
176 |
if not self.instrument:
|
|
178 | 177 |
self.obj = Worker(self.scene, connectAttrImpl, self.ui.checkBoxUpdateLineType.isChecked(), |
179 | 178 |
self.ui.checkBoxUpdateFlowMark.isChecked(), self.ui.checkBoxUpdateSpec.isChecked(), self.ui.checkBoxStreamNo.isChecked()) |
180 | 179 |
else: |
DTI_PID/DTI_PID/ItemPropertyTableWidget.py | ||
---|---|---|
386 | 386 |
elif type(item) is QEngineeringLineNoTextItem: |
387 | 387 |
self.setRowCount(2) |
388 | 388 |
self.setItem(0, 1, QTableWidgetItem(self.tr("UID"))) |
389 |
configs = AppDocData.instance().getConfigs('Project', 'Operation') |
|
390 |
if int(configs[0].value) if configs else 1: |
|
389 |
#configs = AppDocData.instance().getConfigs('Project', 'Operation') |
|
390 |
_desc = AppDocData.instance().getCurrentProject().desc.split('!-!') |
|
391 |
if len(_desc) == 2 and _desc[0] == 'Instrument': |
|
391 | 392 |
self.setItem(1, 1, QTableWidgetItem(self.tr("Set Batch"))) |
392 | 393 |
elif type(item) is QEngineeringLineItem: |
393 | 394 |
self.setRowCount(5) |
... | ... | |
844 | 845 |
self.setItem(0, 3, item) |
845 | 846 |
|
846 | 847 |
# for set batch |
847 |
configs = appDocData.getConfigs('Project', 'Operation') |
|
848 |
if int(configs[0].value) if configs else 1: |
|
848 |
#configs = appDocData.getConfigs('Project', 'Operation') |
|
849 |
_desc = appDocData.getCurrentProject().desc.split('!-!') |
|
850 |
if len(_desc) == 2 and _desc[0] == 'Instrument': |
|
849 | 851 |
owner_item = QTableWidgetItem('None') |
850 | 852 |
self.setItem(1, 3, owner_item) |
851 | 853 |
attr = SymbolAttr() |
DTI_PID/DTI_PID/RecognitionDialog.py | ||
---|---|---|
1261 | 1261 |
blind_list = [] |
1262 | 1262 |
|
1263 | 1263 |
#print('flag3.9') |
1264 |
configs = app_doc_data.getConfigs('Project', 'Operation') |
|
1265 |
instrument = int(configs[0].value) if configs else 1 |
|
1264 |
#configs = app_doc_data.getConfigs('Project', 'Operation') |
|
1265 |
_desc = app_doc_data.getCurrentProject().desc.split('!-!') |
|
1266 |
if len(_desc) == 2 and _desc[0] == 'Instrument': |
|
1267 |
instrument = True |
|
1268 |
else: |
|
1269 |
instrument = False |
|
1270 |
|
|
1266 | 1271 |
if app_doc_data.lines: |
1267 | 1272 |
# connect line to symbol |
1268 | 1273 |
try: |
... | ... | |
1321 | 1326 |
# detect flange |
1322 | 1327 |
try: |
1323 | 1328 |
not_conn = [] |
1324 |
if instrument == 1:
|
|
1329 |
if not instrument:
|
|
1325 | 1330 |
flange = None |
1326 | 1331 |
configs = app_doc_data.getConfigs('Default', 'Flange') |
1327 | 1332 |
flange_name = configs[0].value if 1 == len(configs) else 'flange' |
... | ... | |
1439 | 1444 |
|
1440 | 1445 |
# remove piping line and text for instrument mode |
1441 | 1446 |
try: |
1442 |
if instrument == -1:
|
|
1447 |
if instrument: |
|
1443 | 1448 |
# remove piping line |
1444 | 1449 |
remove_items = [] |
1445 | 1450 |
|
... | ... | |
4226 | 4231 |
conn.transfer.onPosChanged.connect(line.onConnectorPosChaned) |
4227 | 4232 |
|
4228 | 4233 |
# insert flange |
4229 |
configs = app_doc_data.getConfigs('Project', 'Operation') |
|
4230 |
instrument = int(configs[0].value) if configs else 1
|
|
4231 |
if instrument == 1:
|
|
4234 |
#configs = app_doc_data.getConfigs('Project', 'Operation')
|
|
4235 |
_desc = app_doc_data.getCurrentProject().desc.split('!-!')
|
|
4236 |
if not (len(_desc) == 2 and _desc[0] == 'Instrument'):
|
|
4232 | 4237 |
configs = app_doc_data.getConfigs('Default', 'Flange') |
4233 | 4238 |
flange_name = configs[0].value if 1 == len(configs) else 'flange' |
4234 | 4239 |
for flange in flanges[0]: |
내보내기 Unified diff