프로젝트

일반

사용자정보

개정판 8853ba50

ID8853ba50f2eee19f2a479574fbf5e4ad76a0644d
상위 dffcae96
하위 ca5a1a5b, 98fdb329

함의성이(가) 일년 이상 전에 추가함

add global typical area setting

Change-Id: Ia8c878fa54af4e493184d7a211976c6d28d7a075

차이점 보기:

DTI_PID/DTI_PID/ConfigurationAreaDialog.py
192 192
        self.ui.tableWidgetTypicalArea.hideColumn(0)
193 193
        section = '{} Typical Area'.format(docData.imgName)
194 194
        configs = docData.getConfigs(section)
195
        section = 'Global Typical Area'
196
        configs.extend(docData.getConfigs(section))
195 197
        self.ui.tableWidgetTypicalArea.setRowCount(len(configs))
196 198
        row = 0
197 199
        for config in configs:
......
203 205
            boundingBox.setPen(QPen(Qt.darkGray, THICKNESS, Qt.SolidLine))
204 206
            self.parent().graphicsView.scene().addItem(boundingBox)
205 207

  
206
            item = QTableWidgetItem(docData.imgName)
208
            item = QTableWidgetItem(config.section)
207 209
            item.setFlags(Qt.ItemIsEnabled)
208 210
            self.ui.tableWidgetTypicalArea.setItem(row, 0, item)
209 211
            item = QTableWidgetItem(config.key)
......
595 597
            docData = AppDocData.instance()
596 598
            row = self.ui.tableWidgetTypicalArea.rowCount()
597 599
            self.ui.tableWidgetTypicalArea.setRowCount(row + 1)
598
            item = QTableWidgetItem(docData.imgName)
600
            item = QTableWidgetItem((docData.imgName if not self.ui.checkBoxTypicalGlobal.isChecked() else 'Global') + ' Typical Area')
599 601
            self.ui.tableWidgetTypicalArea.setItem(row, 0, item)
600
            item = QTableWidgetItem(str(uuid.uuid4()))
602
            item = QTableWidgetItem(str(uuid.uuid4()) if not self.ui.checkBoxTypicalGlobal.isChecked() else 'Global ' + str(uuid.uuid4()))
601 603
            item.setFlags(Qt.ItemIsEnabled | Qt.ItemIsEditable)
602 604
            self.ui.tableWidgetTypicalArea.setItem(row, 1, item)
603 605
            strArea = '({},{}),({},{})'.format(x, y, width, height)
606
            self.ui.lineEditTypicalArea.setText(strArea)
604 607
            item = QTableWidgetItem(strArea)
605 608
            item.setFlags(Qt.ItemIsEnabled)
606 609
            item.tag = boundingBox
......
759 762
            # save typical area
760 763
            section = '{} Typical Area'.format(docData.imgName)
761 764
            docData.deleteConfigs(section)
765
            docData.deleteConfigs('Global Typical Area')
762 766

  
763 767
            for row in range(self.ui.tableWidgetTypicalArea.rowCount()):
768
                section = self.ui.tableWidgetTypicalArea.item(row, 0).text()
764 769
                name = self.ui.tableWidgetTypicalArea.item(row, 1).text()
765 770
                area = Area('Typical Area')
766 771
                area.parse(self.ui.tableWidgetTypicalArea.item(row, 2).text())
DTI_PID/DTI_PID/Configuration_Area_UI.py
1 1
# -*- coding: utf-8 -*-
2 2

  
3
# Form implementation generated from reading ui file '.\UI\Configuration_Area.ui'
3
# Form implementation generated from reading ui file './UI/Configuration_Area.ui'
4 4
#
5
# Created by: PyQt5 UI code generator 5.13.1
5
# Created by: PyQt5 UI code generator 5.15.4
6 6
#
7
# WARNING! All changes made in this file will be lost!
7
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
8
# run again.  Do not edit this file unless you know what you are doing.
8 9

  
9 10

  
10 11
from PyQt5 import QtCore, QtGui, QtWidgets
......
157 158
        self.horizontalLayout = QtWidgets.QHBoxLayout()
158 159
        self.horizontalLayout.setObjectName("horizontalLayout")
159 160
        self.lineEditEquipmentDescArea = QtWidgets.QLineEdit(self.groupBoxEquipmentDesc)
161
        self.lineEditEquipmentDescArea.setReadOnly(True)
160 162
        self.lineEditEquipmentDescArea.setObjectName("lineEditEquipmentDescArea")
161 163
        self.horizontalLayout.addWidget(self.lineEditEquipmentDescArea)
162 164
        self.pushButtonAdd = QtWidgets.QToolButton(self.groupBoxEquipmentDesc)
......
228 230
        self.verticalLayout_2.setObjectName("verticalLayout_2")
229 231
        self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
230 232
        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
233
        self.checkBoxTypicalGlobal = QtWidgets.QCheckBox(self.groupBoxTypicalArea)
234
        self.checkBoxTypicalGlobal.setObjectName("checkBoxTypicalGlobal")
235
        self.horizontalLayout_5.addWidget(self.checkBoxTypicalGlobal)
231 236
        self.lineEditTypicalArea = QtWidgets.QLineEdit(self.groupBoxTypicalArea)
237
        self.lineEditTypicalArea.setReadOnly(True)
232 238
        self.lineEditTypicalArea.setObjectName("lineEditTypicalArea")
233 239
        self.horizontalLayout_5.addWidget(self.lineEditTypicalArea)
234 240
        self.pushButtonAddTypicalArea = QtWidgets.QToolButton(self.groupBoxTypicalArea)
......
279 285
        self.groupBoxEquipmentDesc.setTitle(_translate("AreaDialog", "Equipment Desc. Area"))
280 286
        self.groupBoxTitleBlock.setTitle(_translate("AreaDialog", "Title Block"))
281 287
        self.groupBoxTypicalArea.setTitle(_translate("AreaDialog", "Typical Area"))
288
        self.checkBoxTypicalGlobal.setText(_translate("AreaDialog", "Global"))
282 289
import MainWindow_rc
290

  
291

  
292
if __name__ == "__main__":
293
    import sys
294
    app = QtWidgets.QApplication(sys.argv)
295
    AreaDialog = QtWidgets.QDialog()
296
    ui = Ui_AreaDialog()
297
    ui.setupUi(AreaDialog)
298
    AreaDialog.show()
299
    sys.exit(app.exec_())
DTI_PID/DTI_PID/ImportTextFromCADDialog.py
293 293
        self.scales = None
294 294
        self.offsets = None
295 295
        self.areas = None
296
        self.typicals = None
296 297

  
297 298
        self.isAccepted = False
298 299
 
......
1105 1106

  
1106 1107
        self.text_scale = self.ui.doubleSpinBoxScale.value()
1107 1108
        self.areas = app_doc_data.getAreaList()
1109
        typical_list = app_doc_data.getConfigs('Global Typical Area')
1110
        self.typicals = []
1111
        if typical_list:
1112
            for typical_area in typical_list:
1113
                area = Area(typical_area.key)
1114
                area.parse(typical_area.value)
1115
                self.typicals.append(area)
1108 1116
        title_area_list = app_doc_data.getTitleBlockProperties()
1109 1117
        title_list = []
1110 1118
        if title_area_list:
......
1620 1628

  
1621 1629
            node = item.toXml()
1622 1630

  
1631
            for area in self.typicals:
1632
                if area.contains([loc[0], loc[1]]):
1633
                    node = None
1634

  
1623 1635
            return node
1624 1636
        except Exception as ex:
1625 1637
            from App import App
DTI_PID/DTI_PID/RecognitionDialog.py
843 843
                                      (int(found[0]) + int(found[2]), int(found[1]) + int(found[3])), 255, -1)
844 844

  
845 845
                configs = app_doc_data.getConfigs('{} Typical Area'.format(app_doc_data.imgName))
846
                configs.extend(app_doc_data.getConfigs('Global Typical Area'))
846 847
                for config in configs:
847 848
                    found = re.findall('\\d+', config.value)
848 849
                    if len(found) == 4:
DTI_PID/DTI_PID/UI/Configuration_Area.ui
321 321
        <item>
322 322
         <layout class="QHBoxLayout" name="horizontalLayout">
323 323
          <item>
324
           <widget class="QLineEdit" name="lineEditEquipmentDescArea"/>
324
           <widget class="QLineEdit" name="lineEditEquipmentDescArea">
325
            <property name="readOnly">
326
             <bool>true</bool>
327
            </property>
328
           </widget>
325 329
          </item>
326 330
          <item>
327 331
           <widget class="QToolButton" name="pushButtonAdd">
......
457 461
        <item>
458 462
         <layout class="QHBoxLayout" name="horizontalLayout_5">
459 463
          <item>
460
           <widget class="QLineEdit" name="lineEditTypicalArea"/>
464
           <widget class="QCheckBox" name="checkBoxTypicalGlobal">
465
            <property name="text">
466
             <string>Global</string>
467
            </property>
468
           </widget>
469
          </item>
470
          <item>
471
           <widget class="QLineEdit" name="lineEditTypicalArea">
472
            <property name="readOnly">
473
             <bool>true</bool>
474
            </property>
475
           </widget>
461 476
          </item>
462 477
          <item>
463 478
           <widget class="QToolButton" name="pushButtonAddTypicalArea">

내보내기 Unified diff

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