개정판 13004596
symbol scale
Change-Id: I8f679fc9e18928a447c947b251c72197c2604e22
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
590 | 590 |
scaleY = round(self.transform().m22() * 100) |
591 | 591 |
scale = str(scaleX / 100.0) + ',' + str(scaleY / 100.0) |
592 | 592 |
else: |
593 |
scale = str(round(self.scale(), 2)) |
|
593 |
_scale = str(round(self.scale(), 2)) |
|
594 |
scale = _scale + ',' + _scale |
|
594 | 595 |
|
595 | 596 |
cols = ['UID', 'Drawings_UID', 'Symbol_UID', 'X', 'Y', 'Width', 'Height', 'Rotation', 'Area', 'Owner', |
596 | 597 |
'Connected', '[Supplied By]', \ |
... | ... | |
714 | 715 |
''' |
715 | 716 |
|
716 | 717 |
def buildItem(self, name, _type, angle: float, loc, size, origin, connPts, parentSymbol, childSymbol, hasInstrumentLabel, |
717 |
dbUid=None, scale=1.0):
|
|
718 |
dbUid=None, scale=[1.0, 1.0]):
|
|
718 | 719 |
""" |
719 | 720 |
build symbol item |
720 | 721 |
:param name: |
... | ... | |
757 | 758 |
convertOriginalPoint = convertOriginalPoint.split(',') |
758 | 759 |
self.symbolConvertingOrigin = [float(convertOriginalPoint[0]), float(convertOriginalPoint[1])] |
759 | 760 |
if type(self) is QEngineeringEquipmentItem: |
760 |
if scale == 1.0: |
|
761 |
scale = [1.0, 1.0] |
|
762 | 761 |
transform = QTransform().translate(self.symbolOrigin[0], self.symbolOrigin[1]) |
763 | 762 |
transform.scale(scale[0], scale[1]) |
764 | 763 |
transform.translate(-self.symbolOrigin[0], -self.symbolOrigin[1]) |
765 | 764 |
self.setTransform(transform) |
766 | 765 |
else: |
767 |
self.setScale(scale) |
|
766 |
self.setScale(scale[0])
|
|
768 | 767 |
|
769 | 768 |
# setting connectors |
770 | 769 |
connectionPoints = symbolInfo.getConnectionPoint().split('/') |
... | ... | |
1968 | 1967 |
scaleY = round(self.transform().m22() * 100) |
1969 | 1968 |
scaleNode.text = str(scaleX / 100.0) + ',' + str(scaleY / 100.0) |
1970 | 1969 |
else: |
1971 |
scaleNode.text = str(round(self.scale(), 2)) |
|
1970 |
_scale = str(round(self.scale(), 2)) |
|
1971 |
scaleNode.text = _scale + ',' + _scale |
|
1972 | 1972 |
node.append(scaleNode) |
1973 | 1973 |
|
1974 | 1974 |
parentSymbolNode = Element('PARENT') |
... | ... | |
2098 | 2098 |
item = SymbolSvgItem.createItem(_type, name, svgFilePath, uid, owner=owner, flip=flipLabel) |
2099 | 2099 |
item.setVisible(False) |
2100 | 2100 |
|
2101 |
scale = None |
|
2102 |
if type(item) is QEngineeringEquipmentItem: |
|
2103 |
scale = [1.0, 1.0] |
|
2104 |
if component['Value']: |
|
2105 |
if ',' in component['Value']: |
|
2106 |
scale = [float(component['Value'].split(',')[0]), float(component['Value'].split(',')[1])] |
|
2107 |
else: |
|
2108 |
scale = [float(component['Value']), float(component['Value'])] |
|
2109 |
else: |
|
2110 |
scale = float(component['Value']) if component['Value'] else 1.0 |
|
2101 |
scale = [1.0, 1.0] |
|
2102 |
if component['Value']: |
|
2103 |
if ',' in component['Value']: |
|
2104 |
scale = [float(component['Value'].split(',')[0]), float(component['Value'].split(',')[1])] |
|
2105 |
else: |
|
2106 |
scale = [float(component['Value']), float(component['Value'])] |
|
2111 | 2107 |
|
2112 | 2108 |
# if additional symbol was changed, change symbol info |
2113 | 2109 |
symbolInfo = None |
... | ... | |
2280 | 2276 |
item.setVisible(False) |
2281 | 2277 |
|
2282 | 2278 |
scaleNode = node.find('SCALE') |
2283 |
scale = None |
|
2284 |
if type(item) is QEngineeringEquipmentItem: |
|
2285 |
scale = [1.0, 1.0] |
|
2286 |
if scaleNode is not None and scaleNode.text: |
|
2287 |
if ',' in scaleNode.text: |
|
2288 |
scale = [float(scaleNode.text.split(',')[0]), float(scaleNode.text.split(',')[1])] |
|
2289 |
else: |
|
2290 |
scale = [float(scaleNode.text), float(scaleNode.text)] |
|
2291 |
else: |
|
2292 |
scale = float(scaleNode.text) if scaleNode is not None else 1.0 |
|
2293 |
|
|
2279 |
scale = [1.0, 1.0] |
|
2280 |
if scaleNode is not None and scaleNode.text: |
|
2281 |
if ',' in scaleNode.text: |
|
2282 |
scale = [float(scaleNode.text.split(',')[0]), float(scaleNode.text.split(',')[1])] |
|
2283 |
else: |
|
2284 |
scale = [float(scaleNode.text), float(scaleNode.text)] |
|
2285 |
|
|
2294 | 2286 |
# if additional symbol was changed, change symbol info |
2295 | 2287 |
symbolInfo = None |
2296 | 2288 |
if dbUid is None: |
내보내기 Unified diff