개정판 bae576b7
Add QAreaConfigurationDialog
DTI_PID/DTI_PID/App.py | ||
---|---|---|
76 | 76 |
self.actionRecognition.triggered.connect(self.recognize) |
77 | 77 |
self.actionArea.triggered.connect(self.areaConfiguration) |
78 | 78 |
self.actionConfiguration.triggered.connect(self.configuration) |
79 |
|
|
80 |
self.pushButtonCreateSymbol.clicked.connect(self.createSymbol) |
|
79 | 81 |
|
80 | 82 |
''' |
81 | 83 |
@brief area configuration |
... | ... | |
131 | 133 |
return self.path |
132 | 134 |
|
133 | 135 |
''' |
136 |
@brief create a symbol |
|
137 |
''' |
|
138 |
def createSymbol(self): |
|
139 |
self.graphicsView.command = CropCommand.CropCommand(self.graphicsView) |
|
140 |
|
|
141 |
''' |
|
134 | 142 |
@brief connect equipment and nozzle |
135 | 143 |
''' |
136 | 144 |
def connectEqpNozzle(self): |
DTI_PID/DTI_PID/DTI_PID_UI.py | ||
---|---|---|
59 | 59 |
self.verticalLayout_2 = QtWidgets.QVBoxLayout() |
60 | 60 |
self.verticalLayout_2.setObjectName("verticalLayout_2") |
61 | 61 |
self.pushButtonCreateSymbol = QtWidgets.QPushButton(self.Symbol) |
62 |
self.pushButtonCreateSymbol.setMaximumSize(QtCore.QSize(32, 16777215)) |
|
63 |
self.pushButtonCreateSymbol.setLayoutDirection(QtCore.Qt.LeftToRight) |
|
62 | 64 |
self.pushButtonCreateSymbol.setObjectName("pushButtonCreateSymbol") |
63 | 65 |
self.verticalLayout_2.addWidget(self.pushButtonCreateSymbol) |
64 | 66 |
self.listView_2 = QtWidgets.QListView(self.Symbol) |
DTI_PID/DTI_PID/QAreaConfigurationDialog.py | ||
---|---|---|
1 |
# coding: utf-8 |
|
2 |
import os |
|
3 |
import sys |
|
4 |
from PyQt5.QtCore import * |
|
5 |
from PyQt5.QtGui import * |
|
6 |
from PyQt5.QtWidgets import * |
|
7 |
import sqlite3 |
|
8 |
|
|
9 |
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '\\Commands') |
|
10 |
import CreateCommand |
|
11 |
import CropCommand |
|
12 |
|
|
13 |
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '\\Shapes') |
|
14 |
import QGraphicsPolylineItem |
|
15 |
from QEngineeringLineItem import QEngineeringLineItem |
|
16 |
from SymbolSvg import SymbolSvg |
|
17 |
from QGraphicsBoundingBoxItem import QGraphicsBoundingBoxItem |
|
18 |
import Configuration_Area_UI |
|
19 |
|
|
20 |
DB_NAME = os.path.dirname(os.path.realpath(__file__)) + "\\db\\DTI_PID.db" |
|
21 |
|
|
22 |
class QAreaConfigurationDialog(QDialog): |
|
23 |
def __init__(self, parent): |
|
24 |
QDialog.__init__(self, parent) |
|
25 |
|
|
26 |
self.ui = Configuration_Area_UI.Ui_AreaDialog() |
|
27 |
self.ui.setupUi(self) |
|
28 |
self.isAccepted = False |
|
29 |
|
|
30 |
self.ui.pushButtonDrawingArea.clicked.connect(self.selectNoteArea) |
|
31 |
self.ui.pushButtonNoteArea.clicked.connect(self.selectNoteArea) |
|
32 |
self.ui.pushButtonHistoryDataArea.clicked.connect(self.selectNoteArea) |
|
33 |
self.ui.pushButtonAreaArea.clicked.connect(self.selectNoteArea) |
|
34 |
self.ui.pushButtonDrawingNoArea.clicked.connect(self.selectNoteArea) |
|
35 |
self.ui.pushButtonRevNoArea.clicked.connect(self.selectNoteArea) |
|
36 |
|
|
37 |
try: |
|
38 |
pass |
|
39 |
# Catch the exception |
|
40 |
except Exception as e: |
|
41 |
# Roll back any change if something goes wrong |
|
42 |
raise e |
|
43 |
finally: |
|
44 |
pass |
|
45 |
# Close the db connection |
|
46 |
|
|
47 |
def selectNoteArea(self): |
|
48 |
cmd = CreateCommand.CreateCommand(self.parent().graphicsView, QGraphicsBoundingBoxItem(0, 0, 0, 0)) |
|
49 |
cmd.templateCreated.connect(self.areaCreated) |
|
50 |
self.parent().graphicsView.command = cmd |
|
51 |
pass |
|
52 |
|
|
53 |
''' |
|
54 |
@brief called when area is created |
|
55 |
''' |
|
56 |
def areaCreated(self, obj): |
|
57 |
self.ui.lineEditNote.setText('({},{}),({},{})'.format(obj.rect().left(), obj.rect().top(), obj.rect().right(), obj.rect().bottom())) |
|
58 |
pass |
|
59 |
|
|
60 |
def accept(self): |
|
61 |
try: |
|
62 |
self.isAccepted = True |
|
63 |
except Exception as e: |
|
64 |
pass |
|
65 |
finally: |
|
66 |
pass |
|
67 |
|
|
68 |
QDialog.accept(self) |
DTI_PID/DTI_PID/UI/DTI__PID.ui | ||
---|---|---|
106 | 106 |
<layout class="QVBoxLayout" name="verticalLayout_2"> |
107 | 107 |
<item> |
108 | 108 |
<widget class="QPushButton" name="pushButtonCreateSymbol"> |
109 |
<property name="maximumSize"> |
|
110 |
<size> |
|
111 |
<width>32</width> |
|
112 |
<height>16777215</height> |
|
113 |
</size> |
|
114 |
</property> |
|
115 |
<property name="layoutDirection"> |
|
116 |
<enum>Qt::LeftToRight</enum> |
|
117 |
</property> |
|
109 | 118 |
<property name="text"> |
110 | 119 |
<string>생성</string> |
111 | 120 |
</property> |
내보내기 Unified diff