개정판 c80d49e6
Apply highlight to unknown and text item
DTI_PID/DTI_PID/Commands/AreaOcrCommand.py | ||
---|---|---|
13 | 13 |
import OcrResultDialog |
14 | 14 |
import sys |
15 | 15 |
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + '\\Shapes') |
16 |
from QEngineeringTextItem import QEngineeringTextItem
|
|
16 |
from EngineeringTextItem import QEngineeringTextItem |
|
17 | 17 |
from QEngineeringLineNoTextItem import QEngineeringLineNoTextItem |
18 | 18 |
from QEngineeringNoteItem import QEngineeringNoteItem |
19 | 19 |
from TextItemFactory import TextItemFactory |
DTI_PID/DTI_PID/Commands/SelectAttributeCommand.py | ||
---|---|---|
52 | 52 |
@date 18.07.19 |
53 | 53 |
''' |
54 | 54 |
def findTextItemInPoint(self, point): |
55 |
from QEngineeringTextItem import QEngineeringTextItem
|
|
55 |
from EngineeringTextItem import QEngineeringTextItem |
|
56 | 56 |
|
57 | 57 |
for item in self.imageViewer.items(): |
58 | 58 |
if type(item) is QEngineeringTextItem: |
DTI_PID/DTI_PID/DTI_PID.py | ||
---|---|---|
823 | 823 |
from SymbolSvgItem import SymbolSvgItem |
824 | 824 |
from QEngineeringFlowArrowItem import QEngineeringFlowArrowItem |
825 | 825 |
from QEngineeringLineNoTextItem import QEngineeringLineNoTextItem |
826 |
from QEngineeringTextItem import QEngineeringTextItem
|
|
826 |
from EngineeringTextItem import QEngineeringTextItem |
|
827 | 827 |
from EngineeringLineItem import QEngineeringLineItem |
828 | 828 |
from LineDetector import LineDetector |
829 | 829 |
|
DTI_PID/DTI_PID/ItemTreeWidget.py | ||
---|---|---|
15 | 15 |
except ImportError: |
16 | 16 |
raise ImportError("ImageViewerQt: Requires PyQt5 or PyQt4.") |
17 | 17 |
from SymbolSvgItem import SymbolSvgItem |
18 |
from QEngineeringTextItem import QEngineeringTextItem
|
|
18 |
from EngineeringTextItem import QEngineeringTextItem |
|
19 | 19 |
from QEngineeringNoteItem import QEngineeringNoteItem |
20 | 20 |
from QEngineeringLineNoTextItem import QEngineeringLineNoTextItem |
21 | 21 |
from QEngineeringTrimLineNoTextItem import QEngineeringTrimLineNoTextItem |
DTI_PID/DTI_PID/LineNoTracer.py | ||
---|---|---|
15 | 15 |
from QEngineeringLineNoTextItem import QEngineeringLineNoTextItem |
16 | 16 |
from QEngineeringFlowArrowItem import QEngineeringFlowArrowItem |
17 | 17 |
from SymbolSvgItem import SymbolSvgItem |
18 |
from QEngineeringTextItem import QEngineeringTextItem
|
|
18 |
from EngineeringTextItem import QEngineeringTextItem |
|
19 | 19 |
|
20 | 20 |
class LineNoTracer: |
21 | 21 |
''' |
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
31 | 31 |
from EngineeringLineItem import QEngineeringLineItem |
32 | 32 |
from SymbolSvgItem import SymbolSvgItem |
33 | 33 |
from QGraphicsBoundingBoxItem import QGraphicsBoundingBoxItem |
34 |
from QEngineeringTextItem import QEngineeringTextItem
|
|
34 |
from EngineeringTextItem import QEngineeringTextItem |
|
35 | 35 |
from QEngineeringLineNoTextItem import QEngineeringLineNoTextItem |
36 | 36 |
from QEngineeringNoteItem import QEngineeringNoteItem |
37 | 37 |
from QEngineeringSizeTextItem import QEngineeringSizeTextItem |
DTI_PID/DTI_PID/QConnectAttrDialog.py | ||
---|---|---|
12 | 12 |
from QEngineeringLineNoTextItem import QEngineeringLineNoTextItem |
13 | 13 |
from QEngineeringFlowArrowItem import QEngineeringFlowArrowItem |
14 | 14 |
from SymbolSvgItem import SymbolSvgItem |
15 |
from QEngineeringTextItem import QEngineeringTextItem
|
|
15 |
from EngineeringTextItem import QEngineeringTextItem |
|
16 | 16 |
from QGraphicsBoundingBoxItem import QGraphicsBoundingBoxItem |
17 | 17 |
|
18 | 18 |
''' |
DTI_PID/DTI_PID/QRecognitionDialog.py | ||
---|---|---|
16 | 16 |
from QEngineeringLineNoTextItem import QEngineeringLineNoTextItem |
17 | 17 |
from QEngineeringFlowArrowItem import QEngineeringFlowArrowItem |
18 | 18 |
from SymbolSvgItem import SymbolSvgItem |
19 |
from QEngineeringTextItem import QEngineeringTextItem
|
|
19 |
from EngineeringTextItem import QEngineeringTextItem |
|
20 | 20 |
from QGraphicsBoundingBoxItem import QGraphicsBoundingBoxItem |
21 | 21 |
|
22 | 22 |
from MainWindow import MainWindow |
... | ... | |
1232 | 1232 |
from SymbolSvgItem import SymbolSvgItem |
1233 | 1233 |
from QEngineeringFlowArrowItem import QEngineeringFlowArrowItem |
1234 | 1234 |
from QEngineeringLineNoTextItem import QEngineeringLineNoTextItem |
1235 |
from QEngineeringTextItem import QEngineeringTextItem
|
|
1235 |
from EngineeringTextItem import QEngineeringTextItem |
|
1236 | 1236 |
from EngineeringLineItem import QEngineeringLineItem |
1237 | 1237 |
from LineDetector import LineDetector |
1238 | 1238 |
|
DTI_PID/DTI_PID/READ ME.txt | ||
---|---|---|
171 | 171 |
- ����� �ؽ�Ʈ ������ ������ Ŭ���� |
172 | 172 |
|
173 | 173 |
24) TextItemFactory.py |
174 |
- QEngineeringTextItem ���� �������� ���� �� ���
|
|
175 |
- QEngineeringTextItem ���� �� �ʿ��� ������ �����Ͽ�, �ش� �����Ϳ� �´� Ÿ���� �������� ��ȯ
|
|
174 |
- EngineeringTextItem ���� �������� ���� �� ��� |
|
175 |
- EngineeringTextItem ���� �� �ʿ��� ������ �����Ͽ�, �ش� �����Ϳ� �´� Ÿ���� �������� ��ȯ |
|
176 | 176 |
- ���� ������ ������ ��� (2018.06.28 ����) |
177 | 177 |
|
178 | 178 |
[1] QEngineeringNoteItem |
179 | 179 |
[2] QEngineeringLineNoItem |
180 | 180 |
[3] QEngineeringSizeTextItem |
181 | 181 |
[4] QEngineeringTagNoTextItem |
182 |
[5] QEngineeringTextItem
|
|
182 |
[5] EngineeringTextItem |
|
183 | 183 |
|
184 | 184 |
25) XmlGenerator.py |
185 | 185 |
- �߰����� �� SPPID ��ȯ�� XML ���� ������ ���� ��� |
DTI_PID/DTI_PID/Shapes/EngineeringNozzleNameItem.py | ||
---|---|---|
15 | 15 |
raise ImportError("ImageViewerQt: Requires PyQt5 or PyQt4.") |
16 | 16 |
|
17 | 17 |
from AppDocData import AppDocData |
18 |
from QEngineeringTextItem import QEngineeringTextItem
|
|
18 |
from EngineeringTextItem import QEngineeringTextItem |
|
19 | 19 |
|
20 | 20 |
class QEngineeringNozzleNameItem(QEngineeringTextItem): |
21 | 21 |
|
DTI_PID/DTI_PID/Shapes/EngineeringTextItem.py | ||
---|---|---|
1 |
# coding: utf-8 |
|
2 |
import os.path |
|
3 |
import copy |
|
4 |
import sys |
|
5 |
try: |
|
6 |
from PyQt5.QtCore import Qt, QPointF, QRectF, pyqtSignal, QObject, QT_VERSION_STR, QRect |
|
7 |
from PyQt5.QtGui import QImage, QPixmap, QPainterPath, QBrush, QPen, QTransform, QFont, QColor |
|
8 |
from PyQt5.QtWidgets import QGraphicsView, QGraphicsScene, QFileDialog, QGraphicsItem, QAbstractGraphicsShapeItem, QGraphicsTextItem |
|
9 |
except ImportError: |
|
10 |
try: |
|
11 |
from PyQt4.QtCore import Qt, QRectF, pyqtSignal, QRect, QObject, QT_VERSION_STR |
|
12 |
from PyQt4.QtGui import QGraphicsView, QGraphicsScene, QImage, QPixmap, QPainterPath, QFileDialog, QFont, QColor |
|
13 |
except ImportError: |
|
14 |
raise ImportError("ImageViewerQt: Requires PyQt5 or PyQt4.") |
|
15 |
|
|
16 |
from EngineeringPolylineItem import QEngineeringPolylineItem |
|
17 |
from QGraphicsBoundingBoxItem import QGraphicsBoundingBoxItem |
|
18 |
from OcrResultDialog import QOcrResultDialog |
|
19 |
from AppDocData import AppDocData |
|
20 |
from QEngineeringAbstractItem import QEngineeringAbstractItem |
|
21 |
|
|
22 |
class QEngineeringTextItem(QGraphicsTextItem, QEngineeringAbstractItem): |
|
23 |
HIGHLIGHT = '#BC4438' |
|
24 |
|
|
25 |
''' |
|
26 |
@history 2018.05.17 Jeongwoo Add self._owner variable |
|
27 |
''' |
|
28 |
def __init__(self, uid=None, parent=None): |
|
29 |
import uuid |
|
30 |
|
|
31 |
QGraphicsTextItem.__init__(self, parent) |
|
32 |
QEngineeringAbstractItem.__init__(self) |
|
33 |
|
|
34 |
self.uid = uuid.uuid4() if uid is None else uid |
|
35 |
self.loc = None |
|
36 |
self.size = None |
|
37 |
self.angle = 0 # angle in radian |
|
38 |
self.conns = [] |
|
39 |
self._owner = None |
|
40 |
self.setFlags(QGraphicsItem.ItemIsSelectable|QGraphicsItem.ItemIsFocusable) |
|
41 |
self.setAcceptHoverEvents(True) |
|
42 |
self.setAcceptTouchEvents(True) |
|
43 |
|
|
44 |
self.setColor(self._color) |
|
45 |
|
|
46 |
self.delimiter = '"' |
|
47 |
|
|
48 |
self.attribute = '' |
|
49 |
|
|
50 |
self.transfer = Transfer() |
|
51 |
|
|
52 |
''' |
|
53 |
@brief Get owner |
|
54 |
@author Jeongwoo |
|
55 |
@date 2018.05.17 |
|
56 |
''' |
|
57 |
@property |
|
58 |
def owner(self): |
|
59 |
return self._owner |
|
60 |
|
|
61 |
''' |
|
62 |
@brief Set owner |
|
63 |
@author Jeongwoo |
|
64 |
@date 2018.05.17 |
|
65 |
@history 2018.05.17 Jeongwoo Add Calling setColor if self._owner is None or not |
|
66 |
''' |
|
67 |
@owner.setter |
|
68 |
def owner(self, value): |
|
69 |
self._owner = value |
|
70 |
|
|
71 |
if self._owner is None: |
|
72 |
self._color = self.DEFAULT_COLOR |
|
73 |
self.setColor(self._color) |
|
74 |
|
|
75 |
''' |
|
76 |
@brief return text string |
|
77 |
@author humkyung |
|
78 |
@date 2018.04.16 |
|
79 |
''' |
|
80 |
def text(self): |
|
81 |
return self.toPlainText() |
|
82 |
|
|
83 |
''' |
|
84 |
@brief return center position of text |
|
85 |
@author humkyung |
|
86 |
@date 2018.04.16 |
|
87 |
''' |
|
88 |
def center(self): |
|
89 |
return self.sceneBoundingRect().center() |
|
90 |
|
|
91 |
''' |
|
92 |
@brief hover event |
|
93 |
@authro humkyung |
|
94 |
@date |
|
95 |
''' |
|
96 |
def hoverEnterEvent(self, event): |
|
97 |
self._savedColor = self.getColor() |
|
98 |
self.setColor(QEngineeringTextItem.HIGHLIGHT) |
|
99 |
self.update() |
|
100 |
|
|
101 |
def hoverLeaveEvent(self, event): |
|
102 |
self.setColor(self._savedColor) |
|
103 |
self.update() |
|
104 |
|
|
105 |
def hoverMoveEvent(self, event): |
|
106 |
pass |
|
107 |
|
|
108 |
''' |
|
109 |
@brief remove item when user press delete key |
|
110 |
@author humkyung |
|
111 |
@date 2018.04.23 |
|
112 |
@history 2018.05.25 Jeongwoo Seperate delete item method |
|
113 |
''' |
|
114 |
def keyPressEvent(self, event): |
|
115 |
if event.key() == Qt.Key_Delete: |
|
116 |
self.deleteTextItemFromScene() |
|
117 |
|
|
118 |
''' |
|
119 |
@brief draw rect when item is selected |
|
120 |
@author humkyung |
|
121 |
@date 2018.07.08 |
|
122 |
''' |
|
123 |
def drawFocusRect(self, painter): |
|
124 |
self.focuspen = QPen(Qt.DotLine) |
|
125 |
self.focuspen.setColor(Qt.black) |
|
126 |
self.focuspen.setWidthF(1.5) |
|
127 |
hilightColor = QColor(255, 0, 0, 127) |
|
128 |
painter.setBrush(QBrush(hilightColor)) |
|
129 |
painter.setPen(self.focuspen) |
|
130 |
painter.drawRect(self.boundingRect()) |
|
131 |
|
|
132 |
''' |
|
133 |
@brief override paint(draw connection points) |
|
134 |
@author humkyung |
|
135 |
@date 2018.07.08 |
|
136 |
''' |
|
137 |
def paint(self, painter, options=None, widget=None): |
|
138 |
QGraphicsTextItem.paint(self, painter, options, widget) |
|
139 |
if self.isSelected(): |
|
140 |
self.drawFocusRect(painter) |
|
141 |
|
|
142 |
''' |
|
143 |
@brief Delete text item |
|
144 |
@author Jeongwoo |
|
145 |
@date 2018.05.25 |
|
146 |
''' |
|
147 |
def deleteTextItemFromScene(self): |
|
148 |
self.transfer.onRemoved.emit(self) |
|
149 |
self.scene().removeItem(self) |
|
150 |
|
|
151 |
''' |
|
152 |
@brief Return real item position |
|
153 |
@author Jeongwoo |
|
154 |
@date 2018.05.25 |
|
155 |
''' |
|
156 |
def boundingRectOnScene(self): |
|
157 |
rect = self.boundingRect() |
|
158 |
rect.moveTo(self.loc[0], self.loc[1]) |
|
159 |
return rect |
|
160 |
|
|
161 |
''' |
|
162 |
@brief Double click event, Show QOcrResultDialog |
|
163 |
@author Jeongwoo |
|
164 |
@date 18.04.23 |
|
165 |
@history 18.06.20 Jeongwoo Resize QRect added 1 |
|
166 |
''' |
|
167 |
def mouseDoubleClickEvent(self, event): |
|
168 |
if event.buttons() == Qt.LeftButton: |
|
169 |
dialog = QOcrResultDialog(None, AppDocData.instance().getCurrentPidSource().getQImageOnRect(QRect(self.loc[0], self.loc[1], self.size[0]+1, self.size[1])) |
|
170 |
, QRect(self.loc[0], self.loc[1], self.size[0]+1, self.size[1]), True, self.text()) |
|
171 |
(isAccept, textInfoList) = dialog.showDialog() |
|
172 |
|
|
173 |
if isAccept: |
|
174 |
scene = self.scene() |
|
175 |
scene.removeItem(self) |
|
176 |
text = textInfoList[0].getText() |
|
177 |
self.setPlainText(text) |
|
178 |
self.setDefaultTextColor(Qt.blue) |
|
179 |
self.addTextItemToScene(scene) |
|
180 |
|
|
181 |
''' |
|
182 |
@brief Put text on scene |
|
183 |
@author Jeongwoo |
|
184 |
@date 18.04.23 |
|
185 |
@history humkyung 2018.06.30 apply font configuration |
|
186 |
''' |
|
187 |
def addTextItemToScene(self, scene): |
|
188 |
try: |
|
189 |
docData = AppDocData.instance() |
|
190 |
configs = docData.getConfigs('Text Style', 'Font Name') |
|
191 |
fontName = configs[0].value if configs else 'Arial' |
|
192 |
configs = docData.getConfigs('Text Style', 'Font Size') |
|
193 |
fontSize = int(configs[0].value) if configs else -1 |
|
194 |
|
|
195 |
sx = 1 |
|
196 |
sy = 1 |
|
197 |
width = self.size[0] |
|
198 |
height = self.size[1] |
|
199 |
x = self.loc[0] |
|
200 |
y = self.loc[1] |
|
201 |
rect = None |
|
202 |
transform = QTransform() |
|
203 |
if (1.57 == self.angle) or (4.71 == self.angle): |
|
204 |
font = QFont(fontName, width*1.2 if fontSize == -1 else fontSize) |
|
205 |
self.setFont(font) |
|
206 |
rect = self.boundingRect() |
|
207 |
sx = width/rect.height() |
|
208 |
sy = height/rect.width() |
|
209 |
|
|
210 |
transform.translate(x, y) |
|
211 |
transform.translate(width*0.5, height*0.5) |
|
212 |
transform.scale(1, sy) |
|
213 |
transform.rotateRadians(-self.angle) |
|
214 |
transform.translate(-rect.width()*0.5, -rect.height()*0.5) |
|
215 |
elif 3.14 == self.angle: |
|
216 |
font = QFont(fontName, height*1.2 if fontSize == -1 else fontSize) |
|
217 |
self.setFont(font) |
|
218 |
rect = self.boundingRect() |
|
219 |
sx = width/rect.width() |
|
220 |
sy = height/rect.height() |
|
221 |
|
|
222 |
transform.translate(x, y - round((rect.height()-height)*0.5)) |
|
223 |
transform.scale(sx, 1) |
|
224 |
transform.rotateRadians(-self.angle) |
|
225 |
transform.translate(-width*0.5, -height*0.5) |
|
226 |
else: |
|
227 |
font = QFont(fontName, height*1.2 if fontSize == -1 else fontSize) |
|
228 |
self.setFont(font) |
|
229 |
rect = self.boundingRect() |
|
230 |
sx = width/rect.width() |
|
231 |
sy = height/rect.height() |
|
232 |
|
|
233 |
#if '\n' not in text: |
|
234 |
transform.translate(x, y - round((rect.height()-height)*0.5)) |
|
235 |
transform.scale(sx, 1) |
|
236 |
|
|
237 |
self.setTransform(transform) |
|
238 |
|
|
239 |
scene.addItem(self) |
|
240 |
except Exception as ex: |
|
241 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
|
242 |
|
|
243 |
''' |
|
244 |
@brief get connected items |
|
245 |
@author humkyung |
|
246 |
@date 2018.04.23 |
|
247 |
''' |
|
248 |
def getConnectedItems(self): |
|
249 |
visited = [] |
|
250 |
|
|
251 |
try: |
|
252 |
if 1 == len(self.conns): |
|
253 |
# iterate connected items |
|
254 |
pool = [] |
|
255 |
visited = [] |
|
256 |
pool.append(self.conns[0]) |
|
257 |
while len(pool) > 0: |
|
258 |
it = pool.pop() |
|
259 |
visited.append(it) |
|
260 |
for conn in it.conns: |
|
261 |
if (conn is not None) and (conn not in visited): pool.append(conn) |
|
262 |
# up to here |
|
263 |
except Exception as ex: |
|
264 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
|
265 |
|
|
266 |
return visited |
|
267 |
|
|
268 |
''' |
|
269 |
@brief generate xml code |
|
270 |
@author humkyung |
|
271 |
@date 2018.04.23 |
|
272 |
@history humkyung 2018.04.27 move to QEngineeringLineNoTextItem |
|
273 |
humkyung 2018.05.02 add name as parameter |
|
274 |
Jeongwoo 2018.05.30 Change variable [owner] is nullable and Add/Modify attributes |
|
275 |
''' |
|
276 |
def toXml(self, owner = None, name='TEXT'): |
|
277 |
from xml.etree.ElementTree import Element, SubElement, dump, ElementTree |
|
278 |
from EngineeringLineItem import QEngineeringLineItem |
|
279 |
from SymbolSvgItem import SymbolSvgItem |
|
280 |
|
|
281 |
try: |
|
282 |
node = Element('ATTRIBUTE') |
|
283 |
#if owner is not None: |
|
284 |
uidNode = Element('UID') |
|
285 |
uidNode.text = str(self.uid) |
|
286 |
node.append(uidNode) |
|
287 |
|
|
288 |
attributeValueNode = Element('ATTRIBUTEVALUE') |
|
289 |
attributeValueNode.text = self.attribute |
|
290 |
node.append(attributeValueNode) |
|
291 |
|
|
292 |
nameNode = Element('NAME') |
|
293 |
nameNode.text = name |
|
294 |
node.append(nameNode) |
|
295 |
|
|
296 |
locNode = Element('LOCATION') |
|
297 |
locNode.text = '{},{}'.format(self.loc[0], self.loc[1]) |
|
298 |
node.append(locNode) |
|
299 |
|
|
300 |
valueNode = Element('VALUE') |
|
301 |
valueNode.text = self.text() |
|
302 |
node.append(valueNode) |
|
303 |
|
|
304 |
angleNode = Element('ANGLE') |
|
305 |
angleNode.text = str(self.angle) |
|
306 |
node.append(angleNode) |
|
307 |
|
|
308 |
#rect = self.sceneBoundingRect() |
|
309 |
widthNode = Element('WIDTH') |
|
310 |
#widthNode.text = str(rect.width()) |
|
311 |
widthNode.text = str(self.size[0]) |
|
312 |
node.append(widthNode) |
|
313 |
|
|
314 |
heightNode = Element('HEIGHT') |
|
315 |
#heightNode.text = str(rect.height()) |
|
316 |
heightNode.text = str(self.size[1]) |
|
317 |
node.append(heightNode) |
|
318 |
except Exception as ex: |
|
319 |
return str(self.uid) |
|
320 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
|
321 |
|
|
322 |
return node |
|
323 |
|
|
324 |
''' |
|
325 |
@brief Set Color. Override QEngineeringAbstractItem's |
|
326 |
@author Jeongwoo |
|
327 |
@date 2018.05.11 |
|
328 |
@history humkyung 2018.05.13 update after change color |
|
329 |
''' |
|
330 |
def setColor(self, color): |
|
331 |
self._color = color |
|
332 |
c = QColor() |
|
333 |
c.setNamedColor(color) |
|
334 |
self.setDefaultTextColor(c) |
|
335 |
self.update() |
|
336 |
|
|
337 |
def getColor(self): |
|
338 |
return self._color |
|
339 |
|
|
340 |
''' |
|
341 |
@brief The class transfer pyqtSignal Event. Cause Subclass of QGraphicsRectItem can't use pyqtSignal |
|
342 |
@author Jeongwoo |
|
343 |
@date 2018.06.18 |
|
344 |
''' |
|
345 |
class Transfer(QObject): |
|
346 |
onRemoved = pyqtSignal(QGraphicsItem) |
|
347 |
|
|
348 |
def __init__(self, parent = None): |
|
349 |
QObject.__init__(self, parent) |
DTI_PID/DTI_PID/Shapes/EngineeringUnknownItem.py | ||
---|---|---|
19 | 19 |
from QEngineeringAbstractItem import QEngineeringAbstractItem |
20 | 20 |
|
21 | 21 |
class QEngineeringUnknownItem(QEngineeringPolylineItem, QEngineeringAbstractItem): |
22 |
HIGHLIGHT = '#BC4438' |
|
23 |
|
|
22 | 24 |
''' |
23 | 25 |
@history 2018.06.18 Jeongwoo Add variable [transfer] for pyqtSignal |
24 | 26 |
''' |
... | ... | |
50 | 52 |
self.setBrush(QBrush(QColor(255, 255, 0, 127))) |
51 | 53 |
|
52 | 54 |
def hoverEnterEvent(self, event): |
53 |
pass |
|
55 |
self._savedColor = self.getColor() |
|
56 |
self.setColor(QEngineeringUnknownItem.HIGHLIGHT) |
|
57 |
self.update() |
|
54 | 58 |
|
55 | 59 |
def hoverLeaveEvent(self, event): |
56 |
pass |
|
60 |
self.setColor(self._savedColor) |
|
61 |
self.update() |
|
57 | 62 |
|
58 | 63 |
def hoverMoveEvent(self, event): |
59 | 64 |
pass |
... | ... | |
85 | 90 |
menu.exec_(event.screenPos()) |
86 | 91 |
|
87 | 92 |
''' |
93 |
@brief change unknown item's color |
|
94 |
@author humkyung |
|
95 |
@date 2018.08.13 |
|
96 |
''' |
|
97 |
def setColor(self, color): |
|
98 |
self._color = color |
|
99 |
c = QColor() |
|
100 |
c.setNamedColor(color) |
|
101 |
c.setAlpha(127) |
|
102 |
self.setBrush(QBrush(c)) |
|
103 |
self.update() |
|
104 |
|
|
105 |
''' |
|
106 |
@brief return unknown item's color |
|
107 |
@author humkyung |
|
108 |
@date 2018.08.13 |
|
109 |
''' |
|
110 |
def getColor(self): |
|
111 |
return self.brush().color().name() |
|
112 |
|
|
113 |
''' |
|
88 | 114 |
@brief override paint(draw connection points) |
89 | 115 |
@author humkyung |
90 | 116 |
@date 2018.08.08 |
91 | 117 |
''' |
92 | 118 |
def paint(self, painter, options=None, widget=None): |
119 |
painter.setClipRect(options.exposedRect) |
|
93 | 120 |
if self.isSelected(): |
94 |
self.setBrush(QBrush(QColor(255, 0, 0, 127))) |
|
121 |
painter.setBrush(QBrush(QColor(255, 0, 0, 127))) |
|
122 |
QEngineeringPolylineItem.paint(self, painter, options, widget) |
|
95 | 123 |
else: |
96 |
self.setBrush(QBrush(QColor(255, 255, 0, 127))) |
|
97 |
|
|
98 |
QEngineeringPolylineItem.paint(self, painter, options, widget) |
|
124 |
QEngineeringPolylineItem.paint(self, painter, options, widget) |
|
99 | 125 |
|
100 | 126 |
''' |
101 | 127 |
@brief show symbol editor |
DTI_PID/DTI_PID/Shapes/QEngineeringLineNoTextItem.py | ||
---|---|---|
17 | 17 |
from QGraphicsBoundingBoxItem import QGraphicsBoundingBoxItem |
18 | 18 |
from OcrResultDialog import QOcrResultDialog |
19 | 19 |
from AppDocData import AppDocData |
20 |
from QEngineeringTextItem import QEngineeringTextItem
|
|
20 |
from EngineeringTextItem import QEngineeringTextItem |
|
21 | 21 |
|
22 | 22 |
class QEngineeringLineNoTextItem(QEngineeringTextItem): |
23 | 23 |
|
... | ... | |
193 | 193 |
|
194 | 194 |
return node |
195 | 195 |
|
196 |
def hoverEnterEvent(self, event): |
|
197 |
pass |
|
198 |
|
|
199 |
def hoverLeaveEvent(self, event): |
|
200 |
pass |
|
201 |
|
|
202 |
def hoverMoveEvent(self, event): |
|
203 |
pass |
|
204 |
|
|
205 | 196 |
''' |
206 | 197 |
@Override (QEngineeringTextItem) |
207 | 198 |
@brief get connected items |
DTI_PID/DTI_PID/Shapes/QEngineeringNoteItem.py | ||
---|---|---|
16 | 16 |
from QGraphicsBoundingBoxItem import QGraphicsBoundingBoxItem |
17 | 17 |
import OcrResultDialog |
18 | 18 |
from AppDocData import AppDocData |
19 |
from QEngineeringTextItem import QEngineeringTextItem
|
|
19 |
from EngineeringTextItem import QEngineeringTextItem |
|
20 | 20 |
import re |
21 | 21 |
|
22 | 22 |
class QEngineeringNoteItem(QEngineeringTextItem): |
... | ... | |
31 | 31 |
self.title = None |
32 | 32 |
self.conetents = None |
33 | 33 |
|
34 |
def hoverEnterEvent(self, event): |
|
35 |
pass |
|
36 |
|
|
37 |
def hoverLeaveEvent(self, event): |
|
38 |
pass |
|
39 |
|
|
40 |
def hoverMoveEvent(self, event): |
|
41 |
pass |
|
42 |
|
|
43 | 34 |
''' |
44 | 35 |
@brief Find Note Contents by NOTE No. |
45 | 36 |
@author Jeongwoo |
DTI_PID/DTI_PID/Shapes/QEngineeringSizeTextItem.py | ||
---|---|---|
17 | 17 |
from QGraphicsBoundingBoxItem import QGraphicsBoundingBoxItem |
18 | 18 |
import OcrResultDialog |
19 | 19 |
from AppDocData import AppDocData |
20 |
from QEngineeringTextItem import QEngineeringTextItem
|
|
20 |
from EngineeringTextItem import QEngineeringTextItem |
|
21 | 21 |
|
22 | 22 |
class QEngineeringSizeTextItem(QEngineeringTextItem): |
23 | 23 |
#removed = pyqtSignal(QGraphicsItem) |
... | ... | |
66 | 66 |
except Exception as ex: |
67 | 67 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
68 | 68 |
|
69 |
return node |
|
70 |
|
|
71 |
def hoverEnterEvent(self, event): |
|
72 |
pass |
|
73 |
|
|
74 |
def hoverLeaveEvent(self, event): |
|
75 |
pass |
|
76 |
|
|
77 |
def hoverMoveEvent(self, event): |
|
78 |
pass |
|
69 |
return node |
DTI_PID/DTI_PID/Shapes/QEngineeringTagNoTextItem.py | ||
---|---|---|
17 | 17 |
from QGraphicsBoundingBoxItem import QGraphicsBoundingBoxItem |
18 | 18 |
import OcrResultDialog |
19 | 19 |
from AppDocData import AppDocData |
20 |
from QEngineeringTextItem import QEngineeringTextItem
|
|
20 |
from EngineeringTextItem import QEngineeringTextItem |
|
21 | 21 |
|
22 | 22 |
class QEngineeringTagNoTextItem(QEngineeringTextItem): |
23 | 23 |
#removed = pyqtSignal(QGraphicsItem) |
DTI_PID/DTI_PID/Shapes/QEngineeringTextItem.py | ||
---|---|---|
1 |
# coding: utf-8 |
|
2 |
import os.path |
|
3 |
import copy |
|
4 |
import sys |
|
5 |
try: |
|
6 |
from PyQt5.QtCore import Qt, QPointF, QRectF, pyqtSignal, QObject, QT_VERSION_STR, QRect |
|
7 |
from PyQt5.QtGui import QImage, QPixmap, QPainterPath, QBrush, QPen, QTransform, QFont, QColor |
|
8 |
from PyQt5.QtWidgets import QGraphicsView, QGraphicsScene, QFileDialog, QGraphicsItem, QAbstractGraphicsShapeItem, QGraphicsTextItem |
|
9 |
except ImportError: |
|
10 |
try: |
|
11 |
from PyQt4.QtCore import Qt, QRectF, pyqtSignal, QRect, QObject, QT_VERSION_STR |
|
12 |
from PyQt4.QtGui import QGraphicsView, QGraphicsScene, QImage, QPixmap, QPainterPath, QFileDialog, QFont, QColor |
|
13 |
except ImportError: |
|
14 |
raise ImportError("ImageViewerQt: Requires PyQt5 or PyQt4.") |
|
15 |
|
|
16 |
from EngineeringPolylineItem import QEngineeringPolylineItem |
|
17 |
from QGraphicsBoundingBoxItem import QGraphicsBoundingBoxItem |
|
18 |
from OcrResultDialog import QOcrResultDialog |
|
19 |
from AppDocData import AppDocData |
|
20 |
from QEngineeringAbstractItem import QEngineeringAbstractItem |
|
21 |
|
|
22 |
class QEngineeringTextItem(QGraphicsTextItem, QEngineeringAbstractItem): |
|
23 |
''' |
|
24 |
@history 2018.05.17 Jeongwoo Add self._owner variable |
|
25 |
''' |
|
26 |
def __init__(self, uid=None, parent=None): |
|
27 |
import uuid |
|
28 |
|
|
29 |
QGraphicsTextItem.__init__(self, parent) |
|
30 |
QEngineeringAbstractItem.__init__(self) |
|
31 |
|
|
32 |
self.uid = uuid.uuid4() if uid is None else uid |
|
33 |
self.loc = None |
|
34 |
self.size = None |
|
35 |
self.angle = 0 # angle in radian |
|
36 |
self.conns = [] |
|
37 |
self._owner = None |
|
38 |
self.setFlags(QGraphicsItem.ItemIsSelectable|QGraphicsItem.ItemIsFocusable) |
|
39 |
self.setAcceptHoverEvents(True) |
|
40 |
self.setAcceptTouchEvents(True) |
|
41 |
|
|
42 |
self.setColor(self._color) |
|
43 |
|
|
44 |
self.delimiter = '"' |
|
45 |
|
|
46 |
self.attribute = '' |
|
47 |
|
|
48 |
self.transfer = Transfer() |
|
49 |
|
|
50 |
''' |
|
51 |
@brief Get owner |
|
52 |
@author Jeongwoo |
|
53 |
@date 2018.05.17 |
|
54 |
''' |
|
55 |
@property |
|
56 |
def owner(self): |
|
57 |
return self._owner |
|
58 |
|
|
59 |
''' |
|
60 |
@brief Set owner |
|
61 |
@author Jeongwoo |
|
62 |
@date 2018.05.17 |
|
63 |
@history 2018.05.17 Jeongwoo Add Calling setColor if self._owner is None or not |
|
64 |
''' |
|
65 |
@owner.setter |
|
66 |
def owner(self, value): |
|
67 |
self._owner = value |
|
68 |
|
|
69 |
if self._owner is None: |
|
70 |
self._color = self.DEFAULT_COLOR |
|
71 |
self.setColor(self._color) |
|
72 |
|
|
73 |
''' |
|
74 |
@brief return text string |
|
75 |
@author humkyung |
|
76 |
@date 2018.04.16 |
|
77 |
''' |
|
78 |
def text(self): |
|
79 |
return self.toPlainText() |
|
80 |
|
|
81 |
''' |
|
82 |
@brief return center position of text |
|
83 |
@author humkyung |
|
84 |
@date 2018.04.16 |
|
85 |
''' |
|
86 |
def center(self): |
|
87 |
return self.sceneBoundingRect().center() |
|
88 |
|
|
89 |
def hoverEnterEvent(self, event): |
|
90 |
pass |
|
91 |
|
|
92 |
def hoverLeaveEvent(self, event): |
|
93 |
pass |
|
94 |
|
|
95 |
def hoverMoveEvent(self, event): |
|
96 |
pass |
|
97 |
|
|
98 |
''' |
|
99 |
@brief remove item when user press delete key |
|
100 |
@author humkyung |
|
101 |
@date 2018.04.23 |
|
102 |
@history 2018.05.25 Jeongwoo Seperate delete item method |
|
103 |
''' |
|
104 |
def keyPressEvent(self, event): |
|
105 |
if event.key() == Qt.Key_Delete: |
|
106 |
self.deleteTextItemFromScene() |
|
107 |
|
|
108 |
''' |
|
109 |
@brief draw rect when item is selected |
|
110 |
@author humkyung |
|
111 |
@date 2018.07.08 |
|
112 |
''' |
|
113 |
def drawFocusRect(self, painter): |
|
114 |
self.focuspen = QPen(Qt.DotLine) |
|
115 |
self.focuspen.setColor(Qt.black) |
|
116 |
self.focuspen.setWidthF(1.5) |
|
117 |
hilightColor = QColor(255, 0, 0, 127) |
|
118 |
painter.setBrush(QBrush(hilightColor)) |
|
119 |
painter.setPen(self.focuspen) |
|
120 |
painter.drawRect(self.boundingRect()) |
|
121 |
|
|
122 |
''' |
|
123 |
@brief override paint(draw connection points) |
|
124 |
@author humkyung |
|
125 |
@date 2018.07.08 |
|
126 |
''' |
|
127 |
def paint(self, painter, options=None, widget=None): |
|
128 |
QGraphicsTextItem.paint(self, painter, options, widget) |
|
129 |
if self.isSelected(): |
|
130 |
self.drawFocusRect(painter) |
|
131 |
|
|
132 |
''' |
|
133 |
@brief Delete text item |
|
134 |
@author Jeongwoo |
|
135 |
@date 2018.05.25 |
|
136 |
''' |
|
137 |
def deleteTextItemFromScene(self): |
|
138 |
self.transfer.onRemoved.emit(self) |
|
139 |
self.scene().removeItem(self) |
|
140 |
|
|
141 |
''' |
|
142 |
@brief Return real item position |
|
143 |
@author Jeongwoo |
|
144 |
@date 2018.05.25 |
|
145 |
''' |
|
146 |
def boundingRectOnScene(self): |
|
147 |
rect = self.boundingRect() |
|
148 |
rect.moveTo(self.loc[0], self.loc[1]) |
|
149 |
return rect |
|
150 |
|
|
151 |
''' |
|
152 |
@brief Double click event, Show QOcrResultDialog |
|
153 |
@author Jeongwoo |
|
154 |
@date 18.04.23 |
|
155 |
@history 18.06.20 Jeongwoo Resize QRect added 1 |
|
156 |
''' |
|
157 |
def mouseDoubleClickEvent(self, event): |
|
158 |
if event.buttons() == Qt.LeftButton: |
|
159 |
dialog = QOcrResultDialog(None, AppDocData.instance().getCurrentPidSource().getQImageOnRect(QRect(self.loc[0], self.loc[1], self.size[0]+1, self.size[1])) |
|
160 |
, QRect(self.loc[0], self.loc[1], self.size[0]+1, self.size[1]), True, self.text()) |
|
161 |
(isAccept, textInfoList) = dialog.showDialog() |
|
162 |
|
|
163 |
if isAccept: |
|
164 |
scene = self.scene() |
|
165 |
scene.removeItem(self) |
|
166 |
text = textInfoList[0].getText() |
|
167 |
self.setPlainText(text) |
|
168 |
self.setDefaultTextColor(Qt.blue) |
|
169 |
self.addTextItemToScene(scene) |
|
170 |
|
|
171 |
''' |
|
172 |
@brief Put text on scene |
|
173 |
@author Jeongwoo |
|
174 |
@date 18.04.23 |
|
175 |
@history humkyung 2018.06.30 apply font configuration |
|
176 |
''' |
|
177 |
def addTextItemToScene(self, scene): |
|
178 |
try: |
|
179 |
docData = AppDocData.instance() |
|
180 |
configs = docData.getConfigs('Text Style', 'Font Name') |
|
181 |
fontName = configs[0].value if configs else 'Arial' |
|
182 |
configs = docData.getConfigs('Text Style', 'Font Size') |
|
183 |
fontSize = int(configs[0].value) if configs else -1 |
|
184 |
|
|
185 |
sx = 1 |
|
186 |
sy = 1 |
|
187 |
width = self.size[0] |
|
188 |
height = self.size[1] |
|
189 |
x = self.loc[0] |
|
190 |
y = self.loc[1] |
|
191 |
rect = None |
|
192 |
transform = QTransform() |
|
193 |
if (1.57 == self.angle) or (4.71 == self.angle): |
|
194 |
font = QFont(fontName, width*1.2 if fontSize == -1 else fontSize) |
|
195 |
self.setFont(font) |
|
196 |
rect = self.boundingRect() |
|
197 |
sx = width/rect.height() |
|
198 |
sy = height/rect.width() |
|
199 |
|
|
200 |
transform.translate(x, y) |
|
201 |
transform.translate(width*0.5, height*0.5) |
|
202 |
transform.scale(1, sy) |
|
203 |
transform.rotateRadians(-self.angle) |
|
204 |
transform.translate(-rect.width()*0.5, -rect.height()*0.5) |
|
205 |
elif 3.14 == self.angle: |
|
206 |
font = QFont(fontName, height*1.2 if fontSize == -1 else fontSize) |
|
207 |
self.setFont(font) |
|
208 |
rect = self.boundingRect() |
|
209 |
sx = width/rect.width() |
|
210 |
sy = height/rect.height() |
|
211 |
|
|
212 |
transform.translate(x, y - round((rect.height()-height)*0.5)) |
|
213 |
transform.scale(sx, 1) |
|
214 |
transform.rotateRadians(-self.angle) |
|
215 |
transform.translate(-width*0.5, -height*0.5) |
|
216 |
else: |
|
217 |
font = QFont(fontName, height*1.2 if fontSize == -1 else fontSize) |
|
218 |
self.setFont(font) |
|
219 |
rect = self.boundingRect() |
|
220 |
sx = width/rect.width() |
|
221 |
sy = height/rect.height() |
|
222 |
|
|
223 |
#if '\n' not in text: |
|
224 |
transform.translate(x, y - round((rect.height()-height)*0.5)) |
|
225 |
transform.scale(sx, 1) |
|
226 |
|
|
227 |
self.setTransform(transform) |
|
228 |
|
|
229 |
scene.addItem(self) |
|
230 |
except Exception as ex: |
|
231 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
|
232 |
|
|
233 |
''' |
|
234 |
@brief get connected items |
|
235 |
@author humkyung |
|
236 |
@date 2018.04.23 |
|
237 |
''' |
|
238 |
def getConnectedItems(self): |
|
239 |
visited = [] |
|
240 |
|
|
241 |
try: |
|
242 |
if 1 == len(self.conns): |
|
243 |
# iterate connected items |
|
244 |
pool = [] |
|
245 |
visited = [] |
|
246 |
pool.append(self.conns[0]) |
|
247 |
while len(pool) > 0: |
|
248 |
it = pool.pop() |
|
249 |
visited.append(it) |
|
250 |
for conn in it.conns: |
|
251 |
if (conn is not None) and (conn not in visited): pool.append(conn) |
|
252 |
# up to here |
|
253 |
except Exception as ex: |
|
254 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
|
255 |
|
|
256 |
return visited |
|
257 |
|
|
258 |
''' |
|
259 |
@brief generate xml code |
|
260 |
@author humkyung |
|
261 |
@date 2018.04.23 |
|
262 |
@history humkyung 2018.04.27 move to QEngineeringLineNoTextItem |
|
263 |
humkyung 2018.05.02 add name as parameter |
|
264 |
Jeongwoo 2018.05.30 Change variable [owner] is nullable and Add/Modify attributes |
|
265 |
''' |
|
266 |
def toXml(self, owner = None, name='TEXT'): |
|
267 |
from xml.etree.ElementTree import Element, SubElement, dump, ElementTree |
|
268 |
from EngineeringLineItem import QEngineeringLineItem |
|
269 |
from SymbolSvgItem import SymbolSvgItem |
|
270 |
|
|
271 |
try: |
|
272 |
node = Element('ATTRIBUTE') |
|
273 |
#if owner is not None: |
|
274 |
uidNode = Element('UID') |
|
275 |
uidNode.text = str(self.uid) |
|
276 |
node.append(uidNode) |
|
277 |
|
|
278 |
attributeValueNode = Element('ATTRIBUTEVALUE') |
|
279 |
attributeValueNode.text = self.attribute |
|
280 |
node.append(attributeValueNode) |
|
281 |
|
|
282 |
nameNode = Element('NAME') |
|
283 |
nameNode.text = name |
|
284 |
node.append(nameNode) |
|
285 |
|
|
286 |
locNode = Element('LOCATION') |
|
287 |
locNode.text = '{},{}'.format(self.loc[0], self.loc[1]) |
|
288 |
node.append(locNode) |
|
289 |
|
|
290 |
valueNode = Element('VALUE') |
|
291 |
valueNode.text = self.text() |
|
292 |
node.append(valueNode) |
|
293 |
|
|
294 |
angleNode = Element('ANGLE') |
|
295 |
angleNode.text = str(self.angle) |
|
296 |
node.append(angleNode) |
|
297 |
|
|
298 |
#rect = self.sceneBoundingRect() |
|
299 |
widthNode = Element('WIDTH') |
|
300 |
#widthNode.text = str(rect.width()) |
|
301 |
widthNode.text = str(self.size[0]) |
|
302 |
node.append(widthNode) |
|
303 |
|
|
304 |
heightNode = Element('HEIGHT') |
|
305 |
#heightNode.text = str(rect.height()) |
|
306 |
heightNode.text = str(self.size[1]) |
|
307 |
node.append(heightNode) |
|
308 |
except Exception as ex: |
|
309 |
return str(self.uid) |
|
310 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
|
311 |
|
|
312 |
return node |
|
313 |
|
|
314 |
''' |
|
315 |
@brief Set Color. Override QEngineeringAbstractItem's |
|
316 |
@author Jeongwoo |
|
317 |
@date 2018.05.11 |
|
318 |
@history humkyung 2018.05.13 update after change color |
|
319 |
''' |
|
320 |
def setColor(self, color): |
|
321 |
self._color = color |
|
322 |
c = QColor() |
|
323 |
c.setNamedColor(color) |
|
324 |
self.setDefaultTextColor(c) |
|
325 |
self.update() |
|
326 |
|
|
327 |
def getColor(self): |
|
328 |
return self._color |
|
329 |
|
|
330 |
''' |
|
331 |
@brief The class transfer pyqtSignal Event. Cause Subclass of QGraphicsRectItem can't use pyqtSignal |
|
332 |
@author Jeongwoo |
|
333 |
@date 2018.06.18 |
|
334 |
''' |
|
335 |
class Transfer(QObject): |
|
336 |
onRemoved = pyqtSignal(QGraphicsItem) |
|
337 |
|
|
338 |
def __init__(self, parent = None): |
|
339 |
QObject.__init__(self, parent) |
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
388 | 388 |
@date 18.07.17 |
389 | 389 |
''' |
390 | 390 |
def findTextItemInPoint(self, point): |
391 |
from QEngineeringTextItem import QEngineeringTextItem
|
|
391 |
from EngineeringTextItem import QEngineeringTextItem |
|
392 | 392 |
|
393 | 393 |
scene = self.scene() |
394 | 394 |
|
... | ... | |
506 | 506 |
@history kyouho 2018.07.18 Add only attr QEngineeringTextItem |
507 | 507 |
''' |
508 | 508 |
def getAttributes(self): |
509 |
from QEngineeringTextItem import QEngineeringTextItem
|
|
509 |
from EngineeringTextItem import QEngineeringTextItem |
|
510 | 510 |
from QEngineeringInstrumentItem import QEngineeringInstrumentItem |
511 | 511 |
attrs = {} |
512 | 512 |
|
DTI_PID/DTI_PID/SmartFEED.nsi | ||
---|---|---|
759 | 759 |
File "dist\SmartFEED\Shapes\QEngineeringOPCItem.py" |
760 | 760 |
File "dist\SmartFEED\Shapes\QEngineeringSizeTextItem.py" |
761 | 761 |
File "dist\SmartFEED\Shapes\QEngineeringTagNoTextItem.py" |
762 |
File "dist\SmartFEED\Shapes\QEngineeringTextItem.py"
|
|
762 |
File "dist\SmartFEED\Shapes\EngineeringTextItem.py" |
|
763 | 763 |
File "dist\SmartFEED\Shapes\QEngineeringTrimLineNoTextItem.py" |
764 | 764 |
File "dist\SmartFEED\Shapes\QGraphicsBoundingBoxItem.py" |
765 | 765 |
File "dist\SmartFEED\Shapes\SymbolSvgItem.py" |
... | ... | |
785 | 785 |
File "dist\SmartFEED\Shapes\__pycache__\QEngineeringRunItem.cpython-36.pyc" |
786 | 786 |
File "dist\SmartFEED\Shapes\__pycache__\QEngineeringSizeTextItem.cpython-36.pyc" |
787 | 787 |
File "dist\SmartFEED\Shapes\__pycache__\QEngineeringTagNoTextItem.cpython-36.pyc" |
788 |
File "dist\SmartFEED\Shapes\__pycache__\QEngineeringTextItem.cpython-36.pyc"
|
|
788 |
File "dist\SmartFEED\Shapes\__pycache__\EngineeringTextItem.cpython-36.pyc" |
|
789 | 789 |
File "dist\SmartFEED\Shapes\__pycache__\QEngineeringTrimLineNoTextItem.cpython-36.pyc" |
790 | 790 |
File "dist\SmartFEED\Shapes\__pycache__\QEngineeringUnknownItem.cpython-36.pyc" |
791 | 791 |
File "dist\SmartFEED\Shapes\__pycache__\QGraphicsBoundingBoxItem.cpython-36.pyc" |
... | ... | |
795 | 795 |
File "dist\SmartFEED\SingletonInstance.py" |
796 | 796 |
File "dist\SmartFEED\sip.pyd" |
797 | 797 |
File "dist\SmartFEED\${PRODUCT_NAME}.exe" |
798 |
CreateDirectory "$SMPROGRAMS\???? ??????"
|
|
799 |
CreateShortCut "$SMPROGRAMS\???? ??????\???? ??????.lnk" "$INSTDIR\${PRODUCT_NAME}.exe"
|
|
800 |
CreateShortCut "$DESKTOP\???? ??????.lnk" "$INSTDIR\${PRODUCT_NAME}.exe"
|
|
798 |
CreateDirectory "$SMPROGRAMS\���� ���α�"
|
|
799 |
CreateShortCut "$SMPROGRAMS\���� ���α�\���� ���α�.lnk" "$INSTDIR\${PRODUCT_NAME}.exe"
|
|
800 |
CreateShortCut "$DESKTOP\���� ���α�.lnk" "$INSTDIR\${PRODUCT_NAME}.exe"
|
|
801 | 801 |
File "dist\SmartFEED\SmartFEED.exe.manifest" |
802 | 802 |
File "dist\SmartFEED\sqlite3.dll" |
803 | 803 |
File "dist\SmartFEED\symbol.py" |
... | ... | |
1902 | 1902 |
|
1903 | 1903 |
Section -AdditionalIcons |
1904 | 1904 |
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" |
1905 |
CreateShortCut "$SMPROGRAMS\???? ??????\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
|
|
1906 |
CreateShortCut "$SMPROGRAMS\???? ??????\Uninstall.lnk" "$INSTDIR\uninst.exe"
|
|
1905 |
CreateShortCut "$SMPROGRAMS\���� ���α�\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
|
|
1906 |
CreateShortCut "$SMPROGRAMS\���� ���α�\Uninstall.lnk" "$INSTDIR\uninst.exe"
|
|
1907 | 1907 |
SectionEnd |
1908 | 1908 |
|
1909 | 1909 |
Section -Post |
... | ... | |
1931 | 1931 |
uninst: |
1932 | 1932 |
ClearErrors |
1933 | 1933 |
ExecWait '"$R0" _?=$INSTDIR' ;Do not copy the uninstaller to a temp file |
1934 |
;abort ; ?????? ????
|
|
1934 |
;abort ; ���α� ����
|
|
1935 | 1935 |
|
1936 | 1936 |
IfErrors no_remove_uninstaller |
1937 | 1937 |
;You can either use Delete /REBOOTOK in the uninstaller or add some code |
... | ... | |
1945 | 1945 |
|
1946 | 1946 |
Function un.onUninstSuccess |
1947 | 1947 |
HideWindow |
1948 |
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name)??(??) ?????? ???????????."
|
|
1948 |
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name)��(��) ������ ���ŵǾ����ϴ�."
|
|
1949 | 1949 |
FunctionEnd |
1950 | 1950 |
|
1951 | 1951 |
Function un.onInit |
1952 |
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(^Name)??(??) ?????????????" IDYES +2
|
|
1952 |
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(^Name)��(��) �����Ͻðڽ��ϱ�?" IDYES +2
|
|
1953 | 1953 |
Abort |
1954 | 1954 |
FunctionEnd |
1955 | 1955 |
|
... | ... | |
3003 | 3003 |
Delete "$INSTDIR\Shapes\__pycache__\QGraphicsBoundingBoxItem.cpython-36.pyc" |
3004 | 3004 |
Delete "$INSTDIR\Shapes\__pycache__\QEngineeringUnknownItem.cpython-36.pyc" |
3005 | 3005 |
Delete "$INSTDIR\Shapes\__pycache__\QEngineeringTrimLineNoTextItem.cpython-36.pyc" |
3006 |
Delete "$INSTDIR\Shapes\__pycache__\QEngineeringTextItem.cpython-36.pyc"
|
|
3006 |
Delete "$INSTDIR\Shapes\__pycache__\EngineeringTextItem.cpython-36.pyc" |
|
3007 | 3007 |
Delete "$INSTDIR\Shapes\__pycache__\QEngineeringTagNoTextItem.cpython-36.pyc" |
3008 | 3008 |
Delete "$INSTDIR\Shapes\__pycache__\QEngineeringSizeTextItem.cpython-36.pyc" |
3009 | 3009 |
Delete "$INSTDIR\Shapes\__pycache__\QEngineeringRunItem.cpython-36.pyc" |
... | ... | |
3028 | 3028 |
Delete "$INSTDIR\Shapes\SymbolSvgItem.py" |
3029 | 3029 |
Delete "$INSTDIR\Shapes\QGraphicsBoundingBoxItem.py" |
3030 | 3030 |
Delete "$INSTDIR\Shapes\QEngineeringTrimLineNoTextItem.py" |
3031 |
Delete "$INSTDIR\Shapes\QEngineeringTextItem.py"
|
|
3031 |
Delete "$INSTDIR\Shapes\EngineeringTextItem.py" |
|
3032 | 3032 |
Delete "$INSTDIR\Shapes\QEngineeringTagNoTextItem.py" |
3033 | 3033 |
Delete "$INSTDIR\Shapes\QEngineeringSizeTextItem.py" |
3034 | 3034 |
Delete "$INSTDIR\Shapes\QEngineeringOPCItem.py" |
... | ... | |
4083 | 4083 |
Delete "$INSTDIR\api-ms-win-core-datetime-l1-1-0.dll" |
4084 | 4084 |
Delete "$INSTDIR\api-ms-win-core-console-l1-1-0.dll" |
4085 | 4085 |
|
4086 |
Delete "$SMPROGRAMS\???? ??????\Uninstall.lnk"
|
|
4087 |
Delete "$SMPROGRAMS\???? ??????\Website.lnk"
|
|
4088 |
Delete "$DESKTOP\???? ??????.lnk"
|
|
4089 |
Delete "$SMPROGRAMS\???? ??????\???? ??????.lnk"
|
|
4086 |
Delete "$SMPROGRAMS\���� ���α�\Uninstall.lnk"
|
|
4087 |
Delete "$SMPROGRAMS\���� ���α�\Website.lnk"
|
|
4088 |
Delete "$DESKTOP\���� ���α�.lnk"
|
|
4089 |
Delete "$SMPROGRAMS\���� ���α�\���� ���α�.lnk"
|
|
4090 | 4090 |
|
4091 |
RMDir "$SMPROGRAMS\???? ??????"
|
|
4091 |
RMDir "$SMPROGRAMS\���� ���α�"
|
|
4092 | 4092 |
RMDir "$INSTDIR\tk\ttk" |
4093 | 4093 |
RMDir "$INSTDIR\tk\msgs" |
4094 | 4094 |
RMDir "$INSTDIR\tk\images" |
DTI_PID/DTI_PID/TextItemFactory.py | ||
---|---|---|
13 | 13 |
from AppDocData import * |
14 | 14 |
import sys, os |
15 | 15 |
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '\\Shapes') |
16 |
from QEngineeringTextItem import QEngineeringTextItem
|
|
16 |
from EngineeringTextItem import QEngineeringTextItem |
|
17 | 17 |
from QEngineeringLineNoTextItem import QEngineeringLineNoTextItem |
18 | 18 |
from QEngineeringNoteItem import QEngineeringNoteItem |
19 | 19 |
from QEngineeringSizeTextItem import QEngineeringSizeTextItem |
DTI_PID/DTI_PID/XmlGenerator.py | ||
---|---|---|
355 | 355 |
''' |
356 | 356 |
def writeXmlOnScene(pidName, pidWidth, pidHeight, scene): |
357 | 357 |
from QEngineeringNoteItem import QEngineeringNoteItem |
358 |
from QEngineeringTextItem import QEngineeringTextItem
|
|
358 |
from EngineeringTextItem import QEngineeringTextItem |
|
359 | 359 |
from EngineeringLineItem import QEngineeringLineItem |
360 | 360 |
from QEngineeringLineNoTextItem import QEngineeringLineNoTextItem |
361 | 361 |
from EngineeringUnknownItem import QEngineeringUnknownItem |
내보내기 Unified diff