프로젝트

일반

사용자정보

개정판 b43ef0e1

IDb43ef0e17888310925499010200a26a6bedf3cd0
상위 494d1725
하위 fc0411f4, cf686e0c

김연진이(가) 5년 이상 전에 추가함

issue #1047 심벌 생성

Change-Id: I675e09f67c042c4a6fab603b853dcc579e9d89f6

차이점 보기:

HYTOS/HYTOS/MainWindow.py
102 102
        docData = AppDocData.instance()
103 103
        project = docData.getCurrentProject()
104 104
        _translate = QCoreApplication.translate
105
        self.setWindowTitle(_translate("HYTOS Plus - {}".format(project.name), "HYTOS Plus - {}".format(project.name)))
105
        self.setWindowTitle(_translate(App.NAME  + " - {}".format(project.name), App.NAME + " - {}".format(project.name)))
106 106

  
107 107
        self.lineComboBox = QComboBox(self.toolBar)
108 108
        for condition in LineTypeConditions.items():
......
189 189
        self.actionOpen.triggered.connect(self.onOpenImageDrawing)
190 190
        self.actionLine.triggered.connect(self.onPlaceLine)
191 191
        self.actionRecognition.triggered.connect(self.recognize)
192
        self.pushButtonBatchRecognition.clicked.connect(self.recognizeBatch)
193
        self.pushButtonRefreshDrawings.clicked.connect(self.load_drawing_list)
194 192
        self.actionLineRecognition.triggered.connect(self.connect_attributes)
195 193
        self.actionArea.triggered.connect(self.areaConfiguration)
196 194
        self.actionConfiguration.triggered.connect(self.configuration)
197 195
        self.actionOCR.triggered.connect(self.onAreaOcr)
198 196
        self.actionGenerateOutput.triggered.connect(self.generateOutput)
199
        self.pushButtonCreateSymbol.clicked.connect(self.onCreateSymbolClicked)
200 197
        self.pushButtonClearLog.clicked.connect(self.onClearLog)
201 198
        self.actionHMB_DATA.triggered.connect(self.onHMBData)
202 199
        self.actionItem_Data_List.triggered.connect(self.showItemDataList)
......
216 213
        self.actionVendor.triggered.connect(self.onVendor)
217 214
        self.actionFitWindow.triggered.connect(self.fitWindow)
218 215
        self.actionpdf_to_image.triggered.connect(self.onConvertPDFToImage)
216
        self.actionCreate_Symbol.triggered.connect(self.create_symbol)
219 217
        #self.graphicsView.scene.changed.connect(self.onSceneChanged)
220 218
        self.graphicsView.scene.contents_changed.connect(self.onSceneChanged)
221 219
        self.graphicsView.scene.selectionChanged.connect(self.onSelectionChanged)
......
223 221
        self.actionSave.triggered.connect(self.actionSaveCliked)
224 222
        self.addMessage.connect(self.onAddMessage)
225 223
        self.actionFindReplaceText.triggered.connect(self.findReplaceTextClicked)
226
        self.pushButtonDetectSymbol.clicked.connect(self.onShowDetectSymbol)
224

  
225

  
226

  
227 227

  
228 228
        configs = docData.getAppConfigs('app', 'mode')
229 229
        if configs and 1 == len(configs) and 'advanced' == configs[0].value:
230 230
            self.actionOCR_Training.triggered.connect(self.oCRTrainingClicked)
231
            self.pushButtonBatchRecognition
232 231
        else:
233 232
            self.actionOCR_Training.setVisible(False)
234
            self.pushButtonBatchRecognition.setVisible(False)
235 233

  
236 234
        # removedItems
237 235
        '''
......
440 438
                        
441 439
            for drawing in drawings:               
442 440
                item = QTreeWidgetItem(self.treeWidgetDrawingList.root, [drawing[1], drawing[2] if drawing and drawing[0] else ''])
443
                item.setIcon(0, QIcon(':newPrefix/image.png'))
444 441
                item.setFlags(item.flags() | Qt.ItemIsUserCheckable)
445 442
                item.setCheckState(0, Qt.Unchecked)
446 443
            
......
463 460
        drawing = os.path.join(appDocData.getCurrentProject().getDrawingFilePath(), item.text(0))
464 461
        self.onOpenImageDrawing(drawing)
465 462

  
466
    def onShowDetectSymbol(self):
467
        from DetectSymbolDialog import QDetectSymbolDialog
468

  
469
        dlgDetectSymbol = QDetectSymbolDialog(self)
470
        dlgDetectSymbol.show()
471
        dlgDetectSymbol.exec_()
472
        
473 463
    '''
474 464
        @brief      OCR Editor
475 465
        @author     euisung
......
1249 1239
        cmd = FenceCommand.FenceCommand(self.graphicsView)
1250 1240
        cmd.onSuccess.connect(self.onAreaSelected)
1251 1241
        self.graphicsView.command = cmd
1252
        QApplication.setOverrideCursor(Qt.CrossCursor)
1242
        QApplication.setOverrideCursor(Qt.CrossCursor)        
1253 1243

  
1244
        
1245
       
1254 1246
    '''
1255 1247
        @brief      show SymbolEditorDialog with image selected by user
1256 1248
        @author     humkyung
......
1451 1443
        except Exception as ex:
1452 1444
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
1453 1445
            self.addMessage.emit(MessageType.Error, message)
1454
    
1455
    def recognizeBatch(self, MainWindow):
1456
        '''
1457
            @brief      batch recognize symbol, text and line
1458
            @author     euisung
1459
            @date       2018.11.23
1460 1446
        
1461
        '''
1462
        from datetime import datetime
1463
        from RecognitionDialog import QRecognitionDialog
1464

  
1465
        appDocData = AppDocData.instance()
1466
        project = appDocData.getCurrentProject()
1467
        appDocData.needReOpening = None
1468
        currentPid = None
1469
        
1470
        if self.graphicsView.hasImage():
1471
            currentPid = appDocData.activeDrawing.name
1472

  
1473
        drawingTop = self.treeWidgetDrawingList.topLevelItem(0)
1474
        drawingCount = drawingTop.childCount()
1475
        checkedTreeItems = []
1476
        checkedDrawingPath = []
1477
        for drawing in range(drawingCount):
1478
            drawingChild = drawingTop.child(drawing)
1479
            if drawingChild.checkState(0) == 2:
1480
                checkedTreeItems.append(drawingChild)
1481
                checkedDrawingPath.append(os.path.join(project.getDrawingFilePath(), drawingChild.data(0, 0)))
1482
                if currentPid is not None and drawingChild.data(0, 0).find(currentPid) is 0:
1483
                    appDocData.needReOpening = False # later check need reopening at drawUnknownItems()
1484
                    currentPid = drawingChild.data(0, 0)
1485

  
1486
        if len(checkedDrawingPath) == 0:
1487
            self.showImageSelectionMessageBox()
1488
            return
1489

  
1490
        try:
1491
            self.onClearLog()
1492
            self.dlg = QRecognitionDialog(self, checkedDrawingPath, True)
1493
            self.dlg.exec_()
1494
            if self.dlg.isAccepted == True:
1495
                pass
1496

  
1497
            if appDocData.needReOpening == True:
1498
                drawing = os.path.join(appDocData.getCurrentProject().getDrawingFilePath(), currentPid)
1499
                self.onOpenImageDrawing(drawing)
1500

  
1501
            # save working date-time
1502
            drawings = appDocData.getDrawings()
1503
            checkedDrawings = []
1504
            for checkedTreeItem in checkedTreeItems:
1505
                for drawing in drawings:
1506
                    if checkedTreeItem.data(0, 0) == drawing[1]:
1507
                        if drawing[0]:
1508
                            drawing[2] = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
1509
                            checkedDrawings.append(drawing)
1510
                            checkedTreeItem.setText(1, datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
1511
            appDocData.saveDrawings(checkedDrawings)
1512
            self.changeViewCheckedState(True)
1513
            # up to here
1514
        except Exception as ex:
1515
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
1516
            self.addMessage.emit(MessageType.Error, message)
1517

  
1518 1447
    '''
1519 1448
        @brief      recognize symbol and text
1520 1449
        @author     humkyung
......
2665 2594

  
2666 2595
        return itemList
2667 2596

  
2597
    def create_symbol(self):        
2598
        symbolEditorDialog = SymbolEditorDialog.QSymbolEditorDialog(self, None, AppDocData.instance().getCurrentProject())
2599
        (isAccepted, isImmediateInsert, offsetX, offsetY, newSym) = symbolEditorDialog.showDialog()        
2600
        self.dirTreeWidget.initDirTreeWidget()        
2601
            
2602

  
2668 2603
if __name__ == '__main__':
2669 2604
    import locale
2670 2605
    from PyQt5.QtCore import QTranslator
HYTOS/HYTOS/MainWindow_UI.py
78 78
        self.symbolTabVerticalLayout.setObjectName("symbolTabVerticalLayout")
79 79
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
80 80
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
81
        self.pushButtonCreateSymbol = QtWidgets.QPushButton(self.Symbol)
82
        self.pushButtonCreateSymbol.setMaximumSize(QtCore.QSize(32, 16777215))
83
        self.pushButtonCreateSymbol.setLayoutDirection(QtCore.Qt.LeftToRight)
84
        self.pushButtonCreateSymbol.setObjectName("pushButtonCreateSymbol")
85
        self.horizontalLayout_3.addWidget(self.pushButtonCreateSymbol)
86
        self.pushButtonDetectSymbol = QtWidgets.QPushButton(self.Symbol)
87
        self.pushButtonDetectSymbol.setMaximumSize(QtCore.QSize(130, 16777215))
88
        self.pushButtonDetectSymbol.setObjectName("pushButtonDetectSymbol")
89
        self.horizontalLayout_3.addWidget(self.pushButtonDetectSymbol)
90 81
        self.symbolTabVerticalLayout.addLayout(self.horizontalLayout_3)
91 82
        self.gridLayout_3.addLayout(self.symbolTabVerticalLayout, 0, 0, 1, 1)
92 83
        self.tabWidget.addTab(self.Symbol, "")
......
116 107
        self.gridLayout_7.setObjectName("gridLayout_7")
117 108
        self.verticalLayoutDrawingList = QtWidgets.QVBoxLayout()
118 109
        self.verticalLayoutDrawingList.setObjectName("verticalLayoutDrawingList")
119
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
120
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
121
        self.pushButtonBatchRecognition = QtWidgets.QPushButton(self.tabDrawingList)
122
        self.pushButtonBatchRecognition.setMaximumSize(QtCore.QSize(80, 16777215))
123
        self.pushButtonBatchRecognition.setObjectName("pushButtonBatchRecognition")
124
        self.horizontalLayout_4.addWidget(self.pushButtonBatchRecognition)
125
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
126
        self.horizontalLayout_4.addItem(spacerItem)
127
        self.pushButtonRefreshDrawings = QtWidgets.QPushButton(self.tabDrawingList)
128
        self.pushButtonRefreshDrawings.setObjectName("pushButtonRefreshDrawings")
129
        self.horizontalLayout_4.addWidget(self.pushButtonRefreshDrawings)
130
        self.verticalLayoutDrawingList.addLayout(self.horizontalLayout_4)
131 110
        self.treeWidgetDrawingList = QtWidgets.QTreeWidget(self.tabDrawingList)
132 111
        self.treeWidgetDrawingList.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
133 112
        self.treeWidgetDrawingList.setColumnCount(2)
......
164 143
        self.verticalLayout_3.setObjectName("verticalLayout_3")
165 144
        self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
166 145
        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
167
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
168
        self.horizontalLayout_5.addItem(spacerItem1)
146
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
147
        self.horizontalLayout_5.addItem(spacerItem)
169 148
        self.pushButtonClearLog = QtWidgets.QPushButton(self.tabTerminal)
170 149
        self.pushButtonClearLog.setEnabled(True)
171 150
        self.pushButtonClearLog.setMaximumSize(QtCore.QSize(32, 16777215))
......
448 427
        font.setFamily("맑은 고딕")
449 428
        self.actionNew.setFont(font)
450 429
        self.actionNew.setObjectName("actionNew")
430
        self.actionCreate_Symbol = QtWidgets.QAction(MainWindow)
431
        self.actionCreate_Symbol.setObjectName("actionCreate_Symbol")
451 432
        self.menu.addAction(self.actionNew)
452 433
        self.menu.addAction(self.actionOpen)
453 434
        self.menu.addAction(self.actionArea)
......
472 453
        self.menu_3.addAction(self.actionViewVendor_Area)
473 454
        self.menu_3.addSeparator()
474 455
        self.menu_3.addAction(self.actionDrawing_Only)
456
        self.menu_4.addAction(self.actionCreate_Symbol)
475 457
        self.menu_5.addAction(self.actionFindReplaceText)
476 458
        self.menu_5.addAction(self.actionText_Data_List)
477 459
        self.menubar.addAction(self.menu.menuAction())
......
515 497
        self.menu_5.setTitle(_translate("MainWindow", "Edit"))
516 498
        self.toolBar.setWindowTitle(_translate("MainWindow", "Main Toolbar"))
517 499
        self.dockWidget.setWindowTitle(_translate("MainWindow", "Symbol Explorer"))
518
        self.pushButtonCreateSymbol.setText(_translate("MainWindow", "Create"))
519
        self.pushButtonDetectSymbol.setText(_translate("MainWindow", "Symbol Manager"))
520 500
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.Symbol), _translate("MainWindow", "Symbol"))
521 501
        self.dockWidgetObjectExplorer.setWindowTitle(_translate("MainWindow", "Object Explorer"))
522 502
        self.tabWidgetItemExplorer.setTabText(self.tabWidgetItemExplorer.indexOf(self.tabItemProperty), _translate("MainWindow", "Object Explorer"))
523
        self.pushButtonBatchRecognition.setText(_translate("MainWindow", "Batch Job"))
524
        self.pushButtonRefreshDrawings.setText(_translate("MainWindow", "Refresh Drawing List"))
525 503
        self.treeWidgetDrawingList.setSortingEnabled(True)
526 504
        self.tabWidgetItemExplorer.setTabText(self.tabWidgetItemExplorer.indexOf(self.tabDrawingList), _translate("MainWindow", "Drawing List"))
527 505
        self.EditToolbar.setWindowTitle(_translate("MainWindow", "Edit Toolbar"))
......
589 567
        self.actionNew.setText(_translate("MainWindow", "New"))
590 568
        self.actionNew.setToolTip(_translate("MainWindow", "New(Ctrl + N)"))
591 569
        self.actionNew.setShortcut(_translate("MainWindow", "Ctrl+N"))
570
        self.actionCreate_Symbol.setText(_translate("MainWindow", "Symbol Editor"))
592 571

  
593 572
import MainWindow_rc
HYTOS/HYTOS/QDrawingDialog.py
18 18
        self.result = False
19 19
        self.ui = Drawing_UI.Ui_DrawingDialog()
20 20
        self.ui.setupUi(self)    
21
        self.ui.lineEditName.setFocus()
21 22
        self.setWindowTitle(_translate('New Drawing Dialog', 'New Drawing'))
22 23
        
23 24
    def showDialog(self):
24 25
        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowCloseButtonHint & ~QtCore.Qt.WindowContextHelpButtonHint)
26
        self.ui.lineEditName.setFocus()
25 27
        self.exec_()
26

  
28
    
27 29
        return self.result
28 30

  
29 31
    def accept(self):
......
31 33
        
32 34
        if not self.validationCheck(drawingName):            
33 35
            QMessageBox.warning(self, self.tr('Notice'), self.tr('Name is empty.'))
36
            self.ui.lineEditName.setFocus()
34 37
            return
35 38
        
36 39
        if self.exists_drawing(drawingName):
37
            QMessageBox.warning(self, self.tr('Notice'), self.tr('Name already exists.'))            
40
            QMessageBox.warning(self, self.tr('Notice'), self.tr('Name already exists.'))      
41
            self.ui.lineEditName.setFocus()      
38 42
            return
39 43

  
40 44
        self.saveDrawing(drawingName)
......
61 65
        drawings.append([str(uuid.uuid4()), drawingName, str(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))])
62 66

  
63 67
        AppDocData.instance().saveDrawings(drawings)
68

  
69

  
70
    if __name__ == '__main__':
71
        from AppDocData import AppDocData
72
        from License import QLicenseDialog
73
        from QDrawingDialog import QDrawingDialog
74
        from MainWindow import MainWindow
75
        from ExceptionHandler import QExceptionHandler
76
        from App import App
77
        app = App(sys.argv)
78

  
79
        """ log for unhandled exception """
80
        exceptionHandler = QExceptionHandler()
81
        sys._excepthook = sys.excepthook
82
        sys.excepthook = exceptionHandler.handler
83

  
84
        """
85
        try:
86
            import qtmodern.styles
87
        except ImportError:
88
            pass
89
        else:
90
            qtmodern.styles.darkorange(app)
91
        """
92
        if True:# == QLicenseDialog.check_license_key():
93
            dlg = QDrawingDialog(parent=None)
94
            dlg.exec_()
HYTOS/HYTOS/SymbolEditorDialog.py
41 41
            self.project = project
42 42
            self.ui = SymbolEditor_UI.Ui_Dialog()
43 43
            self.ui.setupUi(self)
44
            
44 45
            self.ui.tableWidgetConnList.setColumnCount(3)
45 46
            self.ui.tableWidgetConnList.setHorizontalHeaderLabels([self.tr('위치'), self.tr('방향'), self.tr('심볼')])
46 47
            self.ui.tableWidgetConnList.horizontalHeaderItem(0).setSizeHint(QSize(25, 25))
......
56 57
            self.newSym = None
57 58

  
58 59
            #self.setWindowTitle(self.tr('심볼 편집기'))
59
            if self.selectedSymbol is None:
60
                self.ui.checkBoxChange.setEnabled(False)
61
                self.ui.pushButtonChange.setEnabled(False)
62

  
63
            self.ui.hasInstrumentLabel.setHidden(True)
64
            self.ui.hasInstrumentLabelCheckBox.setHidden(True)
65
            self.ui.immediateInsertLabel.setHidden(True)
66
            self.ui.immediateInsertCheckBox.setHidden(True)
67
            
68
            self.ui.label_3.setHidden(True)
69
            self.ui.label_4.setHidden(True)
70
            self.ui.checkBoxChange.setHidden(True)
71
            self.ui.pushButtonChange.setHidden(True)
60
            if self.selectedSymbol is not None:
61
                self.ui.openImageFileButton.setEnabled(False)                
62
                self.ui.imageFileLineEdit.setText(os.path.basename(self.selectedSymbol.getPath()))            
63
                
72 64
        except Exception as ex:
73 65
            from App import App
74 66

  
75 67
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
76 68
            App.mainWnd().addMessage.emit(MessageType.Error, message)
77 69

  
78
    def changeSymbolInfo(self):
79
        ''' 
80
            @brief      change base and additional symbol info for already created on drawing
81
            @author     euisung
82
            @date       2019.04.23
83
        '''
84
        from App import App
85
        from SymbolSvgItem import SymbolSvgItem
86

  
87
        mainScene = App.mainWnd().graphicsView
88
        if not mainScene.hasImage():
89
            return
90
        symbols = [item for item in mainScene.items() if issubclass(type(item), SymbolSvgItem) and item.name == self.selectedSymbol.getName()]
91
        newBase = self.ui.baseSymbolComboBox.currentText()
92
        newAddition = self.makeAdditionalSymbolListString()
93
        newType = self.ui.typeComboBox.currentText()
94
        for symbol in symbols:
95
            symbol.type = newType
96
            symbol.parentSymbol = newBase
97
            symbol.childSymbol = newAddition
98

  
99 70

  
100 71
    ''' 
101 72
        @brief      hilight pressed connector item
......
149 120
        self.ui.imageView.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
150 121
        self.ui.imageView.canZoom = True
151 122
        self.ui.imageView.canPan = True
152
        image = self.image.copy()
153
        self.imgW = image.width()
154
        self.imgH = image.height()
155
        image = image.scaled(self.imgW, self.imgH)
156
        self.ui.imageView.setImage(image)
123
        if self.image is not None:
124
            image = self.image.copy()
125
            self.imgW = image.width()
126
            self.imgH = image.height()
127
            image = image.scaled(self.imgW, self.imgH)
128
            self.ui.imageView.setImage(image)
157 129
        self.ui.imageViewerContainerLayout.addWidget(self.ui.imageView)
158 130
        self.ui.imageView.startPointChanged.connect(self.offsetChanged)
159 131

  
......
163 135
                    2018.06.11  Jeongwoo    Add connection for rotation and flip
164 136
    '''
165 137
    def setupTools(self):
138
        self.ui.openImageFileButton.clicked.connect(self.openImageFileClickEvent)
166 139
        self.ui.handButton.clicked.connect(self.handToolClickEvent)
167 140
        self.ui.cropButton.clicked.connect(self.cropToolClickEvent)
168 141
        self.ui.penButton.clicked.connect(self.penToolClickEvent)
......
174 147
        self.ui.zoomButton.clicked.connect(self.zoomToolClickEvent)
175 148
        self.ui.areaZoomButton.clicked.connect(self.areaZoomToolClickEvent)
176 149
        self.ui.initZoomButton.clicked.connect(self.zoomInitToolClickEvent)
177
        self.ui.guidelineCheckbox.stateChanged.connect(self.guidelineStateChangedEvent)
178
        self.ui.removeTextButton.clicked.connect(self.removeTextClickEvent)
179 150
        self.ui.rotateLeftButton.clicked.connect(self.rotateLeftClickEvent)
180 151
        self.ui.rotateRightButton.clicked.connect(self.rotateRightClickEvent)
181 152
        self.ui.flipHorizontalButton.clicked.connect(self.flipHorizontalClickEvent)
182 153
        self.ui.flipVerticalButton.clicked.connect(self.flipVerticalClickEvent)
183 154
        self.ui.pushButtonDelConnPt.clicked.connect(self.onDeleteConnPt)
184
        self.ui.pushButtonChange.clicked.connect(self.changeSymbolInfo)
185 155

  
186 156
    '''
187 157
        @brief  Init Forms with type and default values
188 158
    '''
189 159
    def initForms(self):
190
        self.ui.thresholdLineEdit.setValidator(QRegExpValidator(QtCore.QRegExp("^[0-9]\d+$"))) # ([0-1]{1}[.])?[0-9]+
191
        self.ui.minMatchPointLineEdit.setValidator(QRegExpValidator(QtCore.QRegExp("^[0-9]\d+$")))
192
        self.initDefaultSymbolDirectionComboBoxItems()
193
        self.ui.addAdditionalSymbolButton.clicked.connect(self.addAdditionalSymbolEvent)
194 160
        self.ui.addOriginalPointButton.clicked.connect(self.addOriginalPoint)
195 161
        self.ui.addConnectionPointButton.clicked.connect(self.addConnectionPoint)
196
        self.initSymbolTypeComboBoxItems()
197
        self.initBaseSymbolComboBoxItems(None)
198
        self.initAdditionalSymbolComboBoxItems()
199
        self.ui.guidelineCheckbox.setChecked(True)
162
        self.initSymbolTypeComboBoxItems()        
200 163

  
201 164
        ''' add symbol gradients to combobox '''
202 165
        configs = AppDocData.instance().getConfigs('Symbol Gradients')
......
220 183
    def initSymbolTypeComboBoxItems(self):
221 184
        for item in AppDocData.instance().getSymbolTypeComboBoxItems():
222 185
            self.ui.typeComboBox.addItem(item[2])
223
        self.ui.typeComboBox.currentTextChanged.connect(self.symbolTypeTextChagedEvent)
224 186

  
225
    def symbolTypeTextChagedEvent(self, value):
226
        self.initBaseSymbolComboBoxItems(value)
227
        
228 187
    '''
229 188
        @brief  Set data on forms, For modifying symbol
230 189
        @history    2018.05.02  Jeongwoo    When modifying symbol, Make immediateInsertCheckBox disable
......
233 192
    def initContents(self):
234 193
        try:
235 194
            if self.selectedSymbol is not None:
236
                self.ui.immediateInsertCheckBox.setDisabled(True)
237 195

  
238
                self.ui.nameLineEdit.setText(self.selectedSymbol.getName())
239
                self.ui.thresholdLineEdit.setText(str(int(self.selectedSymbol.getThreshold() * 100)))
240
                self.ui.minMatchPointLineEdit.setText(str(self.selectedSymbol.getMinMatchCount()))
241
                self.ui.rotationCountSpinBox.setValue(self.selectedSymbol.getRotationCount())
242
                self.ui.isContainChildCheckBox.setChecked(True if self.selectedSymbol.getIsContainChild() else False)
196
                self.ui.nameLineEdit.setText(self.selectedSymbol.getName())                                
243 197
                self.ui.typeComboBox.setCurrentIndex(self.ui.typeComboBox.findText(self.selectedSymbol.getType()))
244
                self.ui.baseSymbolComboBox.setCurrentIndex(self.ui.baseSymbolComboBox.findText(self.selectedSymbol.getBaseSymbol()))
245
                self.ui.isExceptDetectCheckBox.setChecked(True if self.selectedSymbol.getIsExceptDetect() else False)
246
                self.ui.makeFlipCheckBox.setChecked(True if self.selectedSymbol.getDetectFlip() else False)
247 198
                
248
                self.ui.hasInstrumentLabelCheckBox.setChecked(True if self.selectedSymbol.getHasInstrumentLabel() else False)
249

  
250
                additionalSymbol = self.selectedSymbol.getAdditionalSymbol()
251
                if additionalSymbol is not None and len(additionalSymbol) > 0:
252
                    splitAdditionalSymbolList = additionalSymbol.split("/")
253
                    i = 1
254
                    for symString in splitAdditionalSymbolList:
255
                        splitSymString = symString.split(",")
256
                        if len(splitSymString) is 2:
257
                            self.addAdditionalSymbol(i, splitSymString[0], splitSymString[1])
258
                            i = i + 1
259
                        else:
260
                            self.addAdditionalSymbol(splitSymString[0], splitSymString[1], splitSymString[2])
261

  
262 199
                originalPoint = self.selectedSymbol.getOriginalPoint()
263 200
                self.ui.originalPointLineEdit.setText(originalPoint)
264 201
                OriginalPointCommand.OriginalPointCommand.drawCircle(self.ui.imageView, originalPoint.split(",")[0], originalPoint.split(",")[1])
265
                self.ui.imageView.isOriginalPointSelected = True
266

  
202
                
267 203
                connectionPoint = self.selectedSymbol.getConnectionPoint()
268 204
                if connectionPoint is not None and len(connectionPoint) > 0:
269 205
                    splitConnectionPointList = connectionPoint.split("/")
270
                    symbol_indecies = [str(idx) for idx in range(self.ui.additionalSymbolListWidget.count()+1)]
206
                    symbol_indecies = [str(idx) for idx in range(1)]
271 207

  
272 208
                    self.ui.tableWidgetConnList.setRowCount(len(splitConnectionPointList))
273 209
                    row = 0
......
312 248

  
313 249
                        row = row + 1
314 250

  
315
                        self.ui.tableWidgetConnList.resizeColumnsToContents()
316
            else:
317
                self.ui.minMatchPointLineEdit.setText('0')
251
                        self.ui.tableWidgetConnList.resizeColumnsToContents()          
318 252
        except Exception as ex:
319 253
            from App import App
320 254

  
321 255
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
322 256
            App.mainWnd().addMessage.emit(MessageType.Error, message)
323

  
324
    '''
325
        @brief  Init ComboBox Items For Direction of DB Field [additionalSymbol]
326
    '''
327
    def initDefaultSymbolDirectionComboBoxItems(self):
328
        for item in AppDocData.instance().getDefaultSymbolDirectionComboBoxItems():
329
            self.ui.defaultSymbolDirectionComboBox.addItem(item[0], item[1]) # 0 : text / 1 : data(integer)
330
        
331
    '''
332
        @brief  Init ComboBox Items For DB Field [baseSymbol]
333
    '''
334
    def initBaseSymbolComboBoxItems(self, type):
335
        self.ui.baseSymbolComboBox.clear()
336
        for item in AppDocData.instance().getBaseSymbolComboBoxItems(type):
337
            self.ui.baseSymbolComboBox.addItem(item)
338
            
339
    '''
340
        @brief  Init ComboBox Items For symbolName of DB Field [additionalSymbol]
341
    '''
342
    def initAdditionalSymbolComboBoxItems(self):
343
        for name in AppDocData.instance().getAdditionalSymbolComboBoxItems():
344
            self.ui.additionalSymbolComboBox.addItem(name)
345
    
257
   
346 258
    '''
347 259
        @brief  remove ConnectionPoint Circles (Using for loop)
348 260
    '''
......
371 283
    def showDialog(self):
372 284
        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint)
373 285
        self.exec_()
374
        return (self.isAccepted, self.ui.immediateInsertCheckBox.isChecked(), self.offsetX, self.offsetY, self.newSym)
286
        return (self.isAccepted, False, self.offsetX, self.offsetY, self.newSym)
375 287
    
376 288
    '''
377 289
        @brief  Using input [Name], make file name
......
412 324
            fileName = name
413 325
        else:
414 326
            fileName = self.makeFileName(type, name, name)
415
        threshold = self.ui.thresholdLineEdit.text()
416
        minMatchPoint = self.ui.minMatchPointLineEdit.text()
417
        rotationCount = self.ui.rotationCountSpinBox.value()
327
        
328
        minMatchPoint = 0
329
        isDetectOnOrigin = True
330
        rotationCount = 0
418 331
        ocrOption = 0
419
        isContainChild = 1 if self.ui.isContainChildCheckBox.isChecked() else 0
332
        isContainChild = 0
420 333
        originalPoint = self.ui.originalPointLineEdit.text()
421 334
        connectionPoint = self.makeConnectionPointListString()
422
        baseSymbol = self.ui.baseSymbolComboBox.currentText()
423
        additionalSymbol = self.makeAdditionalSymbolListString()
424
        isExceptDetect = 1 if self.ui.isExceptDetectCheckBox.isChecked() else 0
425

  
426
        hasInstrumentLabel = 1 if self.ui.hasInstrumentLabelCheckBox.isChecked() else 0
427

  
428
        detectFlip = 1 if self.ui.makeFlipCheckBox.isChecked() else 0
429

  
430
        convertedThreshold = int(threshold) / 100.0
335
        baseSymbol = None
336
        additionalSymbol = None
337
        isExceptDetect = 0
338
        hasInstrumentLabel = 0
339
        detectFlip = 0
340
        convertedThreshold = 70 / 100.0
431 341

  
432 342
        imageWidth = width
433 343
        iamgeHeight = height
434 344

  
435
        self.newSym = symbol.SymbolBase(fileName, type, convertedThreshold, int(minMatchPoint), True, 
345
        self.newSym = symbol.SymbolBase(fileName, type, convertedThreshold, int(minMatchPoint), isDetectOnOrigin, 
436 346
                        rotationCount, ocrOption, isContainChild, originalPoint, connectionPoint, baseSymbol, additionalSymbol, isExceptDetect, hasInstrumentLabel, uid, imageWidth, iamgeHeight, detectFlip=detectFlip)
437 347

  
438 348
        return self.newSym
......
514 424
                        #if self.ui.makeFlipCheckBox.isChecked():
515 425
                        #    potrace.convertImageToSvg(imagePath + '_Flip', os.path.join(svgLocation + "/" + fileName + "_Flip.svg"), normalColor=normal_color, hoverColor=hover_color)
516 426
                        self.isAccepted = True
517
                        if self.ui.checkBoxChange.isChecked():
518
                            self.changeSymbolInfo()
427
                                              
519 428
                        QDialog.accept(self)
520 429
                except:
521 430
                    if self.selectedSymbol is None:
......
589 498
                        self.ui.additionalSymbolListWidget.takeItem(self.ui.additionalSymbolListWidget.row(item))
590 499
                        
591 500
    '''
501
        @brief  Open Image File Button Clicked
502
    '''
503
    def openImageFileClickEvent(self, event):
504
        appDocData = AppDocData.instance()
505
        project = appDocData.getCurrentProject()
506

  
507
        self.path = self.ui.imageView.loadImageFromFile(project.getImageFilePath(), '')
508
        if not self.path:
509
            return
510
            
511
        if os.path.isfile(self.path): 
512
            self.ui.imageFileLineEdit.setText(os.path.basename(self.path))
513
            self.ui.nameLineEdit.setText(os.path.splitext(self.ui.imageFileLineEdit.text())[0])
514
    '''
592 515
        @brief  Hand Tool Button Clicked
593 516
    '''
594 517
    def handToolClickEvent(self, event):
......
601 524
    def cropToolClickEvent(self, event):
602 525
        self.initOriginalAndConnectionPoint()
603 526
        self.ui.imageView.command = CropCommand.CropCommand(self.ui.imageView)
604
        self.guidelineStateChangedEvent(None)
605 527
                         
606 528
    '''
607 529
        @brief  Zoom Init Tool Button Clicked
......
669 591
        self.ui.imageView.command = FitImageCommand.FitImageCommand(self.ui.imageView)
670 592
        adjustX, adjustY = self.ui.imageView.command.getOffset()
671 593
        self.ui.imageView.startPointChanged.emit(adjustX, adjustY)
672
                         
673
    '''
674
        @brief  Guideline Check State Changed
675
    '''
676
    def guidelineStateChangedEvent(self, value):
677
        if self.ui.guidelineCheckbox.isChecked():
678
            self.ui.imageView.showGuideline(None, True)
679
        else:
680
            self.ui.imageView.showGuideline(None, False)
681
                             
682
    '''
683
        @brief  Add AdditionalSymbol String on ListWidget Listener
684
    '''
685
    def addAdditionalSymbolEvent(self, event):
686
        additionalSymbolIndex = self.ui.additionalSymbolComboBox.currentIndex()
687
        if additionalSymbolIndex != 0:
688
            parent_index = self.ui.spinBoxParent.value()
689
            direction = self.ui.defaultSymbolDirectionComboBox.currentText()
690
            symbolName = self.ui.additionalSymbolComboBox.currentText()
691
            self.addAdditionalSymbol(parent_index, direction, symbolName)
692
                    
594
    
693 595
    '''
694 596
        @brief  Add AdditionalSymbol String on ListWidget
695 597
    '''
......
735 637
            self.ui.tableWidgetConnList.setCellWidget(rows, 1, directionComboBox)
736 638

  
737 639
            # add symbol index combobox - 2019.01.07 added by humkyung
738
            symbol_indecies = [str(idx) for idx in range(self.ui.additionalSymbolListWidget.count()+1)]
640
            symbol_indecies = [str(idx) for idx in range(1)]
739 641
            symbol_idx_combobox = QComboBox(self.ui.tableWidgetConnList)
740 642
            symbol_idx_combobox.addItems(symbol_indecies)
741 643
            symbol_idx_combobox.setCurrentText('0')
......
746 648
        @brief  Original Point Tool Button Clicked
747 649
    '''
748 650
    def addOriginalPoint(self, event):
651
        if not self.ui.imageView.hasImage():
652
            return
653

  
749 654
        cmd = OriginalPointCommand.OriginalPointCommand(self.ui.imageView, self.ui.originalPointLineEdit)
750 655
        cmd.onSuccess.connect(self.onCommandSuccess)
751 656
        self.ui.imageView.command = cmd
......
754 659
        @brief  Connection Point Tool Button Clicked
755 660
    '''
756 661
    def addConnectionPoint(self, event):
662
        if not self.ui.imageView.hasImage():
663
            return
664

  
757 665
        cmd = ConnectionPointCommand.ConnectionPointCommand(self.ui.imageView, self.ui.connectionPointLineEdit)
758 666
        cmd.onSuccess.connect(self.onCommandSuccess)
759 667
        self.ui.imageView.command = cmd
......
781 689
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
782 690
            App.mainWnd().addMessage.emit(MessageType.Error, message)
783 691

  
784
    '''
785
        @brief  Remove Text Tool Button Clicked
786
        @author Jeongwoo
787
        @date   2018.05.03
788
        @history    2018.05.09  Jeongwoo    Remove comment and activate RemoveTextCommand
789
    '''
790
    def removeTextClickEvent(self, event):
791
        self.ui.imageView.command = RemoveTextCommand.RemoveTextCommand(self.ui.imageView)
792 692

  
793 693
    '''
794 694
        @brief      Init Original/Connection points
......
808 708
    def rotateLeftClickEvent(self, event):
809 709
        self.initOriginalAndConnectionPoint()
810 710
        self.ui.imageView.command = RotateImageCommand.RotateImageCommand(self.ui.imageView, True)
811
        self.guidelineStateChangedEvent(None)
812 711
        
813 712
    '''
814 713
        @brief      Rotate image counter-clockwise
......
818 717
    def rotateRightClickEvent(self, event):
819 718
        self.initOriginalAndConnectionPoint()
820 719
        self.ui.imageView.command = RotateImageCommand.RotateImageCommand(self.ui.imageView)
821
        self.guidelineStateChangedEvent(None)
822 720
        
823 721
    '''
824 722
        @brief      Flip image left and right
......
828 726
    def flipHorizontalClickEvent(self, event):
829 727
        self.initOriginalAndConnectionPoint()
830 728
        self.ui.imageView.command = FlipImageCommand.FlipImageCommand(self.ui.imageView, horizontal = True, vertical = False)
831
        self.guidelineStateChangedEvent(None)
832 729
        
833 730
    '''
834 731
        @brief      Flip image up and down
......
838 735
    def flipVerticalClickEvent(self, event):
839 736
        self.initOriginalAndConnectionPoint()
840 737
        self.ui.imageView.command = FlipImageCommand.FlipImageCommand(self.ui.imageView, horizontal = False, vertical = True)
841
        self.guidelineStateChangedEvent(None)
842 738

  
843 739
    def adjustOriginalPoint(self, adjustX, adjustY):
844 740
        originalPoint = self.ui.originalPointLineEdit.text()
......
878 774
            infoTitle = self.ui.nameLabel.text()
879 775
            return (False, EXCEPTION_MSG_FORMAT.format(infoTitle))
880 776

  
881
        thresholdText = self.ui.thresholdLineEdit.text()
882
        threshold = float(thresholdText) if thresholdText else -1
883
        if not(threshold >= 0 and threshold <= 100):
884
            infoTitle = self.ui.thresholdLabel.text()
885
            return (False, EXCEPTION_MSG_FORMAT.format(infoTitle))
886
            
887
        minMatchPointText = self.ui.minMatchPointLineEdit.text()
888
        minMatchPoint = float(minMatchPointText) if minMatchPointText else -1
889
        if not(minMatchPoint >= 0):
890
            infoTitle = self.ui.minMatchPointLabel.text()
891
            return (False, EXCEPTION_MSG_FORMAT.format(infoTitle))
892

  
893 777
        if self.ui.typeComboBox.currentIndex() == 0:
894 778
            infoTitle = self.ui.typeLabel.text()
895 779
            return (False, EXCEPTION_MSG_FORMAT.format(infoTitle))
896 780

  
897
        if self.ui.baseSymbolComboBox.currentIndex() == 0: #default value(None) index
898
            infoTitle = self.ui.baseSymbolLabel.text()
899
            return (False, EXCEPTION_MSG_FORMAT.format(infoTitle))
900

  
901 781
        #Additional Symbol is Nullable
902 782

  
903
        if not self.ui.originalPointLineEdit.text() or self.ui.imageView.isOriginalPointSelected == False:
783
        if not self.ui.originalPointLineEdit.text():
904 784
            infoTitle = self.ui.originalPointLabel.text()
905 785
            return (False, EXCEPTION_MSG_FORMAT.format(infoTitle))
906 786

  
......
922 802
        #print('offsetY : ' + str(self.offsetY) + '->' + str(self.offsetY+oY))
923 803
        self.offsetX = self.offsetX + oX
924 804
        self.offsetY = self.offsetY + oY
925
        self.guidelineStateChangedEvent(None)
HYTOS/HYTOS/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 5
# Created by: PyQt5 UI code generator 5.11.3
6 6
#
......
11 11
class Ui_Dialog(object):
12 12
    def setupUi(self, Dialog):
13 13
        Dialog.setObjectName("Dialog")
14
        Dialog.resize(1280, 823)
14
        Dialog.resize(1280, 720)
15 15
        Dialog.setMinimumSize(QtCore.QSize(1280, 720))
16 16
        Dialog.setMaximumSize(QtCore.QSize(16777215, 16777215))
17 17
        font = QtGui.QFont()
......
41 41
        self.horizontalLayout = QtWidgets.QHBoxLayout(self.toolWidget)
42 42
        self.horizontalLayout.setObjectName("horizontalLayout")
43 43
        self.gridLayout_5 = QtWidgets.QGridLayout()
44
        self.gridLayout_5.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
45 44
        self.gridLayout_5.setObjectName("gridLayout_5")
46 45
        self.penButton = QtWidgets.QPushButton(self.toolWidget)
47 46
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
......
178 177
        self.initZoomButton.setMaximumSize(QtCore.QSize(32, 32))
179 178
        self.initZoomButton.setObjectName("initZoomButton")
180 179
        self.gridLayout_5.addWidget(self.initZoomButton, 1, 6, 1, 1)
181
        self.removeTextButton = QtWidgets.QPushButton(self.toolWidget)
182
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
183
        sizePolicy.setHorizontalStretch(0)
184
        sizePolicy.setVerticalStretch(0)
185
        sizePolicy.setHeightForWidth(self.removeTextButton.sizePolicy().hasHeightForWidth())
186
        self.removeTextButton.setSizePolicy(sizePolicy)
187
        self.removeTextButton.setMinimumSize(QtCore.QSize(150, 32))
188
        self.removeTextButton.setMaximumSize(QtCore.QSize(16777215, 32))
189
        self.removeTextButton.setObjectName("removeTextButton")
190
        self.gridLayout_5.addWidget(self.removeTextButton, 0, 12, 1, 1)
191 180
        self.penWidthSpinBox = QtWidgets.QSpinBox(self.toolWidget)
192 181
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
193 182
        sizePolicy.setHorizontalStretch(0)
......
257 246
        self.areaEraserButton.setIconSize(QtCore.QSize(20, 20))
258 247
        self.areaEraserButton.setObjectName("areaEraserButton")
259 248
        self.gridLayout_5.addWidget(self.areaEraserButton, 0, 7, 1, 1)
260
        self.guidelineCheckbox = QtWidgets.QCheckBox(self.toolWidget)
261
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
262
        sizePolicy.setHorizontalStretch(0)
263
        sizePolicy.setVerticalStretch(0)
264
        sizePolicy.setHeightForWidth(self.guidelineCheckbox.sizePolicy().hasHeightForWidth())
265
        self.guidelineCheckbox.setSizePolicy(sizePolicy)
266
        self.guidelineCheckbox.setMinimumSize(QtCore.QSize(0, 32))
267
        self.guidelineCheckbox.setMaximumSize(QtCore.QSize(16777215, 32))
268
        self.guidelineCheckbox.setObjectName("guidelineCheckbox")
269
        self.gridLayout_5.addWidget(self.guidelineCheckbox, 1, 12, 1, 1)
270 249
        self.horizontalLayout.addLayout(self.gridLayout_5)
271 250
        self.gridLayout_6 = QtWidgets.QGridLayout()
272 251
        self.gridLayout_6.setObjectName("gridLayout_6")
......
313 292
        self.scrollArea.setWidgetResizable(True)
314 293
        self.scrollArea.setObjectName("scrollArea")
315 294
        self.scrollAreaWidgetContents = QtWidgets.QWidget()
316
        self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 478, 754))
295
        self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 478, 651))
317 296
        self.scrollAreaWidgetContents.setMinimumSize(QtCore.QSize(378, 0))
318 297
        self.scrollAreaWidgetContents.setMaximumSize(QtCore.QSize(16777215, 16777215))
319 298
        self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
......
326 305
        self.formLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
327 306
        self.formLayout.setContentsMargins(6, 6, 6, 6)
328 307
        self.formLayout.setObjectName("formLayout")
308
        self.imgFileNameLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
309
        font = QtGui.QFont()
310
        font.setBold(True)
311
        font.setWeight(75)
312
        self.imgFileNameLabel.setFont(font)
313
        self.imgFileNameLabel.setObjectName("imgFileNameLabel")
314
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.imgFileNameLabel)
315
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
316
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
317
        self.imageFileLineEdit = QtWidgets.QLineEdit(self.scrollAreaWidgetContents)
318
        self.imageFileLineEdit.setReadOnly(True)
319
        self.imageFileLineEdit.setObjectName("imageFileLineEdit")
320
        self.horizontalLayout_3.addWidget(self.imageFileLineEdit)
321
        self.openImageFileButton = QtWidgets.QPushButton(self.scrollAreaWidgetContents)
322
        self.openImageFileButton.setMinimumSize(QtCore.QSize(0, 0))
323
        self.openImageFileButton.setMaximumSize(QtCore.QSize(40, 16777215))
324
        self.openImageFileButton.setObjectName("openImageFileButton")
325
        self.horizontalLayout_3.addWidget(self.openImageFileButton)
326
        self.formLayout.setLayout(0, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout_3)
329 327
        self.nameLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
330 328
        font = QtGui.QFont()
331 329
        font.setBold(True)
332 330
        font.setWeight(75)
333 331
        self.nameLabel.setFont(font)
334 332
        self.nameLabel.setObjectName("nameLabel")
335
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.nameLabel)
333
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.nameLabel)
336 334
        self.nameLineEdit = QtWidgets.QLineEdit(self.scrollAreaWidgetContents)
337 335
        self.nameLineEdit.setObjectName("nameLineEdit")
338
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.nameLineEdit)
339
        self.thresholdLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
340
        font = QtGui.QFont()
341
        font.setBold(True)
342
        font.setWeight(75)
343
        self.thresholdLabel.setFont(font)
344
        self.thresholdLabel.setObjectName("thresholdLabel")
345
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.thresholdLabel)
346
        self.thresholdLineEdit = QtWidgets.QLineEdit(self.scrollAreaWidgetContents)
347
        self.thresholdLineEdit.setObjectName("thresholdLineEdit")
348
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.thresholdLineEdit)
349
        self.minMatchPointLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
350
        font = QtGui.QFont()
351
        font.setBold(True)
352
        font.setWeight(75)
353
        self.minMatchPointLabel.setFont(font)
354
        self.minMatchPointLabel.setObjectName("minMatchPointLabel")
355
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.minMatchPointLabel)
356
        self.minMatchPointLineEdit = QtWidgets.QLineEdit(self.scrollAreaWidgetContents)
357
        self.minMatchPointLineEdit.setObjectName("minMatchPointLineEdit")
358
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.minMatchPointLineEdit)
359
        self.rotationCountLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
360
        font = QtGui.QFont()
361
        font.setBold(True)
362
        font.setWeight(75)
363
        self.rotationCountLabel.setFont(font)
364
        self.rotationCountLabel.setObjectName("rotationCountLabel")
365
        self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.rotationCountLabel)
366
        self.rotationCountSpinBox = QtWidgets.QSpinBox(self.scrollAreaWidgetContents)
367
        self.rotationCountSpinBox.setMinimum(0)
368
        self.rotationCountSpinBox.setMaximum(3)
369
        self.rotationCountSpinBox.setProperty("value", 0)
370
        self.rotationCountSpinBox.setObjectName("rotationCountSpinBox")
371
        self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.rotationCountSpinBox)
372
        self.isContainChildLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
373
        font = QtGui.QFont()
374
        font.setBold(True)
375
        font.setWeight(75)
376
        self.isContainChildLabel.setFont(font)
377
        self.isContainChildLabel.setObjectName("isContainChildLabel")
378
        self.formLayout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.isContainChildLabel)
379
        self.isContainChildCheckBox = QtWidgets.QCheckBox(self.scrollAreaWidgetContents)
380
        self.isContainChildCheckBox.setText("")
381
        self.isContainChildCheckBox.setCheckable(True)
382
        self.isContainChildCheckBox.setObjectName("isContainChildCheckBox")
383
        self.formLayout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.isContainChildCheckBox)
336
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.nameLineEdit)
384 337
        self.typeLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
385 338
        font = QtGui.QFont()
386 339
        font.setBold(True)
387 340
        font.setWeight(75)
388 341
        self.typeLabel.setFont(font)
389 342
        self.typeLabel.setObjectName("typeLabel")
390
        self.formLayout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.typeLabel)
343
        self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.typeLabel)
391 344
        self.typeComboBox = QtWidgets.QComboBox(self.scrollAreaWidgetContents)
392 345
        self.typeComboBox.setObjectName("typeComboBox")
393
        self.formLayout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.typeComboBox)
394
        self.baseSymbolLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
395
        font = QtGui.QFont()
396
        font.setBold(True)
397
        font.setWeight(75)
398
        self.baseSymbolLabel.setFont(font)
399
        self.baseSymbolLabel.setObjectName("baseSymbolLabel")
400
        self.formLayout.setWidget(6, QtWidgets.QFormLayout.LabelRole, self.baseSymbolLabel)
401
        self.baseSymbolComboBox = QtWidgets.QComboBox(self.scrollAreaWidgetContents)
402
        self.baseSymbolComboBox.setObjectName("baseSymbolComboBox")
403
        self.formLayout.setWidget(6, QtWidgets.QFormLayout.FieldRole, self.baseSymbolComboBox)
404
        self.additionalSymbolLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
405
        font = QtGui.QFont()
406
        font.setBold(True)
407
        font.setWeight(75)
408
        self.additionalSymbolLabel.setFont(font)
409
        self.additionalSymbolLabel.setObjectName("additionalSymbolLabel")
410
        self.formLayout.setWidget(7, QtWidgets.QFormLayout.LabelRole, self.additionalSymbolLabel)
411
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
412
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
413
        self.spinBoxParent = QtWidgets.QSpinBox(self.scrollAreaWidgetContents)
414
        self.spinBoxParent.setMaximumSize(QtCore.QSize(50, 16777215))
415
        self.spinBoxParent.setMaximum(10)
416
        self.spinBoxParent.setObjectName("spinBoxParent")
417
        self.horizontalLayout_2.addWidget(self.spinBoxParent)
418
        self.defaultSymbolDirectionComboBox = QtWidgets.QComboBox(self.scrollAreaWidgetContents)
419
        self.defaultSymbolDirectionComboBox.setMaximumSize(QtCore.QSize(50, 16777215))
420
        self.defaultSymbolDirectionComboBox.setObjectName("defaultSymbolDirectionComboBox")
421
        self.horizontalLayout_2.addWidget(self.defaultSymbolDirectionComboBox)
422
        self.additionalSymbolComboBox = QtWidgets.QComboBox(self.scrollAreaWidgetContents)
423
        self.additionalSymbolComboBox.setObjectName("additionalSymbolComboBox")
424
        self.horizontalLayout_2.addWidget(self.additionalSymbolComboBox)
425
        self.addAdditionalSymbolButton = QtWidgets.QPushButton(self.scrollAreaWidgetContents)
426
        self.addAdditionalSymbolButton.setMaximumSize(QtCore.QSize(40, 16777215))
427
        self.addAdditionalSymbolButton.setObjectName("addAdditionalSymbolButton")
428
        self.horizontalLayout_2.addWidget(self.addAdditionalSymbolButton)
429
        self.formLayout.setLayout(7, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout_2)
430
        self.additionalSymbolListWidget = QtWidgets.QListWidget(self.scrollAreaWidgetContents)
431
        self.additionalSymbolListWidget.setObjectName("additionalSymbolListWidget")
432
        self.formLayout.setWidget(9, QtWidgets.QFormLayout.FieldRole, self.additionalSymbolListWidget)
346
        self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.typeComboBox)
433 347
        self.originalPointLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
434 348
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
435 349
        sizePolicy.setHorizontalStretch(0)
......
442 356
        self.originalPointLabel.setFont(font)
443 357
        self.originalPointLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
444 358
        self.originalPointLabel.setObjectName("originalPointLabel")
445
        self.formLayout.setWidget(10, QtWidgets.QFormLayout.LabelRole, self.originalPointLabel)
359
        self.formLayout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.originalPointLabel)
446 360
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
447 361
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
448 362
        self.originalPointLineEdit = QtWidgets.QLineEdit(self.scrollAreaWidgetContents)
......
453 367
        self.addOriginalPointButton.setMaximumSize(QtCore.QSize(40, 16777215))
454 368
        self.addOriginalPointButton.setObjectName("addOriginalPointButton")
455 369
        self.horizontalLayout_4.addWidget(self.addOriginalPointButton)
456
        self.formLayout.setLayout(10, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout_4)
370
        self.formLayout.setLayout(5, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout_4)
457 371
        self.connectionPointLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
458 372
        font = QtGui.QFont()
459 373
        font.setBold(True)
......
461 375
        self.connectionPointLabel.setFont(font)
462 376
        self.connectionPointLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
463 377
        self.connectionPointLabel.setObjectName("connectionPointLabel")
464
        self.formLayout.setWidget(13, QtWidgets.QFormLayout.LabelRole, self.connectionPointLabel)
378
        self.formLayout.setWidget(9, QtWidgets.QFormLayout.LabelRole, self.connectionPointLabel)
465 379
        self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
466 380
        self.horizontalLayout_6.setObjectName("horizontalLayout_6")
467 381
        self.connectionPointLineEdit = QtWidgets.QLineEdit(self.scrollAreaWidgetContents)
......
478 392
        self.pushButtonDelConnPt.setMaximumSize(QtCore.QSize(40, 16777215))
479 393
        self.pushButtonDelConnPt.setObjectName("pushButtonDelConnPt")
480 394
        self.horizontalLayout_6.addWidget(self.pushButtonDelConnPt)
481
        self.formLayout.setLayout(13, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout_6)
395
        self.formLayout.setLayout(9, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout_6)
482 396
        self.tableWidgetConnList = QtWidgets.QTableWidget(self.scrollAreaWidgetContents)
483 397
        self.tableWidgetConnList.setObjectName("tableWidgetConnList")
484 398
        self.tableWidgetConnList.setColumnCount(0)
485 399
        self.tableWidgetConnList.setRowCount(0)
486 400
        self.tableWidgetConnList.verticalHeader().setVisible(False)
487
        self.formLayout.setWidget(14, QtWidgets.QFormLayout.FieldRole, self.tableWidgetConnList)
488
        self.hasInstrumentLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
489
        font = QtGui.QFont()
490
        font.setBold(True)
491
        font.setWeight(75)
492
        self.hasInstrumentLabel.setFont(font)
493
        self.hasInstrumentLabel.setObjectName("hasInstrumentLabel")
494
        self.formLayout.setWidget(15, QtWidgets.QFormLayout.LabelRole, self.hasInstrumentLabel)
495
        self.hasInstrumentLabelCheckBox = QtWidgets.QCheckBox(self.scrollAreaWidgetContents)
496
        self.hasInstrumentLabelCheckBox.setText("")
497
        self.hasInstrumentLabelCheckBox.setObjectName("hasInstrumentLabelCheckBox")
498
        self.formLayout.setWidget(15, QtWidgets.QFormLayout.FieldRole, self.hasInstrumentLabelCheckBox)
499
        self.isExceptDetectLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
500
        font = QtGui.QFont()
501
        font.setBold(True)
502
        font.setWeight(75)
503
        self.isExceptDetectLabel.setFont(font)
504
        self.isExceptDetectLabel.setObjectName("isExceptDetectLabel")
505
        self.formLayout.setWidget(16, QtWidgets.QFormLayout.LabelRole, self.isExceptDetectLabel)
506
        self.isExceptDetectCheckBox = QtWidgets.QCheckBox(self.scrollAreaWidgetContents)
507
        self.isExceptDetectCheckBox.setText("")
508
        self.isExceptDetectCheckBox.setObjectName("isExceptDetectCheckBox")
509
        self.formLayout.setWidget(16, QtWidgets.QFormLayout.FieldRole, self.isExceptDetectCheckBox)
510
        self.immediateInsertLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
511
        font = QtGui.QFont()
512
        font.setBold(True)
513
        font.setWeight(75)
514
        self.immediateInsertLabel.setFont(font)
515
        self.immediateInsertLabel.setObjectName("immediateInsertLabel")
516
        self.formLayout.setWidget(17, QtWidgets.QFormLayout.LabelRole, self.immediateInsertLabel)
517
        self.immediateInsertCheckBox = QtWidgets.QCheckBox(self.scrollAreaWidgetContents)
518
        self.immediateInsertCheckBox.setText("")
519
        self.immediateInsertCheckBox.setObjectName("immediateInsertCheckBox")
520
        self.formLayout.setWidget(17, QtWidgets.QFormLayout.FieldRole, self.immediateInsertCheckBox)
521
        self.makeFlipLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
522
        font = QtGui.QFont()
523
        font.setBold(True)
524
        font.setWeight(75)
525
        self.makeFlipLabel.setFont(font)
526
        self.makeFlipLabel.setObjectName("makeFlipLabel")
527
        self.formLayout.setWidget(18, QtWidgets.QFormLayout.LabelRole, self.makeFlipLabel)
528
        self.makeFlipCheckBox = QtWidgets.QCheckBox(self.scrollAreaWidgetContents)
529
        self.makeFlipCheckBox.setText("")
530
        self.makeFlipCheckBox.setObjectName("makeFlipCheckBox")
531
        self.formLayout.setWidget(18, QtWidgets.QFormLayout.FieldRole, self.makeFlipCheckBox)
532
        self.label_3 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
533
        font = QtGui.QFont()
534
        font.setBold(True)
535
        font.setWeight(75)
536
        self.label_3.setFont(font)
537
        self.label_3.setObjectName("label_3")
538
        self.formLayout.setWidget(19, QtWidgets.QFormLayout.LabelRole, self.label_3)
539
        self.checkBoxChange = QtWidgets.QCheckBox(self.scrollAreaWidgetContents)
540
        self.checkBoxChange.setText("")
541
        self.checkBoxChange.setObjectName("checkBoxChange")
542
        self.formLayout.setWidget(19, QtWidgets.QFormLayout.FieldRole, self.checkBoxChange)
543
        self.label_4 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
544
        font = QtGui.QFont()
545
        font.setBold(True)
546
        font.setWeight(75)
547
        self.label_4.setFont(font)
548
        self.label_4.setObjectName("label_4")
549
        self.formLayout.setWidget(20, QtWidgets.QFormLayout.LabelRole, self.label_4)
550
        self.pushButtonChange = QtWidgets.QPushButton(self.scrollAreaWidgetContents)
551
        self.pushButtonChange.setObjectName("pushButtonChange")
552
        self.formLayout.setWidget(20, QtWidgets.QFormLayout.FieldRole, self.pushButtonChange)
401
        self.formLayout.setWidget(10, QtWidgets.QFormLayout.FieldRole, self.tableWidgetConnList)
553 402
        self.gridLayout_4.addLayout(self.formLayout, 0, 0, 1, 1)
554 403
        self.scrollArea.setWidget(self.scrollAreaWidgetContents)
555 404
        self.verticalLayout.addWidget(self.scrollArea)
......
571 420
        self.handButton.setText(_translate("Dialog", "Hand"))
572 421
        self.zoomButton.setText(_translate("Dialog", "Zoom"))
573 422
        self.initZoomButton.setText(_translate("Dialog", "Init Zoom"))
574
        self.removeTextButton.setText(_translate("Dialog", "Remove Text"))
575
        self.guidelineCheckbox.setText(_translate("Dialog", "Show Guideline"))
576 423
        self.label.setText(_translate("Dialog", "Normal Color :"))
577 424
        self.label_2.setText(_translate("Dialog", "Highlight Color :"))
425
        self.imgFileNameLabel.setText(_translate("Dialog", "Image File Name"))
426
        self.openImageFileButton.setText(_translate("Dialog", "Open"))
578 427
        self.nameLabel.setText(_translate("Dialog", "Symbol Name"))
579
        self.thresholdLabel.setText(_translate("Dialog", "Threshold(%)"))
580
        self.minMatchPointLabel.setText(_translate("Dialog", "Min Feature Count"))
581
        self.rotationCountLabel.setText(_translate("Dialog", "Rotation Count"))
582
        self.isContainChildLabel.setText(_translate("Dialog", "Include Child Symbol"))
583 428
        self.typeLabel.setText(_translate("Dialog", "Symbol Type"))
584
        self.baseSymbolLabel.setText(_translate("Dialog", "Base Symbol"))
585
        self.additionalSymbolLabel.setText(_translate("Dialog", "Addition Symbol"))
586
        self.addAdditionalSymbolButton.setText(_translate("Dialog", "Add"))
587 429
        self.originalPointLabel.setText(_translate("Dialog", "Original Point"))
588 430
        self.addOriginalPointButton.setText(_translate("Dialog", "Add"))
589 431
        self.connectionPointLabel.setText(_translate("Dialog", "Connection Point"))
590 432
        self.addConnectionPointButton.setText(_translate("Dialog", "Add"))
591 433
        self.pushButtonDelConnPt.setText(_translate("Dialog", "Del"))
592
        self.hasInstrumentLabel.setText(_translate("Dialog", "Include Ins\'t Label"))
593
        self.isExceptDetectLabel.setText(_translate("Dialog", "Exclude"))
594
        self.immediateInsertLabel.setText(_translate("Dialog", "Insert Symbol When Create"))
595
        self.makeFlipLabel.setText(_translate("Dialog", "Detect Flip"))
596
        self.label_3.setText(_translate("Dialog", "Change Base, Additional"))
597
        self.label_4.setText(_translate("Dialog", "Symbol Info on Drawing"))
598
        self.pushButtonChange.setText(_translate("Dialog", "Change Item on Drawing without DB Update"))
599 434

  
600 435
import MainWindow_rc
601

  
602
if __name__ == "__main__":
603
    import sys
604
    app = QtWidgets.QApplication(sys.argv)
605
    Dialog = QtWidgets.QDialog()
606
    ui = Ui_Dialog()
607
    ui.setupUi(Dialog)
608
    Dialog.show()
609
    sys.exit(app.exec_())
610

  
HYTOS/HYTOS/SymbolPropertyTableWidget.py
35 35
        self.setColumnCount(2)
36 36
        self.setHorizontalHeaderLabels(['Name', 'Value'])
37 37
        self.horizontalHeaderItem(0).setSizeHint(QSize(25, 25))
38
        self.setRowCount(12)
38
        self.setRowCount(4)
39 39
        self.verticalHeader().hide()
40 40
        self.horizontalHeader().setStretchLastSection(True)
41 41
        self.initTitleCell()
42 42

  
43
        ### Rotation Count SpinBox Init
44
        rotationCountSpinBox = QSpinBox()
45
        rotationCountSpinBox.setRange(0, 3)
46
        rotationCountSpinBox.setSingleStep(1)
47
        rotationCountSpinBox.setValue(0)
48
        rotationCountSpinBox.setEnabled(False)
49
        self.setCellWidget(3, 1, rotationCountSpinBox)
50

  
51
        ### IsContainChild CheckBox Init
52
        isContainChildCheckBox = QCheckBox()
53
        isContainChildCheckBox.setEnabled(False)
54
        self.setCellWidget(4, 1, isContainChildCheckBox)
55

  
56 43
        ### Symbol Type ComboBox Init
57 44
        symbolTypeComboBox = QComboBox()
58 45
        for symbolType in AppDocData.instance().getSymbolTypeComboBoxItems():
59 46
            symbolTypeComboBox.addItem(symbolType[2])
60 47
        symbolTypeComboBox.setEnabled(False)
61
        self.setCellWidget(5, 1, symbolTypeComboBox)
62

  
63
        ### Base Symbol ComboBox Init
64
        baseSymbolComboBox = QComboBox()
65
        for name in AppDocData.instance().getBaseSymbolComboBoxItems():
66
            baseSymbolComboBox.addItem(name)
67
        baseSymbolComboBox.setEnabled(False)
68
        self.setCellWidget(6, 1, baseSymbolComboBox)
69

  
70
        ### IsExceptDetect CheckBox Init
71
        isExceptDetectCheckBox = QCheckBox()
72
        isExceptDetectCheckBox.setEnabled(False)
73
        self.setCellWidget(10, 1, isExceptDetectCheckBox)
74

  
75
        ### hasInstrumentLabel CheckBox Init
76
        hasInstrumentLabelCheckBox = QCheckBox()
77
        hasInstrumentLabelCheckBox.setEnabled(False)
78
        self.setCellWidget(11, 1, hasInstrumentLabelCheckBox)
48
        self.setCellWidget(1, 1, symbolTypeComboBox)
79 49

  
80 50
    '''
81 51
        @brief  Init contents and background color in Title cell
82 52
    '''
53

  
83 54
    def initTitleCell(self):
84 55
        item1 = QTableWidgetItem(self.tr("Symbol Name"))
85 56
        item1.setFlags(Qt.ItemIsEnabled)
86 57
        self.setItem(0, 0, item1)
87 58

  
88
        item2 = QTableWidgetItem(self.tr("Threshold(%)"))
59
        item2 = QTableWidgetItem(self.tr("Symbol Type"))
89 60
        item2.setFlags(Qt.ItemIsEnabled)
90 61
        self.setItem(1, 0, item2)
91 62

  
92
        item3 = QTableWidgetItem(self.tr("Min Feature Count"))
63
        item3 = QTableWidgetItem(self.tr("Original Point"))
93 64
        item3.setFlags(Qt.ItemIsEnabled)
94 65
        self.setItem(2, 0, item3)
95 66

  
96
        item4 = QTableWidgetItem(self.tr("Rotation Count"))
67
        item4 = QTableWidgetItem(self.tr("Connection Point"))
97 68
        item4.setFlags(Qt.ItemIsEnabled)
98 69
        self.setItem(3, 0, item4)
99 70

  
100
        item5 = QTableWidgetItem(self.tr("Include Child Symbol"))
101
        item5.setFlags(Qt.ItemIsEnabled)
102
        self.setItem(4, 0, item5)
103

  
104
        item6 = QTableWidgetItem(self.tr("Symbol Type"))
105
        item6.setFlags(Qt.ItemIsEnabled)
106
        self.setItem(5, 0, item6)
107

  
108
        item7 = QTableWidgetItem(self.tr("Base Symbol"))
109
        item7.setFlags(Qt.ItemIsEnabled)
110
        self.setItem(6, 0, item7)
111

  
112
        item8 = QTableWidgetItem(self.tr("Additional Symbol"))
113
        item8.setFlags(Qt.ItemIsEnabled)
114
        self.setItem(7, 0, item8)
115

  
116
        item9 = QTableWidgetItem(self.tr("Original Point"))
117
        item9.setFlags(Qt.ItemIsEnabled)
118
        self.setItem(8, 0, item9)
119

  
120
        item10 = QTableWidgetItem(self.tr("Connection Point"))
121
        item10.setFlags(Qt.ItemIsEnabled)
122
        self.setItem(9, 0, item10)
123

  
124
        item11 = QTableWidgetItem(self.tr("Exclude"))
125
        item11.setFlags(Qt.ItemIsEnabled)
126
        self.setItem(10, 0, item11)
127

  
128
        item12 = QTableWidgetItem(self.tr("Has Ins't Label"))
129
        item12.setFlags(Qt.ItemIsEnabled)
130
        self.setItem(11, 0, item12)
131

  
132 71
        for index in range(self.rowCount()):
133 72
            self.item(index, 0).setBackground(QColor(220, 220, 220))
134 73

  
......
137 76
        retranslate ui
138 77
        """
139 78
        self.item(0,0).setText(self.tr("Symbol Name"))
140
        self.item(1,0).setText(self.tr("Threshold(%)"))
141
        self.item(2,0).setText(self.tr("Min Feature Count"))
142
        self.item(3,0).setText(self.tr("Rotation Count"))
143
        self.item(4,0).setText(self.tr("Include Child Symbol"))
144
        self.item(5,0).setText(self.tr("Symbol Type"))
145
        self.item(6,0).setText(self.tr("Base Symbol"))
146
        self.item(7,0).setText(self.tr("Additional Symbol"))
147
        self.item(8,0).setText(self.tr("Original Point"))
148
        self.item(9,0).setText(self.tr("Connection Point"))
149
        self.item(10,0).setText(self.tr("Exclude"))
150
        self.item(11,0).setText(self.tr("Has Ins't Label"))
79
        self.item(1,0).setText(self.tr("Symbol Type"))
80
        self.item(2,0).setText(self.tr("Original Point"))
81
        self.item(3,0).setText(self.tr("Connection Point"))
82
        
151 83

  
152 84
    def makeConnection(self, dirTreeWidget):
153 85
        dirTreeWidget.singleClicked.connect(self.getClickedSymbol)
......
167 99
        @history    18.04.24    Jeongwoo    Add 14th row(isExceptDetect CheckBox)
168 100
    '''
169 101
    def symbolChanged(self):
170
        if self.symData.baseSymbol is not None:
171
            #self.setItem(0, 1, QTableWidgetItem(str(self.symData.getId())))
172
            #self.setItem(0, 1, QTableWidgetItem(self.symData.getName()))
173
            #self.setItem(1, 1, QTableWidgetItem(str(int(self.symData.getThreshold() * 100))))
174
            #self.setItem(2, 1, QTableWidgetItem(str(self.symData.getMinMatchCount())))
175

  
102
        if self.symData.sType is not None:
176 103
            Symboldata = QTableWidgetItem(self.symData.getName())
177 104
            Symboldata.setFlags(Qt.ItemIsEnabled)
178 105
            self.setItem(0, 1, Symboldata)
179 106

  
180
            SymbolThreshold = QTableWidgetItem(str(self.symData.getThreshold() *100))
181
            SymbolThreshold.setFlags(Qt.ItemIsEnabled)
182
            self.setItem(1, 1, SymbolThreshold)
183

  
184
            SymbolMinMatchCount = QTableWidgetItem(str(self.symData.getMinMatchCount()))
185
            SymbolMinMatchCount.setFlags(Qt.ItemIsEnabled)
186
            self.setItem(2, 1, SymbolMinMatchCount)
187

  
188
            rotationCountSpinBox = self.cellWidget(3, 1)
189
            rotationCountSpinBox.setValue(self.symData.getRotationCount())
190

  
191
            isContainChildCheckBox = self.cellWidget(4, 1)
192
            isContainChildCheckBox.setChecked(True if self.symData.getIsContainChild() == 1 else False)
193

  
194
            symbolTypeComboBox = self.cellWidget(5, 1)
107
            symbolTypeComboBox = self.cellWidget(1, 1)
195 108
            symbolTypeComboBox.setCurrentIndex(symbolTypeComboBox.findText(self.symData.getType())) ##### USED FIND TEXT
196 109
            
197
            baseSymbolComboBox = self.cellWidget(6, 1)
198
            baseSymbolComboBox.clear()
199
            for name in AppDocData.instance().getBaseSymbolComboBoxItems(self.symData.getType()):
200
                baseSymbolComboBox.addItem(name)
201
            baseSymbolComboBox.setCurrentIndex(baseSymbolComboBox.findText(self.symData.getBaseSymbol())) ##### USED FIND TEXT
202

  
203
            additionalSymbolItem = QTableWidgetItem(self.symData.getAdditionalSymbol())
204
            additionalSymbolItem.setFlags(Qt.ItemIsEnabled)
205
            self.setItem(7, 1, additionalSymbolItem)
206

  
207 110
            originalPointItem = QTableWidgetItem(self.symData.getOriginalPoint())
208 111
            originalPointItem.setFlags(Qt.ItemIsEnabled)
209
            self.setItem(8, 1, originalPointItem)
112
            self.setItem(2, 1, originalPointItem)
210 113

  
211 114
            connectionPointItem = QTableWidgetItem(self.symData.getConnectionPoint())
212 115
            connectionPointItem.setFlags(Qt.ItemIsEnabled)
213
            self.setItem(9, 1, connectionPointItem)
116
            self.setItem(3, 1, connectionPointItem)
214 117
            
215
            isExceptDetectCheckBox = self.cellWidget(10, 1)
216
            isExceptDetectCheckBox.setChecked(True if self.symData.getIsExceptDetect() == 1 else False)
217

  
218
            hasInstrumentLabelCheckBox = self.cellWidget(11, 1)
219
            hasInstrumentLabelCheckBox.setChecked(True if self.symData.getHasInstrumentLabel() == 1 else False)
220

  
221 118
        else:
222
            #self.setItem(0,     1,   QTableWidgetItem(""))
223
            #self.setItem(0,     1,   QTableWidgetItem(""))
224
            #self.setItem(1,     1,   QTableWidgetItem(""))
225
            #self.setItem(2,     1,   QTableWidgetItem(""))
226

  
227 119
            item1 = QTableWidgetItem("")
228 120
            item1.setFlags(Qt.ItemIsEnabled)
229 121
            self.setItem(0, 1, item1)
230 122

  
231
            item2 = QTableWidgetItem("")
232
            item2.setFlags(Qt.ItemIsEnabled)
233
            self.setItem(1, 1, item2)
234

  
235
            item3 = QTableWidgetItem("")
236
            item3.setFlags(Qt.ItemIsEnabled)
237
            self.setItem(2, 1, item3)
238

  
239

  
240
            rotationCountSpinBox = self.cellWidget(3, 1)
241
            rotationCountSpinBox.setValue(0)
242

  
243
            isContainChildCheckBox = self.cellWidget(4, 1)
244
            isContainChildCheckBox.setChecked(False)
245

  
246
            symbolTypeComboBox = self.cellWidget(5, 1)
123
            symbolTypeComboBox = self.cellWidget(1, 1)
247 124
            symbolTypeComboBox.setCurrentIndex(0)
248 125

  
249
            baseSymbolComboBox = self.cellWidget(6, 1)
250
            baseSymbolComboBox.setCurrentIndex(0)
251

  
252
            additionalSymbolItem = QTableWidgetItem("")
253
            additionalSymbolItem.setFlags(Qt.ItemIsEnabled)
254
            self.setItem(7, 1, additionalSymbolItem)
255

  
256 126
            originalPointItem = QTableWidgetItem("")
257 127
            originalPointItem.setFlags(Qt.ItemIsEnabled)
258
            self.setItem(8, 1, originalPointItem)
128
            self.setItem(2, 1, originalPointItem)
259 129

  
260 130
            connectionPointItem = QTableWidgetItem("")
261 131
            connectionPointItem.setFlags(Qt.ItemIsEnabled)
262
            self.setItem(9, 1, connectionPointItem)
263
            
264
            isExceptDetectCheckBox = self.cellWidget(10, 1)
265
            isExceptDetectCheckBox.setChecked(False)
266

  
267
            hasInstrumentLabelCheckBox = self.cellWidget(11, 1)
268
            hasInstrumentLabelCheckBox.setChecked(False)
132
            self.setItem(3, 1, connectionPointItem)
HYTOS/HYTOS/UI/MainWindow.ui
103 103
    <property name="title">
104 104
     <string>Tool</string>
105 105
    </property>
106
    <addaction name="actionCreate_Symbol"/>
106 107
   </widget>
107 108
   <widget class="QMenu" name="menu_5">
108 109
    <property name="title">
......
183 184
         <item row="0" column="0">
184 185
          <layout class="QVBoxLayout" name="symbolTabVerticalLayout">
185 186
           <item>
186
            <layout class="QHBoxLayout" name="horizontalLayout_3">
187
             <item>
188
              <widget class="QPushButton" name="pushButtonCreateSymbol">
189
               <property name="maximumSize">
190
                <size>
191
                 <width>32</width>
192
                 <height>16777215</height>
193
                </size>
194
               </property>
195
               <property name="layoutDirection">
196
                <enum>Qt::LeftToRight</enum>
197
               </property>
198
               <property name="text">
199
                <string>Create</string>
200
               </property>
201
              </widget>
202
             </item>
203
             <item>
204
              <widget class="QPushButton" name="pushButtonDetectSymbol">
205
               <property name="maximumSize">
206
                <size>
207
                 <width>130</width>
208
                 <height>16777215</height>
209
                </size>
210
               </property>
211
               <property name="text">
212
                <string>Symbol Manager</string>
213
               </property>
214
              </widget>
215
             </item>
216
            </layout>
187
            <layout class="QHBoxLayout" name="horizontalLayout_3"/>
217 188
           </item>
218 189
          </layout>
219 190
         </item>
......
262 233
         <item row="0" column="0">
263 234
          <layout class="QVBoxLayout" name="verticalLayoutDrawingList">
264 235
           <item>
265
            <layout class="QHBoxLayout" name="horizontalLayout_4">
266
             <item>
267
              <widget class="QPushButton" name="pushButtonBatchRecognition">
268
               <property name="maximumSize">
269
                <size>
270
                 <width>80</width>
271
                 <height>16777215</height>
272
                </size>
273
               </property>
274
               <property name="text">
275
                <string>Batch Job</string>
276
               </property>
277
              </widget>
278
             </item>
279
             <item>
280
              <spacer name="horizontalSpacer_2">
281
               <property name="orientation">
282
                <enum>Qt::Horizontal</enum>
283
               </property>
284
               <property name="sizeHint" stdset="0">
285
                <size>
286
                 <width>40</width>
287
                 <height>20</height>
288
                </size>
289
               </property>
290
              </spacer>
291
             </item>
292
             <item>
293
              <widget class="QPushButton" name="pushButtonRefreshDrawings">
294
               <property name="text">
295
                <string>Refresh Drawing List</string>
296
               </property>
297
              </widget>
298
             </item>
299
            </layout>
300
           </item>
301
           <item>
302 236
            <widget class="QTreeWidget" name="treeWidgetDrawingList">
303 237
             <property name="editTriggers">
304 238
              <set>QAbstractItemView::NoEditTriggers</set>
......
987 921
    <string>Ctrl+N</string>
988 922
   </property>
989 923
  </action>
924
  <action name="actionCreate_Symbol">
925
   <property name="text">
926
    <string>Symbol Editor</string>
927
   </property>
928
  </action>
990 929
 </widget>
991 930
 <resources>
992 931
  <include location="../res/MainWindow.qrc"/>
HYTOS/HYTOS/UI/SymbolEditor.ui
7 7
    <x>0</x>
8 8
    <y>0</y>
9 9
    <width>1280</width>
10
    <height>823</height>
10
    <height>720</height>
11 11
   </rect>
12 12
  </property>
... 이 차이점은 표시할 수 있는 최대 줄수를 초과해서 이 차이점은 잘렸습니다.

내보내기 Unified diff

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