개정판 11045d18
custom line type test, inst attrs update
Change-Id: I42b0e7ab3a9a186f7758e081e8c271a88acd1c36
DTI_PID/DTI_PID/ConfigurationDialog.py | ||
---|---|---|
337 | 337 |
self.ui.lineEditOPCToPrefix.setText(configs[0].value if configs else '') |
338 | 338 |
configs = docData.getConfigs('Supplied by Tag Rule', 'by Vendor') |
339 | 339 |
self.ui.lineEditByVendor.setText(configs[0].value if configs else 'by Vendor') |
340 |
self.ui.lineEditDrainSize.setText(docData.drain_size) # 2019.05.20 added by humkyung |
|
340 |
self.ui.lineEditDrainSize.setText(docData.drain_size) |
|
341 |
|
|
342 |
configs = docData.getConfigs('Line', 'Piping') |
|
343 |
self.ui.lineEditPipingLineType.setText(configs[0].value) if 1 == len(configs) else \ |
|
344 |
self.ui.lineEditPipingLineType.setText('Secondary,Primary') |
|
341 | 345 |
|
342 | 346 |
configs = docData.getConfigs('LineTypes') |
343 | 347 |
|
... | ... | |
1244 | 1248 |
configs.append(Config('Default', 'Blind', self.ui.lineEditBlind.text())) |
1245 | 1249 |
configs.append(Config('Text Recognition', 'Page Segmentation Modes', |
1246 | 1250 |
str(self.ui.comboBoxPageSegmentationModes.currentIndex()))) |
1247 |
# Add Line Color Option - 2018.07.06 by kyouho |
|
1251 |
configs.append(Config('Line', 'Piping', self.ui.lineEditPipingLineType.text())) |
|
1252 |
# Add Line Color Option |
|
1248 | 1253 |
rbRandomValue = self.ui.radioButtonRandom.isChecked() |
1249 | 1254 |
|
1250 | 1255 |
for row in range(self.ui.tableWidgetLineTypes.rowCount()): |
DTI_PID/DTI_PID/Configuration_UI.py | ||
---|---|---|
14 | 14 |
class Ui_ConfigurationDialog(object): |
15 | 15 |
def setupUi(self, ConfigurationDialog): |
16 | 16 |
ConfigurationDialog.setObjectName("ConfigurationDialog") |
17 |
ConfigurationDialog.resize(768, 844)
|
|
17 |
ConfigurationDialog.resize(768, 871)
|
|
18 | 18 |
font = QtGui.QFont() |
19 | 19 |
font.setFamily("맑은 고딕") |
20 | 20 |
ConfigurationDialog.setFont(font) |
... | ... | |
635 | 635 |
self.gridLayout_16.addWidget(self.tableWidgetLineTypes, 1, 0, 1, 1) |
636 | 636 |
self.horizontalLayout_17 = QtWidgets.QHBoxLayout() |
637 | 637 |
self.horizontalLayout_17.setObjectName("horizontalLayout_17") |
638 |
self.label_64 = QtWidgets.QLabel(self.groupBox_6) |
|
639 |
self.label_64.setObjectName("label_64") |
|
640 |
self.horizontalLayout_17.addWidget(self.label_64) |
|
641 |
self.lineEditPipingLineType = QtWidgets.QLineEdit(self.groupBox_6) |
|
642 |
self.lineEditPipingLineType.setObjectName("lineEditPipingLineType") |
|
643 |
self.horizontalLayout_17.addWidget(self.lineEditPipingLineType) |
|
638 | 644 |
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) |
639 | 645 |
self.horizontalLayout_17.addItem(spacerItem5) |
640 | 646 |
self.pushButtonLineTypeAdd = QtWidgets.QPushButton(self.groupBox_6) |
... | ... | |
1158 | 1164 |
self.lineEditOPCToPrefix.setText(_translate("ConfigurationDialog", "TO")) |
1159 | 1165 |
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabTagNoRule), _translate("ConfigurationDialog", "Tag Rule")) |
1160 | 1166 |
self.groupBox_6.setTitle(_translate("ConfigurationDialog", "Line Setting")) |
1167 |
self.label_64.setText(_translate("ConfigurationDialog", "Piping Type : ")) |
|
1161 | 1168 |
self.groupBox_2.setTitle(_translate("ConfigurationDialog", "Symbol Style")) |
1162 | 1169 |
self.label_3.setText(_translate("ConfigurationDialog", "Instrument Color : ")) |
1163 | 1170 |
self.label_23.setText(_translate("ConfigurationDialog", "Equipment Color : ")) |
DTI_PID/DTI_PID/ImportTextFromCADDialog.py | ||
---|---|---|
313 | 313 |
self.ui.checkBoxGenDrawing.setChecked(False) |
314 | 314 |
|
315 | 315 |
# disabel manual cal. |
316 |
#'''
|
|
316 |
''' |
|
317 | 317 |
self.ui.label.setVisible(False) |
318 | 318 |
self.ui.spinBoxX.setVisible(False) |
319 | 319 |
self.ui.spinBoxY.setVisible(False) |
... | ... | |
333 | 333 |
self.ui.doubleSpinBox.setVisible(False) |
334 | 334 |
self.ui.doubleSpinBox_2.setVisible(False) |
335 | 335 |
self.ui.checkBoxAuto.setVisible(False) |
336 |
#'''
|
|
336 |
''' |
|
337 | 337 |
|
338 | 338 |
def importClicked(self): |
339 | 339 |
if self.ui.checkBoxLegend.isChecked(): |
DTI_PID/DTI_PID/LineNoTracer.py | ||
---|---|---|
1013 | 1013 |
end_break.transfer.onRemoved.connect(App.mainWnd().itemRemoved) |
1014 | 1014 |
# end break can be modeled only piping line |
1015 | 1015 |
if (type(end_break.owner) is not QEngineeringLineItem or ( |
1016 |
type(end_break.owner) is QEngineeringLineItem and ( |
|
1017 |
end_break.owner.lineType == 'Secondary' or end_break.owner.lineType == 'Primary'))) \ |
|
1016 |
type(end_break.owner) is QEngineeringLineItem and end_break.owner.is_piping(True))) \ |
|
1018 | 1017 |
and (type(end_break.prop('Connected Item')) is not QEngineeringLineItem or ( |
1019 |
type(end_break.prop('Connected Item')) is QEngineeringLineItem and ( |
|
1020 |
end_break.prop('Connected Item').lineType == 'Secondary' or end_break.prop( |
|
1021 |
'Connected Item').lineType == 'Primary'))): |
|
1018 |
type(end_break.prop('Connected Item')) is QEngineeringLineItem and end_break.prop('Connected Item').is_piping(True))): |
|
1022 | 1019 |
end_break.addSvgItemToScene(worker.scene) |
1023 | 1020 |
|
1024 | 1021 |
except Exception as ex: |
... | ... | |
1070 | 1067 |
for lineNo in lineNos: |
1071 | 1068 |
for run in lineNo.runs: |
1072 | 1069 |
line_ends.append(run.items[0]) if issubclass(type(run.items[0]), SymbolSvgItem) or ( |
1073 |
type(run.items[0]) is QEngineeringLineItem and ( |
|
1074 |
run.items[0].lineType == 'Secondary' or run.items[ |
|
1075 |
0].lineType == 'Primary')) else None |
|
1070 |
type(run.items[0]) is QEngineeringLineItem and run.items[0].is_piping(True)) else None |
|
1076 | 1071 |
for lineNo in lineNos: |
1077 | 1072 |
for run in lineNo.runs: |
1078 | 1073 |
if run.items[0] is not run.items[-1]: |
1079 | 1074 |
line_ends.append(run.items[-1]) if issubclass(type(run.items[-1]), SymbolSvgItem) or ( |
1080 |
type(run.items[-1]) is QEngineeringLineItem and ( |
|
1081 |
run.items[-1].lineType == 'Secondary' or run.items[ |
|
1082 |
-1].lineType == 'Primary')) else None |
|
1075 |
type(run.items[-1]) is QEngineeringLineItem and run.items[-1].is_piping(True)) else None |
|
1083 | 1076 |
|
1084 | 1077 |
spec_breaks = [] |
1085 | 1078 |
for line_end in line_ends: |
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
3077 | 3077 |
|
3078 | 3078 |
target_symbol = symbolItems[0] |
3079 | 3079 |
index = [index for index in range(len(target_symbol.conn_type)) \ |
3080 |
if target_symbol.conn_type[index] == 'Primary' or target_symbol.conn_type[index] == 'Secondary']
|
|
3080 |
if QEngineeringLineItem.check_piping(target_symbol.conn_type[index], True)]
|
|
3081 | 3081 |
for connector in target_symbol.connectors: |
3082 | 3082 |
svg = QtImageViewer.createSymbolObject(symName) |
3083 | 3083 |
if len(svg.connectors) > 1: |
DTI_PID/DTI_PID/RecognitionDialog.py | ||
---|---|---|
1294 | 1294 |
if sym.conn_type: |
1295 | 1295 |
for index in range(len(sym.conn_type)): |
1296 | 1296 |
item = sym.connectors[index].connectedItem |
1297 |
if item and type(item) is QEngineeringLineItem and sym.conn_type[index] != 'Secondary' and sym.conn_type[index] != 'Primary':
|
|
1297 |
if item and type(item) is QEngineeringLineItem and not QEngineeringLineItem.check_piping(sym.conn_type[index], True):
|
|
1298 | 1298 |
Worker.changeConnectedLineType(item, sym.conn_type[index]) |
1299 | 1299 |
|
1300 | 1300 |
except Exception as ex: |
... | ... | |
1310 | 1310 |
for sym in symbols: |
1311 | 1311 |
if sym.conn_type: |
1312 | 1312 |
for index in range(len(sym.conn_type)): |
1313 |
if sym.conn_type[index] == 'Secondary' or sym.conn_type[index] == 'Primary':
|
|
1313 |
if QEngineeringLineItem.check_piping(sym.conn_type[index], True):
|
|
1314 | 1314 |
item = sym.connectors[index].connectedItem |
1315 | 1315 |
if item is None: |
1316 | 1316 |
conns.append(sym.connectors[index]) |
... | ... | |
1340 | 1340 |
if sym.conn_type: |
1341 | 1341 |
for index in range(len(sym.conn_type)): |
1342 | 1342 |
item = sym.connectors[index].connectedItem |
1343 |
if flange and item and type(item) is QEngineeringLineItem and (sym.conn_type[index] == 'Secondary' or sym.conn_type[index] == 'Primary') \
|
|
1343 |
if flange and item and type(item) is QEngineeringLineItem and QEngineeringLineItem.check_piping(sym.conn_type[index], True) \
|
|
1344 | 1344 |
and item.is_piping(True): |
1345 | 1345 |
point = worker.detectFlangeOnPid(sym, sym.connectors[index], item, app_doc_data.activeDrawing.image_origin) |
1346 | 1346 |
if point is not None: |
1347 | 1347 |
flange_list.append(point) |
1348 | 1348 |
|
1349 |
elif blind and not item and (sym.conn_type[index] == 'Secondary' or sym.conn_type[index] == 'Primary'):
|
|
1349 |
elif blind and not item and QEngineeringLineItem.check_piping(sym.conn_type[index], True):
|
|
1350 | 1350 |
point = worker.detectFlangeOnPid(sym, sym.connectors[index], None, app_doc_data.activeDrawing.image_origin) |
1351 | 1351 |
if point is not None: |
1352 | 1352 |
blind_list.append(point) |
... | ... | |
1364 | 1364 |
for sym in symbols: |
1365 | 1365 |
if sym.conn_type: |
1366 | 1366 |
for index in range(len(sym.conn_type)): |
1367 |
if sym.conn_type[index] == 'Secondary' or sym.conn_type[index] == 'Primary':
|
|
1367 |
if QEngineeringLineItem.check_piping(sym.conn_type[index], True):
|
|
1368 | 1368 |
item = sym.connectors[index].connectedItem |
1369 | 1369 |
if item is None and sym.connectors[index] not in not_conn: |
1370 | 1370 |
conns.append(sym.connectors[index]) |
... | ... | |
1402 | 1402 |
for sym in symbols: |
1403 | 1403 |
if sym.conn_type: |
1404 | 1404 |
for index in range(len(sym.conn_type)): |
1405 |
if sym.conn_type[index] != 'Secondary' and sym.conn_type[index] != 'Primary':
|
|
1405 |
if not QEngineeringLineItem.check_piping(sym.conn_type[index], True):
|
|
1406 | 1406 |
item = sym.connectors[index].connectedItem |
1407 | 1407 |
if item and type(item) is QEngineeringLineItem: |
1408 | 1408 |
if item in lines: |
... | ... | |
1693 | 1693 |
line_shapes = [] |
1694 | 1694 |
|
1695 | 1695 |
# can not determine piping line cuz always matched |
1696 |
lines = [line for line in all_lines if line.lineType != 'Secondary' and line.lineType != 'Primary']
|
|
1696 |
lines = [line for line in all_lines if not QEngineeringLineItem.check_piping(line.lineType, True)]
|
|
1697 | 1697 |
|
1698 | 1698 |
line_names = app_doc_data.getSymbolListByType('type', 'Line') |
1699 | 1699 |
if len(line_names) != 0: |
DTI_PID/DTI_PID/Scripts/MSSQL/ID2.sql | ||
---|---|---|
2273 | 2273 |
INSERT INTO SymbolAttribute (UID,SymbolType_UID,"Attribute",DisplayAttribute,AttributeType,Expression,"index",AttrAt,"Length",Target,Property) VALUES ( |
2274 | 2274 |
'e630853f-8b08-45b8-949b-3005c02674b4','21','Type','Type','Text Item','item.text()[1:]',1,0,NULL,'ALL',0); |
2275 | 2275 |
INSERT INTO SymbolAttribute (UID,SymbolType_UID,"Attribute",DisplayAttribute,AttributeType,Expression,"index",AttrAt,"Length",Target,Property) VALUES ( |
2276 |
'94cfa92b-1e0c-49c1-866e-d540dc8c23a4','21','SeqNumber','Tag Seq Number','Text Item','item.text() if item.text()[-1].isdecimal() else (item.text()[:-1] if item.text()[-2].isdecimal() else (item.text()[:-2] if item.text()[-3].isdecimal() else item.text()[:-3]))',2,1,NULL,'ALL',0);
|
|
2276 |
'94cfa92b-1e0c-49c1-866e-d540dc8c23a4','21','SeqNumber','Tag Seq Number','Text Item','item.text() if item.text()[-1].isdecimal() else (item.text()[:-1] if len(item.text()) > 1 and item.text()[-2].isdecimal() else (item.text()[:-2] if len(item.text()) > 2 and item.text()[-3].isdecimal() else item.text()[:-3]))',2,1,NULL,'ALL',0);
|
|
2277 | 2277 |
INSERT INTO SymbolAttribute (UID,SymbolType_UID,"Attribute",DisplayAttribute,AttributeType,Expression,"index",AttrAt,"Length",Target,Property) VALUES ( |
2278 | 2278 |
'b21acc50-ca25-4d37-a121-b654c4e8b155','21','MEASURED_VARIABLE','MEASURED_VARIABLE','Text Item','item.text()[0]',0,0,NULL,'ALL',0); |
2279 | 2279 |
INSERT INTO SymbolAttribute (UID,SymbolType_UID,"Attribute",DisplayAttribute,AttributeType,Expression,"index",AttrAt,"Length",Target,Property) VALUES ( |
2280 | 2280 |
'eb5cbcca-9f4c-484e-a4cb-ca4fcc14499f','25','Type','Type','Text Item','item.text()[1:]',1,0,NULL,'ALL',0); |
2281 | 2281 |
INSERT INTO SymbolAttribute (UID,SymbolType_UID,"Attribute",DisplayAttribute,AttributeType,Expression,"index",AttrAt,"Length",Target,Property) VALUES ( |
2282 |
'0816f270-c098-4284-901f-61b7b5c856ef','25','SeqNumber','Tag Seq Number','Text Item','item.text() if item.text()[-1].isdecimal() else (item.text()[:-1] if item.text()[-2].isdecimal() else (item.text()[:-2] if item.text()[-3].isdecimal() else item.text()[:-3]))',2,1,NULL,'ALL',0);
|
|
2282 |
'0816f270-c098-4284-901f-61b7b5c856ef','25','SeqNumber','Tag Seq Number','Text Item','item.text() if item.text()[-1].isdecimal() else (item.text()[:-1] if len(item.text()) > 1 and item.text()[-2].isdecimal() else (item.text()[:-2] if len(item.text()) > 2 and item.text()[-3].isdecimal() else item.text()[:-3]))',2,1,NULL,'ALL',0);
|
|
2283 | 2283 |
INSERT INTO SymbolAttribute (UID,SymbolType_UID,"Attribute",DisplayAttribute,AttributeType,Expression,"index",AttrAt,"Length",Target,Property) VALUES ( |
2284 | 2284 |
'4271299e-a197-4250-b195-c748aa46b9a2','25','MEASURED_VARIABLE','MEASURED_VARIABLE','Text Item','item.text()[0]',0,0,NULL,'ALL',0); |
2285 | 2285 |
INSERT INTO SymbolAttribute (UID,SymbolType_UID,"Attribute",DisplayAttribute,AttributeType,Expression,"index",AttrAt,"Length",Target,Property) VALUES ( |
... | ... | |
2351 | 2351 |
INSERT INTO SymbolAttribute (UID,SymbolType_UID,"Attribute",DisplayAttribute,AttributeType,Expression,"index",AttrAt,"Length",Target,Property) VALUES ( |
2352 | 2352 |
'235c62dc-02ca-483b-bcd6-eb8ee5c86f9a','19','Type','Type','Text Item','item.text()[1:]',2,0,NULL,'ALL',0); |
2353 | 2353 |
INSERT INTO SymbolAttribute (UID,SymbolType_UID,"Attribute",DisplayAttribute,AttributeType,Expression,"index",AttrAt,"Length",Target,Property) VALUES ( |
2354 |
'16b674b2-9c10-4309-9d98-c36035ab0922','19','SeqNumber','Tag Seq Number','Text Item','item.text() if item.text()[-1].isdecimal() else (item.text()[:-1] if item.text()[-2].isdecimal() else (item.text()[:-2] if item.text()[-3].isdecimal() else item.text()[:-3]))',3,1,NULL,'ALL',0);
|
|
2354 |
'16b674b2-9c10-4309-9d98-c36035ab0922','19','SeqNumber','Tag Seq Number','Text Item','item.text() if item.text()[-1].isdecimal() else (item.text()[:-1] if len(item.text()) > 1 and item.text()[-2].isdecimal() else (item.text()[:-2] if len(item.text()) > 2 and item.text()[-3].isdecimal() else item.text()[:-3]))',3,1,NULL,'ALL',0);
|
|
2355 | 2355 |
INSERT INTO SymbolAttribute (UID,SymbolType_UID,"Attribute",DisplayAttribute,AttributeType,Expression,"index",AttrAt,"Length",Target,Property) VALUES ( |
2356 |
'a5b5ff96-c33c-43e2-91ed-b0e2ad583a53','19','Suffix','Tag Suffix','Text Item',''''' if item.text()[-1].isdecimal() else (item.text()[-1] if item.text()[-2].isdecimal() else (item.text()[-2:] if item.text()[-3].isdecimal() else item.text()[-3:]))',4,1,NULL,'ALL',0);
|
|
2356 |
'a5b5ff96-c33c-43e2-91ed-b0e2ad583a53','19','Suffix','Tag Suffix','Text Item',''''' if item.text()[-1].isdecimal() else (item.text()[-1] if len(item.text()) > 1 and item.text()[-2].isdecimal() else (item.text()[-2:] if len(item.text()) > 2 and item.text()[-3].isdecimal() else item.text()[-3:]))',4,1,NULL,'ALL',0);
|
|
2357 | 2357 |
INSERT INTO SymbolAttribute (UID,SymbolType_UID,"Attribute",DisplayAttribute,AttributeType,Expression,"index",AttrAt,"Length",Target,Property) VALUES ( |
2358 |
'7b22bbba-9323-43af-9ca3-973c0a2a2b37','21','Suffix','Tag Suffix','Text Item',''''' if item.text()[-1].isdecimal() else (item.text()[-1] if item.text()[-2].isdecimal() else (item.text()[-2:] if item.text()[-3].isdecimal() else item.text()[-3:]))',3,1,NULL,'ALL',0);
|
|
2358 |
'7b22bbba-9323-43af-9ca3-973c0a2a2b37','21','Suffix','Tag Suffix','Text Item',''''' if item.text()[-1].isdecimal() else (item.text()[-1] if len(item.text()) > 1 and item.text()[-2].isdecimal() else (item.text()[-2:] if len(item.text()) > 2 and item.text()[-3].isdecimal() else item.text()[-3:]))',3,1,NULL,'ALL',0);
|
|
2359 | 2359 |
INSERT INTO SymbolAttribute (UID,SymbolType_UID,"Attribute",DisplayAttribute,AttributeType,Expression,"index",AttrAt,"Length",Target,Property) VALUES ( |
2360 |
'28a2680b-3125-4cb7-a637-26ec54d594b1','25','Suffix','Tag Suffix','Text Item',''''' if item.text()[-1].isdecimal() else (item.text()[-1] if item.text()[-2].isdecimal() else (item.text()[-2:] if item.text()[-3].isdecimal() else item.text()[-3:]))',3,1,NULL,'ALL',0);
|
|
2360 |
'28a2680b-3125-4cb7-a637-26ec54d594b1','25','Suffix','Tag Suffix','Text Item',''''' if item.text()[-1].isdecimal() else (item.text()[-1] if len(item.text()) > 1 and item.text()[-2].isdecimal() else (item.text()[-2:] if len(item.text()) > 2 and item.text()[-3].isdecimal() else item.text()[-3:]))',3,1,NULL,'ALL',0);
|
|
2361 | 2361 |
INSERT INTO SymbolAttribute (UID,SymbolType_UID,"Attribute",DisplayAttribute,AttributeType,Expression,"index",AttrAt,"Length",Target,Property) VALUES ( |
2362 | 2362 |
'66cef7da-9f34-4dd8-8f23-b804b2cc6e16','19','SP','SP','Text Item','item.text()',5,0,NULL,'ALL',0); |
2363 | 2363 |
INSERT INTO SymbolAttribute (UID,SymbolType_UID,"Attribute",DisplayAttribute,AttributeType,Expression,"index",AttrAt,"Length",Target,Property) VALUES ( |
DTI_PID/DTI_PID/Shapes/EngineeringAbstractItem.py | ||
---|---|---|
580 | 580 |
return res |
581 | 581 |
if issubclass(type(matches[0].items[0]), SymbolSvgItem): |
582 | 582 |
_item = matches[0].items[0] |
583 |
connectedItems = [_item.connectors[index].connectedItem for index in range(len(_item.conn_type)) if (_item.conn_type[index] == 'Secondary' or _item.conn_type[index] == 'Primary') and \
|
|
583 |
connectedItems = [_item.connectors[index].connectedItem for index in range(len(_item.conn_type)) if QEngineeringLineItem.check_piping(_item.conn_type[index], True) and \
|
|
584 | 584 |
_item.connectors[index].connectedItem and _item.connectors[index].connectedItem not in matches[0].items] |
585 | 585 |
if connectedItems: |
586 | 586 |
connectedItems[0].sizeDepth = self.sizeDepth + 1 |
... | ... | |
590 | 590 |
return res |
591 | 591 |
if issubclass(type(matches[0].items[-1]), SymbolSvgItem): |
592 | 592 |
_item = matches[0].items[-1] |
593 |
connectedItems = [_item.connectors[index].connectedItem for index in range(len(_item.conn_type)) if (_item.conn_type[index] == 'Secondary' or _item.conn_type[index] == 'Primary') and \
|
|
593 |
connectedItems = [_item.connectors[index].connectedItem for index in range(len(_item.conn_type)) if QEngineeringLineItem.check_piping(_item.conn_type[index], True) and \
|
|
594 | 594 |
_item.connectors[index].connectedItem and _item.connectors[index].connectedItem not in matches[0].items] |
595 | 595 |
if connectedItems: |
596 | 596 |
connectedItems[0].sizeDepth = self.sizeDepth + 1 |
DTI_PID/DTI_PID/Shapes/EngineeringLineItem.py | ||
---|---|---|
613 | 613 |
|
614 | 614 |
def is_piping(self, strong=False): |
615 | 615 |
""" return true if piping line """ |
616 |
from AppDocData import AppDocData |
|
617 |
|
|
618 |
configs = AppDocData.instance().getConfigs('Line', 'Piping') |
|
619 |
pipings = configs[0].value if 1 == len(configs) else 'Secondary,Primary' |
|
620 |
pipings = [piping.strip() for piping in pipings.split(',')] |
|
621 |
|
|
616 | 622 |
if strong: |
617 |
return self._lineType == 'Primary' or self._lineType == 'Secondary'
|
|
623 |
return self._lineType in pipings
|
|
618 | 624 |
else: |
619 |
return self._lineType == 'Primary' or self._lineType == 'Secondary' or \ |
|
620 |
self._lineType == 'Connect To Process' |
|
625 |
return self._lineType in pipings or self._lineType == 'Connect To Process' |
|
621 | 626 |
|
622 | 627 |
def next_connected(self, lhs, rhs): |
623 | 628 |
""" check given two item's are next connected(ex: 0-1) """ |
... | ... | |
632 | 637 |
@staticmethod |
633 | 638 |
def check_piping(lineType, strong=False): |
634 | 639 |
""" return true if piping line """ |
640 |
from AppDocData import AppDocData |
|
641 |
|
|
642 |
configs = AppDocData.instance().getConfigs('Line', 'Piping') |
|
643 |
pipings = configs[0].value if 1 == len(configs) else 'Secondary,Primary' |
|
644 |
pipings = [piping.strip() for piping in pipings.split(',')] |
|
645 |
|
|
635 | 646 |
if strong: |
636 |
return lineType == 'Primary' or lineType == 'Secondary'
|
|
647 |
return lineType in pipings
|
|
637 | 648 |
else: |
638 |
return lineType == 'Primary' or lineType == 'Secondary' or \ |
|
639 |
lineType == 'Connect To Process' |
|
640 |
|
|
649 |
return lineType in pipings or lineType == 'Connect To Process' |
|
641 | 650 |
|
642 | 651 |
''' |
643 | 652 |
@brief check if two lines are extendable |
DTI_PID/DTI_PID/Shapes/EngineeringLineNoTextItem.py | ||
---|---|---|
375 | 375 |
pre = None |
376 | 376 |
preRadian = None |
377 | 377 |
for item in run.items: |
378 |
if pre is None and type(item) is QEngineeringLineItem and ( |
|
379 |
item._lineType == 'Primary' or item._lineType == 'Secondary') and item.length() > minLength: |
|
378 |
if pre is None and type(item) is QEngineeringLineItem and item.is_piping(True) and item.length() > minLength: |
|
380 | 379 |
pre = item |
381 | 380 |
start = item.line().p1() |
382 | 381 |
end = item.line().p2() |
... | ... | |
385 | 384 |
preRadian = radian if radian >= 0 else radian + 2 * math.pi |
386 | 385 |
preRadian = abs(preRadian - math.pi) |
387 | 386 |
|
388 |
elif pre and type(pre) is QEngineeringLineItem and type(item) is QEngineeringLineItem and ( |
|
389 |
item._lineType == 'Primary' or item._lineType == 'Secondary'): |
|
387 |
elif pre and type(pre) is QEngineeringLineItem and type(item) is QEngineeringLineItem and item.is_piping(True): |
|
390 | 388 |
start = item.line().p1() |
391 | 389 |
end = item.line().p2() |
392 | 390 |
_dir = [(end.x() - start.x()) / item.length(), (end.y() - start.y()) / item.length()] |
... | ... | |
406 | 404 |
pre = item |
407 | 405 |
preRadian = currRadian |
408 | 406 |
|
409 |
if pre and type(item) is QEngineeringLineItem and ( |
|
410 |
item._lineType == 'Primary' or item._lineType == 'Secondary') and item.length() > minLength: |
|
407 |
if pre and type(item) is QEngineeringLineItem and item.is_piping(True) and item.length() > minLength: |
|
411 | 408 |
pre.flowMark = position |
412 | 409 |
pre.update_arrow() |
413 | 410 |
|
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
326 | 326 |
for index in range(len(self.conn_type)): |
327 | 327 |
item = self.connectors[index].connectedItem |
328 | 328 |
if item and type(item) is QEngineeringLineItem: |
329 |
if ((self.conn_type[index] == 'Primary' or self.conn_type[index] == 'Secondary') and not item.is_piping()) or \
|
|
330 |
(not (self.conn_type[index] == 'Primary' or self.conn_type[index] == 'Secondary' or self.conn_type[index] == 'Connect To Process') and item.is_piping(True)):
|
|
329 |
if (QEngineeringLineItem.check_piping(self.conn_type[index], True) and not item.is_piping()) or \
|
|
330 |
(not QEngineeringLineItem.check_piping(self.conn_type[index]) and item.is_piping(True)):
|
|
331 | 331 |
error = SymbolSvgItem.createItem('Error', None, dataPath) |
332 | 332 |
error.setPosition(list(self.connectors[index].center())) |
333 | 333 |
error.parent = self |
... | ... | |
1272 | 1272 |
|
1273 | 1273 |
elif issubclass(type(item), QEngineeringNozzleItem) and item.has_connection: |
1274 | 1274 |
for index in range(len(item.connectors)): |
1275 |
if item.connectors[index].connectedItem or (item.conn_type[index] != 'Secondary' and item.conn_type[index] != 'Primary'):
|
|
1275 |
if item.connectors[index].connectedItem or not QEngineeringLineItem.check_piping(item.conn_type[index], True):
|
|
1276 | 1276 |
continue |
1277 | 1277 |
|
1278 | 1278 |
if self.includes(item.connectors[index], margin=100): |
DTI_PID/DTI_PID/UI/Configuration.ui | ||
---|---|---|
7 | 7 |
<x>0</x> |
8 | 8 |
<y>0</y> |
9 | 9 |
<width>768</width> |
10 |
<height>844</height>
|
|
10 |
<height>871</height>
|
|
11 | 11 |
</rect> |
12 | 12 |
</property> |
13 | 13 |
<property name="font"> |
... | ... | |
1300 | 1300 |
<item row="0" column="0"> |
1301 | 1301 |
<layout class="QHBoxLayout" name="horizontalLayout_17"> |
1302 | 1302 |
<item> |
1303 |
<widget class="QLabel" name="label_64"> |
|
1304 |
<property name="text"> |
|
1305 |
<string>Piping Type : </string> |
|
1306 |
</property> |
|
1307 |
</widget> |
|
1308 |
</item> |
|
1309 |
<item> |
|
1310 |
<widget class="QLineEdit" name="lineEditPipingLineType"/> |
|
1311 |
</item> |
|
1312 |
<item> |
|
1303 | 1313 |
<spacer name="horizontalSpacer_8"> |
1304 | 1314 |
<property name="orientation"> |
1305 | 1315 |
<enum>Qt::Horizontal</enum> |
... | ... | |
2195 | 2205 |
</connection> |
2196 | 2206 |
</connections> |
2197 | 2207 |
<buttongroups> |
2198 |
<buttongroup name="buttonGroup_14"/> |
|
2199 |
<buttongroup name="buttonGroup_4"/> |
|
2200 |
<buttongroup name="buttonGroup"/> |
|
2201 |
<buttongroup name="buttonGroup_6"/> |
|
2202 |
<buttongroup name="buttonGroup_11"/> |
|
2203 |
<buttongroup name="buttonGroup_12"/> |
|
2204 | 2208 |
<buttongroup name="buttonGroup_7"/> |
2205 |
<buttongroup name="buttonGroup_5"/> |
|
2206 |
<buttongroup name="buttonGroup_9"/> |
|
2207 |
<buttongroup name="buttonGroup_8"/> |
|
2208 | 2209 |
<buttongroup name="buttonGroup_3"/> |
2209 | 2210 |
<buttongroup name="buttonGroup_2"/> |
2210 |
<buttongroup name="buttonGroup_10"/>
|
|
2211 |
<buttongroup name="buttonGroup_8"/>
|
|
2211 | 2212 |
<buttongroup name="buttonGroup_13"/> |
2213 |
<buttongroup name="buttonGroup_10"/> |
|
2214 |
<buttongroup name="buttonGroup_14"/> |
|
2215 |
<buttongroup name="buttonGroup_12"/> |
|
2216 |
<buttongroup name="buttonGroup_6"/> |
|
2217 |
<buttongroup name="buttonGroup_5"/> |
|
2218 |
<buttongroup name="buttonGroup_11"/> |
|
2219 |
<buttongroup name="buttonGroup_9"/> |
|
2220 |
<buttongroup name="buttonGroup_4"/> |
|
2221 |
<buttongroup name="buttonGroup"/> |
|
2212 | 2222 |
</buttongroups> |
2213 | 2223 |
</ui> |
내보내기 Unified diff