프로젝트

일반

사용자정보

개정판 5faffe94

ID5faffe9483520d9f84a2fd672c6ae65b9acfdab5
상위 23a7dd60
하위 266ea391, 6e592fb5

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

main action arrange

Change-Id: I403d5f1ea97469a3f8532df10915b5ebaf9ef8f8

차이점 보기:

DTI_PID/DTI_PID/AppRibbon.py
246 246
            pane.ui.toolButtonSymbolReplaceInsert.clicked.connect(main_wnd.replaceInsertSymbolClicked)
247 247
            pane.ui.toolButtonConnectLineToSymbol.clicked.connect(main_wnd.on_connect_line_to_symbol)
248 248
            pane.ui.toolButtonOCRUnknown.clicked.connect(main_wnd.on_ocr_unknown_items)
249
            pane.ui.toolButtonSymbolRecognition.clicked.connect(main_wnd.recognizeSymbol)
249 250
            cSection.addCustomWidget(pane)
250 251
        except Exception as ex:
251 252
            message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \
DTI_PID/DTI_PID/MainWindow.py
173 173
        # up to here
174 174

  
175 175
        # connect signals and slots
176
        self.actionClose.triggered.connect(self.close)
177
        self.actionOpen.triggered.connect(self.open_image_drawing)
178
        self.actionExportAsSVG.triggered.connect(self.export_as_svg)
179
        self.actionExportAsXML.triggered.connect(self.export_as_xml)
180
        self.actionExportAsImage.triggered.connect(self.export_as_image)
181
        self.actionLine.triggered.connect(self.onPlaceLine)
182
        self.actionRecognition.triggered.connect(self.recognize)
176
        #self.actionClose.triggered.connect(self.close)
177
        #self.actionOpen.triggered.connect(self.open_image_drawing)
178
        #self.actionExportAsSVG.triggered.connect(self.export_as_svg)
179
        #self.actionExportAsXML.triggered.connect(self.export_as_xml)
180
        #self.actionExportAsImage.triggered.connect(self.export_as_image)
181
        #self.actionLine.triggered.connect(self.onPlaceLine)
182
        #self.actionRecognition.triggered.connect(self.recognize)
183 183
        self.pushButtonRefreshDrawings.clicked.connect(self.load_drawing_list)
184 184
        self.pushButtonRefreshTree.clicked.connect(self.refresh_item_list)
185
        self.actionLineRecognition.triggered.connect(self.connect_attributes)
186
        self.actionArea.triggered.connect(self.areaConfiguration)
187
        self.actionConfiguration.triggered.connect(self.configuration)
188
        self.actionOCR.triggered.connect(self.onAreaOcr)
189
        self.actionGenerateOutput.triggered.connect(self.generateOutput)
185
        #self.actionLineRecognition.triggered.connect(self.connect_attributes)
186
        #self.actionArea.triggered.connect(self.areaConfiguration)
187
        #self.actionConfiguration.triggered.connect(self.configuration)
188
        #self.actionOCR.triggered.connect(self.onAreaOcr)
189
        #self.actionGenerateOutput.triggered.connect(self.generateOutput)
190 190
        self.pushButtonCreateSymbol.clicked.connect(self.onCreateSymbolClicked)
191 191
        self.toolButtonClearLog.clicked.connect(self.on_clear_log)
192
        self.actionStreamline.triggered.connect(self.on_streamline)
193
        self.actionHMB_DATA.triggered.connect(self.onHMBData)
194
        self.actionItem_Data_List.triggered.connect(self.showItemDataList)
195
        self.actionText_Data_List.triggered.connect(self.showTextDataList)
196
        self.actionSpecialItemTypes.triggered.connect(self.on_show_special_item_types)  # show special item types dialog
197
        self.actionDataTransfer.triggered.connect(self.on_show_data_transfer)  # show data transfer dialog
198
        self.actionDataExport.triggered.connect(self.on_show_data_export)
199
        self.actionExportEqpDatasheet.triggered.connect(self.on_show_eqp_datasheet_export)  # show eqp datasheet export dialog
200
        self.actionOPCRelation.triggered.connect(self.on_show_opc_relation)  # show OPC Relation dialog
201
        self.actionCodeTable.triggered.connect(self.onShowCodeTable)
202
        self.actionCustom_Code_Table.triggered.connect(self.onShowCustomCodeTable)
203
        self.actionReplace_Code_Table.triggered.connect(self.onShowReplaceCodeTable)
204
        self.actionImage_Drawing.triggered.connect(self.onViewImageDrawing)
205
        self.actionDrawing_Only.triggered.connect(self.onViewDrawingOnly)
206
        self.actionValidate.triggered.connect(self.onValidation)
207
        self.actionViewText.triggered.connect(self.onViewText)
208
        self.actionViewSymbol.triggered.connect(self.onViewSymbol)
209
        self.actionViewLine.triggered.connect(self.onViewLine)
210
        self.actionViewUnknown.triggered.connect(self.onViewUnknown)
211
        self.actionViewInconsistency.triggered.connect(self.onViewInconsistency)
212
        self.actionViewVendor_Area.triggered.connect(self.onViewVendorArea)
213
        self.actionRotate.triggered.connect(self.onRotate)
214
        self.actionZoom.triggered.connect(self.onAreaZoom)
215
        self.actionVendor.triggered.connect(self.onVendor)
216
        self.actionFitWindow.triggered.connect(self.fitWindow)
217
        self.actionpdf_to_image.triggered.connect(self.onConvertPDFToImage)
218
        self.actionImport_Text_From_CAD.triggered.connect(self.on_import_text_from_cad)
219
        self.actionImport_Text_from_CAD_for_Instrument.triggered.connect(self.on_import_text_from_cad_for_instrument)
220
        self.actionSymbol_Thickness_Reinforcement.triggered.connect(self.onSymbolThickness)
221
        self.actionHelp.triggered.connect(self.on_help)
222
        self.actionReadme.triggered.connect(self.on_readme)
192
        #self.actionStreamline.triggered.connect(self.on_streamline)
193
        #self.actionHMB_DATA.triggered.connect(self.onHMBData)
194
        #self.actionItem_Data_List.triggered.connect(self.showItemDataList)
195
        #self.actionText_Data_List.triggered.connect(self.showTextDataList)
196
        #self.actionSpecialItemTypes.triggered.connect(self.on_show_special_item_types)  # show special item types dialog
197
        #self.actionDataTransfer.triggered.connect(self.on_show_data_transfer)  # show data transfer dialog
198
        #self.actionDataExport.triggered.connect(self.on_show_data_export)
199
        #self.actionExportEqpDatasheet.triggered.connect(self.on_show_eqp_datasheet_export)  # show eqp datasheet export dialog
200
        #self.actionOPCRelation.triggered.connect(self.on_show_opc_relation)  # show OPC Relation dialog
201
        #self.actionCodeTable.triggered.connect(self.onShowCodeTable)
202
        #self.actionCustom_Code_Table.triggered.connect(self.onShowCustomCodeTable)
203
        #self.actionReplace_Code_Table.triggered.connect(self.onShowReplaceCodeTable)
204
        #self.actionImage_Drawing.triggered.connect(self.onViewImageDrawing)
205
        #self.actionDrawing_Only.triggered.connect(self.onViewDrawingOnly)
206
        #self.actionValidate.triggered.connect(self.onValidation)
207
        #self.actionViewText.triggered.connect(self.onViewText)
208
        #self.actionViewSymbol.triggered.connect(self.onViewSymbol)
209
        #self.actionViewLine.triggered.connect(self.onViewLine)
210
        #self.actionViewUnknown.triggered.connect(self.onViewUnknown)
211
        #self.actionViewInconsistency.triggered.connect(self.onViewInconsistency)
212
        #self.actionViewVendor_Area.triggered.connect(self.onViewVendorArea)
213
        #self.actionRotate.triggered.connect(self.onRotate)
214
        #self.actionZoom.triggered.connect(self.onAreaZoom)
215
        #self.actionVendor.triggered.connect(self.onVendor)
216
        #self.actionFitWindow.triggered.connect(self.fitWindow)
217
        #self.actionpdf_to_image.triggered.connect(self.onConvertPDFToImage)
218
        #self.actionImport_Text_From_CAD.triggered.connect(self.on_import_text_from_cad)
219
        #self.actionImport_Text_from_CAD_for_Instrument.triggered.connect(self.on_import_text_from_cad_for_instrument)
220
        #self.actionSymbol_Thickness_Reinforcement.triggered.connect(self.onSymbolThickness)
221
        #self.actionHelp.triggered.connect(self.on_help)
222
        #self.actionReadme.triggered.connect(self.on_readme)
223 223
        self.graphicsView.scene().selectionChanged.connect(self.onSelectionChanged)
224
        self.actionInitialize.triggered.connect(self.on_initialize_scene)
225
        self.actionSave.triggered.connect(self.actionSaveCliked)
224
        #self.actionInitialize.triggered.connect(self.on_initialize_scene)
225
        #self.actionSave.triggered.connect(self.actionSaveCliked)
226 226
        self.addMessage.connect(self.onAddMessage)
227 227
        self.toogle_lock_axis.connect(self.on_toggle_lock_axis)
228
        self.actionFindReplaceText.triggered.connect(self.findReplaceTextClicked)
229
        self.actionSymbol_Replace_Insert.triggered.connect(self.replaceInsertSymbolClicked)
230
        self.actionConnectLineToSymbol.triggered.connect(self.on_connect_line_to_symbol)
231
        self.actionGlobal_Validation.triggered.connect(self.on_validation_global_clicked)
228
        #self.actionFindReplaceText.triggered.connect(self.findReplaceTextClicked)
229
        #self.actionSymbol_Replace_Insert.triggered.connect(self.replaceInsertSymbolClicked)
230
        #self.actionConnectLineToSymbol.triggered.connect(self.on_connect_line_to_symbol)
231
        #self.actionGlobal_Validation.triggered.connect(self.on_validation_global_clicked)
232 232
        self.pushButtonDetectSymbol.clicked.connect(self.show_detect_symbol_dialog)
233
        self.actionUndo.triggered.connect(self._scene.undo_stack.undo)
234
        self.actionRedo.triggered.connect(self._scene.undo_stack.redo)
233
        #self.actionUndo.triggered.connect(self._scene.undo_stack.undo)
234
        #self.actionRedo.triggered.connect(self._scene.undo_stack.redo)
235 235
        self.pushButtonMemoRefresh.clicked.connect(self.on_memo_refresh_clicked)
236 236
        self.pushButtonMemoEdit.clicked.connect(self.on_memo_edit_clicked)
237 237
        self.pushButtonMemoSave.clicked.connect(self.on_memo_save_clicked)
......
538 538
    def refresh_item_list(self):
539 539
        """refresh item tree"""
540 540

  
541
        if not self.graphicsView.hasImage():
542
            self.showImageSelectionMessageBox()
543
            return
544
        
541 545
        app_doc_data = AppDocData.instance()
542 546
        
543 547
        '''
......
1320 1324
        from SaveWorkCommand import SaveWorkCommand
1321 1325

  
1322 1326
        try:
1327
            app_doc_data = AppDocData.instance()
1328

  
1329
            if app_doc_data.imgName is None:
1330
                self.showImageSelectionMessageBox()
1331
                return
1332

  
1323 1333
            home_pane = self.ribbon.get_pane('Home File')
1324 1334
            if not home_pane.ui.toolButtonFileSave.isEnabled():
1325 1335
                return
......
1327 1337
            home_pane.ui.toolButtonFileSave.setEnabled(False)
1328 1338

  
1329 1339
            # save alarm
1330
            self.save_alarm_enable(False)
1331

  
1332
            app_doc_data = AppDocData.instance()
1333
            if app_doc_data.imgName is None:
1334
                self.showImageSelectionMessageBox()
1335
                return
1340
            self.save_alarm_enable(False)    
1336 1341

  
1337 1342
            app_doc_data.clearItemList(False)
1338 1343

  
......
2530 2535
                    2018.06.08  Jeongwoo    Add Paramter on SymbolSvgItem.buildItem()
2531 2536
    '''
2532 2537
    def onCreateSymbolClicked(self):
2538
        if not self.graphicsView.hasImage():
2539
            self.showImageSelectionMessageBox()
2540
            return
2541

  
2533 2542
        selected = [item for item in self.graphicsView.scene().selectedItems() if issubclass(type(item), QEngineeringVendorItem)]
2534 2543
        if len(selected) == 1:
2535 2544
            symbol_image = AppDocData.instance().activeDrawing.image_origin
......
3116 3125
                      f"{sys.exc_info()[-1].tb_lineno}"
3117 3126
            self.addMessage.emit(MessageType.Error, message)
3118 3127

  
3128
    def recognizeSymbol(self):
3129
        print('a')
3130

  
3119 3131
    def recognize(self):
3120 3132
        """recognize symbol, text and line for selected drawings"""
3121 3133
        from datetime import datetime
DTI_PID/DTI_PID/UI/Edit.ui
6 6
   <rect>
7 7
    <x>0</x>
8 8
    <y>0</y>
9
    <width>512</width>
9
    <width>580</width>
10 10
    <height>84</height>
11 11
   </rect>
12 12
  </property>
......
58 58
       </property>
59 59
      </widget>
60 60
     </item>
61
     <item row="0" column="3">
62
      <widget class="QToolButton" name="toolButtonSymbolReplaceInsert">
61
     <item row="0" column="1">
62
      <widget class="QToolButton" name="toolButtonTextDataList">
63 63
       <property name="text">
64
        <string>Symbol
65
Replace/Insert</string>
64
        <string>Text
65
Data List</string>
66 66
       </property>
67 67
       <property name="icon">
68 68
        <iconset resource="../res/MainWindow.qrc">
69
         <normaloff>:/newPrefix/Reinforcement.svg</normaloff>:/newPrefix/Reinforcement.svg</iconset>
69
         <normaloff>:/newPrefix/text_list_32px.svg</normaloff>:/newPrefix/text_list_32px.svg</iconset>
70 70
       </property>
71 71
       <property name="iconSize">
72 72
        <size>
......
82 82
       </property>
83 83
      </widget>
84 84
     </item>
85
     <item row="0" column="1">
86
      <widget class="QToolButton" name="toolButtonTextDataList">
85
     <item row="0" column="2">
86
      <widget class="QToolButton" name="toolButtonOCRUnknown">
87 87
       <property name="text">
88
        <string>Text
89
Data List</string>
88
        <string>OCR Unknown Items</string>
90 89
       </property>
91 90
       <property name="icon">
92 91
        <iconset resource="../res/MainWindow.qrc">
93
         <normaloff>:/newPrefix/text_list_32px.svg</normaloff>:/newPrefix/text_list_32px.svg</iconset>
92
         <normaloff>:/newPrefix/OCR.svg</normaloff>:/newPrefix/OCR.svg</iconset>
94 93
       </property>
95 94
       <property name="iconSize">
96 95
        <size>
......
131 130
       </property>
132 131
      </widget>
133 132
     </item>
134
     <item row="0" column="2">
135
      <widget class="QToolButton" name="toolButtonOCRUnknown">
133
     <item row="0" column="3">
134
      <widget class="QToolButton" name="toolButtonSymbolReplaceInsert">
136 135
       <property name="text">
137
        <string>OCR Unknown Items</string>
136
        <string>Symbol
137
Replace/Insert</string>
138 138
       </property>
139 139
       <property name="icon">
140 140
        <iconset resource="../res/MainWindow.qrc">
141
         <normaloff>:/newPrefix/OCR.svg</normaloff>:/newPrefix/OCR.svg</iconset>
141
         <normaloff>:/newPrefix/Reinforcement.svg</normaloff>:/newPrefix/Reinforcement.svg</iconset>
142
       </property>
143
       <property name="iconSize">
144
        <size>
145
         <width>32</width>
146
         <height>32</height>
147
        </size>
148
       </property>
149
       <property name="toolButtonStyle">
150
        <enum>Qt::ToolButtonTextUnderIcon</enum>
151
       </property>
152
       <property name="autoRaise">
153
        <bool>true</bool>
154
       </property>
155
      </widget>
156
     </item>
157
     <item row="0" column="5">
158
      <widget class="QToolButton" name="toolButtonSymbolRecognition">
159
       <property name="text">
160
        <string>Recognize
161
Symbol</string>
162
       </property>
163
       <property name="icon">
164
        <iconset resource="../res/MainWindow.qrc">
165
         <normaloff>:/newPrefix/Recognition.svg</normaloff>:/newPrefix/Recognition.svg</iconset>
142 166
       </property>
143 167
       <property name="iconSize">
144 168
        <size>

내보내기 Unified diff

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