개정판 5807a5b2
add EvaluatedLabel function
Change-Id: Ifabcd345162cb93f5ba90a9d4fa21f771836aa7f
DTI_PID/DTI_PID/Shapes/EngineeringAbstractItem.py | ||
---|---|---|
451 | 451 |
drawing_text_item.setPlainText(drawing_name) |
452 | 452 |
return drawing_text_item |
453 | 453 | |
454 |
def EvaluatedLabel(self, prop): |
|
455 |
""" return label symbol's attribute """ |
|
456 |
from EngineeringInstrumentItem import QEngineeringInstrumentItem |
|
457 | ||
458 |
scene = self.scene() |
|
459 |
labels = [item for item in scene.items() if type(item) is QEngineeringInstrumentItem and (item.iType == 19 or item.iType == 29 or item.iType == 30)] |
|
460 |
if labels: |
|
461 |
label = [label for label in labels if label.EvaluatedAttribute('OWNERSYMBOL') == self.uid] |
|
462 |
if label: |
|
463 |
return label.EvaluatedAttribute('prop') |
|
464 | ||
465 |
return '' |
|
466 | ||
454 | 467 |
def EvaluatedAttribute(self, prop, cache=False): |
455 | 468 |
""" return item's attribute """ |
456 | 469 |
attrs = self.getAttributes(findOwner=cache) |
내보내기 Unified diff