개정판 fdbbac79
issue #1059:
1. Transform 컬럼 생성 (DocVer_3.4.4.0.sql 스크립트 추가)
2. 기존 keypress return을 부모로 전달하도록 수정(EngineeringStreamlineItem.py, SymbolSvgItem.py)
3. 생성했던 onUpdateUI 모든 커멘드에서 삭제
Change-Id: I27dc054d2879ffe23c2201e81574e44571dc2149
HYTOS/HYTOS/AppDocData.py | ||
---|---|---|
1565 | 1565 |
, c.Rotation |
1566 | 1566 |
, c.ScaleX |
1567 | 1567 |
, c.ScaleY |
1568 |
, c.Transform |
|
1568 | 1569 |
, p.UID as Point_UID |
1569 | 1570 |
, p.[Index] |
1570 | 1571 |
, p.X |
HYTOS/HYTOS/Commands/AreaZoomCommand.py | ||
---|---|---|
17 | 17 |
|
18 | 18 |
onSuccess = pyqtSignal() |
19 | 19 |
onRejected = pyqtSignal(AbstractCommand.AbstractCommand) |
20 |
onUpdateUI = pyqtSignal() |
|
21 | 20 |
|
22 | 21 |
''' |
23 | 22 |
@history 2018.06.27 Jeongwoo Add variables [startPoint, endPoint] |
HYTOS/HYTOS/Commands/DownAlignmentCommand.py | ||
---|---|---|
11 | 11 |
|
12 | 12 |
onSuccess = pyqtSignal() |
13 | 13 |
onRejected = pyqtSignal() |
14 |
onUpdateUI = pyqtSignal() |
|
15 | 14 |
|
16 | 15 |
def __init__(self, scene, items, parent=None): |
17 | 16 |
from SymbolSvgItem import SymbolSvgItem |
HYTOS/HYTOS/Commands/FlipCommand.py | ||
---|---|---|
11 | 11 |
"""This is flip command class""" |
12 | 12 |
onSuccess = pyqtSignal() |
13 | 13 |
onRejected = pyqtSignal() |
14 |
onUpdateUI = pyqtSignal() |
|
15 | 14 |
|
16 | 15 |
def __init__(self, scene, items, flip, parent=None): |
17 | 16 |
from SymbolSvgItem import SymbolSvgItem |
HYTOS/HYTOS/Commands/HydroCalculationCommand.py | ||
---|---|---|
20 | 20 |
|
21 | 21 |
onSuccess = pyqtSignal(QGraphicsItem) |
22 | 22 |
onRejected = pyqtSignal() |
23 |
onUpdateUI = pyqtSignal() |
|
24 | 23 |
ERRORS = 0 |
25 | 24 |
|
26 | 25 |
def __init__(self, imageViewer): |
HYTOS/HYTOS/Commands/LeftAlignmentCommand.py | ||
---|---|---|
11 | 11 |
|
12 | 12 |
onSuccess = pyqtSignal() |
13 | 13 |
onRejected = pyqtSignal() |
14 |
onUpdateUI = pyqtSignal() |
|
15 | 14 |
|
16 | 15 |
def __init__(self, scene, items, parent=None): |
17 | 16 |
from SymbolSvgItem import SymbolSvgItem |
HYTOS/HYTOS/Commands/PlaceCalloutCommand.py | ||
---|---|---|
22 | 22 |
|
23 | 23 |
onSuccess = pyqtSignal() |
24 | 24 |
onRejected = pyqtSignal(AbstractCommand.AbstractCommand) |
25 |
onUpdateUI = pyqtSignal() |
|
26 | 25 |
|
27 | 26 |
def __init__(self, imageViewer): |
28 | 27 |
super(PlaceCalloutCommand, self).__init__(imageViewer) |
HYTOS/HYTOS/Commands/PlaceCloudCommand.py | ||
---|---|---|
22 | 22 |
|
23 | 23 |
onSuccess = pyqtSignal() |
24 | 24 |
onRejected = pyqtSignal(AbstractCommand.AbstractCommand) |
25 |
onUpdateUI = pyqtSignal() |
|
26 | 25 |
|
27 | 26 |
def __init__(self, imageViewer): |
28 | 27 |
super(PlaceCloudCommand, self).__init__(imageViewer) |
HYTOS/HYTOS/Commands/PlaceDimensionCommand.py | ||
---|---|---|
22 | 22 |
|
23 | 23 |
onSuccess = pyqtSignal() |
24 | 24 |
onRejected = pyqtSignal(AbstractCommand.AbstractCommand) |
25 |
onUpdateUI = pyqtSignal() |
|
26 | 25 |
|
27 | 26 |
def __init__(self, imageViewer): |
28 | 27 |
super(PlaceDimensionCommand, self).__init__(imageViewer) |
HYTOS/HYTOS/Commands/PlaceStreamlineCommand.py | ||
---|---|---|
22 | 22 |
|
23 | 23 |
onSuccess = pyqtSignal() |
24 | 24 |
onRejected = pyqtSignal(AbstractCommand.AbstractCommand) |
25 |
onUpdateUI = pyqtSignal() |
|
26 | 25 |
|
27 | 26 |
def __init__(self, imageViewer): |
28 | 27 |
super(PlaceStreamlineCommand, self).__init__(imageViewer) |
... | ... | |
31 | 30 |
|
32 | 31 |
self._streamline = None |
33 | 32 |
self.connectorItems = [] |
33 |
self.tmp_param = None |
|
34 | 34 |
|
35 | 35 |
@property |
36 | 36 |
def streamline(self): |
... | ... | |
45 | 45 |
''' |
46 | 46 |
|
47 | 47 |
def reset(self): |
48 |
|
|
49 |
#if self._streamline is not None: |
|
50 |
# scene = self._streamline.scene() |
|
51 |
# if scene is not None: |
|
52 |
# scene.removeItem(self._streamline) |
|
53 |
# scene.invalidate() |
|
48 | 54 |
self._streamline = None |
49 | 55 |
|
50 | 56 |
def execute(self, param): |
... | ... | |
56 | 62 |
|
57 | 63 |
try: |
58 | 64 |
event = param[1] |
65 |
self.tmp_param = param |
|
66 |
|
|
59 | 67 |
if 'mousePressEvent' == param[0] and event.button() == Qt.LeftButton: |
60 | 68 |
selected = [item for item in self.imageViewer.scene.items(param[2]) if type(item) is QEngineeringConnectorItem] |
61 | 69 |
|
... | ... | |
116 | 124 |
pass |
117 | 125 |
|
118 | 126 |
def redo(self): |
119 |
pass |
|
127 |
pass |
HYTOS/HYTOS/Commands/RightAlignmentCommand.py | ||
---|---|---|
11 | 11 |
|
12 | 12 |
onSuccess = pyqtSignal() |
13 | 13 |
onRejected = pyqtSignal() |
14 |
onUpdateUI = pyqtSignal() |
|
15 | 14 |
|
16 | 15 |
def __init__(self, scene, items, parent=None): |
17 | 16 |
from SymbolSvgItem import SymbolSvgItem |
HYTOS/HYTOS/Commands/RotateCommand.py | ||
---|---|---|
12 | 12 |
|
13 | 13 |
onSuccess = pyqtSignal() |
14 | 14 |
onRejected = pyqtSignal() |
15 |
onUpdateUI = pyqtSignal() |
|
16 | 15 |
|
17 | 16 |
def __init__(self, scene, items, reverse=False, angles=None, parent=None): |
18 | 17 |
from SymbolSvgItem import SymbolSvgItem |
HYTOS/HYTOS/Commands/SelectByPolygonCommand.py | ||
---|---|---|
20 | 20 |
|
21 | 21 |
onSuccess = pyqtSignal() |
22 | 22 |
onRejected = pyqtSignal(AbstractCommand.AbstractCommand) |
23 |
onUpdateUI = pyqtSignal() |
|
24 | 23 |
|
25 | 24 |
def __init__(self, imageViewer): |
26 | 25 |
super(SelectByPolygonCommand, self).__init__(imageViewer) |
... | ... | |
43 | 42 |
scene.invalidate() |
44 | 43 |
|
45 | 44 |
self._polyline = None |
46 |
self.onUpdateUI.emit() |
|
47 | 45 |
|
48 | 46 |
''' |
49 | 47 |
@brief place a line |
... | ... | |
83 | 81 |
self.onSuccess.emit() |
84 | 82 |
elif 'mouseReleaseEvent' == param[0] and event.button() == Qt.RightButton and self._polyline is None: |
85 | 83 |
self.onRejected.emit(self) |
86 |
self.onUpdateUI.emit() |
|
87 | 84 |
elif 'mouseMoveEvent' == param[0] and self._polyline is not None: |
88 | 85 |
self._polyline.drawing_mode = QEngineeringPolylineItem.FREE_MODE |
89 | 86 |
self._polyline.onMouseMoved(event, param[2]) |
HYTOS/HYTOS/Commands/UpAlignmentCommand.py | ||
---|---|---|
11 | 11 |
|
12 | 12 |
onSuccess = pyqtSignal() |
13 | 13 |
onRejected = pyqtSignal() |
14 |
onUpdateUI = pyqtSignal() |
|
15 | 14 |
|
16 | 15 |
def __init__(self, scene, items, parent=None): |
17 | 16 |
from SymbolSvgItem import SymbolSvgItem |
HYTOS/HYTOS/MainWindow.py | ||
---|---|---|
512 | 512 |
self.actionSelectByPolygon.setChecked(False) |
513 | 513 |
self.graphicsView.useDefaultCommand() |
514 | 514 |
|
515 |
def on_updateUI(): |
|
516 |
self.actionSelectByPolygon.setChecked(False) |
|
517 |
|
|
518 | 515 |
if self.graphicsView.command is not None: |
519 | 516 |
self.graphicsView.command.reset() |
520 | 517 |
|
... | ... | |
525 | 522 |
|
526 | 523 |
self.actionSelectByPolygon.tag.onSuccess.connect(on_success) |
527 | 524 |
self.actionSelectByPolygon.tag.onRejected.connect(self.onCommandRejected) |
528 |
self.actionSelectByPolygon.tag.onUpdateUI.connect(on_updateUI) |
|
529 | 525 |
self.graphicsView.command = self.actionSelectByPolygon.tag |
530 | 526 |
|
531 | 527 |
if self.actionSelectByPolygon.isChecked() == False: |
... | ... | |
2823 | 2819 |
''' |
2824 | 2820 |
|
2825 | 2821 |
def onPlaceLine(self): |
2822 |
|
|
2823 |
if self.graphicsView.command is not None: |
|
2824 |
self.graphicsView.command.reset() |
|
2825 |
|
|
2826 |
#if self.actionLine.isChecked(): |
|
2826 | 2827 |
self.actionLine.setChecked(True) |
2827 | 2828 |
if not hasattr(self.actionLine, 'tag'): |
2828 | 2829 |
self.actionLine.tag = PlaceStreamlineCommand.PlaceStreamlineCommand(self.graphicsView) |
... | ... | |
3103 | 3104 |
self.graphicsView.scene.removeItem(self.actionLine.tag.streamline) |
3104 | 3105 |
self.graphicsView.scene.update() |
3105 | 3106 |
self.actionLine.tag.reset() |
3106 |
|
|
3107 | 3107 |
self.actionLine.setChecked(False) |
3108 | 3108 |
elif type(cmd) is AreaZoomCommand.AreaZoomCommand: |
3109 | 3109 |
self.actionZoom.setChecked(False) |
... | ... | |
3115 | 3115 |
|
3116 | 3116 |
self.actionLine.setChecked(False) |
3117 | 3117 |
self.actionZoom.setChecked(False) |
3118 |
self.actionSelectByPolygon.setChecked(False) |
|
3118 | 3119 |
finally: |
3119 | 3120 |
self.graphicsView.useDefaultCommand() |
3120 | 3121 |
|
... | ... | |
3128 | 3129 |
def keyPressEvent(self, event): |
3129 | 3130 |
try: |
3130 | 3131 |
if event.key() == Qt.Key_Escape: |
3131 |
self.graphicsView.useDefaultCommand() |
|
3132 |
self.onCommandRejected() |
|
3133 |
'''self.graphicsView.useDefaultCommand() |
|
3134 |
for action in self.toolBar.actions(): |
|
3135 |
# if hasattr(action, 'tag') and action.isChecked(): |
|
3136 |
if action.isChecked(): # AreaZoom Command's tag is empty |
|
3137 |
action.setChecked(False)''' |
|
3132 | 3138 |
elif (event.key() == Qt.Key_C) and (event.modifiers() & Qt.ControlModifier): |
3133 | 3139 |
if self.tableWidgetHMB.hasFocus(): |
3134 | 3140 |
self.copy_selection(self.tableWidgetHMB) |
HYTOS/HYTOS/Scripts/DocVer_3.4.4.0.sql | ||
---|---|---|
1 |
ALTER TABLE Components ADD COLUMN Transform [REAL] DEFAULT '1,0,0,0,1,0,0,0,1'; |
HYTOS/HYTOS/Shapes/EngineeringCloudItem.py | ||
---|---|---|
164 | 164 |
start_x = componentInfos[0]['Comp_X'] # X@Components |
165 | 165 |
start_y = componentInfos[0]['Comp_Y'] # Y@Components |
166 | 166 |
angle = componentInfos[0]['Rotation'] # Rotation@Components |
167 |
#scale = componentInfos[0]['Scale'] # Scale@Components
|
|
167 |
#trans = componentInfos[0]['Transform'] # Transform@Components
|
|
168 | 168 |
end_x, end_y = componentInfos[0]['X'], componentInfos[0]['Y'] |
169 | 169 |
|
170 | 170 |
pos = QPointF(float(start_x), float(start_y)) |
171 | 171 |
item = PlaceCloudCommand.create_item(pos) |
172 | 172 |
if item: |
173 |
tokens = componentInfos[0]['Scale'].split(',')
|
|
173 |
tokens = componentInfos[0]['Transform'].split(',')
|
|
174 | 174 |
trans = QTransform(float(tokens[0]), float(tokens[1]), float(tokens[2]), |
175 | 175 |
float(tokens[3]), float(tokens[4]), float(tokens[5]), |
176 | 176 |
float(tokens[6]), float(tokens[7]), float(tokens[8])) |
... | ... | |
193 | 193 |
try: |
194 | 194 |
rect = self.sceneBoundingRect() |
195 | 195 |
|
196 |
cols = ['UID', 'Symbols_UID', 'Name', 'X', 'Y', 'Rotation', 'Scale']
|
|
196 |
cols = ['UID', 'Symbols_UID', 'Name', 'X', 'Y', 'Rotation', 'Transform']
|
|
197 | 197 |
values = ['?', "(select uid from Symbols where Name='Cloud')", '?', '?', '?', '?', '?'] |
198 | 198 |
|
199 | 199 |
trans = self.transform() |
HYTOS/HYTOS/Shapes/EngineeringStreamlineItem.py | ||
---|---|---|
1003 | 1003 |
def keyPressEvent(self, event): |
1004 | 1004 |
from App import App |
1005 | 1005 |
from AppDocData import AppDocData |
1006 |
if not self.isSelected(): return |
|
1007 | 1006 |
|
1008 |
if event.key() == Qt.Key_Delete: |
|
1009 |
self.transfer.onRemoved.emit(self) |
|
1010 |
elif event.key() == Qt.Key_QuoteLeft: |
|
1011 |
self.mouseDoubleClickEvent(event) |
|
1007 |
if self.isSelected(): |
|
1008 |
if event.key() == Qt.Key_Delete: |
|
1009 |
self.transfer.onRemoved.emit(self) |
|
1010 |
elif event.key() == Qt.Key_QuoteLeft: |
|
1011 |
self.mouseDoubleClickEvent(event) |
|
1012 |
else: |
|
1013 |
QGraphicsPathItem.keyPressEvent(self, event) |
|
1012 | 1014 |
|
1013 | 1015 |
def toSql(self): |
1014 | 1016 |
""" convert valve data to sql query """ |
HYTOS/HYTOS/Shapes/SymbolSvgItem.py | ||
---|---|---|
1397 | 1397 |
''' |
1398 | 1398 |
|
1399 | 1399 |
def keyPressEvent(self, event): |
1400 |
if not self.isSelected(): return |
|
1400 |
if self.isSelected(): |
|
1401 |
if event.key() == Qt.Key_Delete: |
|
1402 |
self.transfer.onRemoved.emit(self) |
|
1403 |
elif event.key() == Qt.Key_QuoteLeft: |
|
1404 |
self.mouseDoubleClickEvent(event) |
|
1405 |
else: |
|
1406 |
QGraphicsSvgItem.keyPressEvent(self, event) |
|
1407 |
'''if not self.isSelected(): return |
|
1401 | 1408 |
|
1402 | 1409 |
if event.key() == Qt.Key_Delete: |
1403 | 1410 |
self.deleteSvgItemFromScene() |
1404 | 1411 |
elif event.key() == Qt.Key_QuoteLeft: |
1405 |
self.mouseDoubleClickEvent(event) |
|
1412 |
self.mouseDoubleClickEvent(event)'''
|
|
1406 | 1413 |
|
1407 | 1414 |
''' |
1408 | 1415 |
@brief Double click event, Show rotate symbol dialog |
ReportApp/ReportApp/ReportApp.csproj | ||
---|---|---|
39 | 39 |
<StartupObject /> |
40 | 40 |
</PropertyGroup> |
41 | 41 |
<ItemGroup> |
42 |
<Reference Include="GemBox.Spreadsheet, Version=47.0.0.1207, Culture=neutral, PublicKeyToken=b1b72c69714d4847, processorArchitecture=MSIL" /> |
|
42 |
<Reference Include="GemBox.Spreadsheet, Version=47.0.0.1203, Culture=neutral, PublicKeyToken=b1b72c69714d4847, processorArchitecture=MSIL"> |
|
43 |
<SpecificVersion>False</SpecificVersion> |
|
44 |
<HintPath>..\packages\GemBox.Spreadsheet.47\net35\GemBox.Spreadsheet.dll</HintPath> |
|
45 |
</Reference> |
|
43 | 46 |
<Reference Include="PresentationCore" /> |
44 | 47 |
<Reference Include="PresentationFramework" /> |
45 | 48 |
<Reference Include="ReachFramework" /> |
내보내기 Unified diff