개정판 c4c2a9ed
issue #000: add note symbol item assoc and sym attr comp item handle
Change-Id: I81cbaab9f6f81c5f41095f18b21be91bbb5bb0ef
DTI_PID/DTI_PID/Shapes/EngineeringAbstractItem.py | ||
---|---|---|
233 | 233 |
_attrs[attr] = eval(attr.Expression) if attr.Expression else '' |
234 | 234 |
else: |
235 | 235 |
_attrs[attr] = '' |
236 |
if attr.AttributeType == 'Size Text Item': |
|
236 |
elif attr.AttributeType == 'Size Text Item':
|
|
237 | 237 |
at = int(attr.AttrAt) |
238 | 238 |
items = [text for text in _texts if QEngineeringAbstractItem.assoc_type(text) == attr.AttributeType] |
239 | 239 |
if not attr.AssocItem and len(items) > at: |
... | ... | |
243 | 243 |
else: |
244 | 244 |
item = attr.AssocItem |
245 | 245 |
_attrs[attr] = eval(attr.Expression) if attr.Expression and ((item and 'item' in attr.Expression) or 'self' in attr.Expression) else '' |
246 |
elif attr.AttributeType == 'Symbol Item': |
|
246 |
elif attr.AttributeType == 'Symbol Item' or attr.AttributeType == 'Comp Item':
|
|
247 | 247 |
at = int(attr.AttrAt) |
248 | 248 |
if not attr.AssocItem and len(_symbols) > at: |
249 | 249 |
attr.AssocItem = _symbols[at] |
... | ... | |
289 | 289 |
from EngineeringValveOperCodeTextItem import QEngineeringValveOperCodeTextItem |
290 | 290 |
from QEngineeringSizeTextItem import QEngineeringSizeTextItem |
291 | 291 |
from QEngineeringTagNoTextItem import QEngineeringTagNoTextItem |
292 |
from EngineeringLineItem import QEngineeringLineItem |
|
292 | 293 |
|
293 | 294 |
_type = None |
294 | 295 |
|
... | ... | |
302 | 303 |
_type = 'Text Item' |
303 | 304 |
elif type(item) is SymbolSvgItem or issubclass(type(item), SymbolSvgItem): |
304 | 305 |
_type = 'Symbol Item' |
306 |
elif issubclass(type(item), SymbolSvgItem) or type(item) is QEngineeringLineItem: |
|
307 |
_type = 'Comp Item' |
|
305 | 308 |
|
306 | 309 |
return _type |
307 | 310 |
|
DTI_PID/DTI_PID/TextItemFactory.py | ||
---|---|---|
278 | 278 |
for symbol in appDocData.symbols: |
279 | 279 |
if symbol.name in symbol_names and symbol.includes(textInfo.center): |
280 | 280 |
item = QEngineeringNoteItem(symbol=symbol) |
281 |
symbol.add_assoc_item(item) |
|
281 | 282 |
break |
282 | 283 |
else: |
283 | 284 |
item = QEngineeringNoteItem() |
내보내기 Unified diff