Exemple #1
0
    def save_scenario(self):
        """Save current scenario to text file"""
        from safe.gui.tools.save_scenario import SaveScenarioDialog

        dialog = SaveScenarioDialog(
            iface=self.iface,
            dock=self.dock_widget)
        dialog.save_scenario()
Exemple #2
0
    def setUp(self):
        """Fixture run before all tests."""
        os.environ['LANG'] = 'en'
        self.DOCK.show_only_visible_layers_flag = True
        load_standard_layers(self.DOCK)
        self.DOCK.hazard_layer_combo.setCurrentIndex(0)
        self.DOCK.exposure_layer_combo.setCurrentIndex(0)
        self.DOCK.run_in_thread_flag = False
        self.DOCK.show_only_visible_layers_flag = False
        self.DOCK.set_layer_from_title_flag = False
        self.DOCK.zoom_to_impact_flag = False
        self.DOCK.hide_exposure_flag = False

        # Create scenario dialog
        self.save_scenario_dialog = SaveScenarioDialog(IFACE, self.DOCK)
Exemple #3
0
    def setUp(self):
        """Fixture run before all tests."""
        os.environ['LANG'] = 'en'
        DOCK.show_only_visible_layers_flag = True
        load_standard_layers(DOCK)
        DOCK.cboHazard.setCurrentIndex(0)
        DOCK.cboExposure.setCurrentIndex(0)
        DOCK.cboFunction.setCurrentIndex(0)
        DOCK.run_in_thread_flag = False
        DOCK.show_only_visible_layers_flag = False
        DOCK.set_layer_from_title_flag = False
        DOCK.zoom_to_impact_flag = False
        DOCK.hide_exposure_flag = False
        DOCK.show_intermediate_layers = False

        # Create scenario dialog
        self.save_scenario_dialog = SaveScenarioDialog(IFACE, DOCK)
Exemple #4
0
    def setUp(self):
        """Fixture run before all tests."""
        os.environ['LANG'] = 'en'
        self.DOCK.show_only_visible_layers_flag = True
        load_standard_layers(self.DOCK)
        self.DOCK.hazard_layer_combo.setCurrentIndex(0)
        self.DOCK.exposure_layer_combo.setCurrentIndex(0)
        self.DOCK.run_in_thread_flag = False
        self.DOCK.show_only_visible_layers_flag = False
        self.DOCK.set_layer_from_title_flag = False
        self.DOCK.zoom_to_impact_flag = False
        self.DOCK.hide_exposure_flag = False

        # Check that the default layers have been loaded!
        # FIXME: this fails if the test is run inside QGIS3
        # assert (self.DOCK.hazard_layer_combo.itemText(1) == 'Classified Flood')

        # Create scenario dialog
        self.save_scenario_dialog = SaveScenarioDialog(IFACE, self.DOCK)