프로젝트

일반

사용자정보

개정판 60363ba3

ID60363ba3054600881f3cbd812ecbc61fc9ded354
상위 b8fdc55f
하위 291a86fa

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

issue #7: add diagonal detection func and disable drawing image save into db

Change-Id: Ib1607edda1ec4cb783023be9e7899134ba2d66da

차이점 보기:

DTI_PID/DTI_PID/AppDocData.py
3514 3514
                    if drawing.UID is None:
3515 3515
                        # get image data
3516 3516
                        image_blob_data = None
3517
                        file_path = os.path.join(self.project.getDrawingFilePath(), drawing.name)
3518
                        if drawing.name and os.path.isfile(file_path):
3519
                            with open(file_path.encode('utf-8'), 'rb') as file:
3520
                                image_blob_data = file.read()
3517
                        #file_path = os.path.join(self.project.getDrawingFilePath(), drawing.name)
3518
                        #if drawing.name and os.path.isfile(file_path):
3519
                        #    with open(file_path.encode('utf-8'), 'rb') as file:
3520
                        #        image_blob_data = file.read()
3521 3521
                        # up to here
3522 3522

  
3523 3523
                        sql = self.project.database.to_sql(
DTI_PID/DTI_PID/ConfigurationDialog.py
116 116
        else:
117 117
            at = self.ui.comboBoxLineType.findText('Secondary')
118 118
            self.ui.comboBoxLineType.setCurrentIndex(at)
119
        configs = docData.getConfigs('Line', 'Diagonal')
120
        if configs:
121
            size = int(configs[0].value)
122
            self.ui.radioButtonDiagonalYes.setChecked(True if size == 1 else False)
123
            self.ui.radioButtonDiagonalNo.setChecked(True if size == -1 else False)
124
        else:
125
            self.ui.radioButtonDiagonalYes.setChecked(True)
126
            self.ui.radioButtonDiagonalNo.setChecked(False)
119 127

  
120 128
        properties = docData.getLineProperties()
121 129
        if properties:
......
683 691
            configs.append(Config('Small Line Minimum Length', 'Min Length', self.ui.smallLineMinLengthSpinBox.value()))
684 692
            configs.append(Config('Line Detector', 'Length to connect line', self.ui.spinBoxLengthToConnectLine.value()))
685 693
            configs.append(Config('Line', 'Default Type', self.ui.comboBoxLineType.currentText()))
694
            configs.append(Config('Line', 'Diagonal', '1' if self.ui.radioButtonDiagonalYes.isChecked() else '-1'))
686 695
            configs.append(Config('Note No Tag Rule', 'Note No Expression', self.ui.lineEditNoteNoExpression.text()))
687 696
            configs.append(Config('Note No Tag Rule', 'Note No Symbol Name', self.ui.lineEditNoteNoSymbolName.text()))
688 697
            configs.append(Config('OPC Tag Rule', 'From Prefix', self.ui.lineEditOPCFromPrefix.text()))
DTI_PID/DTI_PID/Configuration_UI.py
11 11
class Ui_ConfigurationDialog(object):
12 12
    def setupUi(self, ConfigurationDialog):
13 13
        ConfigurationDialog.setObjectName("ConfigurationDialog")
14
        ConfigurationDialog.resize(704, 869)
14
        ConfigurationDialog.resize(704, 925)
15 15
        font = QtGui.QFont()
16 16
        font.setFamily("맑은 고딕")
17 17
        ConfigurationDialog.setFont(font)
......
86 86
        self.gridLayout_5.setObjectName("gridLayout_5")
87 87
        self.gridLayout_11 = QtWidgets.QGridLayout()
88 88
        self.gridLayout_11.setObjectName("gridLayout_11")
89
        self.spinBoxMaxArea = QtWidgets.QSpinBox(self.groupBox)
90
        self.spinBoxMaxArea.setMinimumSize(QtCore.QSize(100, 0))
91
        self.spinBoxMaxArea.setObjectName("spinBoxMaxArea")
92
        self.gridLayout_11.addWidget(self.spinBoxMaxArea, 0, 3, 1, 1)
93 89
        self.spinBoxLengthToConnectLine = QtWidgets.QSpinBox(self.groupBox)
94 90
        self.spinBoxLengthToConnectLine.setProperty("value", 20)
95 91
        self.spinBoxLengthToConnectLine.setObjectName("spinBoxLengthToConnectLine")
96 92
        self.gridLayout_11.addWidget(self.spinBoxLengthToConnectLine, 3, 1, 1, 1)
97
        self.label_5 = QtWidgets.QLabel(self.groupBox)
98
        self.label_5.setAlignment(QtCore.Qt.AlignCenter)
99
        self.label_5.setObjectName("label_5")
100
        self.gridLayout_11.addWidget(self.label_5, 0, 2, 1, 1)
101
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
102
        self.gridLayout_11.addItem(spacerItem, 0, 4, 1, 1)
93
        self.spinBoxMinArea = QtWidgets.QSpinBox(self.groupBox)
94
        self.spinBoxMinArea.setMinimumSize(QtCore.QSize(100, 0))
95
        self.spinBoxMinArea.setObjectName("spinBoxMinArea")
96
        self.gridLayout_11.addWidget(self.spinBoxMinArea, 0, 1, 1, 1)
103 97
        self.smallLineMinLengthSpinBox = QtWidgets.QSpinBox(self.groupBox)
104 98
        self.smallLineMinLengthSpinBox.setMinimumSize(QtCore.QSize(100, 0))
105 99
        self.smallLineMinLengthSpinBox.setObjectName("smallLineMinLengthSpinBox")
106 100
        self.gridLayout_11.addWidget(self.smallLineMinLengthSpinBox, 2, 1, 1, 1)
101
        self.comboBoxLineType = QtWidgets.QComboBox(self.groupBox)
102
        self.comboBoxLineType.setObjectName("comboBoxLineType")
103
        self.gridLayout_11.addWidget(self.comboBoxLineType, 4, 1, 1, 2)
104
        self.spinBoxWidth = QtWidgets.QSpinBox(self.groupBox)
105
        self.spinBoxWidth.setMinimumSize(QtCore.QSize(100, 0))
106
        self.spinBoxWidth.setObjectName("spinBoxWidth")
107
        self.gridLayout_11.addWidget(self.spinBoxWidth, 1, 1, 1, 1)
107 108
        self.label_4 = QtWidgets.QLabel(self.groupBox)
108 109
        self.label_4.setObjectName("label_4")
109 110
        self.gridLayout_11.addWidget(self.label_4, 0, 0, 1, 1)
110
        self.spinBoxMinArea = QtWidgets.QSpinBox(self.groupBox)
111
        self.spinBoxMinArea.setMinimumSize(QtCore.QSize(100, 0))
112
        self.spinBoxMinArea.setObjectName("spinBoxMinArea")
113
        self.gridLayout_11.addWidget(self.spinBoxMinArea, 0, 1, 1, 1)
114
        self.label_9 = QtWidgets.QLabel(self.groupBox)
115
        self.label_9.setObjectName("label_9")
116
        self.gridLayout_11.addWidget(self.label_9, 3, 0, 1, 1)
117 111
        self.label_16 = QtWidgets.QLabel(self.groupBox)
118 112
        self.label_16.setObjectName("label_16")
119 113
        self.gridLayout_11.addWidget(self.label_16, 2, 0, 1, 1)
120
        self.spinBoxHeight = QtWidgets.QSpinBox(self.groupBox)
121
        self.spinBoxHeight.setMinimumSize(QtCore.QSize(100, 0))
122
        self.spinBoxHeight.setObjectName("spinBoxHeight")
123
        self.gridLayout_11.addWidget(self.spinBoxHeight, 1, 2, 1, 1)
124
        self.spinBoxWidth = QtWidgets.QSpinBox(self.groupBox)
125
        self.spinBoxWidth.setMinimumSize(QtCore.QSize(100, 0))
126
        self.spinBoxWidth.setObjectName("spinBoxWidth")
127
        self.gridLayout_11.addWidget(self.spinBoxWidth, 1, 1, 1, 1)
114
        self.label_9 = QtWidgets.QLabel(self.groupBox)
115
        self.label_9.setObjectName("label_9")
116
        self.gridLayout_11.addWidget(self.label_9, 3, 0, 1, 1)
128 117
        self.label = QtWidgets.QLabel(self.groupBox)
129 118
        self.label.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
130 119
        self.label.setObjectName("label")
131 120
        self.gridLayout_11.addWidget(self.label, 1, 0, 1, 1)
121
        self.label_5 = QtWidgets.QLabel(self.groupBox)
122
        self.label_5.setAlignment(QtCore.Qt.AlignCenter)
123
        self.label_5.setObjectName("label_5")
124
        self.gridLayout_11.addWidget(self.label_5, 0, 2, 1, 1)
125
        self.spinBoxHeight = QtWidgets.QSpinBox(self.groupBox)
126
        self.spinBoxHeight.setMinimumSize(QtCore.QSize(100, 0))
127
        self.spinBoxHeight.setObjectName("spinBoxHeight")
128
        self.gridLayout_11.addWidget(self.spinBoxHeight, 1, 2, 1, 1)
132 129
        self.label_28 = QtWidgets.QLabel(self.groupBox)
133 130
        self.label_28.setObjectName("label_28")
134 131
        self.gridLayout_11.addWidget(self.label_28, 4, 0, 1, 1)
135
        self.comboBoxLineType = QtWidgets.QComboBox(self.groupBox)
136
        self.comboBoxLineType.setObjectName("comboBoxLineType")
137
        self.gridLayout_11.addWidget(self.comboBoxLineType, 4, 1, 1, 2)
132
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
133
        self.gridLayout_11.addItem(spacerItem, 0, 4, 1, 1)
134
        self.spinBoxMaxArea = QtWidgets.QSpinBox(self.groupBox)
135
        self.spinBoxMaxArea.setMinimumSize(QtCore.QSize(100, 0))
136
        self.spinBoxMaxArea.setObjectName("spinBoxMaxArea")
137
        self.gridLayout_11.addWidget(self.spinBoxMaxArea, 0, 3, 1, 1)
138
        self.label_35 = QtWidgets.QLabel(self.groupBox)
139
        self.label_35.setObjectName("label_35")
140
        self.gridLayout_11.addWidget(self.label_35, 5, 0, 1, 1)
141
        self.radioButtonDiagonalYes = QtWidgets.QRadioButton(self.groupBox)
142
        self.radioButtonDiagonalYes.setObjectName("radioButtonDiagonalYes")
143
        self.buttonGroup_3 = QtWidgets.QButtonGroup(ConfigurationDialog)
144
        self.buttonGroup_3.setObjectName("buttonGroup_3")
145
        self.buttonGroup_3.addButton(self.radioButtonDiagonalYes)
146
        self.gridLayout_11.addWidget(self.radioButtonDiagonalYes, 5, 1, 1, 1)
147
        self.radioButtonDiagonalNo = QtWidgets.QRadioButton(self.groupBox)
148
        self.radioButtonDiagonalNo.setObjectName("radioButtonDiagonalNo")
149
        self.buttonGroup_3.addButton(self.radioButtonDiagonalNo)
150
        self.gridLayout_11.addWidget(self.radioButtonDiagonalNo, 5, 2, 1, 1)
138 151
        self.gridLayout_5.addLayout(self.gridLayout_11, 0, 0, 1, 1)
139 152
        self.gridLayout_2.addWidget(self.groupBox, 3, 1, 1, 1)
140 153
        self.groupBoxLineNo = QtWidgets.QGroupBox(self.Recognition)
......
645 658
        self.label_24.setText(_translate("ConfigurationDialog", "Line Flow Mark Position(Percent) : "))
646 659
        self.label_26.setText(_translate("ConfigurationDialog", "Line Flow Mark Minimum Line Length : "))
647 660
        self.groupBox.setTitle(_translate("ConfigurationDialog", "Line Detection"))
648
        self.label_5.setText(_translate("ConfigurationDialog", "< Area < "))
649 661
        self.label_4.setText(_translate("ConfigurationDialog", "Ignore Small Object Size : "))
650
        self.label_9.setText(_translate("ConfigurationDialog", "Length to Connect Line"))
651
        self.label_16.setText(_translate("ConfigurationDialog", "Line Minimum Length"))
662
        self.label_16.setText(_translate("ConfigurationDialog", "Line Minimum Length : "))
663
        self.label_9.setText(_translate("ConfigurationDialog", "Length to Connect Line : "))
652 664
        self.label.setText(_translate("ConfigurationDialog", "Sliding Window Size(WxH) : "))
653
        self.label_28.setText(_translate("ConfigurationDialog", "Default Line Type"))
665
        self.label_5.setText(_translate("ConfigurationDialog", "< Area < "))
666
        self.label_28.setText(_translate("ConfigurationDialog", "Default Line Type : "))
667
        self.label_35.setText(_translate("ConfigurationDialog", "Diagonal Detection : "))
668
        self.radioButtonDiagonalYes.setText(_translate("ConfigurationDialog", "Yes"))
669
        self.radioButtonDiagonalNo.setText(_translate("ConfigurationDialog", "No"))
654 670
        self.groupBoxLineNo.setTitle(_translate("ConfigurationDialog", "Line No"))
655 671
        self.pushButtonLineNoAttribute.setText(_translate("ConfigurationDialog", "Line No Attribute"))
656 672
        self.pushButtonAddProperty.setText(_translate("ConfigurationDialog", "Add"))
DTI_PID/DTI_PID/RecognitionDialog.py
676 676
                        connectedLines.extend(res)
677 677

  
678 678
            # line detection without symbol connection point info
679
            remainLines = detector.detectLineWithoutSymbol(area)
680
            windowSize = appDocData.getSlidingWindowSize()
681
            thickness = int(windowSize[1])
682
            for line in remainLines:
683
                line.append(thickness)
684
            connectedLines.extend(remainLines)
679
            configs = appDocData.getConfigs('Line', 'Diagonal')
680
            if configs and int(configs[0].value) is 1:
681
                remainLines = detector.detectLineWithoutSymbol(area)
682
                windowSize = appDocData.getSlidingWindowSize()
683
                thickness = int(windowSize[1])
684
                for line in remainLines:
685
                    line.append(thickness)
686
                connectedLines.extend(remainLines)
685 687

  
686 688
            configs = appDocData.getConfigs('Line Detector', 'Length to connect line')
687 689
            toler = int(configs[0].value) if configs else 20
DTI_PID/DTI_PID/UI/Configuration.ui
7 7
    <x>0</x>
8 8
    <y>0</y>
9 9
    <width>704</width>
10
    <height>869</height>
10
    <height>925</height>
11 11
   </rect>
12 12
  </property>
13 13
  <property name="font">
......
155 155
         <layout class="QGridLayout" name="gridLayout_5">
156 156
          <item row="0" column="0">
157 157
           <layout class="QGridLayout" name="gridLayout_11">
158
            <item row="0" column="3">
159
             <widget class="QSpinBox" name="spinBoxMaxArea">
160
              <property name="minimumSize">
161
               <size>
162
                <width>100</width>
163
                <height>0</height>
164
               </size>
165
              </property>
166
             </widget>
167
            </item>
168 158
            <item row="3" column="1">
169 159
             <widget class="QSpinBox" name="spinBoxLengthToConnectLine">
170 160
              <property name="value">
......
172 162
              </property>
173 163
             </widget>
174 164
            </item>
175
            <item row="0" column="2">
176
             <widget class="QLabel" name="label_5">
177
              <property name="text">
178
               <string>&lt; Area &lt; </string>
179
              </property>
180
              <property name="alignment">
181
               <set>Qt::AlignCenter</set>
165
            <item row="0" column="1">
166
             <widget class="QSpinBox" name="spinBoxMinArea">
167
              <property name="minimumSize">
168
               <size>
169
                <width>100</width>
170
                <height>0</height>
171
               </size>
182 172
              </property>
183 173
             </widget>
184 174
            </item>
185
            <item row="0" column="4">
186
             <spacer name="horizontalSpacer_2">
187
              <property name="orientation">
188
               <enum>Qt::Horizontal</enum>
189
              </property>
190
              <property name="sizeHint" stdset="0">
175
            <item row="2" column="1">
176
             <widget class="QSpinBox" name="smallLineMinLengthSpinBox">
177
              <property name="minimumSize">
191 178
               <size>
192
                <width>40</width>
193
                <height>20</height>
179
                <width>100</width>
180
                <height>0</height>
194 181
               </size>
195 182
              </property>
196
             </spacer>
183
             </widget>
197 184
            </item>
198
            <item row="2" column="1">
199
             <widget class="QSpinBox" name="smallLineMinLengthSpinBox">
185
            <item row="4" column="1" colspan="2">
186
             <widget class="QComboBox" name="comboBoxLineType"/>
187
            </item>
188
            <item row="1" column="1">
189
             <widget class="QSpinBox" name="spinBoxWidth">
200 190
              <property name="minimumSize">
201 191
               <size>
202 192
                <width>100</width>
......
212 202
              </property>
213 203
             </widget>
214 204
            </item>
215
            <item row="0" column="1">
216
             <widget class="QSpinBox" name="spinBoxMinArea">
217
              <property name="minimumSize">
218
               <size>
219
                <width>100</width>
220
                <height>0</height>
221
               </size>
205
            <item row="2" column="0">
206
             <widget class="QLabel" name="label_16">
207
              <property name="text">
208
               <string>Line Minimum Length : </string>
222 209
              </property>
223 210
             </widget>
224 211
            </item>
225 212
            <item row="3" column="0">
226 213
             <widget class="QLabel" name="label_9">
227 214
              <property name="text">
228
               <string>Length to Connect Line</string>
215
               <string>Length to Connect Line : </string>
229 216
              </property>
230 217
             </widget>
231 218
            </item>
232
            <item row="2" column="0">
233
             <widget class="QLabel" name="label_16">
219
            <item row="1" column="0">
220
             <widget class="QLabel" name="label">
221
              <property name="text">
222
               <string>Sliding Window Size(WxH) : </string>
223
              </property>
224
              <property name="alignment">
225
               <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
226
              </property>
227
             </widget>
228
            </item>
229
            <item row="0" column="2">
230
             <widget class="QLabel" name="label_5">
234 231
              <property name="text">
235
               <string>Line Minimum Length</string>
232
               <string>&lt; Area &lt; </string>
233
              </property>
234
              <property name="alignment">
235
               <set>Qt::AlignCenter</set>
236 236
              </property>
237 237
             </widget>
238 238
            </item>
......
246 246
              </property>
247 247
             </widget>
248 248
            </item>
249
            <item row="1" column="1">
250
             <widget class="QSpinBox" name="spinBoxWidth">
249
            <item row="4" column="0">
250
             <widget class="QLabel" name="label_28">
251
              <property name="text">
252
               <string>Default Line Type : </string>
253
              </property>
254
             </widget>
255
            </item>
256
            <item row="0" column="4">
257
             <spacer name="horizontalSpacer_2">
258
              <property name="orientation">
259
               <enum>Qt::Horizontal</enum>
260
              </property>
261
              <property name="sizeHint" stdset="0">
262
               <size>
263
                <width>40</width>
264
                <height>20</height>
265
               </size>
266
              </property>
267
             </spacer>
268
            </item>
269
            <item row="0" column="3">
270
             <widget class="QSpinBox" name="spinBoxMaxArea">
251 271
              <property name="minimumSize">
252 272
               <size>
253 273
                <width>100</width>
......
256 276
              </property>
257 277
             </widget>
258 278
            </item>
259
            <item row="1" column="0">
260
             <widget class="QLabel" name="label">
279
            <item row="5" column="0">
280
             <widget class="QLabel" name="label_35">
261 281
              <property name="text">
262
               <string>Sliding Window Size(WxH) : </string>
263
              </property>
264
              <property name="alignment">
265
               <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
282
               <string>Diagonal Detection : </string>
266 283
              </property>
267 284
             </widget>
268 285
            </item>
269
            <item row="4" column="0">
270
             <widget class="QLabel" name="label_28">
286
            <item row="5" column="1">
287
             <widget class="QRadioButton" name="radioButtonDiagonalYes">
271 288
              <property name="text">
272
               <string>Default Line Type</string>
289
               <string>Yes</string>
273 290
              </property>
291
              <attribute name="buttonGroup">
292
               <string notr="true">buttonGroup_3</string>
293
              </attribute>
274 294
             </widget>
275 295
            </item>
276
            <item row="4" column="1" colspan="2">
277
             <widget class="QComboBox" name="comboBoxLineType"/>
296
            <item row="5" column="2">
297
             <widget class="QRadioButton" name="radioButtonDiagonalNo">
298
              <property name="text">
299
               <string>No</string>
300
              </property>
301
              <attribute name="buttonGroup">
302
               <string notr="true">buttonGroup_3</string>
303
              </attribute>
304
             </widget>
278 305
            </item>
279 306
           </layout>
280 307
          </item>
......
1354 1381
 <buttongroups>
1355 1382
  <buttongroup name="buttonGroup"/>
1356 1383
  <buttongroup name="buttonGroup_2"/>
1384
  <buttongroup name="buttonGroup_3"/>
1357 1385
 </buttongroups>
1358 1386
</ui>

내보내기 Unified diff

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