개정판 21a1712e
save
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
815 | 815 |
if os.path.isfile(svgFilePath): |
816 | 816 |
svg = SymbolSvgItem.createItem(type, svgFilePath) |
817 | 817 |
svg.buildItem(name, type, angle, pt, size, origin, connPts, parentSymbol, childSymbol, hasInstrumentLabel) |
818 |
svg.reCalculationRotatedItem() |
|
819 | 818 |
|
820 | 819 |
# set owner - 2018.07.20 added by humkyung |
821 | 820 |
matches = [searched for searched in searchedMap if searched[0] == symbol.owner] |
... | ... | |
826 | 825 |
|
827 | 826 |
svg.transfer.onRemoved.connect(self.itemRemoved) |
828 | 827 |
self.addSvgItemToScene(svg) |
828 |
|
|
829 |
svg.reCalculationRotatedItem() |
|
829 | 830 |
else: |
830 | 831 |
item = QGraphicsBoundingBoxItem(pt[0], pt[1], size[0], size[1]) |
831 | 832 |
item.isSymbol = True |
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
930 | 930 |
transform.translate(-standardPoint[0], -standardPoint[1]) |
931 | 931 |
|
932 | 932 |
self.setTransform(transform) |
933 |
|
|
933 |
print(self.connectors[0].center()) |
|
934 | 934 |
from EngineeringLineItem import QEngineeringLineItem |
935 | 935 |
for connector in self.connectors: |
936 | 936 |
if connector.connectedItem is not None and type(connector.connectedItem) == QEngineeringLineItem: |
... | ... | |
994 | 994 |
transform.translate(self.loc[0], self.loc[1]) |
995 | 995 |
transform.rotateRadians(-self.angle) |
996 | 996 |
transform.translate(0, 0) |
997 |
|
|
998 |
|
|
999 |
toPoint = transform.map(QPoint(self.symbolOrigin[0], self.symbolOrigin[1])) |
|
1000 |
print(toPoint) |
|
1001 |
|
|
1002 |
goPoint = self.connectors[0].center() |
|
1003 |
print(goPoint) |
|
1004 |
|
|
1005 |
currentPoint = self.getCurrentPoint() |
|
1006 |
newPoint = transform.map(QPoint(currentPoint[0], currentPoint[1])) |
|
1007 |
print(newPoint) |
|
1008 |
|
|
1009 |
#goPoint = [self.connectors[0].center().x(), self.connectors[0].center().y()] |
|
1010 |
|
|
1011 |
|
|
997 | 1012 |
|
998 |
print('gopc') |
|
999 |
print(self.loc) |
|
1000 |
newP = transform.map(QPoint(self.loc[0], self.loc[1])) |
|
1001 |
print(newP) |
|
1013 |
#self.loc = [self.loc[0] + self.origin[0] - newP.x(), self.loc[1] + self.origin[1] - newP.y()] |
|
1002 | 1014 |
|
1003 | 1015 |
#self.loc = [self.loc[0] - self.symbolOrigin[0], self.loc[1] - self.symbolOrigin[1]] |
1004 | 1016 |
if self.angle == 90: |
내보내기 Unified diff