프로젝트

일반

사용자정보

개정판 5afca25c

ID5afca25c090805c0e5ae5b0324587f0723c3d551
상위 b24ce137
하위 de8a82b2

humkyung 이(가) 6년 이상 전에 추가함

Add UI files for line and instrument data

차이점 보기:

DTI_PID/DTI_PID/DTI_PID.py
779 779
                srcGray = cvtGrayImage(src)
780 780
            else:
781 781
                srcGray = src.copy()
782
            srcGray = cv2.threshold(srcGray, 0, 255, cv2.THRESH_BINARY | cv2.THRESH_OTSU)[1]
782 783
            
783 784
            ocrCompletedSrc = srcGray.copy()
784 785

  
DTI_PID/DTI_PID/DTI_PID_UI.py
1 1
# -*- coding: utf-8 -*-
2 2

  
3
# Form implementation generated from reading ui file '.\ui\DTI__PID.ui'
3
# Form implementation generated from reading ui file '.\UI\DTI__PID.ui'
4 4
#
5 5
# Created by: PyQt5 UI code generator 5.10.1
6 6
#
......
101 101
        icon1 = QtGui.QIcon()
102 102
        icon1.addPixmap(QtGui.QPixmap(":/appPrefix/recognition-file.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
103 103
        self.actionRecognition.setIcon(icon1)
104
        font = QtGui.QFont()
105
        font.setFamily("맑은 고딕")
106
        font.setBold(True)
107
        font.setWeight(75)
108
        self.actionRecognition.setFont(font)
104 109
        self.actionRecognition.setObjectName("actionRecognition")
105 110
        self.actionLine = QtWidgets.QAction(MainWindow)
106 111
        icon2 = QtGui.QIcon()
107 112
        icon2.addPixmap(QtGui.QPixmap(":/appPrefix/draw-line-icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
108 113
        self.actionLine.setIcon(icon2)
114
        font = QtGui.QFont()
115
        font.setFamily("맑은 고딕")
116
        font.setBold(True)
117
        font.setWeight(75)
118
        self.actionLine.setFont(font)
109 119
        self.actionLine.setObjectName("actionLine")
110 120
        self.actionValidate = QtWidgets.QAction(MainWindow)
111 121
        icon3 = QtGui.QIcon()
112 122
        icon3.addPixmap(QtGui.QPixmap(":/appPrefix/validation-icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
113 123
        self.actionValidate.setIcon(icon3)
124
        font = QtGui.QFont()
125
        font.setFamily("맑은 고딕")
126
        font.setBold(True)
127
        font.setWeight(75)
128
        self.actionValidate.setFont(font)
114 129
        self.actionValidate.setObjectName("actionValidate")
115 130
        self.actionConfiguration = QtWidgets.QAction(MainWindow)
131
        font = QtGui.QFont()
132
        font.setFamily("맑은 고딕")
133
        font.setBold(True)
134
        font.setWeight(75)
135
        self.actionConfiguration.setFont(font)
116 136
        self.actionConfiguration.setObjectName("actionConfiguration")
117 137
        self.actionArea = QtWidgets.QAction(MainWindow)
138
        font = QtGui.QFont()
139
        font.setFamily("맑은 고딕")
140
        font.setBold(True)
141
        font.setWeight(75)
142
        self.actionArea.setFont(font)
118 143
        self.actionArea.setObjectName("actionArea")
119 144
        self.actionOCR = QtWidgets.QAction(MainWindow)
120 145
        self.actionOCR.setCheckable(True)
146
        font = QtGui.QFont()
147
        font.setFamily("맑은 고딕")
148
        font.setBold(True)
149
        font.setWeight(75)
150
        self.actionOCR.setFont(font)
121 151
        self.actionOCR.setObjectName("actionOCR")
122 152
        self.actionLineRecognition = QtWidgets.QAction(MainWindow)
153
        font = QtGui.QFont()
154
        font.setFamily("맑은 고딕")
155
        font.setBold(True)
156
        font.setWeight(75)
157
        self.actionLineRecognition.setFont(font)
123 158
        self.actionLineRecognition.setObjectName("actionLineRecognition")
124 159
        self.actionGenerateOutput = QtWidgets.QAction(MainWindow)
160
        font = QtGui.QFont()
161
        font.setFamily("맑은 고딕")
162
        font.setBold(True)
163
        font.setWeight(75)
164
        self.actionGenerateOutput.setFont(font)
125 165
        self.actionGenerateOutput.setObjectName("actionGenerateOutput")
126 166
        self.actionEquipment_Data_List = QtWidgets.QAction(MainWindow)
167
        font = QtGui.QFont()
168
        font.setFamily("맑은 고딕")
169
        font.setBold(True)
170
        font.setWeight(75)
171
        self.actionEquipment_Data_List.setFont(font)
127 172
        self.actionEquipment_Data_List.setObjectName("actionEquipment_Data_List")
128 173
        self.actionEquipment = QtWidgets.QAction(MainWindow)
129 174
        self.actionEquipment.setCheckable(True)
175
        font = QtGui.QFont()
176
        font.setFamily("맑은 고딕")
177
        font.setBold(True)
178
        font.setWeight(75)
179
        self.actionEquipment.setFont(font)
130 180
        self.actionEquipment.setObjectName("actionEquipment")
131 181
        self.actionNozzle = QtWidgets.QAction(MainWindow)
132 182
        self.actionNozzle.setCheckable(True)
183
        font = QtGui.QFont()
184
        font.setFamily("맑은 고딕")
185
        font.setBold(True)
186
        font.setWeight(75)
187
        self.actionNozzle.setFont(font)
133 188
        self.actionNozzle.setObjectName("actionNozzle")
189
        self.actionLine_Data_List = QtWidgets.QAction(MainWindow)
190
        font = QtGui.QFont()
191
        font.setFamily("맑은 고딕")
192
        font.setBold(True)
193
        font.setWeight(75)
194
        self.actionLine_Data_List.setFont(font)
195
        self.actionLine_Data_List.setObjectName("actionLine_Data_List")
196
        self.actionInstrument_Data_List = QtWidgets.QAction(MainWindow)
197
        font = QtGui.QFont()
198
        font.setFamily("맑은 고딕")
199
        font.setBold(True)
200
        font.setWeight(75)
201
        self.actionInstrument_Data_List.setFont(font)
202
        self.actionInstrument_Data_List.setObjectName("actionInstrument_Data_List")
134 203
        self.menu.addAction(self.actionOpen)
135 204
        self.menu.addAction(self.actionArea)
136 205
        self.menu.addAction(self.actionConfiguration)
137 206
        self.menu.addSeparator()
138 207
        self.menu.addAction(self.actionClose)
139 208
        self.menu_2.addAction(self.actionEquipment_Data_List)
209
        self.menu_2.addAction(self.actionLine_Data_List)
210
        self.menu_2.addAction(self.actionInstrument_Data_List)
140 211
        self.menubar.addAction(self.menu.menuAction())
141 212
        self.menubar.addAction(self.menu_2.menuAction())
142 213
        self.toolBar.addAction(self.actionOpen)
......
187 258
        self.actionEquipment.setToolTip(_translate("MainWindow", "장치 생성"))
188 259
        self.actionNozzle.setText(_translate("MainWindow", "노즐 생성"))
189 260
        self.actionNozzle.setToolTip(_translate("MainWindow", "노즐 생성"))
261
        self.actionLine_Data_List.setText(_translate("MainWindow", "라인 데이타 리스트"))
262
        self.actionInstrument_Data_List.setText(_translate("MainWindow", "계장 데이타 리스트"))
190 263

  
191 264

  
192 265
if __name__ == "__main__":
DTI_PID/DTI_PID/Instrument_Data_List_UI.py
1
# -*- coding: utf-8 -*-
2

  
3
# Form implementation generated from reading ui file '.\UI\Instrument_Data_List.ui'
4
#
5
# Created by: PyQt5 UI code generator 5.10.1
6
#
7
# WARNING! All changes made in this file will be lost!
8

  
9
from PyQt5 import QtCore, QtGui, QtWidgets
10

  
11
class Ui_Dialog(object):
12
    def setupUi(self, Dialog):
13
        Dialog.setObjectName("Dialog")
14
        Dialog.resize(700, 424)
15
        font = QtGui.QFont()
16
        font.setFamily("맑은 고딕")
17
        Dialog.setFont(font)
18
        self.gridLayout = QtWidgets.QGridLayout(Dialog)
19
        self.gridLayout.setObjectName("gridLayout")
20
        self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
21
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
22
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
23
        self.buttonBox.setObjectName("buttonBox")
24
        self.gridLayout.addWidget(self.buttonBox, 3, 0, 1, 6)
25
        self.tableWidgetInstrumentDataList = QtWidgets.QTableWidget(Dialog)
26
        self.tableWidgetInstrumentDataList.setColumnCount(1)
27
        self.tableWidgetInstrumentDataList.setObjectName("tableWidgetInstrumentDataList")
28
        self.tableWidgetInstrumentDataList.setRowCount(0)
29
        self.gridLayout.addWidget(self.tableWidgetInstrumentDataList, 2, 0, 1, 6)
30
        self.pushButtonImport = QtWidgets.QPushButton(Dialog)
31
        self.pushButtonImport.setMaximumSize(QtCore.QSize(64, 24))
32
        self.pushButtonImport.setObjectName("pushButtonImport")
33
        self.gridLayout.addWidget(self.pushButtonImport, 0, 0, 1, 1)
34
        self.pushButtonAdd = QtWidgets.QPushButton(Dialog)
35
        self.pushButtonAdd.setMaximumSize(QtCore.QSize(32, 24))
36
        self.pushButtonAdd.setObjectName("pushButtonAdd")
37
        self.gridLayout.addWidget(self.pushButtonAdd, 0, 4, 1, 1)
38
        self.pushButtonDel = QtWidgets.QPushButton(Dialog)
39
        self.pushButtonDel.setMinimumSize(QtCore.QSize(32, 0))
40
        self.pushButtonDel.setMaximumSize(QtCore.QSize(32, 24))
41
        self.pushButtonDel.setLayoutDirection(QtCore.Qt.RightToLeft)
42
        self.pushButtonDel.setObjectName("pushButtonDel")
43
        self.gridLayout.addWidget(self.pushButtonDel, 0, 5, 1, 1)
44
        self.pushButtonExport = QtWidgets.QPushButton(Dialog)
45
        self.pushButtonExport.setMaximumSize(QtCore.QSize(64, 24))
46
        self.pushButtonExport.setObjectName("pushButtonExport")
47
        self.gridLayout.addWidget(self.pushButtonExport, 0, 1, 1, 1)
48

  
49
        self.retranslateUi(Dialog)
50
        self.buttonBox.accepted.connect(Dialog.accept)
51
        self.buttonBox.rejected.connect(Dialog.reject)
52
        QtCore.QMetaObject.connectSlotsByName(Dialog)
53

  
54
    def retranslateUi(self, Dialog):
55
        _translate = QtCore.QCoreApplication.translate
56
        Dialog.setWindowTitle(_translate("Dialog", "계장 데이타 리스트"))
57
        self.pushButtonImport.setText(_translate("Dialog", "가져오기"))
58
        self.pushButtonAdd.setText(_translate("Dialog", "추가"))
59
        self.pushButtonDel.setText(_translate("Dialog", "삭제"))
60
        self.pushButtonExport.setText(_translate("Dialog", "내보내기"))
61

  
62

  
63
if __name__ == "__main__":
64
    import sys
65
    app = QtWidgets.QApplication(sys.argv)
66
    Dialog = QtWidgets.QDialog()
67
    ui = Ui_Dialog()
68
    ui.setupUi(Dialog)
69
    Dialog.show()
70
    sys.exit(app.exec_())
71

  
DTI_PID/DTI_PID/LineDetector.py
7 7
class LineDetector():
8 8
    def __init__(self, image):
9 9
        try:
10
            thresh = 127
11
            self.image = cv2.threshold(image, thresh, 255, cv2.THRESH_BINARY)[1]
10
            #thresh = 127
11
            self.image = cv2.threshold(image, 0, 255, cv2.THRESH_BINARY|cv2.THRESH_OTSU)[1]
12 12
            self.width, self.height = self.image.shape[::-1]
13 13
            self.Result = np.zeros((self.width, self.height, 3), np.uint8)
14 14
        except Exception as ex:
DTI_PID/DTI_PID/Line_Data_List_UI.py
1
# -*- coding: utf-8 -*-
2

  
3
# Form implementation generated from reading ui file '.\UI\Line_Data_List.ui'
4
#
5
# Created by: PyQt5 UI code generator 5.10.1
6
#
7
# WARNING! All changes made in this file will be lost!
8

  
9
from PyQt5 import QtCore, QtGui, QtWidgets
10

  
11
class Ui_Dialog(object):
12
    def setupUi(self, Dialog):
13
        Dialog.setObjectName("Dialog")
14
        Dialog.resize(700, 506)
15
        font = QtGui.QFont()
16
        font.setFamily("맑은 고딕")
17
        Dialog.setFont(font)
18
        self.gridLayout = QtWidgets.QGridLayout(Dialog)
19
        self.gridLayout.setObjectName("gridLayout")
20
        self.pushButtonDel = QtWidgets.QPushButton(Dialog)
21
        self.pushButtonDel.setMinimumSize(QtCore.QSize(32, 0))
22
        self.pushButtonDel.setMaximumSize(QtCore.QSize(32, 24))
23
        self.pushButtonDel.setLayoutDirection(QtCore.Qt.RightToLeft)
24
        self.pushButtonDel.setObjectName("pushButtonDel")
25
        self.gridLayout.addWidget(self.pushButtonDel, 0, 5, 1, 1)
26
        self.pushButtonAdd = QtWidgets.QPushButton(Dialog)
27
        self.pushButtonAdd.setMaximumSize(QtCore.QSize(32, 24))
28
        self.pushButtonAdd.setObjectName("pushButtonAdd")
29
        self.gridLayout.addWidget(self.pushButtonAdd, 0, 4, 1, 1)
30
        self.pushButtonImport = QtWidgets.QPushButton(Dialog)
31
        self.pushButtonImport.setMaximumSize(QtCore.QSize(64, 24))
32
        self.pushButtonImport.setObjectName("pushButtonImport")
33
        self.gridLayout.addWidget(self.pushButtonImport, 0, 0, 1, 1)
34
        self.tableWidgetLineDataList = QtWidgets.QTableWidget(Dialog)
35
        self.tableWidgetLineDataList.setColumnCount(1)
36
        self.tableWidgetLineDataList.setObjectName("tableWidgetLineDataList")
37
        self.tableWidgetLineDataList.setRowCount(0)
38
        self.gridLayout.addWidget(self.tableWidgetLineDataList, 2, 0, 1, 6)
39
        self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
40
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
41
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
42
        self.buttonBox.setObjectName("buttonBox")
43
        self.gridLayout.addWidget(self.buttonBox, 3, 0, 1, 6)
44
        self.pushButtonExport = QtWidgets.QPushButton(Dialog)
45
        self.pushButtonExport.setMaximumSize(QtCore.QSize(64, 24))
46
        self.pushButtonExport.setObjectName("pushButtonExport")
47
        self.gridLayout.addWidget(self.pushButtonExport, 0, 1, 1, 1)
48

  
49
        self.retranslateUi(Dialog)
50
        self.buttonBox.accepted.connect(Dialog.accept)
51
        self.buttonBox.rejected.connect(Dialog.reject)
52
        QtCore.QMetaObject.connectSlotsByName(Dialog)
53

  
54
    def retranslateUi(self, Dialog):
55
        _translate = QtCore.QCoreApplication.translate
56
        Dialog.setWindowTitle(_translate("Dialog", "라인 데이타 리스트"))
57
        self.pushButtonDel.setText(_translate("Dialog", "삭제"))
58
        self.pushButtonAdd.setText(_translate("Dialog", "추가"))
59
        self.pushButtonImport.setText(_translate("Dialog", "가져오기"))
60
        self.pushButtonExport.setText(_translate("Dialog", "내보내기"))
61

  
62

  
63
if __name__ == "__main__":
64
    import sys
65
    app = QtWidgets.QApplication(sys.argv)
66
    Dialog = QtWidgets.QDialog()
67
    ui = Ui_Dialog()
68
    ui.setupUi(Dialog)
69
    Dialog.show()
70
    sys.exit(app.exec_())
71

  
DTI_PID/DTI_PID/MainWindow.py
130 130
        self.actionGenerateOutput.triggered.connect(self.generateOutput)
131 131
        self.pushButtonCreateSymbol.clicked.connect(self.createSymbol)
132 132
        self.actionEquipment_Data_List.triggered.connect(self.showEquipmentDataList)
133
        self.actionLine_Data_List.triggered.connect(self.showLineDataList)
134
        self.actionInstrument_Data_List.triggered.connect(self.showInstrumentDataList)
133 135
        self.actionEquipment.triggered.connect(self.createEquipment)
134 136
        self.actionNozzle.triggered.connect(self.createNozzle)
135 137
        self.graphicsView.scene.changed.connect(lambda: self.resultTreeWidget.sceneChanged(self.graphicsView.scene.items()))
......
212 214
        self.dlgEquipmentDataList.exec_()
213 215

  
214 216
    '''
217
        @brief  show line data list 
218
        @author humkyung
219
        @date   2018.05.03
220
    '''
221
    def showLineDataList(self):
222
        from QLineDataListDialog import QLineDataListDialog
223

  
224
        self.dlgLineDataList = QLineDataListDialog(self)
225
        self.dlgLineDataList.exec_()
226

  
227
    '''
228
        @brief  show instrument data list 
229
        @author humkyung
230
        @date   2018.05.03
231
    '''
232
    def showInstrumentDataList(self):
233
        from QInstrumentDataListDialog import QInstrumentDataListDialog
234

  
235
        self.dlgInstrumentDataList = QInstrumentDataListDialog(self)
236
        self.dlgInstrumentDataList.exec_()
237

  
238
    '''
215 239
        @brief  Show Image Selection Guide MessageBox
216 240
        @author Jeongwoo
217 241
        @date   2018.05.02
......
231 255
        import random
232 256

  
233 257
        try:
234
            self.graphicsView.clearImage()
235
            self.graphicsView.scene.clear()
236
            self.graphicsView.useDefaultCommand()
237 258
            self.path = self.graphicsView.loadImageFromFile()
238 259
            if os.path.isfile(self.path):
260
                self.graphicsView.useDefaultCommand()
261

  
239 262
                baseName = os.path.basename(self.path)
240 263
                AppDocData.instance().setCurrentPidSource(Image.open(self.path))
241 264
                self.resultTreeWidget.setCurrentPID(baseName)
DTI_PID/DTI_PID/QInstrumentDataListDialog.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
from AppDocData import AppDocData
9
from AppDocData import Config
10
import Instrument_Data_List_UI
11
from AppDocData import AppDocData
12

  
13
class QInstrumentDataListDialog(QDialog):
14
    def __init__(self, parent):
15
        QDialog.__init__(self, parent)
16

  
17
        self.ui = Instrument_Data_List_UI.Ui_Dialog()
18
        self.ui.setupUi(self)
19

  
20
        self.ui.tableWidgetInstrumentDataList.setSelectionMode(QAbstractItemView.SingleSelection) 
21
        self.ui.tableWidgetInstrumentDataList.setColumnCount(1)
22
        # column header 명 설정.
23
        self.ui.tableWidgetInstrumentDataList.setHorizontalHeaderLabels(['Tag No'])
24
        self.ui.tableWidgetInstrumentDataList.horizontalHeaderItem(0).setToolTip('장치 이름') # header tooltip
25
        self.ui.tableWidgetInstrumentDataList.horizontalHeaderItem(0).setSizeHint(QSize(30, 30))
26

  
27
        docData = AppDocData.instance()
28
        dataList = docData.getEquipmentDataList()
29
        self.ui.tableWidgetInstrumentDataList.setRowCount(len(dataList))
30

  
31
        row = 0
32
        for data in dataList:
33
            self.ui.tableWidgetInstrumentDataList.setItem(row, 0, QTableWidgetItem(data.tagNo))
34
            row += 1
35

  
36
        # connect signals and slots
37
        self.ui.pushButtonAdd.clicked.connect(self.addRow)
38
        self.ui.pushButtonDel.clicked.connect(self.deleteRow)
39

  
40
    '''
41
        @brief  add a row
42
        @author humkyung
43
        @date   2018.05.03
44
    '''
45
    def addRow(self):
46
        self.ui.tableWidgetInstrumentDataList.setRowCount(self.ui.tableWidgetInstrumentDataList.rowCount() + 1)
47

  
48
    '''
49
        @brief  delete a selected row
50
        @author humkyung
51
        @date   2018.05.03
52
    '''
53
    def deleteRow(self):
54
        for index in self.ui.tableWidgetInstrumentDataList.selectedIndexes():
55
            self.ui.tableWidgetInstrumentDataList.removeRow(index.row())
56

  
57
    '''
58
        @brief      insert or update equipment data list modified by user
59
        @author     humkyung
60
        @date       2018.05.03
61
    '''
62
    def accept(self):
63
        from EquipmentData import EquipmentData
64

  
65
        try:
66
            docData = AppDocData.instance()
67

  
68
            dataList = []
69
            for row in range(self.ui.tableWidgetInstrumentDataList.rowCount()):
70
                item = self.ui.tableWidgetInstrumentDataList.item(row, 0)
71
                dataList.append(EquipmentData(item.text()))
72

  
73
            docData.setEquipmentDataList(dataList)
74
        except Exception as ex:
75
            print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno))
76

  
77
        QDialog.accept(self)
DTI_PID/DTI_PID/QLineDataListDialog.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
from AppDocData import AppDocData
9
from AppDocData import Config
10
import Line_Data_List_UI
11
from AppDocData import AppDocData
12

  
13
class QLineDataListDialog(QDialog):
14
    def __init__(self, parent):
15
        QDialog.__init__(self, parent)
16

  
17
        self.ui = Line_Data_List_UI.Ui_Dialog()
18
        self.ui.setupUi(self)
19

  
20
        self.ui.tableWidgetLineDataList.setSelectionMode(QAbstractItemView.SingleSelection) 
21
        self.ui.tableWidgetLineDataList.setColumnCount(1)
22
        # column header 명 설정.
23
        self.ui.tableWidgetLineDataList.setHorizontalHeaderLabels(['Tag No'])
24
        self.ui.tableWidgetLineDataList.horizontalHeaderItem(0).setToolTip('장치 이름') # header tooltip
25
        self.ui.tableWidgetLineDataList.horizontalHeaderItem(0).setSizeHint(QSize(30, 30))
26

  
27
        docData = AppDocData.instance()
28
        dataList = docData.getEquipmentDataList()
29
        self.ui.tableWidgetLineDataList.setRowCount(len(dataList))
30

  
31
        row = 0
32
        for data in dataList:
33
            self.ui.tableWidgetLineDataList.setItem(row, 0, QTableWidgetItem(data.tagNo))
34
            row += 1
35

  
36
        # connect signals and slots
37
        self.ui.pushButtonAdd.clicked.connect(self.addRow)
38
        self.ui.pushButtonDel.clicked.connect(self.deleteRow)
39

  
40
    '''
41
        @brief  add a row
42
        @author humkyung
43
        @date   2018.05.03
44
    '''
45
    def addRow(self):
46
        self.ui.tableWidgetLineDataList.setRowCount(self.ui.tableWidgetLineDataList.rowCount() + 1)
47

  
48
    '''
49
        @brief  delete a selected row
50
        @author humkyung
51
        @date   2018.05.03
52
    '''
53
    def deleteRow(self):
54
        for index in self.ui.tableWidgetLineDataList.selectedIndexes():
55
            self.ui.tableWidgetLineDataList.removeRow(index.row())
56

  
57
    '''
58
        @brief      insert or update equipment data list modified by user
59
        @author     humkyung
60
        @date       2018.05.03
61
    '''
62
    def accept(self):
63
        from EquipmentData import EquipmentData
64

  
65
        try:
66
            docData = AppDocData.instance()
67

  
68
            dataList = []
69
            for row in range(self.ui.tableWidgetLineDataList.rowCount()):
70
                item = self.ui.tableWidgetLineDataList.item(row, 0)
71
                dataList.append(EquipmentData(item.text()))
72

  
73
            docData.setEquipmentDataList(dataList)
74
        except Exception as ex:
75
            print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno))
76

  
77
        QDialog.accept(self)
DTI_PID/DTI_PID/QtImageViewer.py
138 138
        Raises a RuntimeError if the input image has type other than QImage or QPixmap.
139 139
        :type image: QImage | QPixmap
140 140
        """
141
        if type(image) is QPixmap:
142
            pixmap = image
143
        elif type(image) is QImage:
144
            pixmap = QPixmap.fromImage(image)
145
        else:
146
            raise RuntimeError("ImageViewer.setImage: Argument must be a QImage or QPixmap.")
147
        if self.hasImage():
148
            self._pixmapHandle.setPixmap(pixmap)
149
        else:
150
            self._pixmapHandle = self.scene.addPixmap(pixmap)
151

  
152
        self.setSceneRect(QRectF(pixmap.rect()))  # Set scene size to image size.
153
        self.updateViewer()
141
        try:
142
            if type(image) is QPixmap:
143
                pixmap = image
144
            elif type(image) is QImage:
145
                pixmap = QPixmap.fromImage(image)
146
            else:
147
                raise RuntimeError("ImageViewer.setImage: Argument must be a QImage or QPixmap.")
148

  
149
            self.clearImage()
150
            self.scene.clear()
151

  
152
            if self.hasImage():
153
                self._pixmapHandle.setPixmap(pixmap)
154
            else:
155
                self._pixmapHandle = self.scene.addPixmap(pixmap)
156

  
157
            self.setSceneRect(QRectF(pixmap.rect()))  # Set scene size to image size.
158
            self.updateViewer()
159
        except Exception as ex:
160
            print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno))
154 161

  
155 162
    def loadImageFromFile(self, fileName=""):
156 163
        """ Load an image from file.
DTI_PID/DTI_PID/UI/DTI__PID.ui
55 55
     <string>데이타</string>
56 56
    </property>
57 57
    <addaction name="actionEquipment_Data_List"/>
58
    <addaction name="actionLine_Data_List"/>
59
    <addaction name="actionInstrument_Data_List"/>
58 60
   </widget>
59 61
   <addaction name="menu"/>
60 62
   <addaction name="menu_2"/>
......
203 205
   <property name="toolTip">
204 206
    <string>심볼,텍스트 인식</string>
205 207
   </property>
208
   <property name="font">
209
    <font>
210
     <family>맑은 고딕</family>
211
     <weight>75</weight>
212
     <bold>true</bold>
213
    </font>
214
   </property>
206 215
  </action>
207 216
  <action name="actionLine">
208 217
   <property name="icon">
......
215 224
   <property name="toolTip">
216 225
    <string>라인 생성</string>
217 226
   </property>
227
   <property name="font">
228
    <font>
229
     <family>맑은 고딕</family>
230
     <weight>75</weight>
231
     <bold>true</bold>
232
    </font>
233
   </property>
218 234
  </action>
219 235
  <action name="actionValidate">
220 236
   <property name="icon">
......
227 243
   <property name="toolTip">
228 244
    <string>검사</string>
229 245
   </property>
246
   <property name="font">
247
    <font>
248
     <family>맑은 고딕</family>
249
     <weight>75</weight>
250
     <bold>true</bold>
251
    </font>
252
   </property>
230 253
  </action>
231 254
  <action name="actionConfiguration">
232 255
   <property name="text">
233 256
    <string>환경 설정</string>
234 257
   </property>
258
   <property name="font">
259
    <font>
260
     <family>맑은 고딕</family>
261
     <weight>75</weight>
262
     <bold>true</bold>
263
    </font>
264
   </property>
235 265
  </action>
236 266
  <action name="actionArea">
237 267
   <property name="text">
238 268
    <string>영역 설정</string>
239 269
   </property>
270
   <property name="font">
271
    <font>
272
     <family>맑은 고딕</family>
273
     <weight>75</weight>
274
     <bold>true</bold>
275
    </font>
276
   </property>
240 277
  </action>
241 278
  <action name="actionOCR">
242 279
   <property name="checkable">
......
248 285
   <property name="toolTip">
249 286
    <string>OCR</string>
250 287
   </property>
288
   <property name="font">
289
    <font>
290
     <family>맑은 고딕</family>
291
     <weight>75</weight>
292
     <bold>true</bold>
293
    </font>
294
   </property>
251 295
  </action>
252 296
  <action name="actionLineRecognition">
253 297
   <property name="text">
......
256 300
   <property name="toolTip">
257 301
    <string>라인 인식</string>
258 302
   </property>
303
   <property name="font">
304
    <font>
305
     <family>맑은 고딕</family>
306
     <weight>75</weight>
307
     <bold>true</bold>
308
    </font>
309
   </property>
259 310
  </action>
260 311
  <action name="actionGenerateOutput">
261 312
   <property name="text">
262 313
    <string>변환</string>
263 314
   </property>
315
   <property name="font">
316
    <font>
317
     <family>맑은 고딕</family>
318
     <weight>75</weight>
319
     <bold>true</bold>
320
    </font>
321
   </property>
264 322
  </action>
265 323
  <action name="actionEquipment_Data_List">
266 324
   <property name="text">
267 325
    <string>장치 데이타 리스트</string>
268 326
   </property>
327
   <property name="font">
328
    <font>
329
     <family>맑은 고딕</family>
330
     <weight>75</weight>
331
     <bold>true</bold>
332
    </font>
333
   </property>
269 334
  </action>
270 335
  <action name="actionEquipment">
271 336
   <property name="checkable">
......
277 342
   <property name="toolTip">
278 343
    <string>장치 생성</string>
279 344
   </property>
345
   <property name="font">
346
    <font>
347
     <family>맑은 고딕</family>
348
     <weight>75</weight>
349
     <bold>true</bold>
350
    </font>
351
   </property>
280 352
  </action>
281 353
  <action name="actionNozzle">
282 354
   <property name="checkable">
......
288 360
   <property name="toolTip">
289 361
    <string>노즐 생성</string>
290 362
   </property>
363
   <property name="font">
364
    <font>
365
     <family>맑은 고딕</family>
366
     <weight>75</weight>
367
     <bold>true</bold>
368
    </font>
369
   </property>
370
  </action>
371
  <action name="actionLine_Data_List">
372
   <property name="text">
373
    <string>라인 데이타 리스트</string>
374
   </property>
375
   <property name="font">
376
    <font>
377
     <family>맑은 고딕</family>
378
     <weight>75</weight>
379
     <bold>true</bold>
380
    </font>
381
   </property>
382
  </action>
383
  <action name="actionInstrument_Data_List">
384
   <property name="text">
385
    <string>계장 데이타 리스트</string>
386
   </property>
387
   <property name="font">
388
    <font>
389
     <family>맑은 고딕</family>
390
     <weight>75</weight>
391
     <bold>true</bold>
392
    </font>
393
   </property>
291 394
  </action>
292 395
 </widget>
293 396
 <resources/>
DTI_PID/DTI_PID/UI/Instrument_Data_List.ui
1
<?xml version="1.0" encoding="UTF-8"?>
2
<ui version="4.0">
3
 <class>Dialog</class>
4
 <widget class="QDialog" name="Dialog">
5
  <property name="geometry">
6
   <rect>
7
    <x>0</x>
8
    <y>0</y>
9
    <width>700</width>
10
    <height>424</height>
11
   </rect>
12
  </property>
13
  <property name="font">
14
   <font>
15
    <family>맑은 고딕</family>
16
   </font>
17
  </property>
18
  <property name="windowTitle">
19
   <string>계장 데이타 리스트</string>
20
  </property>
21
  <layout class="QGridLayout" name="gridLayout">
22
   <item row="3" column="0" colspan="6">
23
    <widget class="QDialogButtonBox" name="buttonBox">
24
     <property name="orientation">
25
      <enum>Qt::Horizontal</enum>
26
     </property>
27
     <property name="standardButtons">
28
      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
29
     </property>
30
    </widget>
31
   </item>
32
   <item row="2" column="0" colspan="6">
33
    <widget class="QTableWidget" name="tableWidgetInstrumentDataList">
34
     <property name="columnCount">
35
      <number>1</number>
36
     </property>
37
     <column/>
38
    </widget>
39
   </item>
40
   <item row="0" column="0">
41
    <widget class="QPushButton" name="pushButtonImport">
42
     <property name="maximumSize">
43
      <size>
44
       <width>64</width>
45
       <height>24</height>
46
      </size>
47
     </property>
48
     <property name="text">
49
      <string>가져오기</string>
50
     </property>
51
    </widget>
52
   </item>
53
   <item row="0" column="4">
54
    <widget class="QPushButton" name="pushButtonAdd">
55
     <property name="maximumSize">
56
      <size>
57
       <width>32</width>
58
       <height>24</height>
59
      </size>
60
     </property>
61
     <property name="text">
62
      <string>추가</string>
63
     </property>
64
    </widget>
65
   </item>
66
   <item row="0" column="5">
67
    <widget class="QPushButton" name="pushButtonDel">
68
     <property name="minimumSize">
69
      <size>
70
       <width>32</width>
71
       <height>0</height>
72
      </size>
73
     </property>
74
     <property name="maximumSize">
75
      <size>
76
       <width>32</width>
77
       <height>24</height>
78
      </size>
79
     </property>
80
     <property name="layoutDirection">
81
      <enum>Qt::RightToLeft</enum>
82
     </property>
83
     <property name="text">
84
      <string>삭제</string>
85
     </property>
86
    </widget>
87
   </item>
88
   <item row="0" column="1">
89
    <widget class="QPushButton" name="pushButtonExport">
90
     <property name="maximumSize">
91
      <size>
92
       <width>64</width>
93
       <height>24</height>
94
      </size>
95
     </property>
96
     <property name="text">
97
      <string>내보내기</string>
98
     </property>
99
    </widget>
100
   </item>
101
  </layout>
102
 </widget>
103
 <resources/>
104
 <connections>
105
  <connection>
106
   <sender>buttonBox</sender>
107
   <signal>accepted()</signal>
108
   <receiver>Dialog</receiver>
109
   <slot>accept()</slot>
110
   <hints>
111
    <hint type="sourcelabel">
112
     <x>248</x>
113
     <y>254</y>
114
    </hint>
115
    <hint type="destinationlabel">
116
     <x>157</x>
117
     <y>274</y>
118
    </hint>
119
   </hints>
120
  </connection>
121
  <connection>
122
   <sender>buttonBox</sender>
123
   <signal>rejected()</signal>
124
   <receiver>Dialog</receiver>
125
   <slot>reject()</slot>
126
   <hints>
127
    <hint type="sourcelabel">
128
     <x>316</x>
129
     <y>260</y>
130
    </hint>
131
    <hint type="destinationlabel">
132
     <x>286</x>
133
     <y>274</y>
134
    </hint>
135
   </hints>
136
  </connection>
137
 </connections>
138
</ui>
DTI_PID/DTI_PID/UI/Line_Data_List.ui
1
<?xml version="1.0" encoding="UTF-8"?>
2
<ui version="4.0">
3
 <class>Dialog</class>
4
 <widget class="QDialog" name="Dialog">
5
  <property name="geometry">
6
   <rect>
7
    <x>0</x>
8
    <y>0</y>
9
    <width>700</width>
10
    <height>506</height>
11
   </rect>
12
  </property>
13
  <property name="font">
14
   <font>
15
    <family>맑은 고딕</family>
16
   </font>
17
  </property>
18
  <property name="windowTitle">
19
   <string>라인 데이타 리스트</string>
20
  </property>
21
  <layout class="QGridLayout" name="gridLayout">
22
   <item row="0" column="5">
23
    <widget class="QPushButton" name="pushButtonDel">
24
     <property name="minimumSize">
25
      <size>
26
       <width>32</width>
27
       <height>0</height>
28
      </size>
29
     </property>
30
     <property name="maximumSize">
31
      <size>
32
       <width>32</width>
33
       <height>24</height>
34
      </size>
35
     </property>
36
     <property name="layoutDirection">
37
      <enum>Qt::RightToLeft</enum>
38
     </property>
39
     <property name="text">
40
      <string>삭제</string>
41
     </property>
42
    </widget>
43
   </item>
44
   <item row="0" column="4">
45
    <widget class="QPushButton" name="pushButtonAdd">
46
     <property name="maximumSize">
47
      <size>
48
       <width>32</width>
49
       <height>24</height>
50
      </size>
51
     </property>
52
     <property name="text">
53
      <string>추가</string>
54
     </property>
55
    </widget>
56
   </item>
57
   <item row="0" column="0">
58
    <widget class="QPushButton" name="pushButtonImport">
59
     <property name="maximumSize">
60
      <size>
61
       <width>64</width>
62
       <height>24</height>
63
      </size>
64
     </property>
65
     <property name="text">
66
      <string>가져오기</string>
67
     </property>
68
    </widget>
69
   </item>
70
   <item row="2" column="0" colspan="6">
71
    <widget class="QTableWidget" name="tableWidgetLineDataList">
72
     <property name="columnCount">
73
      <number>1</number>
74
     </property>
75
     <column/>
76
    </widget>
77
   </item>
78
   <item row="3" column="0" colspan="6">
79
    <widget class="QDialogButtonBox" name="buttonBox">
80
     <property name="orientation">
81
      <enum>Qt::Horizontal</enum>
82
     </property>
83
     <property name="standardButtons">
84
      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
85
     </property>
86
    </widget>
87
   </item>
88
   <item row="0" column="1">
89
    <widget class="QPushButton" name="pushButtonExport">
90
     <property name="maximumSize">
91
      <size>
92
       <width>64</width>
93
       <height>24</height>
94
      </size>
95
     </property>
96
     <property name="text">
97
      <string>내보내기</string>
98
     </property>
99
    </widget>
100
   </item>
101
  </layout>
102
 </widget>
103
 <resources/>
104
 <connections>
105
  <connection>
106
   <sender>buttonBox</sender>
107
   <signal>accepted()</signal>
108
   <receiver>Dialog</receiver>
109
   <slot>accept()</slot>
110
   <hints>
111
    <hint type="sourcelabel">
112
     <x>248</x>
113
     <y>254</y>
114
    </hint>
115
    <hint type="destinationlabel">
116
     <x>157</x>
117
     <y>274</y>
118
    </hint>
119
   </hints>
120
  </connection>
121
  <connection>
122
   <sender>buttonBox</sender>
123
   <signal>rejected()</signal>
124
   <receiver>Dialog</receiver>
125
   <slot>reject()</slot>
126
   <hints>
127
    <hint type="sourcelabel">
128
     <x>316</x>
129
     <y>260</y>
130
    </hint>
131
    <hint type="destinationlabel">
132
     <x>286</x>
133
     <y>274</y>
134
    </hint>
135
   </hints>
136
  </connection>
137
 </connections>
138
</ui>

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)