프로젝트

일반

사용자정보

개정판 6ca8a44c

ID6ca8a44c380c163af70013cc7102437729dbcced
상위 405c4f1b
하위 94d5675a

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

issue #538: change insert condition

Change-Id: I73b3fd291efcca345582b3b39a0c61c5cb815dd2

차이점 보기:

DTI_PID/DTI_PID/ReplaceSymbolDialog.py
17 17
    """ This is symbol item replace and insert dialog class """
18 18

  
19 19
    CONDITION_REPLACE = {'radioButtonHasCon':['item.has_connection'], 'radioButtonHasNoCon':['not item.has_connection'], 'radioButtonConLine':['False'], 'radioButtonAll':['True']}
20
    CONDITION_INSERT = {'radioButtonHasCon':['conn.connetionItem'], 'radioButtonHasNoCon':['not conn.connectedItem'], 'radioButtonConLine':['conn.connectedItem and type(conn.connectedItem) is QEngineeringLineItem'], 'radioButtonAll':['True']}
20
    CONDITION_INSERT = {'radioButtonHasCon':['conn.connetionItem'], 'radioButtonHasNoCon':['not conn.connectedItem'], 'radioButtonConLine':['conn.connectedItem and type(conn.connectedItem) is QEngineeringLineItem', 'conn.connectedItem.is_piping(True)'], 'radioButtonAll':['True']}
21 21

  
22 22
    def __init__(self, parent):
23 23
        QDialog.__init__(self, parent)
......
87 87

  
88 88
            for item in symbol_items:
89 89
                for conn in item.connectors:
90
                    target = True
90 91
                    for condition in conditions:
91
                        if condition and eval(condition):
92
                            scenePos = conn.sceneBoundingRect().center()
93
                            svg = self.view.createSymbolObject(replace_symbol)
94
                            new_symbols.append([svg, scenePos])
92
                        if condition and not eval(condition):
93
                            target = False
94
                            break
95
                    
96
                    if target:
97
                        scenePos = conn.sceneBoundingRect().center()
98
                        svg = self.view.createSymbolObject(replace_symbol)
99
                        new_symbols.append([svg, scenePos])
95 100

  
96 101
            for item in new_symbols:
97 102
                self.view.matchSymbolToLine(item[0], item[1])

내보내기 Unified diff

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