개정판 f9c5f760
issue #000: spec break xml fixed sql on going
Change-Id: I5ff43f1f1aeb3527f67d1c8379b90c1531fd12a5
DTI_PID/DTI_PID/Commands/SelectAttributeCommand.py | ||
---|---|---|
75 | 75 |
elif item is not None and self._attr.AttributeType == 'CONN' and (type(item) is QEngineeringConnectorItem): |
76 | 76 |
self._item.connectors[self._attr.AttrAt - 1].connect(item.parent, QEngineeringAbstractItem.CONNECTED_AT_PT) |
77 | 77 |
self.onSuccess.emit() |
78 |
elif item is not None and issubclass(type(self._item), QEngineeringSpecBreakItem) and self._attr.AttributeType == 'Comp Item' and type(item) is not QGraphicsPixmapItem: |
|
79 |
self._item.attrs[self._attr] = str(item.uid) |
|
80 |
self.onSuccess.emit() |
|
78 |
#elif item is not None and issubclass(type(self._item), QEngineeringSpecBreakItem) and self._attr.AttributeType == 'Comp Item' and type(item) is not QGraphicsPixmapItem:
|
|
79 |
# self._item.attrs[self._attr] = str(item.uid)
|
|
80 |
# self.onSuccess.emit()
|
|
81 | 81 |
elif item is not None and (type(self._item) is not QEngineeringEndBreakItem) and (type(item) is QEngineeringLineNoTextItem) and self._attr.AttributeType == 'OWNER': |
82 | 82 |
if not item.runs: |
83 | 83 |
item.runs.append(QEngineeringRunItem()) |
... | ... | |
89 | 89 |
elif item is not None and (type(self._item) is QEngineeringEndBreakItem or issubclass(type(self._item), QEngineeringTextItem)) and (type(item) is QEngineeringLineItem or issubclass(type(item), SymbolSvgItem)) and self._attr.AttributeType == 'OWNER': |
90 | 90 |
self._item.owner = item |
91 | 91 |
self.onSuccess.emit() |
92 |
#elif item is not None and (type(self._item) is QEngineeringEndBreakItem) and (type(item) is QEngineeringLineItem) and self._attr.Attribute == 'Connected Line': |
|
93 |
# self._item.attrs[self._attr] = str(item.uid) |
|
94 |
# self.onSuccess.emit() |
|
95 |
elif item is not None and self._attr.AttributeType == QEngineeringAbstractItem.assoc_type(item): |
|
92 |
elif item is not None and (self._attr.AttributeType == QEngineeringAbstractItem.assoc_type(item) or (self._attr.AttributeType == 'Comp Item' and QEngineeringAbstractItem.assoc_type(item) == 'Symbol Item')): |
|
96 | 93 |
if self._attr.Freeze: |
97 | 94 |
self.onSuccess.emit() |
98 | 95 |
return |
99 | 96 |
|
100 |
if self._attr.AttributeType not in self._item._associations:
|
|
101 |
self._item._associations[self._attr.AttributeType] = []
|
|
97 |
if QEngineeringAbstractItem.assoc_type(item) not in self._item._associations:
|
|
98 |
self._item._associations[QEngineeringAbstractItem.assoc_type(item)] = []
|
|
102 | 99 |
|
103 |
while len(self._item._associations[self._attr.AttributeType]) <= self._attr.AttrAt:
|
|
104 |
self._item._associations[self._attr.AttributeType].append(None)
|
|
100 |
while len(self._item._associations[QEngineeringAbstractItem.assoc_type(item)]) <= self._attr.AttrAt:
|
|
101 |
self._item._associations[QEngineeringAbstractItem.assoc_type(item)].append(None)
|
|
105 | 102 |
self._item.add_assoc_item(item, self._attr.AttrAt, force=True) |
106 | 103 |
for key in self._item.attrs.keys(): |
107 | 104 |
if key.Attribute == self._attr.Attribute: |
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
1172 | 1172 |
self.progress.show() |
1173 | 1173 |
## Load data on xml |
1174 | 1174 |
path = os.path.join(appDocData.getCurrentProject().getTempPath(), appDocData.imgName + '.xml') |
1175 |
if os.path.isfile(path): |
|
1175 |
if False:#os.path.isfile(path):
|
|
1176 | 1176 |
self.loadRecognitionResultFromXml(path) |
1177 | 1177 |
else: |
1178 | 1178 |
self.load_drawing(appDocData.activeDrawing) |
DTI_PID/DTI_PID/Shapes/EngineeringAbstractItem.py | ||
---|---|---|
165 | 165 |
if matches: |
166 | 166 |
res.append(matches[0]) |
167 | 167 |
self._associations[key][index] = matches[0] |
168 |
index += 1 |
|
169 | 168 |
# up to here |
170 | 169 |
elif assoc: |
171 | 170 |
res.append(assoc) |
171 |
index += 1 |
|
172 | 172 |
|
173 | 173 |
for key in self.attrs.keys(): |
174 | 174 |
if type(key.AssocItem) is uuid.UUID: |
DTI_PID/DTI_PID/Shapes/EngineeringSpecBreakItem.py | ||
---|---|---|
22 | 22 |
''' |
23 | 23 |
''' |
24 | 24 |
def __init__(self, path, uid=None, flip=0): |
25 |
from SymbolAttr import SymbolProp |
|
26 |
from AppDocData import AppDocData |
|
25 |
from SymbolAttr import SymbolProp |
|
27 | 26 |
SymbolSvgItem.__init__(self, path, uid, flip=flip) |
28 | 27 |
|
29 | 28 |
''' |
... | ... | |
36 | 35 |
attr.AttributeType = 'Comp Item' |
37 | 36 |
self.attrs[attr] = None |
38 | 37 |
''' |
38 |
''' |
|
39 | 39 |
specBreakAttrs = AppDocData.instance().getSymbolAttribute('Segment Breaks') |
40 | 40 |
self.attrs[[up for up in specBreakAttrs if up.Attribute == 'UpStream'][0]] = None |
41 | 41 |
self.attrs[[down for down in specBreakAttrs if down.Attribute == 'DownStream'][0]] = None |
42 |
''' |
|
42 | 43 |
|
43 | 44 |
self._properties = \ |
44 | 45 |
{\ |
... | ... | |
67 | 68 |
''' |
68 | 69 |
def getAttributes(self): |
69 | 70 |
""" attributes MUST have UpStream, DownStream attribute """ |
71 |
from AppDocData import AppDocData |
|
72 |
if not len(self.attrs): |
|
73 |
specBreakAttrs = AppDocData.instance().getSymbolAttribute('Segment Breaks') |
|
74 |
self.attrs[[up for up in specBreakAttrs if up.Attribute == 'UpStream'][0]] = None |
|
75 |
self.attrs[[down for down in specBreakAttrs if down.Attribute == 'DownStream'][0]] = None |
|
76 |
|
|
77 |
for attr, value in self.attrs.items(): |
|
78 |
if attr.AttributeType != 'Spec': |
|
79 |
self.attrs[attr] = attr.AssocItem |
|
70 | 80 |
return self.attrs |
71 | 81 |
|
72 | 82 |
@property |
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
1320 | 1320 |
_type = assoc['Type'] |
1321 | 1321 |
if not _type in item._associations: |
1322 | 1322 |
item._associations[_type] = [] |
1323 |
item._associations[_type].append(uuid.UUID(assoc['Association'])) |
|
1323 |
item._associations[_type].append(uuid.UUID(assoc['Association']) if assoc['Association'] != 'None' else None)
|
|
1324 | 1324 |
# up to here |
1325 | 1325 |
|
1326 | 1326 |
attributes = app_doc_data.get_component_attributes(uid) |
... | ... | |
1332 | 1332 |
else: |
1333 | 1333 |
if _attr.AttributeType == 'Spec': |
1334 | 1334 |
item.attrs[_attr] = [attr['Value'].split(',')[0], attr['Value'].split(',')[1]] |
1335 |
else: |
|
1336 |
item.attrs[_attr] = attr['Value'] |
|
1337 |
''' |
|
1335 | 1338 |
elif _attr.Attribute == 'UpStream': |
1336 | 1339 |
for initKey in item.attrs.keys(): |
1337 | 1340 |
if initKey.Attribute == 'UpStream': |
... | ... | |
1340 | 1343 |
for initKey in item.attrs.keys(): |
1341 | 1344 |
if initKey.Attribute == 'DownStream': |
1342 | 1345 |
item.attrs[initKey] = attr['Value'] |
1346 |
''' |
|
1343 | 1347 |
|
1344 | 1348 |
currentPointModeIndex = component['OriginIndex'] |
1345 | 1349 |
if currentPointModeIndex is not None: |
... | ... | |
1460 | 1464 |
_type = assoc.attrib['TYPE'] |
1461 | 1465 |
if not _type in item._associations: |
1462 | 1466 |
item._associations[_type] = [] |
1463 |
item._associations[_type].append(uuid.UUID(assoc.text)) |
|
1467 |
item._associations[_type].append(uuid.UUID(assoc.text) if assoc.text != 'None' else None)
|
|
1464 | 1468 |
# up to here |
1465 | 1469 |
|
1466 | 1470 |
attributes = node.find('SYMBOLATTRIBUTES') |
... | ... | |
1472 | 1476 |
else: |
1473 | 1477 |
if _attr.AttributeType == 'Spec': |
1474 | 1478 |
item.attrs[_attr] = [attr.text.split(',')[0], attr.text.split(',')[1]] |
1479 |
else: |
|
1480 |
item.attrs[_attr] = attr.text |
|
1481 |
''' |
|
1475 | 1482 |
elif _attr.Attribute == 'UpStream': |
1476 | 1483 |
for initKey in item.attrs.keys(): |
1477 | 1484 |
if initKey.Attribute == 'UpStream': |
... | ... | |
1480 | 1487 |
for initKey in item.attrs.keys(): |
1481 | 1488 |
if initKey.Attribute == 'DownStream': |
1482 | 1489 |
item.attrs[initKey] = attr.text |
1490 |
''' |
|
1483 | 1491 |
|
1484 | 1492 |
currentPointModeIndex = node.find('CURRENTPOINTMODEINDEX') |
1485 | 1493 |
if currentPointModeIndex is not None: |
DTI_PID/DTI_PID/SpecBreakDialog.py | ||
---|---|---|
184 | 184 |
for key in list(self.attrsKey): |
185 | 185 |
if key.AttributeType == 'Spec': |
186 | 186 |
del self.attrs[key] |
187 |
row = 0 |
|
188 |
for rowIndex in range(self.ui.tableWidgetSpec.rowCount()): |
|
187 |
for row in range(self.ui.tableWidgetSpec.rowCount()): |
|
189 | 188 |
attrs = AppDocData.instance().getSymbolAttribute('Segment Breaks') |
190 | 189 |
for attr in attrs: |
191 | 190 |
if attr.DisplayAttribute == self.ui.tableWidgetSpec.cellWidget(row, 0).currentText(): |
... | ... | |
194 | 193 |
up = self.ui.tableWidgetSpec.cellWidget(row, 1).currentText() if self.ui.tableWidgetSpec.cellWidget(row, 1) else self.ui.tableWidgetSpec.item(row, 1).text() |
195 | 194 |
down = self.ui.tableWidgetSpec.cellWidget(row, 2).currentText() if self.ui.tableWidgetSpec.cellWidget(row, 2) else self.ui.tableWidgetSpec.item(row, 2).text() |
196 | 195 |
self.attrs[attr] = [up, down] |
197 |
row += 1 |
|
198 | 196 |
|
199 | 197 |
except Exception as ex: |
200 | 198 |
from App import App |
내보내기 Unified diff