개정판 cf7f2a73
cad spec test
Change-Id: Iaf2096186cebd1d87d3cd441df0184e2f2099e1b
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
798 | 798 |
end_breaks = [item for item in self.graphicsView.scene().items() if type(item) is QEngineeringEndBreakItem] |
799 | 799 |
spec_breaks = [item for item in self.graphicsView.scene().items() if type(item) is QEngineeringSpecBreakItem] |
800 | 800 |
symbols = [item for item in self.graphicsView.scene().items() if issubclass(type(item), SymbolSvgItem) and item not in end_breaks and item not in spec_breaks] |
801 |
texts = [item for item in self.graphicsView.scene().items() if type(item) is QEngineeringTextItem] |
|
801 |
texts = [item for item in self.graphicsView.scene().items() if type(item) is QEngineeringTextItem and item.owner is None]
|
|
802 | 802 |
|
803 | 803 |
for item in lines_short + unknowns: |
804 | 804 |
item.transfer.onRemoved.emit(item) |
... | ... | |
1061 | 1061 |
attribute_table_item[1].remove(downText) |
1062 | 1062 |
break |
1063 | 1063 |
|
1064 |
stream_line = [upItem, downItem] |
|
1065 |
stream_track = [downItem, upItem] |
|
1066 |
stream_res = [False, False] |
|
1067 |
for index in range(len(stream_line)): |
|
1068 |
while True: |
|
1069 |
if type(stream_line[index]) is QEngineeringLineItem: |
|
1070 |
stream_res[index] = True |
|
1071 |
break |
|
1072 |
else: |
|
1073 |
find_next = False |
|
1074 |
connected_count = 0 |
|
1075 |
for connectorr in stream_line[index].connectors: |
|
1076 |
connected_count += 1 |
|
1077 |
if connectorr.connectedItem and stream_track[index] is not connectorr.connectedItem and \ |
|
1078 |
stream_line[index].next_connected(stream_track[index], connectorr.connectedItem): |
|
1079 |
stream_track[index] = stream_line[index] |
|
1080 |
stream_line[index] = connectorr.connectedItem |
|
1081 |
find_next = True |
|
1082 |
break |
|
1083 |
|
|
1084 |
if not find_next: |
|
1085 |
# prevent infinite loop |
|
1086 |
if connected_count == 2: |
|
1087 |
for connectorr in stream_line[index].connectors: |
|
1088 |
if connectorr.connectedItem and not connectorr.connectedItem is stream_track[index]: |
|
1089 |
stream_line[index] = connectorr.connectedItem |
|
1090 |
stream_track[index] = stream_line[index] |
|
1091 |
find_next = True |
|
1092 |
break |
|
1093 |
if not find_next: |
|
1094 |
break |
|
1095 |
else: |
|
1096 |
break |
|
1097 |
|
|
1098 |
if stream_res[0] and stream_res[1]: |
|
1099 |
up_down_find = [upText, downText] |
|
1100 |
|
|
1101 |
for index in range(len(stream_line)): |
|
1102 |
attrs = stream_line[index].getAttributes() |
|
1103 |
for key in attrs.keys(): |
|
1104 |
if key.Attribute == attribute_table_item[0]: |
|
1105 |
attrs[key] = up_down_find[index].text() |
|
1106 |
key.AssocItem = up_down_find[index] |
|
1107 |
stream_line[index].add_assoc_item(up_down_find[index], |
|
1108 |
key.AttrAt, force=True) |
|
1109 |
up_down_find[index].owner = stream_line[index] |
|
1110 |
key.Freeze = True |
|
1111 |
break |
|
1064 | 1112 |
# up to here |
1065 | 1113 |
|
1066 | 1114 |
QMessageBox.information(self, self.tr('Information'), self.tr('Connecting between symbols and lines is complete')) |
내보내기 Unified diff