개정판 cd1a85cc
issue #563: change flow mark condition and fix size text item
Change-Id: If56b0120d90ef1c27c32d11448be1ce65153bfd7
DTI_PID/DTI_PID/LineNoTracer.py | ||
---|---|---|
700 | 700 |
spec_break_item.transfer.onRemoved.connect(App.mainWnd().itemRemoved) |
701 | 701 |
spec_break_item.addSvgItemToScene(worker.graphicsView.scene) |
702 | 702 |
|
703 |
"""make flow mark""" |
|
704 |
if update_flow_mark: |
|
705 |
for line in lines: |
|
706 |
line.flowMark = None |
|
707 |
line.update_arrow() |
|
708 |
|
|
709 |
configs = docdata.getConfigs('Flow Mark', 'Position') |
|
710 |
position = int(configs[0].value) if 1 == len(configs) else 100 |
|
711 |
configs = docdata.getConfigs('Flow Mark', 'Length') |
|
712 |
length = int(configs[0].value) if 1 == len(configs) else 200 |
|
713 |
for lineNo in docdata.tracerLineNos: |
|
714 |
lineNo.update_flow_mark(position, length) |
|
715 |
|
|
716 | 703 |
# trace special item |
717 | 704 |
worker.displayMessage.emit('Find line for special item...') |
718 | 705 |
tracer = SpecialItemTracer([item for item in worker.graphicsView.scene.items() if (type(item) is SymbolSvgItem or type(item) is QEngineeringTextItem) and item.special_item_type], lines) |
... | ... | |
1114 | 1101 |
else: |
1115 | 1102 |
remain_count_past = remain_count |
1116 | 1103 |
|
1104 |
"""make flow mark""" |
|
1105 |
if update_flow_mark: |
|
1106 |
for line in lines: |
|
1107 |
line.flowMark = None |
|
1108 |
# line.update_arrow() |
|
1109 |
|
|
1110 |
configs = docdata.getConfigs('Flow Mark', 'Position') |
|
1111 |
position = int(configs[0].value) if 1 == len(configs) else 100 |
|
1112 |
configs = docdata.getConfigs('Flow Mark', 'Length') |
|
1113 |
length = int(configs[0].value) if 1 == len(configs) else 200 |
|
1114 |
|
|
1115 |
for line in lines: |
|
1116 |
line.update_flow_mark(position, length) |
|
1117 |
line.update_arrow() |
|
1118 |
# for lineNo in docdata.tracerLineNos: |
|
1119 |
# lineNo.update_flow_mark(position, length) |
|
1120 |
|
|
1117 | 1121 |
except Exception as ex: |
1118 | 1122 |
from App import App |
1119 | 1123 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
DTI_PID/DTI_PID/Shapes/EngineeringLineItem.py | ||
---|---|---|
1627 | 1627 |
@history 2018.05.11 Jeongwoo Add self.setPen() Method |
1628 | 1628 |
@history humkyung 2018.05.13 call setPen method to apply changed color |
1629 | 1629 |
''' |
1630 |
|
|
1631 | 1630 |
def setColor(self, color): |
1632 | 1631 |
c = QColor() |
1633 | 1632 |
c.setNamedColor(color) |
... | ... | |
1635 | 1634 |
_pen.setColor(c) |
1636 | 1635 |
self.setPen(_pen) |
1637 | 1636 |
self.update() |
1637 |
|
|
1638 |
def update_flow_mark(self, position, length): |
|
1639 |
""" update flow mark for flow arrow """ |
|
1640 |
import math |
|
1641 |
|
|
1642 |
to_item = self.connectors[1].connectedItem |
|
1643 |
if type(to_item) is QEngineeringLineItem and self.length() > length and not self.isParallel(to_item): |
|
1644 |
self.flowMark = position |
|
1638 | 1645 |
|
1639 | 1646 |
def update_arrow(self): |
1640 | 1647 |
""" update flow arrow """ |
1641 | 1648 |
import math |
1642 | 1649 |
from EngineeringArrowItem import QEngineeringArrowItem |
1650 |
|
|
1643 | 1651 |
if self.length() < 0.01: |
1644 | 1652 |
return |
1645 | 1653 |
|
DTI_PID/DTI_PID/Shapes/EngineeringLineNoTextItem.py | ||
---|---|---|
154 | 154 |
preRadian = radian if radian >= 0 else radian + 2 * math.pi |
155 | 155 |
preRadian = abs(preRadian - math.pi) |
156 | 156 |
|
157 |
elif pre and type(item) is QEngineeringLineItem and (item._lineType == 'Primary' or item._lineType == 'Secondary'): |
|
157 |
elif pre and type(pre) is QEngineeringLineItem and type(item) is QEngineeringLineItem and (item._lineType == 'Primary' or item._lineType == 'Secondary'):
|
|
158 | 158 |
start = item.line().p1() |
159 | 159 |
end = item.line().p2() |
160 | 160 |
_dir = [(end.x() - start.x())/item.length(), (end.y() - start.y())/item.length()] |
DTI_PID/DTI_PID/TextItemFactory.py | ||
---|---|---|
309 | 309 |
|
310 | 310 |
pipe_sizes = NominalPipeSizeTable.instance().pipe_sizes |
311 | 311 |
|
312 |
text = text.replace("'", '"').upper() |
|
312 |
text = text.replace("'", '"').replace(' ', '').upper()
|
|
313 | 313 |
|
314 | 314 |
first, second = None, None |
315 | 315 |
# for imperial |
내보내기 Unified diff