示例#1
0
    def __init__(
        self,
        parent=None,
        command=None,
        db_key=None,
        measuring_group_id=None,
        dockwidget_controlled_structures=None,
    ):
        """Constructor

        # TODO: fix arguments documentation.

        Args:
            parent: Qt parent Widget
            iface: QGiS interface
            command: Command instance with a run_it method which will be called
                     on acceptance of the dialog
        """
        super().__init__(parent)
        # Show gui
        self.setupUi(self)

        self.measuring_group_id = measuring_group_id
        self.command = command
        self.dockwidget_controlled_structures = dockwidget_controlled_structures

        self.db_key = db_key
        self.databases = get_databases()
        self.db = get_database_properties(self.db_key)
        self.control_structure = ControlledStructures(
            flavor=self.db["db_entry"]["db_type"]
        )
        self.setup_tablewidget()
        self.update_ids()
        self.connect_signals()
示例#2
0
    def __init__(
        self,
        parent=None,
        db_key=None,
        table_control_id=None,
        dockwidget_controlled_structures=None,
    ):
        """Constructor

        Args:
            parent: Qt parent Widget
            (str) db_key: The key of the database. It's a combination of
                          database type (postgres/ spatialite) and
                          name of the database.
            (int) table_control_id: The new id of the control table.
            (QDockWidget) dockwidget_controlled_structures:
                The main dockwidget of the control structures feature.
                This dockwidget is populated with the new table control
                upon pressing OK.
        """
        super().__init__(parent)
        # Show gui
        self.setupUi(self)

        self.table_control_id = table_control_id
        self.dockwidget_controlled_structures = dockwidget_controlled_structures

        self.db_key = db_key
        self.databases = get_databases()
        self.db = get_database_properties(self.db_key)
        self.control_structure = main.ControlledStructures(
            flavor=self.db["db_entry"]["db_type"])
        self.setup_ids()
        self.connect_signals()
示例#3
0
    def __init__(self, parent=None, checks=[], command=None):
        """Constructor
        Args:
            parent: Qt parent Widget
            iface: QGiS interface
            command: Command instance with a run_it method which will be
                     called on acceptance of the dialog
        """
        super().__init__(parent)
        self.checks = checks
        self.setupUi(checks)
        self.command = command

        # rasterchecker only works on spatialte db (and not also postgres db)
        self.databases = {}
        self.all_databases = get_databases()
        for k, v in self.all_databases.items():
            if "spatialite" in k:
                if v["db_name"]:
                    self.databases[k] = v

        self.database_combo.addItems(self.databases.keys())

        # Connect signals
        self.buttonBox.accepted.connect(self.on_accept)
        self.buttonBox.rejected.connect(self.on_reject)
    def __init__(self,
                 parent=None,
                 iface=None,
                 ts_datasources=None,
                 command=None):
        """Constructor

        Args:
            parent: Qt parent Widget
            iface: QGiS interface
            ts_datasources: TimeseriesDatasourceModel instance
            command: Command instance with a run_it method which will be called
                     on acceptance of the dialog
        """
        super().__init__(parent)
        self.setupUi(self)

        self.iface = iface
        self.ts_datasources = ts_datasources
        self.command = command

        self.db_path = self.ts_datasources.model_spatialite_filepath
        self.databases = get_databases()
        self.database_combo.addItems(list(self.databases.keys()))

        self.file_button.clicked.connect(self.select_sufhyd_file)

        # Connect signals
        self.buttonBox.accepted.connect(self.on_accept)
        self.buttonBox.rejected.connect(self.on_reject)

        self.filename = None
示例#5
0
 def __init__(self, iface, command):
     super(SchemaCheckerDialogWidget, self).__init__()
     self.setupUi(self)
     self.iface = iface
     self.command = command
     self.available_databases = get_databases()
     self.save_file_location_display.setText(self.STANDARD_OUTPUT_FILE_PATH)
     self.save_file_location_button.clicked.connect(self.on_save)
     self.database_combobox.addItems(list(self.available_databases.keys()))
     self.run_button.clicked.connect(self.on_run)
     self.cancel_button.clicked.connect(self.on_cancel)
     self.open_result_button.clicked.connect(self.on_open)
示例#6
0
    def __init__(self, *args, **kwargs):
        self.args = args
        self.kwargs = kwargs
        self.iface = kwargs.get("iface")
        self.dockwidget_controlled_structures = None
        self.control_structure = None

        self.databases = get_databases()
        # Remove 'selected' spatialite and postgresdatabases
        # from self.databases to prevent confusion about which database
        # is meant by it
        if "spatialite: " in self.databases:
            self.databases.pop("spatialite: ", None)
        if "postgres: None" in self.databases:
            self.databases.pop("postgres: None", None)
示例#7
0
    def __init__(self, parent=None, command=None):
        """Constructor

        Args:
            parent: Qt parent Widget
            iface: QGiS interface
            command: Command instance with a run_it method which will be called
                     on acceptance of the dialog
        """
        super().__init__(parent)
        self.setupUi()

        self.command = command

        self.databases = get_databases()
        self.database_combo.addItems(list(self.databases.keys()))

        # Connect signals
        self.buttonBox.accepted.connect(self.on_accept)
        self.buttonBox.rejected.connect(self.on_reject)

        self.filename = None