개정판 f7ada1c1
fixed issue #610:
- Process Line(Primary, Secondary)외 Line들은 FlowMark 불필요
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
66 | 66 |
self.setupUi(self) |
67 | 67 |
self.labelStatus = QLabel(self.statusbar) |
68 | 68 |
self.labelStatus.setText('미인식 : ') |
69 |
self.labelSymbolStatus = QLabel(self.statusbar) |
|
70 |
self.labelSymbolStatus.setText('심볼 : ') |
|
71 |
self.labelLineStatus = QLabel(self.statusbar) |
|
72 |
self.labelLineStatus.setText('라인 : ') |
|
73 |
self.labelTextStatus = QLabel(self.statusbar) |
|
74 |
self.labelTextStatus.setText('텍스트 : ') |
|
75 |
self.statusbar.addPermanentWidget(self.labelSymbolStatus) |
|
76 |
self.statusbar.addPermanentWidget(self.labelLineStatus) |
|
77 |
self.statusbar.addPermanentWidget(self.labelTextStatus) |
|
69 | 78 |
self.statusbar.addPermanentWidget(self.labelStatus) |
70 | 79 |
|
71 | 80 |
docData = AppDocData.instance() |
... | ... | |
196 | 205 |
@brief show unknownitem's count |
197 | 206 |
@author humkyung |
198 | 207 |
@date 2018.08.23 |
208 |
@history humkyung 2018.08.30 display count of symbol, line, text |
|
199 | 209 |
''' |
200 | 210 |
def onSceneChanged(self): |
201 | 211 |
items = [item for item in self.graphicsView.scene.items() if type(item) is QEngineeringUnknownItem] |
... | ... | |
204 | 214 |
else: |
205 | 215 |
self.labelStatus.setText("<font color='black'>미인식 : {}</font>".format(len(items))) |
206 | 216 |
|
217 |
items = [item for item in self.graphicsView.scene.items() if issubclass(type(item), SymbolSvgItem)] |
|
218 |
self.labelSymbolStatus.setText("<font color='blue'>심볼 : {}</font>".format(len(items))) |
|
219 |
|
|
220 |
items = [item for item in self.graphicsView.scene.items() if type(item) is QEngineeringLineItem] |
|
221 |
self.labelLineStatus.setText("<font color='blue'>라인 : {}</font>".format(len(items))) |
|
222 |
|
|
223 |
items = [item for item in self.graphicsView.scene.items() if issubclass(type(item), QEngineeringTextItem)] |
|
224 |
self.labelTextStatus.setText("<font color='blue'>텍스트 : {}</font>".format(len(items))) |
|
225 |
|
|
207 | 226 |
''' |
208 | 227 |
@brief action save click event |
209 | 228 |
@author kyouho |
DTI_PID/DTI_PID/Shapes/EngineeringLineItem.py | ||
---|---|---|
868 | 868 |
painter.drawRect(self.boundingRect()) |
869 | 869 |
|
870 | 870 |
''' |
871 |
@brief override paint method |
|
871 |
@brief override paint method |
|
872 |
@history humkyung 2018.08.30 draw flowmark only for Primary or Secondary |
|
872 | 873 |
''' |
873 | 874 |
def paint(self, painter, option, widget): |
874 | 875 |
QGraphicsLineItem.paint(self, painter, option, widget) |
875 | 876 |
|
876 |
## draw direction mark |
|
877 |
length = self.length() |
|
878 |
if length > 0: |
|
879 |
ptStart = self.startPoint() |
|
880 |
ptEnd = self.endPoint() |
|
881 |
|
|
882 |
_dir = [(ptEnd[0] - ptStart[0])/self.length(), (ptEnd[1] - ptStart[1])/self.length()] |
|
883 |
perpendicular = (-_dir[1], _dir[0]) |
|
884 |
|
|
885 |
polygon = QPolygonF() |
|
886 |
polygon.append(QPointF(ptEnd[0] - _dir[0]*QEngineeringLineItem.ARROW_SIZE + perpendicular[0]*QEngineeringLineItem.ARROW_SIZE*0.25, |
|
887 |
ptEnd[1] - _dir[1]*QEngineeringLineItem.ARROW_SIZE + perpendicular[1]*QEngineeringLineItem.ARROW_SIZE*0.25)) |
|
888 |
polygon.append(QPointF(ptEnd[0] - _dir[0]*QEngineeringLineItem.ARROW_SIZE - perpendicular[0]*QEngineeringLineItem.ARROW_SIZE*0.25, |
|
889 |
ptEnd[1] - _dir[1]*QEngineeringLineItem.ARROW_SIZE - perpendicular[1]*QEngineeringLineItem.ARROW_SIZE*0.25)) |
|
890 |
polygon.append(QPointF(ptEnd[0], ptEnd[1])) |
|
891 |
polygon.append(polygon[0]) |
|
892 |
|
|
893 |
_pen = self.pen() |
|
894 |
_pen.setWidth(1) |
|
895 |
painter.setPen(_pen) |
|
896 |
painter.setBrush(QBrush(_pen.color())) |
|
897 |
painter.drawConvexPolygon(polygon) |
|
898 |
## up to here |
|
877 |
if self.lineType == 'Primary' or self.lineType == 'Secondary': |
|
878 |
## draw direction mark |
|
879 |
length = self.length() |
|
880 |
if length > 0: |
|
881 |
ptStart = self.startPoint() |
|
882 |
ptEnd = self.endPoint() |
|
883 |
|
|
884 |
_dir = [(ptEnd[0] - ptStart[0])/self.length(), (ptEnd[1] - ptStart[1])/self.length()] |
|
885 |
perpendicular = (-_dir[1], _dir[0]) |
|
886 |
|
|
887 |
polygon = QPolygonF() |
|
888 |
polygon.append(QPointF(ptEnd[0] - _dir[0]*QEngineeringLineItem.ARROW_SIZE + perpendicular[0]*QEngineeringLineItem.ARROW_SIZE*0.25, |
|
889 |
ptEnd[1] - _dir[1]*QEngineeringLineItem.ARROW_SIZE + perpendicular[1]*QEngineeringLineItem.ARROW_SIZE*0.25)) |
|
890 |
polygon.append(QPointF(ptEnd[0] - _dir[0]*QEngineeringLineItem.ARROW_SIZE - perpendicular[0]*QEngineeringLineItem.ARROW_SIZE*0.25, |
|
891 |
ptEnd[1] - _dir[1]*QEngineeringLineItem.ARROW_SIZE - perpendicular[1]*QEngineeringLineItem.ARROW_SIZE*0.25)) |
|
892 |
polygon.append(QPointF(ptEnd[0], ptEnd[1])) |
|
893 |
polygon.append(polygon[0]) |
|
894 |
|
|
895 |
_pen = self.pen() |
|
896 |
_pen.setWidth(1) |
|
897 |
painter.setPen(_pen) |
|
898 |
painter.setBrush(QBrush(_pen.color())) |
|
899 |
painter.drawConvexPolygon(polygon) |
|
900 |
## up to here |
|
899 | 901 |
|
900 | 902 |
if self.isSelected(): |
901 | 903 |
self.drawFocusRect(painter) |
내보내기 Unified diff