프로젝트

일반

사용자정보

개정판 f9176c2f

IDf9176c2f9e7daad9917d69946b0e19a0f1a3e134
상위 837695e7
하위 b95146ca

백흠경이(가) 약 5년 전에 추가함

issue #1051: 장치 이동 시 가능한 라인이 직선이 되도록 한다

Change-Id: I0f2b0d8a6c383e877f4605b1952bb7d240e48a68

차이점 보기:

HYTOS/HYTOS/Shapes/EngineeringStreamlineItem.py
888 888
            self.connectors[0].setPos(self.connectors[0].connectedItem.center())
889 889
        if self.connectors[-1].connectedItem is not None:
890 890
            self.connectors[-1].setPos(self.connectors[-1].connectedItem.center())
891

  
892
        # try to align axis
893
        toler = 3
894
        for idx, conn in enumerate(self.connectors):
895
            if conn.connectedItem and conn.connectedItem.parentItem() is symbol:
896
                start = self.connectors[idx].center()
897
                end = self.connectors[(idx + 1) % 2].center()
898
                dx, dy = abs(end[0] - start[0]), abs(end[1] - start[1])
899
                if dx < toler:
900
                    self.connectors[idx].setPos([end[0], start[1]])
901
                if dy < toler:
902
                    self.connectors[idx].setPos([start[0], end[1]])
903
                break
904
        # up to here
905

  
891 906
        self.on_connector_pos_changed(None)
892 907

  
893 908
    def on_connector_pos_changed(self, connector):
HYTOS/HYTOS/Shapes/SymbolSvgItem.py
1388 1388
        """ call signals when item's position is changed """
1389 1389
        if change == QGraphicsItem.ItemPositionHasChanged:
1390 1390
            self.transfer.on_pos_changed.emit(self)
1391
            """
1392
            for conn in self.connectors:
1393
                if conn.conectedItem:
1394
                    line = conn.connectedItem.parentItem()
1395
                    start = line.connectors[-1].connectedItem.center()
1396
                    end = line.connectors[-2].connectedItem.center()
1397
                    dx, dy = end[-1] - start[0], end[1] - start[1]
1398
            """
1399

  
1391 1400
            self.scene().contents_changed.emit()
1392 1401
            return value
1393 1402

  
1394 1403
        return super().itemChange(change, value)
1395 1404

  
1396
    def removeSelfAttr(self, attributeName):
1397
        target = None
1398
        for attr in self.attrs:
1399
            if attr.Attribute == attributeName:
1400
                target = attr
1401
                break
1402

  
1403
        if target:
1404
            del self.attrs[attr]
1405

  
1406 1405
    '''
1407 1406
        @brief      Check Overlap
1408 1407
        @author     kyouho

내보내기 Unified diff

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