프로젝트

일반

사용자정보

개정판 91b1c35c

ID91b1c35c0d59566af0f83b581bd299ce8747d5b1
상위 fc977b3b
하위 4747c73a

임예철이(가) 약 4년 전에 추가함

Polygon 기능 구현 최종
*onSuccess, onRejected, onUpdateUI 모든 커멘드에 추가

Change-Id: Ibf6aaac6476211a0071d781fe2ca9f83abb0751a

차이점 보기:

HYTOS/HYTOS/Commands/AreaZoomCommand.py
14 14

  
15 15

  
16 16
class AreaZoomCommand(AbstractCommand.AbstractCommand):
17
    
18
    onSuccess = pyqtSignal()
17 19
    onRejected = pyqtSignal(AbstractCommand.AbstractCommand)
20
    onUpdateUI = pyqtSignal()
18 21

  
19 22
    '''
20 23
        @history    2018.06.27  Jeongwoo    Add variables [startPoint, endPoint]
HYTOS/HYTOS/Commands/DownAlignmentCommand.py
8 8

  
9 9

  
10 10
class DownAlignmentCommand(QUndoCommand):
11

  
12
    onSuccess = pyqtSignal()
13
    onRejected = pyqtSignal()
14
    onUpdateUI = pyqtSignal()
15

  
11 16
    def __init__(self, scene, items, parent=None):
12 17
        from SymbolSvgItem import SymbolSvgItem
13 18
        from EngineeringCalloutTextItem import QEngineeringCalloutTextItem
HYTOS/HYTOS/Commands/FlipCommand.py
10 10

  
11 11
class FlipCommand(QUndoCommand):
12 12
    """This is flip command class"""
13
    onSuccess = pyqtSignal()
14
    onRejected = pyqtSignal()
15
    onUpdateUI = pyqtSignal()
16

  
13 17
    def __init__(self, scene, items, flip, parent=None):
14 18
        from SymbolSvgItem import SymbolSvgItem
15 19

  
HYTOS/HYTOS/Commands/HydroCalculationCommand.py
19 19
    """ Hydro Calculation class """
20 20

  
21 21
    onSuccess = pyqtSignal(QGraphicsItem)
22
    onRejected = pyqtSignal()
23
    onUpdateUI = pyqtSignal()
22 24
    ERRORS = 0
23 25

  
24 26
    def __init__(self, imageViewer):
HYTOS/HYTOS/Commands/LeftAlignmentCommand.py
8 8

  
9 9

  
10 10
class LeftAlignmentCommand(QUndoCommand):
11

  
12
    onSuccess = pyqtSignal()
13
    onRejected = pyqtSignal()
14
    onUpdateUI = pyqtSignal()
15

  
11 16
    def __init__(self, scene, items, parent=None):
12 17
        from SymbolSvgItem import SymbolSvgItem
13 18
        from EngineeringCalloutTextItem import QEngineeringCalloutTextItem
HYTOS/HYTOS/Commands/PlaceCalloutCommand.py
22 22

  
23 23
    onSuccess = pyqtSignal()
24 24
    onRejected = pyqtSignal(AbstractCommand.AbstractCommand)
25
    onUpdateUI = pyqtSignal()
25 26

  
26 27
    def __init__(self, imageViewer):
27 28
        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()
25 26

  
26 27
    def __init__(self, imageViewer):
27 28
        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()
25 26

  
26 27
    def __init__(self, imageViewer):
27 28
        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()
25 26

  
26 27
    def __init__(self, imageViewer):
27 28
        super(PlaceStreamlineCommand, self).__init__(imageViewer)
HYTOS/HYTOS/Commands/RightAlignmentCommand.py
8 8

  
9 9

  
10 10
class RightAlignmentCommand(QUndoCommand):
11

  
12
    onSuccess = pyqtSignal()
13
    onRejected = pyqtSignal()
14
    onUpdateUI = pyqtSignal()
15

  
11 16
    def __init__(self, scene, items, parent=None):
12 17
        from SymbolSvgItem import SymbolSvgItem
13 18
        from EngineeringCalloutTextItem import QEngineeringCalloutTextItem
HYTOS/HYTOS/Commands/RotateCommand.py
9 9

  
10 10

  
11 11
class RotateCommand(QUndoCommand):
12
    on_rejected = pyqtSignal()
12
    
13
    onSuccess = pyqtSignal()
14
    onRejected = pyqtSignal()
15
    onUpdateUI = pyqtSignal()
13 16

  
14 17
    def __init__(self, scene, items, reverse=False, angles=None, parent=None):
15 18
        from SymbolSvgItem import SymbolSvgItem
HYTOS/HYTOS/Commands/SelectByPolygonCommand.py
20 20

  
21 21
    onSuccess = pyqtSignal()
22 22
    onRejected = pyqtSignal(AbstractCommand.AbstractCommand)
23
    onButtonCancel = pyqtSignal()
23
    onUpdateUI = pyqtSignal()
24 24

  
25 25
    def __init__(self, imageViewer):
26 26
        super(SelectByPolygonCommand, self).__init__(imageViewer)
......
43 43
                scene.invalidate()
44 44

  
45 45
            self._polyline = None
46
            self.onButtonCancel.emit() #추가
46
            self.onUpdateUI.emit()
47 47

  
48 48
    '''
49 49
        @brief      place a line
......
83 83
                self.onSuccess.emit()
84 84
            elif 'mouseReleaseEvent' == param[0] and event.button() == Qt.RightButton and self._polyline is None:
85 85
                self.onRejected.emit(self)
86
                self.onButtonCancel.emit()
86
                self.onUpdateUI.emit()
87 87
            elif 'mouseMoveEvent' == param[0] and self._polyline is not None:
88 88
                self._polyline.drawing_mode = QEngineeringPolylineItem.FREE_MODE
89 89
                self._polyline.onMouseMoved(event, param[2])
HYTOS/HYTOS/Commands/UpAlignmentCommand.py
8 8

  
9 9

  
10 10
class UpAlignmentCommand(QUndoCommand):
11

  
12
    onSuccess = pyqtSignal()
13
    onRejected = pyqtSignal()
14
    onUpdateUI = pyqtSignal()
15

  
11 16
    def __init__(self, scene, items, parent=None):
12 17
        from SymbolSvgItem import SymbolSvgItem
13 18
        from EngineeringCalloutTextItem import QEngineeringCalloutTextItem
HYTOS/HYTOS/MainWindow.py
512 512
                self.actionSelectByPolygon.setChecked(False)
513 513
                self.graphicsView.useDefaultCommand()
514 514

  
515
        def on_buttoncancel():
515
        def on_updateUI():
516 516
                self.actionSelectByPolygon.setChecked(False)
517 517

  
518 518
        if self.graphicsView.command is not None:
......
525 525

  
526 526
            self.actionSelectByPolygon.tag.onSuccess.connect(on_success)
527 527
            self.actionSelectByPolygon.tag.onRejected.connect(self.onCommandRejected)
528
            self.actionSelectByPolygon.tag.onButtonCancel.connect(on_buttoncancel)
528
            self.actionSelectByPolygon.tag.onUpdateUI.connect(on_updateUI)
529 529
            self.graphicsView.command = self.actionSelectByPolygon.tag
530 530

  
531
        if self.actionSelectByPolygon.isChecked() == False: #폴리곤버튼을 누르고 버튼을 한번더눌러 해제했을때도 선이 그려지는 오류로인한 구현
531
        if self.actionSelectByPolygon.isChecked() == False:
532 532
            self.onCommandRejected()
533 533

  
534 534
    def closeEvent(self, event: QCloseEvent) -> None:

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)