프로젝트

일반

사용자정보

개정판 cb374266

IDcb3742669af5ed5f0f3763ae686b6de88c19fa8b
상위 98e75f12
하위 4aab62a1

함의성이(가) 약 2년 전에 추가함

auto cad and manual

Change-Id: Ia95d3e42f4a885156716f15a28cbe1744fdc3d03

차이점 보기:

DTI_PID/DTI_PID/ImportTextFromCADDialog.py
305 305
        self.ui.checkBoxLegend.stateChanged.connect(self.legendStateChanged)
306 306
        self.ui.checkBoxAuto.stateChanged.connect(self.autoStateChanged)
307 307
        self.ui.pushButtonAutoMapping.clicked.connect(self.autoMapping)
308
        self.ui.pushButtonRefresh.clicked.connect(self.symbolRefesh)
308 309

  
309 310
        configs = app_doc_data.getConfigs('Cad State', 'Auto')
310 311
        self.ui.checkBoxAuto.setChecked(bool(int((configs[0].value)))) if 1 == len(configs) else \
......
374 375
            self.ui.lineEdit.setEnabled(True)
375 376
            self.ui.lineEdit_2.setEnabled(True)
376 377

  
378
    def symbolRefesh(self):
379
        self.on_load_symbol_mapping()
380

  
377 381
    def autoMapping(self):
378 382
        if not self._dwgs:
379 383
            QMessageBox.information(self, self.tr('Information'), self.tr('There is no selected file(s)'))
......
850 854
            self._symbol_types.sort()
851 855
            self._layer_names.sort()
852 856

  
857
            QMessageBox.information(self, self.tr('Information'), self.tr('Successfully loaded'))
858

  
853 859
            return self._symbol_types
854 860

  
855 861
    def on_save_mappings(self):
......
1045 1051
            QApplication.processEvents()
1046 1052

  
1047 1053
        mainWnd.progress_bar.setValue(mainWnd.progress_bar.maximum())
1054
        QMessageBox.information(self, self.tr('Information'), self.tr('Symbol creation complete. Please click "Symbol Refresh" Button'))
1048 1055

  
1049 1056
    def get_contents_size_from_image(self, img_file_path: str) -> list:
1050 1057
        """get actual size of image from image file"""
DTI_PID/DTI_PID/ImportTextFromCAD_UI.py
26 26
        self.verticalLayout.setObjectName("verticalLayout")
27 27
        self.gridLayout = QtWidgets.QGridLayout()
28 28
        self.gridLayout.setObjectName("gridLayout")
29
        self.toolButtonCAD = QtWidgets.QToolButton(ImportTextFromCADDialog)
30
        self.toolButtonCAD.setText("")
31
        icon = QtGui.QIcon()
32
        icon.addPixmap(QtGui.QPixmap(":/newPrefix/File.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
33
        self.toolButtonCAD.setIcon(icon)
34
        self.toolButtonCAD.setObjectName("toolButtonCAD")
35
        self.gridLayout.addWidget(self.toolButtonCAD, 0, 4, 1, 1)
29 36
        self.label_7 = QtWidgets.QLabel(ImportTextFromCADDialog)
30 37
        self.label_7.setObjectName("label_7")
31 38
        self.gridLayout.addWidget(self.label_7, 10, 0, 1, 1)
32 39
        self.listViewExcludeLayers = QtWidgets.QListView(ImportTextFromCADDialog)
33 40
        self.listViewExcludeLayers.setObjectName("listViewExcludeLayers")
34 41
        self.gridLayout.addWidget(self.listViewExcludeLayers, 10, 1, 1, 3)
35
        self.label_6 = QtWidgets.QLabel(ImportTextFromCADDialog)
36
        self.label_6.setObjectName("label_6")
37
        self.gridLayout.addWidget(self.label_6, 9, 0, 1, 1)
38
        self.pushButtonClose = QtWidgets.QPushButton(ImportTextFromCADDialog)
39
        icon = QtGui.QIcon()
40
        icon.addPixmap(QtGui.QPixmap(":/newPrefix/Remove.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
41
        self.pushButtonClose.setIcon(icon)
42
        self.pushButtonClose.setObjectName("pushButtonClose")
43
        self.gridLayout.addWidget(self.pushButtonClose, 12, 3, 1, 1)
44 42
        self.lineEdit_2 = QtWidgets.QLineEdit(ImportTextFromCADDialog)
45 43
        self.lineEdit_2.setObjectName("lineEdit_2")
46 44
        self.gridLayout.addWidget(self.lineEdit_2, 8, 1, 1, 2)
45
        self.lineEditCAD = QtWidgets.QLineEdit(ImportTextFromCADDialog)
46
        self.lineEditCAD.setObjectName("lineEditCAD")
47
        self.gridLayout.addWidget(self.lineEditCAD, 0, 1, 1, 3)
48
        self.pushButtonSave = QtWidgets.QPushButton(ImportTextFromCADDialog)
49
        icon1 = QtGui.QIcon()
50
        icon1.addPixmap(QtGui.QPixmap(":/newPrefix/Save.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
51
        self.pushButtonSave.setIcon(icon1)
52
        self.pushButtonSave.setObjectName("pushButtonSave")
53
        self.gridLayout.addWidget(self.pushButtonSave, 11, 1, 1, 3)
54
        self.pushButtonClose = QtWidgets.QPushButton(ImportTextFromCADDialog)
55
        icon2 = QtGui.QIcon()
56
        icon2.addPixmap(QtGui.QPixmap(":/newPrefix/Remove.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
57
        self.pushButtonClose.setIcon(icon2)
58
        self.pushButtonClose.setObjectName("pushButtonClose")
59
        self.gridLayout.addWidget(self.pushButtonClose, 12, 3, 1, 1)
60
        self.label_6 = QtWidgets.QLabel(ImportTextFromCADDialog)
61
        self.label_6.setObjectName("label_6")
62
        self.gridLayout.addWidget(self.label_6, 9, 0, 1, 1)
47 63
        self.label_4 = QtWidgets.QLabel(ImportTextFromCADDialog)
48 64
        self.label_4.setObjectName("label_4")
49 65
        self.gridLayout.addWidget(self.label_4, 7, 0, 1, 1)
50
        self.pushButtonImport = QtWidgets.QPushButton(ImportTextFromCADDialog)
51
        icon1 = QtGui.QIcon()
52
        icon1.addPixmap(QtGui.QPixmap(":/newPrefix/OK.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
53
        self.pushButtonImport.setIcon(icon1)
54
        self.pushButtonImport.setObjectName("pushButtonImport")
55
        self.gridLayout.addWidget(self.pushButtonImport, 12, 2, 1, 1)
56 66
        self.doubleSpinBox = QtWidgets.QDoubleSpinBox(ImportTextFromCADDialog)
57 67
        self.doubleSpinBox.setDecimals(6)
58 68
        self.doubleSpinBox.setMaximum(9999.9999)
59 69
        self.doubleSpinBox.setObjectName("doubleSpinBox")
60 70
        self.gridLayout.addWidget(self.doubleSpinBox, 9, 1, 1, 1)
71
        self.pushButtonImport = QtWidgets.QPushButton(ImportTextFromCADDialog)
72
        icon3 = QtGui.QIcon()
73
        icon3.addPixmap(QtGui.QPixmap(":/newPrefix/OK.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
74
        self.pushButtonImport.setIcon(icon3)
75
        self.pushButtonImport.setObjectName("pushButtonImport")
76
        self.gridLayout.addWidget(self.pushButtonImport, 12, 2, 1, 1)
61 77
        self.spinBoxY = QtWidgets.QSpinBox(ImportTextFromCADDialog)
62 78
        self.spinBoxY.setMinimum(-50000)
63 79
        self.spinBoxY.setMaximum(50000)
64 80
        self.spinBoxY.setObjectName("spinBoxY")
65 81
        self.gridLayout.addWidget(self.spinBoxY, 4, 2, 1, 1)
66
        self.lineEditCAD = QtWidgets.QLineEdit(ImportTextFromCADDialog)
67
        self.lineEditCAD.setObjectName("lineEditCAD")
68
        self.gridLayout.addWidget(self.lineEditCAD, 0, 1, 1, 3)
69
        self.pushButtonSave = QtWidgets.QPushButton(ImportTextFromCADDialog)
70
        icon2 = QtGui.QIcon()
71
        icon2.addPixmap(QtGui.QPixmap(":/newPrefix/Save.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
72
        self.pushButtonSave.setIcon(icon2)
73
        self.pushButtonSave.setObjectName("pushButtonSave")
74
        self.gridLayout.addWidget(self.pushButtonSave, 11, 1, 1, 3)
75
        self.toolButtonCAD = QtWidgets.QToolButton(ImportTextFromCADDialog)
76
        self.toolButtonCAD.setText("")
77
        icon3 = QtGui.QIcon()
78
        icon3.addPixmap(QtGui.QPixmap(":/newPrefix/File.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
79
        self.toolButtonCAD.setIcon(icon3)
80
        self.toolButtonCAD.setObjectName("toolButtonCAD")
81
        self.gridLayout.addWidget(self.toolButtonCAD, 0, 4, 1, 1)
82
        self.label_3 = QtWidgets.QLabel(ImportTextFromCADDialog)
83
        self.label_3.setObjectName("label_3")
84
        self.gridLayout.addWidget(self.label_3, 5, 0, 1, 1)
85
        self.label = QtWidgets.QLabel(ImportTextFromCADDialog)
86
        self.label.setObjectName("label")
87
        self.gridLayout.addWidget(self.label, 4, 0, 1, 1)
88
        self.spinBoxX = QtWidgets.QSpinBox(ImportTextFromCADDialog)
89
        self.spinBoxX.setMinimumSize(QtCore.QSize(0, 0))
90
        self.spinBoxX.setMinimum(-50000)
91
        self.spinBoxX.setMaximum(50000)
92
        self.spinBoxX.setObjectName("spinBoxX")
93
        self.gridLayout.addWidget(self.spinBoxX, 4, 1, 1, 1)
94
        self.pushButtonAutoMapping = QtWidgets.QPushButton(ImportTextFromCADDialog)
95
        self.pushButtonAutoMapping.setObjectName("pushButtonAutoMapping")
96
        self.gridLayout.addWidget(self.pushButtonAutoMapping, 8, 3, 1, 1)
82 97
        self.tabWidgetEntities = QtWidgets.QTabWidget(ImportTextFromCADDialog)
83 98
        self.tabWidgetEntities.setObjectName("tabWidgetEntities")
84 99
        self.tabLineTypes = QtWidgets.QWidget()
......
98 113
        self.gridLayout_3.addWidget(self.treeViewSymbolMapping, 0, 0, 1, 1)
99 114
        self.tabWidgetEntities.addTab(self.tabSymbols, "")
100 115
        self.gridLayout.addWidget(self.tabWidgetEntities, 2, 0, 1, 4)
101
        self.pushButtonAutoMapping = QtWidgets.QPushButton(ImportTextFromCADDialog)
102
        self.pushButtonAutoMapping.setObjectName("pushButtonAutoMapping")
103
        self.gridLayout.addWidget(self.pushButtonAutoMapping, 8, 3, 1, 1)
104 116
        self.checkBoxAuto = QtWidgets.QCheckBox(ImportTextFromCADDialog)
105 117
        self.checkBoxAuto.setObjectName("checkBoxAuto")
106 118
        self.gridLayout.addWidget(self.checkBoxAuto, 9, 3, 1, 1)
107
        self.label_3 = QtWidgets.QLabel(ImportTextFromCADDialog)
108
        self.label_3.setObjectName("label_3")
109
        self.gridLayout.addWidget(self.label_3, 5, 0, 1, 1)
110
        self.label = QtWidgets.QLabel(ImportTextFromCADDialog)
111
        self.label.setObjectName("label")
112
        self.gridLayout.addWidget(self.label, 4, 0, 1, 1)
113
        self.spinBoxX = QtWidgets.QSpinBox(ImportTextFromCADDialog)
114
        self.spinBoxX.setMinimumSize(QtCore.QSize(0, 0))
115
        self.spinBoxX.setMinimum(-50000)
116
        self.spinBoxX.setMaximum(50000)
117
        self.spinBoxX.setObjectName("spinBoxX")
118
        self.gridLayout.addWidget(self.spinBoxX, 4, 1, 1, 1)
119
        self.spinBoxSymbolY = QtWidgets.QSpinBox(ImportTextFromCADDialog)
120
        self.spinBoxSymbolY.setMinimum(-50000)
121
        self.spinBoxSymbolY.setMaximum(50000)
122
        self.spinBoxSymbolY.setObjectName("spinBoxSymbolY")
123
        self.gridLayout.addWidget(self.spinBoxSymbolY, 6, 2, 1, 1)
119
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
120
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
121
        self.label_2 = QtWidgets.QLabel(ImportTextFromCADDialog)
122
        self.label_2.setObjectName("label_2")
123
        self.horizontalLayout_3.addWidget(self.label_2)
124
        self.checkBoxGenDrawing = QtWidgets.QCheckBox(ImportTextFromCADDialog)
125
        self.checkBoxGenDrawing.setChecked(True)
126
        self.checkBoxGenDrawing.setObjectName("checkBoxGenDrawing")
127
        self.horizontalLayout_3.addWidget(self.checkBoxGenDrawing)
128
        self.gridLayout.addLayout(self.horizontalLayout_3, 0, 0, 1, 1)
129
        self.doubleSpinBox_2 = QtWidgets.QDoubleSpinBox(ImportTextFromCADDialog)
130
        self.doubleSpinBox_2.setDecimals(6)
131
        self.doubleSpinBox_2.setMaximum(9999.9999)
132
        self.doubleSpinBox_2.setObjectName("doubleSpinBox_2")
133
        self.gridLayout.addWidget(self.doubleSpinBox_2, 9, 2, 1, 1)
134
        self.label_8 = QtWidgets.QLabel(ImportTextFromCADDialog)
135
        self.label_8.setObjectName("label_8")
136
        self.gridLayout.addWidget(self.label_8, 6, 0, 1, 1)
124 137
        self.spinBoxSymbolX = QtWidgets.QSpinBox(ImportTextFromCADDialog)
125 138
        self.spinBoxSymbolX.setMinimum(-50000)
126 139
        self.spinBoxSymbolX.setMaximum(50000)
127 140
        self.spinBoxSymbolX.setObjectName("spinBoxSymbolX")
128 141
        self.gridLayout.addWidget(self.spinBoxSymbolX, 6, 1, 1, 1)
142
        self.label_5 = QtWidgets.QLabel(ImportTextFromCADDialog)
143
        self.label_5.setObjectName("label_5")
144
        self.gridLayout.addWidget(self.label_5, 8, 0, 1, 1)
145
        self.spinBoxSymbolY = QtWidgets.QSpinBox(ImportTextFromCADDialog)
146
        self.spinBoxSymbolY.setMinimum(-50000)
147
        self.spinBoxSymbolY.setMaximum(50000)
148
        self.spinBoxSymbolY.setObjectName("spinBoxSymbolY")
149
        self.gridLayout.addWidget(self.spinBoxSymbolY, 6, 2, 1, 1)
129 150
        self.pushButtonAuto = QtWidgets.QPushButton(ImportTextFromCADDialog)
130 151
        self.pushButtonAuto.setObjectName("pushButtonAuto")
131 152
        self.gridLayout.addWidget(self.pushButtonAuto, 7, 3, 1, 1)
......
146 167
        self.doubleSpinBoxScale.setObjectName("doubleSpinBoxScale")
147 168
        self.horizontalLayout.addWidget(self.doubleSpinBoxScale)
148 169
        self.gridLayout.addLayout(self.horizontalLayout, 5, 1, 1, 3)
149
        self.label_8 = QtWidgets.QLabel(ImportTextFromCADDialog)
150
        self.label_8.setObjectName("label_8")
151
        self.gridLayout.addWidget(self.label_8, 6, 0, 1, 1)
152 170
        self.lineEdit = QtWidgets.QLineEdit(ImportTextFromCADDialog)
153 171
        self.lineEdit.setObjectName("lineEdit")
154 172
        self.gridLayout.addWidget(self.lineEdit, 7, 1, 1, 2)
155
        self.label_5 = QtWidgets.QLabel(ImportTextFromCADDialog)
156
        self.label_5.setObjectName("label_5")
157
        self.gridLayout.addWidget(self.label_5, 8, 0, 1, 1)
158
        self.doubleSpinBox_2 = QtWidgets.QDoubleSpinBox(ImportTextFromCADDialog)
159
        self.doubleSpinBox_2.setDecimals(6)
160
        self.doubleSpinBox_2.setMaximum(9999.9999)
161
        self.doubleSpinBox_2.setObjectName("doubleSpinBox_2")
162
        self.gridLayout.addWidget(self.doubleSpinBox_2, 9, 2, 1, 1)
163 173
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
164 174
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
165 175
        self.checkBoxLine = QtWidgets.QCheckBox(ImportTextFromCADDialog)
......
178 188
        self.checkBoxLegend.setObjectName("checkBoxLegend")
179 189
        self.horizontalLayout_2.addWidget(self.checkBoxLegend)
180 190
        self.gridLayout.addLayout(self.horizontalLayout_2, 12, 0, 1, 2)
181
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
182
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
183
        self.label_2 = QtWidgets.QLabel(ImportTextFromCADDialog)
184
        self.label_2.setObjectName("label_2")
185
        self.horizontalLayout_3.addWidget(self.label_2)
186
        self.checkBoxGenDrawing = QtWidgets.QCheckBox(ImportTextFromCADDialog)
187
        self.checkBoxGenDrawing.setChecked(True)
188
        self.checkBoxGenDrawing.setObjectName("checkBoxGenDrawing")
189
        self.horizontalLayout_3.addWidget(self.checkBoxGenDrawing)
190
        self.gridLayout.addLayout(self.horizontalLayout_3, 0, 0, 1, 1)
191
        self.pushButtonRefresh = QtWidgets.QPushButton(ImportTextFromCADDialog)
192
        self.pushButtonRefresh.setObjectName("pushButtonRefresh")
193
        self.gridLayout.addWidget(self.pushButtonRefresh, 6, 3, 1, 1)
191 194
        self.verticalLayout.addLayout(self.gridLayout)
192 195
        self.errorLabel = QtWidgets.QLabel(ImportTextFromCADDialog)
193 196
        self.errorLabel.setMaximumSize(QtCore.QSize(16777215, 0))
......
232 235
        _translate = QtCore.QCoreApplication.translate
233 236
        ImportTextFromCADDialog.setWindowTitle(_translate("ImportTextFromCADDialog", "Import AutoCAD"))
234 237
        self.label_7.setText(_translate("ImportTextFromCADDialog", "Exclude Layers"))
235
        self.label_6.setText(_translate("ImportTextFromCADDialog", "Scale :"))
238
        self.lineEditCAD.setPlaceholderText(_translate("ImportTextFromCADDialog", "Select AutoCAD File(s)"))
239
        self.pushButtonSave.setText(_translate("ImportTextFromCADDialog", "Save Mapping"))
236 240
        self.pushButtonClose.setText(_translate("ImportTextFromCADDialog", "Close"))
241
        self.label_6.setText(_translate("ImportTextFromCADDialog", "Scale :"))
237 242
        self.label_4.setText(_translate("ImportTextFromCADDialog", "Search Text 1(Line No.) :"))
238 243
        self.pushButtonImport.setToolTip(_translate("ImportTextFromCADDialog", "Only horizontal and vertical lines"))
239 244
        self.pushButtonImport.setText(_translate("ImportTextFromCADDialog", "Import"))
240
        self.lineEditCAD.setPlaceholderText(_translate("ImportTextFromCADDialog", "Select AutoCAD File(s)"))
241
        self.pushButtonSave.setText(_translate("ImportTextFromCADDialog", "Save Mapping"))
245
        self.label_3.setText(_translate("ImportTextFromCADDialog", "Text Offset(x, y, scale) : "))
246
        self.label.setText(_translate("ImportTextFromCADDialog", "Line Offset(x, y) : "))
247
        self.pushButtonAutoMapping.setText(_translate("ImportTextFromCADDialog", "Symbol Auto Mapping"))
242 248
        self.tabWidgetEntities.setTabText(self.tabWidgetEntities.indexOf(self.tabLineTypes), _translate("ImportTextFromCADDialog", "Line Types"))
243 249
        self.tabWidgetEntities.setTabText(self.tabWidgetEntities.indexOf(self.tabSymbols), _translate("ImportTextFromCADDialog", "Symbols"))
244
        self.pushButtonAutoMapping.setText(_translate("ImportTextFromCADDialog", "Auto Mapping"))
245 250
        self.checkBoxAuto.setText(_translate("ImportTextFromCADDialog", "Auto Offset, Scale"))
246
        self.label_3.setText(_translate("ImportTextFromCADDialog", "Text Offset(x, y, scale) : "))
247
        self.label.setText(_translate("ImportTextFromCADDialog", "Line Offset(x, y) : "))
248
        self.pushButtonAuto.setText(_translate("ImportTextFromCADDialog", "Auto Cal."))
251
        self.label_2.setText(_translate("ImportTextFromCADDialog", "AutoCAD Files : "))
252
        self.checkBoxGenDrawing.setText(_translate("ImportTextFromCADDialog", "Gen. Drawing"))
249 253
        self.label_8.setText(_translate("ImportTextFromCADDialog", "Symbol Offset(x, y) : "))
250 254
        self.label_5.setText(_translate("ImportTextFromCADDialog", "Search Text 2(Line No.) :"))
255
        self.pushButtonAuto.setText(_translate("ImportTextFromCADDialog", "Auto Cal."))
251 256
        self.checkBoxLine.setText(_translate("ImportTextFromCADDialog", "Line"))
252 257
        self.checkBoxText.setText(_translate("ImportTextFromCADDialog", "Text"))
253 258
        self.checkBoxSymbol.setText(_translate("ImportTextFromCADDialog", "Symbol"))
254 259
        self.checkBoxLegend.setText(_translate("ImportTextFromCADDialog", "Legend"))
255
        self.label_2.setText(_translate("ImportTextFromCADDialog", "AutoCAD Files : "))
256
        self.checkBoxGenDrawing.setText(_translate("ImportTextFromCADDialog", "Gen. Drawing"))
260
        self.pushButtonRefresh.setText(_translate("ImportTextFromCADDialog", "Symbol Refresh"))
257 261
import MainWindow_rc
258 262

  
259 263

  
DTI_PID/DTI_PID/MainWindow.py
661 661
            count = drawing_top.childCount()
662 662
            for idx in range(count):
663 663
                child = drawing_top.child(idx)
664
                child.setCheckState(column, Qt.Unchecked)
664
                child.setCheckState(0, Qt.Unchecked)
665 665
            # up to here
666 666

  
667 667
            drawing.image = None
668 668
            self.open_image_drawing(drawing)
669
            item.setCheckState(column, Qt.Checked)
669
            item.setCheckState(0, Qt.Checked)
670 670

  
671 671
    def show_detect_symbol_dialog(self):
672 672
        from DetectSymbolDialog import QDetectSymbolDialog
DTI_PID/DTI_PID/SymbolRegiDataListDialog.py
64 64
        row = 0
65 65
        for key, symbolInfo in self.symbolInfos.items():
66 66
            imageWidget = QTableWidgetItem()
67
            symbolImage = self.image.copy(round(symbolInfo[2][0]), round(symbolInfo[2][1]), math.ceil(symbolInfo[3] + 2), math.ceil(symbolInfo[4] + 1))
67
            symbolImage = self.image.copy(round(symbolInfo[2][0]) - 1, round(symbolInfo[2][1]), math.ceil(symbolInfo[3] + 2), math.ceil(symbolInfo[4] + 1))
68 68
            
69 69
            symbolImage = symbolImage.scaled(500, 60, Qt.KeepAspectRatio, Qt.SmoothTransformation)
70 70
            imageWidget.setData(Qt.DecorationRole, symbolImage)
......
121 121
    def pushButtonCreateAllClicked(self):
122 122
        targets = []
123 123
        for row in range(self.ui.tableWidget.rowCount()):
124
            if self.ui.tableWidget.cellWidget(row, 2).isEnabled() and int(self.ui.tableWidget.cellWidget(row, 2).checkState()) is int(Qt.Checked):
124
            if self.ui.tableWidget.cellWidget(row, 3).isEnabled() and int(self.ui.tableWidget.cellWidget(row, 3).checkState()) is int(Qt.Checked):
125 125
                targets.append([self.ui.tableWidget.item(row, 1).tag, row])
126 126

  
127 127
        for symbolItem, row in targets:
128 128
            try:
129
                symbolEditorDialog = QSymbolEditorDialog(self, self.image.copy(round(symbolItem[2][0]), round(symbolItem[2][1]), \
129
                symbolEditorDialog = QSymbolEditorDialog(self, self.image.copy(round(symbolItem[2][0]) - 1, round(symbolItem[2][1]), \
130 130
                                                            math.ceil(symbolItem[3] + 2), math.ceil(symbolItem[4] + 1)), \
131 131
                                                            AppDocData.instance().getCurrentProject(), symbolItem[1], False)
132 132
                symbolEditorDialog.accept()
133 133

  
134
                self.ui.tableWidget.cellWidget(row, 2).setCheckState(Qt.Unchecked)
135
                self.ui.tableWidget.cellWidget(row, 2).setEnabled(False)
134
                self.ui.tableWidget.cellWidget(row, 3).setCheckState(Qt.Unchecked)
135
                self.ui.tableWidget.cellWidget(row, 3).setEnabled(False)
136 136

  
137 137
                self.isAccepted = True
138 138
            except Exception as ex:
139 139
                from App import App
140 140
                from AppDocData import MessageType
141 141
                message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
142
                                                            sys.exc_info()[-1].tb_lineno + ' Name : ' + symbolItem.getName())
142
                                                            sys.exc_info()[-1].tb_lineno + ' Name : ' + symbolItem[0])
143 143
                App.mainWnd().addMessage.emit(MessageType.Error, message)
144 144

  
145 145
        QMessageBox.information(self, self.tr('Information'), self.tr('Symbol creation finished'))
......
152 152
            col = 1
153 153
            symbolItem = self.ui.tableWidget.item(row, col).tag
154 154

  
155
            symbolEditorDialog = QSymbolEditorDialog(self, self.image.copy(round(symbolItem[2][0]), round(symbolItem[2][1]), \
155
            symbolEditorDialog = QSymbolEditorDialog(self, self.image.copy(round(symbolItem[2][0]) - 1, round(symbolItem[2][1]), \
156 156
                                                        math.ceil(symbolItem[3] + 2), math.ceil(symbolItem[4] + 1)), \
157 157
                                                        AppDocData.instance().getCurrentProject(), symbolItem[1], False)
158 158
            (isAccepted, _, _, _, _) = symbolEditorDialog.showDialog()
DTI_PID/DTI_PID/UI/ImportTextFromCAD.ui
35 35
  <layout class="QVBoxLayout" name="verticalLayout">
36 36
   <item>
37 37
    <layout class="QGridLayout" name="gridLayout">
38
     <item row="0" column="4">
39
      <widget class="QToolButton" name="toolButtonCAD">
40
       <property name="text">
41
        <string/>
42
       </property>
43
       <property name="icon">
44
        <iconset resource="../res/MainWindow.qrc">
45
         <normaloff>:/newPrefix/File.svg</normaloff>:/newPrefix/File.svg</iconset>
46
       </property>
47
      </widget>
48
     </item>
38 49
     <item row="10" column="0">
39 50
      <widget class="QLabel" name="label_7">
40 51
       <property name="text">
......
45 56
     <item row="10" column="1" colspan="3">
46 57
      <widget class="QListView" name="listViewExcludeLayers"/>
47 58
     </item>
48
     <item row="9" column="0">
49
      <widget class="QLabel" name="label_6">
59
     <item row="8" column="1" colspan="2">
60
      <widget class="QLineEdit" name="lineEdit_2"/>
61
     </item>
62
     <item row="0" column="1" colspan="3">
63
      <widget class="QLineEdit" name="lineEditCAD">
64
       <property name="placeholderText">
65
        <string>Select AutoCAD File(s)</string>
66
       </property>
67
      </widget>
68
     </item>
69
     <item row="11" column="1" colspan="3">
70
      <widget class="QPushButton" name="pushButtonSave">
50 71
       <property name="text">
51
        <string>Scale :</string>
72
        <string>Save Mapping</string>
73
       </property>
74
       <property name="icon">
75
        <iconset resource="../res/MainWindow.qrc">
76
         <normaloff>:/newPrefix/Save.svg</normaloff>:/newPrefix/Save.svg</iconset>
52 77
       </property>
53 78
      </widget>
54 79
     </item>
......
63 88
       </property>
64 89
      </widget>
65 90
     </item>
66
     <item row="8" column="1" colspan="2">
67
      <widget class="QLineEdit" name="lineEdit_2"/>
91
     <item row="9" column="0">
92
      <widget class="QLabel" name="label_6">
93
       <property name="text">
94
        <string>Scale :</string>
95
       </property>
96
      </widget>
68 97
     </item>
69 98
     <item row="7" column="0">
70 99
      <widget class="QLabel" name="label_4">
......
73 102
       </property>
74 103
      </widget>
75 104
     </item>
105
     <item row="9" column="1">
106
      <widget class="QDoubleSpinBox" name="doubleSpinBox">
107
       <property name="decimals">
108
        <number>6</number>
109
       </property>
110
       <property name="maximum">
111
        <double>9999.999900000000707</double>
112
       </property>
113
      </widget>
114
     </item>
76 115
     <item row="12" column="2">
77 116
      <widget class="QPushButton" name="pushButtonImport">
78 117
       <property name="toolTip">
......
87 126
       </property>
88 127
      </widget>
89 128
     </item>
90
     <item row="9" column="1">
91
      <widget class="QDoubleSpinBox" name="doubleSpinBox">
92
       <property name="decimals">
93
        <number>6</number>
94
       </property>
95
       <property name="maximum">
96
        <double>9999.999900000000707</double>
97
       </property>
98
      </widget>
99
     </item>
100 129
     <item row="4" column="2">
101 130
      <widget class="QSpinBox" name="spinBoxY">
102 131
       <property name="minimum">
......
107 136
       </property>
108 137
      </widget>
109 138
     </item>
110
     <item row="0" column="1" colspan="3">
111
      <widget class="QLineEdit" name="lineEditCAD">
112
       <property name="placeholderText">
113
        <string>Select AutoCAD File(s)</string>
139
     <item row="5" column="0">
140
      <widget class="QLabel" name="label_3">
141
       <property name="text">
142
        <string>Text Offset(x, y, scale) : </string>
114 143
       </property>
115 144
      </widget>
116 145
     </item>
117
     <item row="11" column="1" colspan="3">
118
      <widget class="QPushButton" name="pushButtonSave">
146
     <item row="4" column="0">
147
      <widget class="QLabel" name="label">
119 148
       <property name="text">
120
        <string>Save Mapping</string>
149
        <string>Line Offset(x, y) : </string>
121 150
       </property>
122
       <property name="icon">
123
        <iconset resource="../res/MainWindow.qrc">
124
         <normaloff>:/newPrefix/Save.svg</normaloff>:/newPrefix/Save.svg</iconset>
151
      </widget>
152
     </item>
153
     <item row="4" column="1">
154
      <widget class="QSpinBox" name="spinBoxX">
155
       <property name="minimumSize">
156
        <size>
157
         <width>0</width>
158
         <height>0</height>
159
        </size>
160
       </property>
161
       <property name="minimum">
162
        <number>-50000</number>
163
       </property>
164
       <property name="maximum">
165
        <number>50000</number>
125 166
       </property>
126 167
      </widget>
127 168
     </item>
128
     <item row="0" column="4">
129
      <widget class="QToolButton" name="toolButtonCAD">
169
     <item row="8" column="3">
170
      <widget class="QPushButton" name="pushButtonAutoMapping">
130 171
       <property name="text">
131
        <string/>
132
       </property>
133
       <property name="icon">
134
        <iconset resource="../res/MainWindow.qrc">
135
         <normaloff>:/newPrefix/File.svg</normaloff>:/newPrefix/File.svg</iconset>
172
        <string>Symbol Auto Mapping</string>
136 173
       </property>
137 174
      </widget>
138 175
     </item>
......
163 200
       </widget>
164 201
      </widget>
165 202
     </item>
166
     <item row="8" column="3">
167
      <widget class="QPushButton" name="pushButtonAutoMapping">
168
       <property name="text">
169
        <string>Auto Mapping</string>
170
       </property>
171
      </widget>
172
     </item>
173 203
     <item row="9" column="3">
174 204
      <widget class="QCheckBox" name="checkBoxAuto">
175 205
       <property name="text">
......
177 207
       </property>
178 208
      </widget>
179 209
     </item>
180
     <item row="5" column="0">
181
      <widget class="QLabel" name="label_3">
182
       <property name="text">
183
        <string>Text Offset(x, y, scale) : </string>
210
     <item row="0" column="0">
211
      <layout class="QHBoxLayout" name="horizontalLayout_3">
212
       <item>
213
        <widget class="QLabel" name="label_2">
214
         <property name="text">
215
          <string>AutoCAD Files : </string>
216
         </property>
217
        </widget>
218
       </item>
219
       <item>
220
        <widget class="QCheckBox" name="checkBoxGenDrawing">
221
         <property name="text">
222
          <string>Gen. Drawing</string>
223
         </property>
224
         <property name="checked">
225
          <bool>true</bool>
226
         </property>
227
        </widget>
228
       </item>
229
      </layout>
230
     </item>
231
     <item row="9" column="2">
232
      <widget class="QDoubleSpinBox" name="doubleSpinBox_2">
233
       <property name="decimals">
234
        <number>6</number>
235
       </property>
236
       <property name="maximum">
237
        <double>9999.999900000000707</double>
184 238
       </property>
185 239
      </widget>
186 240
     </item>
187
     <item row="4" column="0">
188
      <widget class="QLabel" name="label">
241
     <item row="6" column="0">
242
      <widget class="QLabel" name="label_8">
189 243
       <property name="text">
190
        <string>Line Offset(x, y) : </string>
244
        <string>Symbol Offset(x, y) : </string>
191 245
       </property>
192 246
      </widget>
193 247
     </item>
194
     <item row="4" column="1">
195
      <widget class="QSpinBox" name="spinBoxX">
196
       <property name="minimumSize">
197
        <size>
198
         <width>0</width>
199
         <height>0</height>
200
        </size>
201
       </property>
248
     <item row="6" column="1">
249
      <widget class="QSpinBox" name="spinBoxSymbolX">
202 250
       <property name="minimum">
203 251
        <number>-50000</number>
204 252
       </property>
......
207 255
       </property>
208 256
      </widget>
209 257
     </item>
210
     <item row="6" column="2">
211
      <widget class="QSpinBox" name="spinBoxSymbolY">
212
       <property name="minimum">
213
        <number>-50000</number>
214
       </property>
215
       <property name="maximum">
216
        <number>50000</number>
258
     <item row="8" column="0">
259
      <widget class="QLabel" name="label_5">
260
       <property name="text">
261
        <string>Search Text 2(Line No.) :</string>
217 262
       </property>
218 263
      </widget>
219 264
     </item>
220
     <item row="6" column="1">
221
      <widget class="QSpinBox" name="spinBoxSymbolX">
265
     <item row="6" column="2">
266
      <widget class="QSpinBox" name="spinBoxSymbolY">
222 267
       <property name="minimum">
223 268
        <number>-50000</number>
224 269
       </property>
......
265 310
       </item>
266 311
      </layout>
267 312
     </item>
268
     <item row="6" column="0">
269
      <widget class="QLabel" name="label_8">
270
       <property name="text">
271
        <string>Symbol Offset(x, y) : </string>
272
       </property>
273
      </widget>
274
     </item>
275 313
     <item row="7" column="1" colspan="2">
276 314
      <widget class="QLineEdit" name="lineEdit"/>
277 315
     </item>
278
     <item row="8" column="0">
279
      <widget class="QLabel" name="label_5">
280
       <property name="text">
281
        <string>Search Text 2(Line No.) :</string>
282
       </property>
283
      </widget>
284
     </item>
285
     <item row="9" column="2">
286
      <widget class="QDoubleSpinBox" name="doubleSpinBox_2">
287
       <property name="decimals">
288
        <number>6</number>
289
       </property>
290
       <property name="maximum">
291
        <double>9999.999900000000707</double>
292
       </property>
293
      </widget>
294
     </item>
295 316
     <item row="12" column="0" colspan="2">
296 317
      <layout class="QHBoxLayout" name="horizontalLayout_2">
297 318
       <item>
......
333 354
       </item>
334 355
      </layout>
335 356
     </item>
336
     <item row="0" column="0">
337
      <layout class="QHBoxLayout" name="horizontalLayout_3">
338
       <item>
339
        <widget class="QLabel" name="label_2">
340
         <property name="text">
341
          <string>AutoCAD Files : </string>
342
         </property>
343
        </widget>
344
       </item>
345
       <item>
346
        <widget class="QCheckBox" name="checkBoxGenDrawing">
347
         <property name="text">
348
          <string>Gen. Drawing</string>
349
         </property>
350
         <property name="checked">
351
          <bool>true</bool>
352
         </property>
353
        </widget>
354
       </item>
355
      </layout>
357
     <item row="6" column="3">
358
      <widget class="QPushButton" name="pushButtonRefresh">
359
       <property name="text">
360
        <string>Symbol Refresh</string>
361
       </property>
362
      </widget>
356 363
     </item>
357 364
    </layout>
358 365
   </item>

내보내기 Unified diff

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