프로젝트

일반

사용자정보

개정판 09cda933

ID09cda93354c3514e500214bcb5643a9a208a8373
상위 1ac48030
하위 028d138c

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

issue #637: fromxml not fix yet

차이점 보기:

DTI_PID/DTI_PID/Shapes/EngineeringSpecBreakItem.py
39 39
        attr.Attribute = 'SetSpecs'
40 40
        attr.AttributeType = 'Link Dialog'
41 41
        self.attrs[attr] = 'Double Click'
42
        '''
42 43
        attr = SymbolAttr()
43 44
        attr.Attribute = 'Spec'
44 45
        attr.AttributeType = 'FluidCode'
......
47 48
        attr.Attribute = 'Spec'
48 49
        attr.AttributeType = 'InsulationPurpose'
49 50
        self.attrs[attr] = ['N', 'Ic']
51
        '''
50 52

  
51 53

  
52 54
    '''
......
100 102

  
101 103
            connectorsNode = Element('CONNECTORS')
102 104
            for connector in self.connectors:
103
                connectorsNode.append(connector.toXml())
104
                '''
105 105
                connectorNode = Element('CONNECTOR')
106 106
                connectedItemNode = Element('CONNECTEDITEM')
107 107
                connectedItemNode.text = str(connector.connectedItem.uid) if connector.connectedItem is not None else 'None'
......
114 114
                connectorNode.append(connectPointNode)
115 115
                connectorNode.append(sceneConnectPointNode)
116 116
                connectorsNode.append(connectorNode)
117
                '''
118 117
            node.append(connectorsNode)
119 118

  
120 119
            connectionNode = Element('CONNECTIONPOINT')
......
155 154
            node.append(areaNode)
156 155

  
157 156
            attributesNode = Element('SYMBOLATTRIBUTES')
158
            _attrs = self.getAttributes()
157
            _attrs = list(self.getAttributes())
159 158
            for attr in _attrs:
160 159
                if type(attr) is SymbolAttr:
161 160
                    _node = attr.toXml()
162
                    _node.text = _attrs[attr]
161
                    if attr.Attribute != 'Spec':
162
                        _node.text = self.attrs[attr]
163
                    else:
164
                        _node.text = str(self.attrs[attr])
163 165
                    attributesNode.append(_node)
164
                elif type(attr) is tuple and type(self) is QEngineeringSpecBreakItem:
165
                    attributeNode = Element(attr[0].upper().replace(' ',''))
166
                    attributeNode.text = str(attr[1] if attr[1] is not None else '')
167
                    attributesNode.append(attributeNode)
168

  
166
               
169 167
            node.append(attributesNode)
170 168

  
171 169
            currentPointModeIndexNode = Element('CURRENTPOINTMODEINDEX')
......
178 176
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
179 177
            App.mainWnd().addMessage.emit(MessageType.Error, message)
180 178

  
181
        return node 
179
        return node
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py
862 862
                if attributes is not None:
863 863
                    for attr in attributes.iter('ATTRIBUTE'):
864 864
                        _attr = SymbolAttr.fromXml(attr)
865
                        item[0].attrs[_attr] = attr.text
865
                        if type(item[0]) is not QEngineeringSpecBreakItem:
866
                            item[0].attrs[_attr] = attr.text
867
                        else:
868
                            if _attr.Attribute == 'Spec':
869
                                item[0].attrs[_attr] = [attr.text[1:-1].split(',')[0][1:-1], attr.text[1:-1].split(',')[1][2:-1]]
870
                            elif _attr.Attribute == 'UpStream':
871
                                for initKey in item[0].attrs.keys():
872
                                    if initKey.Attribute == 'UpStream':
873
                                        item[0].attrs[initKey] = attr.text
874
                            elif _attr.Attribute == 'DownStream':
875
                                for initKey in item[0].attrs.keys():
876
                                    if initKey.Attribute == 'DownStream':
877
                                        item[0].attrs[initKey] = attr.text
866 878
                    for attr in attributes.iter('USERINPUTATTRIBUTE'):
867 879
                        typeUID = attr.find('TYPEUID').text
868 880
                        typeValue = attr.find('TYPEVALUE').text
DTI_PID/DTI_PID/SpecBreakDialog.py
160 160
    def accept(self):
161 161
        try:
162 162
            from SymbolAttr import SymbolAttr
163
            for key in self.attrsKey:
163
            for key in list(self.attrsKey):
164 164
                if key.Attribute == 'Spec':
165 165
                    del self.attrs[key]
166 166
            row = 0

내보내기 Unified diff

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