개정판 afa1358d
issue #589: add flow mark toggle and update func, fix flow mark
Change-Id: I43f30b0d23388504f7db244e9eb133879327529e
DTI_PID/DTI_PID/ConnectAttrDialog.py | ||
---|---|---|
31 | 31 |
displayMessage = pyqtSignal(str) |
32 | 32 |
updateProgress = pyqtSignal(int) |
33 | 33 |
|
34 |
def __init__(self, graphicsView, update_line_type): |
|
34 |
def __init__(self, graphicsView, update_line_type, update_flow_mark):
|
|
35 | 35 |
QThread.__init__(self) |
36 | 36 |
self.graphicsView = graphicsView |
37 | 37 |
self._update_line_type = update_line_type |
38 |
self._update_flow_mark = update_flow_mark |
|
38 | 39 |
|
39 | 40 |
''' |
40 | 41 |
@brief execute connecting attributes |
... | ... | |
45 | 46 |
from LineNoTracer import connectAttrImpl |
46 | 47 |
|
47 | 48 |
try: |
48 |
connectAttrImpl(self, self._update_line_type) |
|
49 |
connectAttrImpl(self, self._update_line_type, self._update_flow_mark)
|
|
49 | 50 |
except Exception as ex: |
50 | 51 |
from App import App |
51 | 52 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
... | ... | |
81 | 82 |
self.ui.progressBar.setValue(0) |
82 | 83 |
self.startThread() |
83 | 84 |
self.isRunned = True |
84 |
""" for DEBUG |
|
85 |
from LineNoTracer import connectAttrImpl |
|
86 |
connectAttrImpl(self) |
|
87 |
""" |
|
88 | 85 |
|
89 | 86 |
''' |
90 | 87 |
@brief QListWidget Row Inserted Listener |
... | ... | |
129 | 126 |
self.ui.buttonBox.setDisabled(True) |
130 | 127 |
|
131 | 128 |
# 1 - create Worker and Thread inside the Form |
132 |
self.obj = Worker(self.graphicsView, self.ui.checkBoxUpdateLineType.isChecked()) |
|
129 |
self.obj = Worker(self.graphicsView, self.ui.checkBoxUpdateLineType.isChecked(), self.ui.checkBoxUpdateFlowMark.isChecked())
|
|
133 | 130 |
|
134 | 131 |
# 2 - Connect Worker Signals to the Thread slots |
135 | 132 |
self.obj.displayMessage.connect(self.addListItem) |
DTI_PID/DTI_PID/ConnectAttr_UI.py | ||
---|---|---|
44 | 44 |
self.gridLayout.addLayout(self.horizontalLayout, 6, 0, 1, 1) |
45 | 45 |
self.horizontalLayout_2 = QtWidgets.QHBoxLayout() |
46 | 46 |
self.horizontalLayout_2.setObjectName("horizontalLayout_2") |
47 |
self.checkBoxUpdateFlowMark = QtWidgets.QCheckBox(ConnectAttr) |
|
48 |
self.checkBoxUpdateFlowMark.setObjectName("checkBoxUpdateFlowMark") |
|
49 |
self.horizontalLayout_2.addWidget(self.checkBoxUpdateFlowMark) |
|
47 | 50 |
self.checkBoxUpdateLineType = QtWidgets.QCheckBox(ConnectAttr) |
48 | 51 |
self.checkBoxUpdateLineType.setObjectName("checkBoxUpdateLineType") |
49 | 52 |
self.horizontalLayout_2.addWidget(self.checkBoxUpdateLineType) |
... | ... | |
68 | 71 |
_translate = QtCore.QCoreApplication.translate |
69 | 72 |
ConnectAttr.setWindowTitle(_translate("ConnectAttr", "Connect Attribute")) |
70 | 73 |
self.checkBoxValidation.setText(_translate("ConnectAttr", "Close with Validation Check")) |
74 |
self.checkBoxUpdateFlowMark.setText(_translate("ConnectAttr", "Update Flow Mark")) |
|
71 | 75 |
self.checkBoxUpdateLineType.setText(_translate("ConnectAttr", "Update Line Type")) |
72 | 76 |
self.pushButtonStart.setText(_translate("ConnectAttr", "Start")) |
73 | 77 |
|
DTI_PID/DTI_PID/LineNoTracer.py | ||
---|---|---|
358 | 358 |
@history humkyung 2018.06.21 paste connect attributes codes from recognizeLine function |
359 | 359 |
kyouho 2018.09.14 clear Item's owner |
360 | 360 |
''' |
361 |
def connectAttrImpl(worker, update_line_type): |
|
361 |
def connectAttrImpl(worker, update_line_type, update_flow_mark):
|
|
362 | 362 |
import os, math |
363 | 363 |
from App import App |
364 | 364 |
import uuid |
... | ... | |
515 | 515 |
text.findOwner(symbols) |
516 | 516 |
|
517 | 517 |
""" update line type """ |
518 |
if update_line_type == True:
|
|
518 |
if update_line_type: |
|
519 | 519 |
worker.displayMessage.emit('Updating Line Type...') |
520 | 520 |
for line in lines: line.update_line_type() |
521 | 521 |
|
... | ... | |
584 | 584 |
end_break.addSvgItemToScene(worker.graphicsView.scene) |
585 | 585 |
|
586 | 586 |
"""make flow mark""" |
587 |
for line in lines: |
|
588 |
line.flowMark = None |
|
589 |
line.update_arrow() |
|
590 |
|
|
591 |
configs = docdata.getConfigs('Flow Mark') |
|
592 |
position = int(configs[0].value) if 2 == len(configs) else 100 |
|
593 |
length = int(configs[1].value) if 2 == len(configs) else 200 |
|
594 |
for lineNo in lineNos + docdata.tracerLineNos: |
|
595 |
lineNo.update_flow_mark(position, length) |
|
587 |
if update_flow_mark: |
|
588 |
for line in lines: |
|
589 |
line.flowMark = None |
|
590 |
line.update_arrow() |
|
591 |
|
|
592 |
configs = docdata.getConfigs('Flow Mark', 'Position') |
|
593 |
position = int(configs[0].value) if 1 == len(configs) else 100 |
|
594 |
configs = docdata.getConfigs('Flow Mark', 'Length') |
|
595 |
length = int(configs[0].value) if 1 == len(configs) else 200 |
|
596 |
for lineNo in lineNos + docdata.tracerLineNos: |
|
597 |
lineNo.update_flow_mark(position, length) |
|
596 | 598 |
|
597 | 599 |
# trace special item |
598 | 600 |
worker.displayMessage.emit('Find line for special item...') |
DTI_PID/DTI_PID/Shapes/EngineeringLineItem.py | ||
---|---|---|
1163 | 1163 |
self.scene().removeItem(self) |
1164 | 1164 |
elif event.key() == Qt.Key_C: |
1165 | 1165 |
self.reverse() |
1166 |
elif event.key() == Qt.Key_A: |
|
1167 |
self.toggleFlowMark() |
|
1168 |
|
|
1169 |
def toggleFlowMark(self): |
|
1170 |
from AppDocData import AppDocData |
|
1171 |
|
|
1172 |
if self.flowMark: |
|
1173 |
self.flowMark = None |
|
1174 |
else: |
|
1175 |
configs = AppDocData.instance().getConfigs('Flow Mark', 'Position') |
|
1176 |
self.flowMark = int(configs[0].value) if 1 == len(configs) else 100 |
|
1177 |
self.update_arrow() |
|
1166 | 1178 |
|
1167 | 1179 |
''' |
1168 | 1180 |
@brief draw rect when item is selected |
DTI_PID/DTI_PID/UI/dlgConnectAttr.ui | ||
---|---|---|
65 | 65 |
<item row="2" column="0"> |
66 | 66 |
<layout class="QHBoxLayout" name="horizontalLayout_2"> |
67 | 67 |
<item> |
68 |
<widget class="QCheckBox" name="checkBoxUpdateFlowMark"> |
|
69 |
<property name="text"> |
|
70 |
<string>Update Flow Mark</string> |
|
71 |
</property> |
|
72 |
</widget> |
|
73 |
</item> |
|
74 |
<item> |
|
68 | 75 |
<widget class="QCheckBox" name="checkBoxUpdateLineType"> |
69 | 76 |
<property name="text"> |
70 | 77 |
<string>Update Line Type</string> |
내보내기 Unified diff