Exemplo n.º 1
0
    def __init__(self, iface):

        self.iface = iface
        self.canvas = self.iface.mapCanvas()

        QtGui.QWidget.__init__(self)
        QtCore.QObject.__init__(self)
        self.setupUi(self)
        self.setupUi_extra()

        self.qgis_education_manager = TerreImageManager(self.iface)
        self.lineEdit_working_dir.setText(
            self.qgis_education_manager.working_directory)

        QtCore.QObject.connect(QgsMapLayerRegistry.instance(),
                               QtCore.SIGNAL("layerWillBeRemoved(QString)"),
                               self.layer_deleted)

        self.dock_histo_opened = False
Exemplo n.º 2
0
    def show_education_widget(self, bands, working_dir):
        if ProcessingManager().working_layer and bands:

            if not self.dockOpened:
                # create the widget to display information
                self.educationWidget = QGISEducationWidget(self.iface)
                QObject.connect(self.educationWidget, SIGNAL("terminated()"),
                                self.unload_interface)
                # self.educationWidget.qgis_education_manager = self.qgis_education_manager
                self.educationWidget.qgis_education_manager = TerreImageManager(
                    self.iface)
                self.educationWidget.qgis_education_manager.working_directory = working_dir
                self.educationWidget.lineEdit_working_dir.setText(working_dir)

                self.educationWidget.qgis_education_manager.classif_tool.set_layers(
                    ProcessingManager().get_qgis_working_layers(),
                    ProcessingManager().working_layer.get_qgis_layer(),
                    ProcessingManager().working_layer.band_invert)
                self.educationWidget.qgis_education_manager.classif_tool.set_directory(
                    working_dir)
                self.educationWidget.qgis_education_manager.classif_tool.setupUi(
                )

                # create the dockwidget with the correct parent and add the valuewidget
                self.qgisedudockwidget = Terre_Image_Main_Dock_widget(
                    "Terre Image", self.iface.mainWindow(), self.iface)
                self.qgisedudockwidget.setObjectName("Terre Image")
                self.qgisedudockwidget.setWidget(self.educationWidget)
                QObject.connect(self.qgisedudockwidget,
                                SIGNAL("closed(PyQt_PyObject)"),
                                self.close_dock)

                # add the dockwidget to iface
                self.iface.addDockWidget(Qt.RightDockWidgetArea,
                                         self.qgisedudockwidget)
                self.educationWidget.set_comboBox_sprectral_band_display()

            text = "Plan R <- BS_PIR \nPlan V <- BS_R \nPlan B <- BS_V"

            self.qgisedudockwidget.show()
            self.dockOpened = True
Exemplo n.º 3
0
    def __init__(self, iface, working_dir):

        self.iface = iface
        self.canvas = self.iface.mapCanvas()

        QtGui.QWidget.__init__(self)
        self.setupUi(self)
        self.setupUi_extra()

        self.qgis_education_manager = TerreImageManager(self.iface)

        #working dir
        self.qgis_education_manager.working_directory = working_dir
        self.lineEdit_working_dir.setText(working_dir)

        # todo remove this init
        self.qgis_education_manager.classif_tool.set_layers(
            ProcessingManager().get_qgis_working_layers(),
            ProcessingManager().working_layer.get_qgis_layer(),
            ProcessingManager().working_layer.band_invert)
        self.qgis_education_manager.classif_tool.set_directory(working_dir)
        self.qgis_education_manager.classif_tool.setupUi()

        logger.debug("Manager 1 {}".format(id(self.qgis_education_manager)))
        self.lineEdit_working_dir.setText(
            self.qgis_education_manager.working_directory)
        logger.debug("Before connecting toto titi")
        self.qgis_education_manager.processings_updated.connect(
            self.set_combobox_histograms)

        logger.debug("After connecting toto titi")

        QtCore.QObject.connect(QgsMapLayerRegistry.instance(),
                               QtCore.SIGNAL("layerWillBeRemoved(QString)"),
                               self.layer_deleted)

        self.dock_histo_opened = False