개정판 ad06449c
issue #563: spec label auto
Change-Id: Ie295ae3e42daef358a6ac33ae1cdd8b2249a3124
DTI_PID/DTI_PID/Commands/SelectAttributeBatchCommand.py | ||
---|---|---|
83 | 83 |
if up_value and down_value: |
84 | 84 |
values[index].setPlainText(up_value) |
85 | 85 |
values[index + 1].setPlainText(down_value) |
86 |
spec.append([attr.Attribute, up_value, down_value])
|
|
86 |
spec.append([attr.Attribute, values[index], values[index + 1]])
|
|
87 | 87 |
break |
88 | 88 |
|
89 | 89 |
if len(spec) < 3: |
... | ... | |
103 | 103 |
for attr, value, value2 in spec[2:]: |
104 | 104 |
for full in specBreakAttrsFull: |
105 | 105 |
if full.Attribute == attr: |
106 |
attrs[full] = [value, value2] |
|
106 |
attrs[full] = [value.text(), value2.text()] |
|
107 |
|
|
108 |
#matches = [(prop, value) for prop, value in item.properties.items() if prop.Attribute == 'Freeze'] |
|
109 |
#matches[0][0].Freeze = True |
|
110 |
item.set_property('Freeze', True) |
|
111 |
|
|
112 |
stream_line = [spec[0], spec[1]] |
|
113 |
stream_track = [spec[1], spec[0]] |
|
114 |
stream_res = [False, False] |
|
115 |
for index in range(len(stream_line)): |
|
116 |
while True: |
|
117 |
if type(stream_line[index]) is QEngineeringLineItem: |
|
118 |
stream_res[index] = True |
|
119 |
break |
|
120 |
else: |
|
121 |
find_next = False |
|
122 |
connected_count = 0 |
|
123 |
for connectorr in stream_line[index].connectors: |
|
124 |
connected_count += 1 |
|
125 |
if connectorr.connectedItem and stream_track[ |
|
126 |
index] is not connectorr.connectedItem and stream_line[ |
|
127 |
index].next_connected(stream_track[index], |
|
128 |
connectorr.connectedItem): |
|
129 |
stream_track[index] = stream_line[index] |
|
130 |
stream_line[index] = connectorr.connectedItem |
|
131 |
find_next = True |
|
132 |
break |
|
133 |
|
|
134 |
if not find_next: |
|
135 |
# prevent infinite loop |
|
136 |
if connected_count == 2: |
|
137 |
for connectorr in stream_line[index].connectors: |
|
138 |
if connectorr.connectedItem and not connectorr.connectedItem is \ |
|
139 |
stream_track[index]: |
|
140 |
stream_line[index] = connectorr.connectedItem |
|
141 |
stream_track[index] = stream_line[index] |
|
142 |
find_next = True |
|
143 |
break |
|
144 |
if not find_next: |
|
145 |
break |
|
146 |
else: |
|
147 |
break |
|
148 |
|
|
149 |
if stream_res[0] and stream_res[1]: |
|
150 |
for attr, value, value2 in spec[2:]: |
|
151 |
up_down_find = [value, value2] |
|
152 |
for index in range(len(stream_line)): |
|
153 |
attrs = stream_line[index].getAttributes() |
|
154 |
for key in attrs.keys(): |
|
155 |
if key.Attribute == attr: |
|
156 |
attrs[key] = up_down_find[index].text() |
|
157 |
key.AssocItem = up_down_find[index] |
|
158 |
stream_line[index].add_assoc_item(up_down_find[index], |
|
159 |
key.AttrAt, force=True) |
|
160 |
up_down_find[index].owner = stream_line[index] |
|
161 |
key.Freeze = True |
|
162 |
break |
|
107 | 163 |
|
108 | 164 |
self.onSuccess.emit() |
109 | 165 |
|
내보내기 Unified diff