개정판 cd0dc864
issue #563: spec break angle positioning added
Change-Id: Id6e90d29cdf895171908353e1522ad989c8de64f
DTI_PID/DTI_PID/LineNoTracer.py | ||
---|---|---|
749 | 749 |
|
750 | 750 |
if stream_res[0] and stream_res[1]: |
751 | 751 |
texts = [item for item in worker.graphicsView.scene.items() if type(item) is QEngineeringTextItem and item.owner is None] |
752 |
|
|
752 |
positioning = False |
|
753 |
|
|
753 | 754 |
for attr, value, value2 in spec[2:]: |
754 | 755 |
up_texts = [text for text in texts if text.text() == value] |
755 | 756 |
down_texts = [text for text in texts if text.text() == value2] |
... | ... | |
778 | 779 |
up_down_find[index].owner = stream_line[index] |
779 | 780 |
break |
780 | 781 |
|
781 |
# set spec break position between |
|
782 |
new_x = round((up_down_find[0].center().x() + up_down_find[1].center().x()) / 2) |
|
783 |
new_y = round((up_down_find[0].center().y() + up_down_find[1].center().y()) / 2) |
|
784 |
spec_break.loc = [new_x - spec_break.symbolOrigin[0], new_y - spec_break.symbolOrigin[1]] |
|
785 |
spec_break.origin = [new_x, new_y] |
|
786 |
spec_break.angle = up_down_find[0].angle |
|
782 |
if not positioning: |
|
783 |
# set spec break position between |
|
784 |
positioning = True |
|
785 |
new_x = round((up_down_find[0].center().x() + up_down_find[1].center().x()) / 2) |
|
786 |
new_y = round((up_down_find[0].center().y() + up_down_find[1].center().y()) / 2) |
|
787 |
spec_break.loc = [new_x - spec_break.symbolOrigin[0], new_y - spec_break.symbolOrigin[1]] |
|
788 |
spec_break.origin = [new_x, new_y] |
|
789 |
if abs(up_down_find[0].center().x() - up_down_find[1].center().x()) < abs(up_down_find[0].center().y() - up_down_find[1].center().y()): |
|
790 |
spec_break.angle = 1.57 |
|
791 |
else: |
|
792 |
spec_break.angle = 3.14 |
|
787 | 793 |
|
788 | 794 |
spec_break_items.append(spec_break) |
789 | 795 |
|
DTI_PID/DTI_PID/Shapes/EngineeringLineItem.py | ||
---|---|---|
1645 | 1645 |
if index >= 6: |
1646 | 1646 |
break |
1647 | 1647 |
if key.AssocItem: |
1648 |
key.AssocItem.owner = None |
|
1648 | 1649 |
self.remove_assoc_item(key.AssocItem) |
1649 | 1650 |
key.AssocItem = None |
1650 | 1651 |
attrs[key] = '' |
내보내기 Unified diff