개정판 2f13b3fb
issue #103: load, save texting for text_area in symbol before recognition
Change-Id: Ia82fccdb5e20e627d7b5bfe4b8237986d2491c25
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
48 | 48 |
self.name = name |
49 | 49 |
self.type = '' |
50 | 50 |
self.iType = -2 |
51 |
self.text_area = None |
|
51 | 52 |
self.angle = 0 |
52 | 53 |
self.origin = None |
53 | 54 |
self.loc = None |
... | ... | |
597 | 598 |
symbolInfo = app_doc_data.getSymbolByQuery('UID', dbUid) |
598 | 599 |
self.dbUid = symbolInfo.uid |
599 | 600 |
self.iType = symbolInfo.iType |
601 |
self.text_area = symbolInfo.text_area |
|
600 | 602 |
originalPoint = symbolInfo.getOriginalPoint().split(',') |
601 | 603 |
self.symbolOrigin = [float(originalPoint[0]), float(originalPoint[1])] |
602 | 604 |
|
DTI_PID/DTI_PID/SymbolEditorDialog.py | ||
---|---|---|
56 | 56 |
self.ui.tableWidgetConnList.horizontalHeader().setStretchLastSection(True) |
57 | 57 |
self.ui.tableWidgetConnList.itemPressed.connect(self.onConnPtPressed) |
58 | 58 |
|
59 |
self.ui.textAreaTableWidget.setColumnCount(1) |
|
60 |
self.ui.textAreaTableWidget.setHorizontalHeaderLabels(['Area']) |
|
61 |
self.ui.textAreaTableWidget.horizontalHeader().setStretchLastSection(True) |
|
62 |
|
|
59 | 63 |
self.conn_index = 1 |
60 | 64 |
|
61 | 65 |
self.setupImageViewer() |
... | ... | |
67 | 71 |
self.offsetY = 0 |
68 | 72 |
self.newSym = None |
69 | 73 |
|
70 |
self.ui.textAreaTableWidget.setColumnCount(1) |
|
71 |
self.ui.textAreaTableWidget.setHorizontalHeaderLabels(['Area']) |
|
72 |
self.ui.textAreaTableWidget.horizontalHeader().setStretchLastSection(True) |
|
73 | 74 |
self.ui.addTextAreaButton.clicked.connect(self.onSelectTextArea) |
74 | 75 |
self.ui.delTextAreaButton.clicked.connect(self.onDeleteTextArea) |
75 | 76 |
|
... | ... | |
130 | 131 |
|
131 | 132 |
boundingBox = QGraphicsBoundingBoxItem(x, y, width, height) |
132 | 133 |
boundingBox.transfer.onSizeChanged.connect(self.onBoundingBoxChanged) |
134 |
boundingBox.transfer.onRemoved.connect(self.itemRemoved) |
|
133 | 135 |
boundingBox.setPen(QPen(Qt.darkGray, THICKNESS, Qt.SolidLine)) |
134 | 136 |
self.ui.imageView.scene.addItem(boundingBox) |
135 | 137 |
|
... | ... | |
181 | 183 |
sys.exc_info()[-1].tb_lineno) |
182 | 184 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
183 | 185 |
|
186 |
def itemRemoved(self, item): |
|
187 |
for row in range(self.ui.textAreaTableWidget.rowCount()): |
|
188 |
boundingBox = self.ui.textAreaTableWidget.item(row, 0) |
|
189 |
if item == boundingBox.tag: |
|
190 |
self.ui.textAreaTableWidget.removeRow(row) |
|
191 |
break |
|
192 |
|
|
184 | 193 |
def removeArea(self, box): |
185 | 194 |
try: |
186 | 195 |
self.ui.imageView.scene.removeItem(box) |
... | ... | |
439 | 448 |
else: |
440 | 449 |
self.addAdditionalSymbol(splitSymString[0], splitSymString[1], splitSymString[2]) |
441 | 450 |
|
451 |
if self.selectedSymbol.getText_area(): |
|
452 |
for area in self.selectedSymbol.getText_area(): |
|
453 |
self.onAreaCreated(area.x, area.y, area.width, area.height) |
|
454 |
|
|
442 | 455 |
originalPoint = self.selectedSymbol.getOriginalPoint() |
443 | 456 |
self.ui.originalPointLineEdit.setText(originalPoint) |
444 | 457 |
OriginalPointCommand.OriginalPointCommand.drawCircle(self.ui.imageView, originalPoint.split(",")[0], |
DTI_PID/DTI_PID/SymbolEditor_UI.py | ||
---|---|---|
1 | 1 |
# -*- coding: utf-8 -*- |
2 | 2 |
|
3 |
# Form implementation generated from reading ui file '.\UI\SymbolEditor.ui'
|
|
3 |
# Form implementation generated from reading ui file './UI/SymbolEditor.ui'
|
|
4 | 4 |
# |
5 |
# Created by: PyQt5 UI code generator 5.14.1
|
|
5 |
# Created by: PyQt5 UI code generator 5.11.3
|
|
6 | 6 |
# |
7 | 7 |
# WARNING! All changes made in this file will be lost! |
8 | 8 |
|
9 |
|
|
10 | 9 |
from PyQt5 import QtCore, QtGui, QtWidgets |
11 | 10 |
|
12 |
|
|
13 | 11 |
class Ui_Dialog(object): |
14 | 12 |
def setupUi(self, Dialog): |
15 | 13 |
Dialog.setObjectName("Dialog") |
16 |
Dialog.resize(1565, 1029)
|
|
14 |
Dialog.resize(1565, 976)
|
|
17 | 15 |
Dialog.setMinimumSize(QtCore.QSize(1280, 720)) |
18 | 16 |
Dialog.setMaximumSize(QtCore.QSize(16777215, 16777215)) |
19 | 17 |
font = QtGui.QFont() |
... | ... | |
334 | 332 |
self.scrollArea.setWidgetResizable(True) |
335 | 333 |
self.scrollArea.setObjectName("scrollArea") |
336 | 334 |
self.scrollAreaWidgetContents = QtWidgets.QWidget() |
337 |
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 628, 960))
|
|
335 |
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 628, 907))
|
|
338 | 336 |
self.scrollAreaWidgetContents.setMinimumSize(QtCore.QSize(378, 0)) |
339 | 337 |
self.scrollAreaWidgetContents.setMaximumSize(QtCore.QSize(16777215, 16777215)) |
340 | 338 |
self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") |
... | ... | |
650 | 648 |
self.isExceptDetectLabel.setText(_translate("Dialog", "Exclude")) |
651 | 649 |
self.addAdditionalSymbolButton.setText(_translate("Dialog", "Add")) |
652 | 650 |
self.label_5.setText(_translate("Dialog", "Text Area")) |
651 |
|
|
653 | 652 |
import MainWindow_rc |
653 |
|
|
654 |
if __name__ == "__main__": |
|
655 |
import sys |
|
656 |
app = QtWidgets.QApplication(sys.argv) |
|
657 |
Dialog = QtWidgets.QDialog() |
|
658 |
ui = Ui_Dialog() |
|
659 |
ui.setupUi(Dialog) |
|
660 |
Dialog.show() |
|
661 |
sys.exit(app.exec_()) |
|
662 |
|
DTI_PID/DTI_PID/UI/SymbolEditor.ui | ||
---|---|---|
7 | 7 |
<x>0</x> |
8 | 8 |
<y>0</y> |
9 | 9 |
<width>1565</width> |
10 |
<height>1029</height>
|
|
10 |
<height>976</height>
|
|
11 | 11 |
</rect> |
12 | 12 |
</property> |
13 | 13 |
<property name="minimumSize"> |
... | ... | |
727 | 727 |
<x>0</x> |
728 | 728 |
<y>0</y> |
729 | 729 |
<width>628</width> |
730 |
<height>960</height>
|
|
730 |
<height>907</height>
|
|
731 | 731 |
</rect> |
732 | 732 |
</property> |
733 | 733 |
<property name="minimumSize"> |
내보내기 Unified diff