개정판 21540ad6
issue #1171: fix property save, line no, symbol
Change-Id: Ia97c7551facd95a21fccb5797a5ee6d4c505eacd
DTI_PID/DTI_PID/Shapes/EngineeringLineNoTextItem.py | ||
---|---|---|
555 | 555 |
resLater = [] |
556 | 556 |
|
557 | 557 |
app_doc_data = AppDocData.instance() |
558 |
cols = ['UID', 'Drawings_UID', 'Symbol_UID', 'X', 'Y', 'Width', 'Height', 'Rotation', 'Value', 'Connected'] |
|
558 |
cols = ['UID', 'Drawings_UID', 'Symbol_UID', 'X', 'Y', 'Width', 'Height', 'Rotation', 'Value', 'Connected', '[From]', '[To]']
|
|
559 | 559 |
if type(self) is QEngineeringLineNoTextItem: |
560 |
values = ['?', '?', "(select UID from Symbol where Name='Line NO' and SymbolType_UID=-1)", '?', '?', '?', '?', '?', '?', '?'] |
|
560 |
values = ['?', '?', "(select UID from Symbol where Name='Line NO' and SymbolType_UID=-1)", '?', '?', '?', '?', '?', '?', '?', '?', '?']
|
|
561 | 561 |
else: |
562 |
values = ['?', '?', "(select UID from Symbol where Name='Trim Line NO' and SymbolType_UID=-1)", '?', '?', '?', '?', '?', '?', '?'] |
|
562 |
values = ['?', '?', "(select UID from Symbol where Name='Trim Line NO' and SymbolType_UID=-1)", '?', '?', '?', '?', '?', '?', '?', '?', '?']
|
|
563 | 563 |
params = [(str(self.uid), str(app_doc_data.activeDrawing.UID), self.loc[0], self.loc[1], self.size[0], self.size[1], str(self.angle),\ |
564 |
self.text(),\ |
|
565 |
str(self.conns[0]) if self.conns else None)] |
|
564 |
self.text(), str(self.conns[0]) if self.conns else None, str(self.prop('From')), str(self.prop('To')))] |
|
566 | 565 |
sql = 'insert into Components({}) values({})'.format(','.join(cols), ','.join(values)) |
567 | 566 |
res.append((sql, tuple(params))) |
568 | 567 |
|
... | ... | |
580 | 579 |
resLater.append((sql, tuple(params))) |
581 | 580 |
|
582 | 581 |
# insert line no's properties |
582 |
''' |
|
583 | 583 |
cols = ['UID', 'Components_UID', 'SymbolAttribute_UID', 'Value'] |
584 | 584 |
values = ['?', '?', '?', '?'] |
585 | 585 |
for key in self._properties.keys(): |
... | ... | |
587 | 587 |
params = [(str(uuid.uuid4()), str(self.uid), str(self.prop(key.Attribute)))] |
588 | 588 |
sql = 'insert into Attributes({}) values({})'.format(','.join(cols), ','.join(values)) |
589 | 589 |
res.append((sql, tuple(params))) |
590 |
''' |
|
590 | 591 |
|
591 | 592 |
_index = 0 |
592 | 593 |
for run in self.runs: |
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
509 | 509 |
self.prop('Supplied By'), \ |
510 | 510 |
str(self.special_item_type) if self.special_item_type else None, \ |
511 | 511 |
self.currentPointModeIndex, \ |
512 |
self.prop('From'), \
|
|
513 |
self.prop('To'), \
|
|
512 |
None, \
|
|
513 |
None, \
|
|
514 | 514 |
self.prop('Freeze') if self.prop('Freeze') else 0, \ |
515 | 515 |
str(self.prop('Connected Item')) if self.prop('Connected Item') else None, \ |
516 | 516 |
self.flip, \ |
DTI_PID/DTI_PID/SymbolAttr.py | ||
---|---|---|
94 | 94 |
import uuid |
95 | 95 |
|
96 | 96 |
if self.AttributeType == 'Boolean': |
97 |
return True if text and text == 'True' else False
|
|
97 |
return True if text and (text == 'True' or text == '1' or text == 1) else False
|
|
98 | 98 |
else: |
99 | 99 |
return uuid.UUID(text) if text and SymbolProp.is_valid_uuid(text) else text if text else '' |
100 | 100 |
|
내보내기 Unified diff