프로젝트

일반

사용자정보

개정판 8958cadd

ID8958cadd26a7e12bf784a15ce809b18cc3b6c522
상위 4b4d954c
하위 422da6c8, 596d7b7b

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

issue #486: delete key

차이점 보기:

DTI_PID/DTI_PID/ItemPropertyTableWidget.py
540 540
                    items[0].connectors[connNum - 1].connectedItem = None
541 541
                    self.showItemProperty(items[0])
542 542

  
543
                    for sceneItem in self.mainWindow.graphicsView.scene.items():
544
                        if hasattr(sceneItem, 'connectors'):
545
                            for sceneConnector in sceneItem.connectors:
546
                                if sceneConnector.connectedItem is not None and items[0].uid == sceneConnector.connectedItem.uid:
547
                                    sceneConnector.connectedItem = None
548

  
543 549
    '''
544 550
        @brief      int cell check
545 551
        @author     kyouho
DTI_PID/DTI_PID/MainWindow.py
1906 1906
                # 처음에는 UID가 connectedItem에 String으로 들어가있기 때문에
1907 1907
                connector.connectedItem = self.graphicsView.findItemByUid(connector.connectedItem)
1908 1908

  
1909
            """
1910 1909
            symbols = [item for item in self.graphicsView.scene.items() if issubclass(type(item), SymbolSvgItem) and len(item.attrs) > 0]
1911 1910
            for symbol in symbols:
1912 1911
                # 처음에는 attrs의 uid가 connectedItem에 String으로 들어가있기 때문에
1913 1912
                for index in range(len(symbol.attrs)):
1914 1913
                    if type(symbol.attrs[index]) is not UserInputAttribute and type(symbol.attrs[index]) is not tuple:
1915 1914
                        symbol.attrs[index] = self.graphicsView.findItemByUid(symbol.attrs[index])
1916
            """
1917 1915
                        
1918 1916
            # Update Scene
1919 1917
            self.graphicsView.scene.update(self.graphicsView.sceneRect())
......
2031 2029
                        removeAttrList.append(attr)
2032 2030
                        continue
2033 2031

  
2034
                    attrInfo = docData.getSymbolAttributeByUID(attr.UID)
2032
                    attrInfo = docData.getSymbolAttributeByUID(attr.attribute)
2035 2033
                    if attrInfo is None:
2036 2034
                        removeAttrList.append(attr)
2037 2035
                    # 해당 attribute가 맞는지 확인
2038 2036
                    else:
2037
                        attrType = attrInfo[2]
2039 2038
                        _type = type(attr)
2040
                        if attrInfo.AttributeType == 'Symbol Item':
2039
                        if attrType == 'Symbol Item':
2041 2040
                            if not issubclass(_type, SymbolSvgItem):
2042 2041
                                removeAttrList.append(attr)
2043
                        elif attrInfo.AttributeType == 'Text Item':
2042
                        elif attrType == 'Text Item':
2044 2043
                            if _type is not QEngineeringTextItem:
2045 2044
                                removeAttrList.append(attr)
2046
                        elif attrInfo.AttributeType == 'Int':
2045
                        elif attrType == 'Int':
2047 2046
                            if _type is not UserInputAttribute and self.isNumber(attr.text):
2048 2047
                                removeAttrList.append(attr)
2049
                        elif attrInfo.AttributeType == 'String':
2048
                        elif attrType == 'String':
2050 2049
                            if _type is not UserInputAttribute:
2051 2050
                                removeAttrList.append(attr)
2052 2051

  
2053 2052
                for attr in removeAttrList:
2054
                    del attrs[attr]
2053
                    attrs.remove(attr)
2055 2054

  
2056 2055
            # Line No Text Item의 경우
2057 2056
            items = [item for item in self.graphicsView.scene.items() if issubclass(type(item), QEngineeringLineNoTextItem)]
......
2061 2060
                removeAttrList = []
2062 2061
                for attr in attrs:
2063 2062
                    if type(attr) is UserInputAttribute:
2064
                        attrInfo = docData.getLinePropertiesByUID(attr.UID)
2063
                        attrInfo = docData.getLinePropertiesByUID(attr.attribute)
2065 2064
                        if attrInfo is None:
2066 2065
                            removeAttrList.append(attr)
2067 2066

  
2068 2067
                for attr in removeAttrList:
2069
                    del attrs[attr]
2068
                    attrs.remove(attr)
2070 2069

  
2071 2070
        except Exception as ex:
2072
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
2073
            self.addMessage.emit(MessageType.Error, message)
2074

  
2071
                message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
2072
                self.addMessage.emit(MessageType.Error, message)
2075 2073
    '''
2076 2074
        @brief      Check Number
2077 2075
        @author     kyouho

내보내기 Unified diff

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