프로젝트

일반

사용자정보

개정판 0d987bb7

ID0d987bb74795169b1b15f5f7680549d7054bd1bf
상위 73698ad3
하위 dc379815

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

issue #563: LineNoTracer for inst on going

Change-Id: I584478b05419ea8c506e4a4350fdc9d1d834307f

차이점 보기:

DTI_PID/DTI_PID/AppDocData.py
104 104
        self._symbolType = {}
105 105
        self._lineNoPropertiesUID = {}
106 106
        self._attributeByType = {}
107
        self._connected_items_lists = []
107 108

  
108 109
        # for load drawing data from database
109 110
        self._connecterss = {}
......
168 169
        self._symbolType = {}
169 170
        self._lineNoPropertiesUID = {}
170 171
        self._attributeByType = {}
172
        self._connected_items_lists.clear()
171 173

  
172 174
        self._connecterss = {}
173 175
        self._associationss = {}
DTI_PID/DTI_PID/Commands/ReplaceInsertCommand.py
49 49
            symbol_items = [item for item in scene.items()
50 50
                                if issubclass(type(item), SymbolSvgItem) and find_symbol == item.name] if find_symbol != 'Equipment Package' \
51 51
                            else [item for item in scene.items()
52
                                if (issubclass(type(item), QEngineeringVendorItem) or issubclass(type(item), QEngineeringEquipmentItem)) and item.pack_type == 'Equipment Package']
52
                                if (issubclass(type(item), QEngineeringVendorItem) or (issubclass(type(item), QEngineeringEquipmentItem)) and item.pack_type == 'Equipment Package')]
53 53

  
54 54
            new_symbols = []
55 55
            if replace_action == 'Replace' and find_symbol != 'Equipment Package':
DTI_PID/DTI_PID/ConnectAttrDialog.py
74 74

  
75 75
    def __init__(self, parent, scene):  # Parent is MainWindow
76 76
        import ConnectAttr_UI
77
        from AppDocData import AppDocData
77 78

  
78 79
        QDialog.__init__(self, parent)
79 80

  
......
89 90
        self.ui.pushButtonStart.clicked.connect(self.start_job)
90 91
        self.ui.checkBoxUpdateSpec.setChecked(True)
91 92

  
93
        configs = AppDocData.instance().getConfigs('Project', 'Operation')
94
        self.instrument = int(configs[0].value) if configs else 1
95

  
96
        if self.instrument != 1:
97
            self.ui.checkBoxUpdateFlowMark.setHidden(True)
98
            self.ui.checkBoxUpdateSpec.setHidden(True)
99
            self.ui.checkBoxUpdateLineType.setHidden(True)
100
            self.ui.checkBoxValidation.setHidden(True)
101

  
92 102
    @property
93 103
    def validation_checked(self):
94 104
        """return if validation is checked"""
......
144 154

  
145 155
    def start_thread(self):
146 156
        import timeit
147
        from LineNoTracer import connectAttrImpl
157
        from LineNoTracer import connectAttrImpl, connectAttrImpl_inst
148 158

  
149 159
        try:
150 160
            self.ui.buttonBox.setDisabled(True)
151 161

  
152 162
            # 1 - create Worker and Thread inside the Form
153
            self.obj = Worker(self.scene, connectAttrImpl, self.ui.checkBoxUpdateLineType.isChecked(),
154
                              self.ui.checkBoxUpdateFlowMark.isChecked(), self.ui.checkBoxUpdateSpec.isChecked())
163
            
164
            if self.instrument == 1:
165
                self.obj = Worker(self.scene, connectAttrImpl, self.ui.checkBoxUpdateLineType.isChecked(),
166
                                self.ui.checkBoxUpdateFlowMark.isChecked(), self.ui.checkBoxUpdateSpec.isChecked())
167
            else:
168
                self.obj = Worker(self.scene, connectAttrImpl_inst, self.ui.checkBoxUpdateLineType.isChecked(),
169
                                self.ui.checkBoxUpdateFlowMark.isChecked(), self.ui.checkBoxUpdateSpec.isChecked())
155 170

  
156 171
            # 2 - Connect Worker Signals to the Thread slots
157 172
            self.obj.signals.display_message.connect(self.addListItem)
DTI_PID/DTI_PID/LineNoTracer.py
445 445
    @history    humkyung 2018.06.21 paste connect attributes codes from recognizeLine function
446 446
                kyouho  2018.09.14  clear Item's owner 
447 447
'''
448

  
449

  
450 448
async def connectAttrImpl(worker, update_line_type, update_flow_mark, update_spec):
451 449
    from App import App
452 450
    import uuid
......
1523 1521
        message = 'error occurred({}) in {}:{}'.format(repr(ex), sys.exc_info()[-1].tb_frame.f_code.co_filename,
1524 1522
                                                       sys.exc_info()[-1].tb_lineno)
1525 1523
        worker.display_message.emit(message)
1524

  
1525
async def connectAttrImpl_inst(worker, update_line_type, update_flow_mark, update_spec):
1526
    pass
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py
158 158
        @date   2018.05.10
159 159
        @history    2018.05.17  Jeongwoo    Add Calling setColor if self._owner is None or not
160 160
    '''
161

  
162 161
    @owner.setter
163 162
    def owner(self, value):
164 163
        self._owner = value
......
1974 1973

  
1975 1974
        return pointList[self.currentPointModeIndex]
1976 1975

  
1977
    '''
1978
        @brief      심볼 회전 시 서로 다른 기준점으로 회전하기 때문에 기준점을 이후 개발한 SymbolSvgItem 기준의 회전좌표로 이동하기 위해서 만듬 (loc 기준으로 회전해야함)
1979
        @author     kyouho
1980
        @date       18.08.06
1981
    '''
1976
    def EvaluatedCode(self, old_code, code_name):
1977
        """ return new attribute code """
1978
        #from LineNoTracer import LineNoTracer
1979
        #from EngineeringLineNoTextItem import QEngineeringLineNoTextItem
1980
        from AppDocData import AppDocData
1982 1981

  
1983
    """
1984
    def reCalculationRotatedItem(self):
1985
        goPoint = self.get_transform(self.getCurrentPoint(), self.angle).map(
1986
            QPoint(self.symbolOrigin[0], self.symbolOrigin[1]))
1987
        self.loc = [self.loc[0] + self.origin[0] - goPoint.x(), self.loc[1] + self.origin[1] - goPoint.y()]
1988
    """
1982
        try:
1983
            start_item = None
1984
            if self.iType == 19:    # Labels - Symbol
1985
                matches = [assoc for assoc in self.associations() if type(assoc) is SymbolSvgItem]
1986
                start_item = matches[0] if matches else None
1987
            else:
1988
                start_item = self
1989

  
1990
            if not start_item:
1991
                return ''
1992

  
1993
            #container = QEngineeringLineNoTextItem()
1994
            #container.conns.append(start_item)
1995
            #symbols = [item for item in worker.scene.items() if issubclass(type(item), SymbolSvgItem) and not (type(item) is QEngineeringErrorItem) and not \
1996
            #                            (type(item) is QEngineeringUnknownItem) and item.type != 'Notes' and not (type(item) is QEngineeringEndBreakItem)]
1997
            #lines = [item for item in worker.scene.items() if type(item) is QEngineeringLineItem]
1998
            #tracer = LineNoTracer(symbols, lines, [container], [], [], [], [])
1999

  
2000
            app_doc_data = AppDocData.instance()
2001
            connected_items_lists = app_doc_data._connected_items_lists
1989 2002

  
2003
            
2004

  
2005

  
2006
            
2007

  
2008
            new_code = None
2009

  
2010
            return 'new_code'
2011
        except Exception as ex:
2012
            from App import App
2013
            from AppDocData import MessageType
2014

  
2015
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
2016
                                                          sys.exc_info()[-1].tb_lineno)
2017
            App.mainWnd().addMessage.emit(MessageType.Error, str(self.uid) + self.name + message)
1990 2018

  
1991 2019
def recursiveChangeAttributes(node, attName, attValue):
1992 2020
    while not node.isNull():
DTI_PID/DTI_PID/TextItemFactory.py
46 46

  
47 47
    def createTextItem(self, textInfo):
48 48
        from Configs import LineNoConfig, TagNoConfig
49
        import csv
49 50

  
50 51
        item = None
51 52

  
......
100 101
                if visibleOption == 'Random':
101 102
                    rgb = docData.colors
102 103
                    item.change_color(QColor(rgb.red, rgb.green, rgb.blue).name())
103
                    # item.setColor(QColor(rgb.red, rgb.green, rgb.blue).name())
104 104
                else:
105 105
                    configs = docData.getConfigs('Line No', 'Configuration')
106
                    configs = configs[0].value.split(self.delimiter)
106
                    configs = list(csv.reader([config.value], delimiter=self.delimiter, escapechar='^'))[0]
107 107

  
108 108
                    values = result[1]
109 109
                    index = configs.index(color_property)

내보내기 Unified diff

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