개정판 a4239c65
issue #563: symbol consumed need for multi symbol attrs
Change-Id: I7115816f770d054bf530069bbe654093ada68938
DTI_PID/DTI_PID/Shapes/EngineeringAbstractItem.py | ||
---|---|---|
223 | 223 |
return sorted([x for x in self.associations() if issubclass(type(x), QEngineeringTextItem)], |
224 | 224 |
key=lambda attr: attr.loc[1]) |
225 | 225 |
|
226 |
def symbols(self): |
|
226 |
def symbols(self, symbol_attr_number):
|
|
227 | 227 |
""" return symbol type of associations """ |
228 | 228 |
from SymbolSvgItem import SymbolSvgItem |
229 | 229 |
from EngineeringVendorItem import QEngineeringVendorItem |
... | ... | |
232 | 232 |
res = [] |
233 | 233 |
for symbol in [x for x in self.associations() if |
234 | 234 |
issubclass(type(x), SymbolSvgItem) or type(x) is QEngineeringVendorItem or type(x) is QEngineeringLineItem]: |
235 |
''' |
|
236 |
consumed = False |
|
237 |
for key in list(self.attrs.keys()): |
|
238 |
if key.AssocItem and key.AssocItem is symbol: |
|
239 |
consumed = True |
|
240 |
if not consumed: |
|
235 |
if symbol_attr_number > 1: |
|
236 |
consumed = False |
|
237 |
for key in list(self.attrs.keys()): |
|
238 |
if key.AssocItem and key.AssocItem is symbol: |
|
239 |
consumed = True |
|
240 |
if not consumed: |
|
241 |
res.append(symbol) |
|
242 |
else: |
|
241 | 243 |
res.append(symbol) |
242 |
''' |
|
243 |
res.append(symbol) |
|
244 | 244 |
|
245 | 245 |
return res |
246 | 246 |
|
... | ... | |
397 | 397 |
symbolAttrs = app_doc_data.getSymbolAttribute(self.type) |
398 | 398 |
|
399 | 399 |
targetAttrs = [] |
400 |
symbol_attr_number = 0 |
|
400 | 401 |
if not (type(self) is QEngineeringLineItem or type(self) is QEngineeringVendorItem or |
401 | 402 |
type(self) is QEngineeringLineNoTextItem or type(self) is QEngineeringTagNoTextItem): |
402 | 403 |
for attr in symbolAttrs: |
... | ... | |
406 | 407 |
type(self) is QEngineeringSpecBreakItem or \ |
407 | 408 |
[target for target in attr.Target.split(',') if self.dbUid is int(target)]: |
408 | 409 |
targetAttrs.append(attr) |
410 |
if attr.AttributeType == 'Symbol Item' or attr.AttributeType == 'Line Item' or attr.AttributeType == 'EQ Item' or attr.AttributeType == 'Comp Item': |
|
411 |
symbol_attr_number = max(symbol_attr_number, int(attr.AttrAt)) + 1 |
|
409 | 412 |
else: |
410 | 413 |
targetAttrs = symbolAttrs |
411 | 414 |
|
412 | 415 |
_texts = self.texts() |
413 |
_symbols = self.symbols() |
|
416 |
_symbols = self.symbols(symbol_attr_number)
|
|
414 | 417 |
for attr in [_attr for _attr in targetAttrs if _attr.AttributeType != 'Combined' and _attr.AttributeType != 'Reference']: |
415 | 418 |
matches = [_attr for _attr, _ in self.attrs.items() if _attr.UID == attr.UID] |
416 | 419 |
if matches: |
내보내기 Unified diff