Exemplo n.º 1
0
    def __init__(self, parent=None):
        ''' Constructor '''
        super().__init__(parent)
        self.surface = VideoWidgetSurface(self)
        self.setAttribute(Qt.WA_OpaquePaintEvent)

        self.Tracking_Video_RubberBand = QRubberBand(QRubberBand.Rectangle,
                                                     self)
        self.Censure_RubberBand = QRubberBand(QRubberBand.Rectangle, self)

        color_blue = QColor(Qt.blue)
        color_black = QColor(Qt.black)
        color_amber = QColor(252, 215, 108)

        pal_blue = QPalette()
        pal_blue.setBrush(QPalette.Highlight, QBrush(color_blue))
        self.Tracking_Video_RubberBand.setPalette(pal_blue)

        pal_black = QPalette()
        pal_black.setBrush(QPalette.Highlight, QBrush(color_black))
        self.Censure_RubberBand.setPalette(pal_black)

        self._interaction = InteractionState()
        self._filterSatate = FilterState()

        self._isinit = False
        self._MGRS = False
        self.gt = None

        self.drawCesure = []
        self.poly_coordinates, self.drawPtPos, self.drawLines, self.drawMeasureDistance,self.drawMeasureArea, self.drawPolygon = [], [],[], [], [], []
        # Draw Polygon Canvas Rubberband
        self.poly_Canvas_RubberBand = QgsRubberBand(iface.mapCanvas(),
                                                    True)  # Polygon type
        # set rubber band style
        self.poly_Canvas_RubberBand.setColor(color_amber)
        self.poly_Canvas_RubberBand.setWidth(3)

        # Tracking Canvas Rubberband
        self.Track_Canvas_RubberBand = QgsRubberBand(iface.mapCanvas(),
                                                     QgsWkbTypes.LineGeometry)
        # set rubber band style
        self.Track_Canvas_RubberBand.setColor(color_blue)
        self.Track_Canvas_RubberBand.setWidth(5)

        self.parent = parent.parent()

        palette = self.palette()
        palette.setColor(QPalette.Background, Qt.transparent)
        self.setPalette(palette)

        self.origin, self.dragPos = QPoint(), QPoint()
        self.tapTimer = QBasicTimer()
        self.brush = QBrush(color_black)
        self.blue_Pen = QPen(color_blue, 3)
    def __init__(self, parent=None):
        """Constructor."""
        super(AgknowDockWidgetTimeSlider, self).__init__(parent)
        # Set up the user interface from Designer.
        # After setupUI you can access any designer object by doing
        # self.<objectname>, and you can use autoconnect slots - see
        # http://qt-project.org/doc/qt-4.8/designer-using-a-ui-file.html
        # #widgets-and-dialogs-with-auto-connect
        self.setupUi(self)

        # GUI Events
        # lambda keyword allows the button itself to be passed
        #https://www.tutorialspoint.com/pyqt/pyqt_qradiobutton_widget.htm
        self.rdBtnVisible.toggled.connect(
            lambda: self.rdBtnProductState_toggled(self.rdBtnVisible))
        self.rdBtnVitality.toggled.connect(
            lambda: self.rdBtnProductState_toggled(self.rdBtnVitality))
        self.rdBtnVariations.toggled.connect(
            lambda: self.rdBtnProductState_toggled(self.rdBtnVariations))
        self.rdBtnNDRE1.toggled.connect(
            lambda: self.rdBtnProductState_toggled(self.rdBtnNDRE1))
        self.rdBtnNDRE2.toggled.connect(
            lambda: self.rdBtnProductState_toggled(self.rdBtnNDRE2))
        self.rdBtnNDWI.toggled.connect(
            lambda: self.rdBtnProductState_toggled(self.rdBtnNDWI))
        self.rdBtnSAVI.toggled.connect(
            lambda: self.rdBtnProductState_toggled(self.rdBtnSAVI))
        self.rdBtnEVI2.toggled.connect(
            lambda: self.rdBtnProductState_toggled(self.rdBtnEVI2))
        self.rdBtnCIRE.toggled.connect(
            lambda: self.rdBtnProductState_toggled(self.rdBtnCIRE))
        self.rdBtnNDVI.toggled.connect(
            lambda: self.rdBtnProductState_toggled(self.rdBtnNDVI))
        self.rdBtnRefl.toggled.connect(
            lambda: self.rdBtnProductState_toggled(self.rdBtnRefl))

        self.sliderTime.valueChanged.connect(self.sliderValue_changed)
        self.btnTimePlay.clicked.connect(self.btnTimePlay_clicked)
        self.btnTimeBackward.clicked.connect(self.btnTimeBackward_clicked)
        self.btnTimeForward.clicked.connect(self.btnTimeForward_clicked)

        self.product = "vitality"
        self.rasters = [
        ]  # it's a list here - a dict in agknow_qgis_dockwidget.py
        self.data_source = "sentinel2"
        self.current_parcel_id = None

        # timeslider
        self.timer = QBasicTimer()
        self.step = 0

        self.iface = qgis.utils.iface