프로젝트

일반

사용자정보

개정판 9777bbd1

ID9777bbd18e4de6c8e9f43cc311021237a0a92d48
상위 f441dcdc
하위 c9478bf6

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

issue #000: improve open xml file, fix explode, not exist item reference

Change-Id: I0174c51892b239abf7b6b2cd3cca71c016f31223

차이점 보기:

DTI_PID/DTI_PID/AppDocData.py
111 111
        self._titleBlockProperties = None
112 112
        self.needReOpening = None
113 113

  
114
        self.configTable = None
115

  
114 116
    def clearItemList(self, trim):
115 117
        '''
116 118
            @brief      clear item list
......
1211 1213
        @date   2018.04.16
1212 1214
        @history kyouho 2018.07.09 change query method
1213 1215
    '''
1216
    '''
1214 1217
    def getConfigs(self, section, key=None):
1215 1218
        res = []
1216 1219

  
......
1242 1245
            conn.close()
1243 1246

  
1244 1247
        return res
1248
        '''
1249
    def getConfigs(self, section, key=None):        
1250
        res = []
1251

  
1252
        if self.configTable is None:
1253
            self.configTable = []
1254
            try:
1255
                # Creates or opens a file called mydb with a SQLite3 DB
1256
                dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
1257
                conn = sqlite3.connect(dbPath)
1258
                # Get a cursor object
1259
                cursor = conn.cursor()
1260

  
1261
                sql = "select * from configuration"
1262
            
1263
                cursor.execute(sql)
1264
                rows = cursor.fetchall()
1265
                for row in rows:
1266
                    self.configTable.append(Config(row[0], row[1], row[2]))
1267
                # Catch the exception
1268
            except Exception as ex:
1269
                # Roll back any change if something goes wrong
1270
                conn.rollback()
1271
                print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno))
1272
            finally:
1273
                # Close the db connection
1274
                conn.close()
1275

  
1276
        if key is not None:
1277
            for con in self.configTable:
1278
                if con.section == section and con.key == key:
1279
                    res.append(con)
1280
        else:
1281
            for con in self.configTable:
1282
                if con.section == section:
1283
                    res.append(con)
1284

  
1285
        return res
1245 1286

  
1246 1287
    def getAppConfigs(self, section, key=None):
1247 1288
        """
DTI_PID/DTI_PID/ConfigurationAreaDialog.py
686 686
            # up to here
687 687

  
688 688
            docData.saveConfigs(configs)
689
            docData.configTable = None
689 690

  
690 691
            self.isAccepted = True
691 692
        except Exception as ex:
DTI_PID/DTI_PID/ConfigurationDialog.py
690 690
            docData.saveConfigs(configs)
691 691
            docData.lineTypeConfigs = None  # clear line type configurations
692 692
            NominalPipeSizeTable.instance().pipe_sizes = None    # clear nominal pipe size table
693

  
694
            docData.configTable = None
693 695
        except Exception as ex:
694 696
            from App import App
695 697
            from AppDocData import MessageType
DTI_PID/DTI_PID/ItemTreeWidget.py
164 164
                    menu.addAction(lineTypeAction)
165 165
                    line_no = item.parent().data(0, self.TREE_DATA_ROLE)
166 166
                    freeze = line_no.prop('Freeze')
167
                    explode_action.setEnabled(not freeze)
168 167
                    explode_action = QAction(self.tr("Explode"))
168
                    explode_action.setEnabled(not freeze)
169 169
                    explode_action.triggered.connect(lambda : self.explode_line_run(item))
170 170
                    menu.addAction(explode_action)
171 171
                    menu.exec_(self.viewport().mapToGlobal(position))
DTI_PID/DTI_PID/LineNoTracer.py
350 350
            
351 351
            while len(pool) > 0:
352 352
                sign, obj = pool.pop()
353
                #print(type(obj))
354

  
353
                
355 354
                """ check obj is upstream or downstream of spec break """
356 355
                matches = [spec_break for spec_break in self._spec_breaks if spec_break.is_connected(obj)]
357 356
                if matches or issubclass(type(obj), QEngineeringEquipmentItem): continue
357
                #print('obj={} pool={}'.format(obj, pool))
358 358
                """ end loop if obj is to """
359 359
                if to is not None and str(obj.uid) == str(to.uid): break
360 360

  
......
376 376
                    #for s in self._symbols:
377 377
                    #    print(s)
378 378
                    #    print(s.owner)
379
                    #print(symbolMatches)
380

  
379
                
381 380
                # order connected objects
382 381
                matches = []
383 382
                matches.extend(symbolMatches)
......
395 394
                    rhs = matches
396 395

  
397 396
                for match in lhs:
397
                    #print(match)
398 398
                    pool.append((-1, match))
399 399
                    visited.insert(0, match)
400 400

  
401 401
                for match in rhs:
402
                    #print(match)
402 403
                    pool.append((1, match))
403 404
                    visited.append(match)
404 405
                # up to here
......
409 410
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
410 411
            App.mainWnd().addMessage.emit(MessageType.Error, message)
411 412

  
413
        #print(visited)
412 414
        return visited
413 415

  
414 416
'''
DTI_PID/DTI_PID/Shapes/EngineeringConnectorItem.py
74 74

  
75 75
        if type(self._connectedItem) is uuid.UUID:
76 76
            matches = [x for x in self.scene().items() if hasattr(x, 'uid') and str(x.uid) == str(self._connectedItem)]
77
            if matches: self._connectedItem = matches[0]
77
            if matches:
78
                self._connectedItem = matches[0]
79
            else:
80
                self._connectedItem = None
78 81

  
79 82
        return self._connectedItem
80 83
        

내보내기 Unified diff

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