프로젝트

일반

사용자정보

개정판 739b56f7

ID739b56f707156fd5dc6cd4aa85e96cae84283fe0
상위 93015407
하위 3539f8cc, da8b0505

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

issue #563: line no eq tracing

Change-Id: I495c1f9d025795af2f4a88dba258a2ee42081ec9

차이점 보기:

DTI_PID/DTI_PID/Shapes/EngineeringLineNoTextItem.py
836 836
        from EngineeringNozzleItem import QEngineeringNozzleItem
837 837
        from EngineeringVendorItem import QEngineeringVendorItem
838 838
        from EngineeringEquipmentItem import QEngineeringEquipmentItem
839
        from EngineeringLineItem import QEngineeringLineItem
839 840

  
841
        pool = []
842
        visited = []
840 843
        if self.runs and self.runs[0]:
841
            items = self.runs[0].items
842
            if len(items) > 2:
843
                _attrs = self.getAttributes()
844
                if type(items[0]) is QEngineeringNozzleItem:
845
                    for connector in items[0].connectors:
846
                        # From
847
                        if (type(connector.connectedItem) is QEngineeringVendorItem or type(
848
                                connector.connectedItem) is QEngineeringEquipmentItem) and \
849
                                connector.connectedItem not in items:
850
                            for _attr in _attrs:
851
                                if _attr.Attribute == 'From_eq' and self.add_assoc_item(connector.connectedItem,
844
            pool.append(self)
845
            _attrs = self.getAttributes()
846

  
847
        from_found = False
848
        to_found = False
849

  
850
        while pool:
851
            lineNo = pool.pop()
852
            if lineNo not in visited:
853
                visited.append(lineNo)
854
            else:
855
                continue
856

  
857
            if lineNo.runs and lineNo.runs[0]:
858
                items = lineNo.runs[0].items
859
                if len(items) > 2:
860
                    if type(items[0]) is QEngineeringNozzleItem and not from_found:
861
                        for connector in items[0].connectors:
862
                            # From
863
                            if (type(connector.connectedItem) is QEngineeringVendorItem or type(
864
                                    connector.connectedItem) is QEngineeringEquipmentItem) and \
865
                                    connector.connectedItem not in items:
866
                                for _attr in _attrs:
867
                                    if _attr.Attribute == 'From_eq' and self.add_assoc_item(connector.connectedItem,
868
                                                                                            at=_attr.AttrAt):
869
                                        _attr.AssocItem = connector.connectedItem
870
                                        from_found = True
871
                                        break
872
                                break
873
                    elif not from_found:
874
                        if type(items[0]) is QEngineeringLineItem and items[0].connectors[0].connectedItem and items[0].connectors[0].connectedItem.owner:
875
                            pool.append(items[0].connectors[0].connectedItem.owner)
876
                        else:
877
                            next_items = [connector.connectedItem for connector in items[0].connectors if connector.connectedItem and \
878
                                    connector.connectedItem is not items[1] and items[0].next_connected(items[1], connector.connectedItem)]
879
                            if next_items and next_items[0].owner:
880
                                pool.append(next_items[0].owner)
881

  
882
                    if type(items[-1]) is QEngineeringNozzleItem and not to_found:
883
                        for connector in items[-1].connectors:
884
                            # To
885
                            if (type(connector.connectedItem) is QEngineeringVendorItem or type(
886
                                    connector.connectedItem) is QEngineeringEquipmentItem) and \
887
                                    connector.connectedItem not in items:
888
                                for _attr in _attrs:
889
                                    if _attr.Attribute == 'To_eq' and self.add_assoc_item(connector.connectedItem,
852 890
                                                                                        at=_attr.AttrAt):
853
                                    _attr.AssocItem = connector.connectedItem
854
                                    break
855
                            break
856

  
857
                if type(items[-1]) is QEngineeringNozzleItem:
858
                    for connector in items[-1].connectors:
859
                        # To
860
                        if (type(connector.connectedItem) is QEngineeringVendorItem or type(
861
                                connector.connectedItem) is QEngineeringEquipmentItem) and \
862
                                connector.connectedItem not in items:
863
                            for _attr in _attrs:
864
                                if _attr.Attribute == 'To_eq' and self.add_assoc_item(connector.connectedItem,
865
                                                                                      at=_attr.AttrAt):
866
                                    _attr.AssocItem = connector.connectedItem
867
                                    break
868
                            break
891
                                        _attr.AssocItem = connector.connectedItem
892
                                        to_found = True
893
                                        break
894
                                break
895
                    elif not to_found:
896
                        if type(items[-1]) is QEngineeringLineItem and items[-1].connectors[1].connectedItem and items[-1].connectors[1].connectedItem.owner:
897
                            pool.append(items[-1].connectors[1].connectedItem.owner)
898
                        else:
899
                            next_items = [connector.connectedItem for connector in items[-1].connectors if connector.connectedItem and \
900
                                    connector.connectedItem is not items[-2] and items[-1].next_connected(items[-2], connector.connectedItem)]
901
                            if next_items and next_items[0].owner:
902
                                pool.append(next_items[0].owner)

내보내기 Unified diff

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