diff --git a/HISTORY.rst b/HISTORY.rst
index b52a642..cae81fa 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -4,7 +4,7 @@ History
1.12.1 (unreleased)
-------------------
-- Fixes/enhancements: #116, #250, #257
+- Fixes/enhancements: #116, #149, #250, #254, #257
- Added handling of the multiple schematisations.
- Implemented import of the linear structures from the point datasets (#167).
diff --git a/threedi_schematisation_editor/custom_widgets/__init__.py b/threedi_schematisation_editor/custom_widgets/__init__.py
index 8d4a3d9..4ac7a8d 100644
--- a/threedi_schematisation_editor/custom_widgets/__init__.py
+++ b/threedi_schematisation_editor/custom_widgets/__init__.py
@@ -179,6 +179,8 @@ class ImportStructuresDialog(ic_basecls, ic_uicls):
}
STRUCTURES_WITH_MANHOLES = (dm.Culvert, dm.Orifice, dm.Weir, dm.Pipe)
+ LAST_CONFIG_DIR_ENTRY = "threedi/last_import_config_dir"
+
def __init__(self, structure_model_cls, model_gpkg, layer_manager, uc, parent=None):
super().__init__(parent)
self.setupUi(self)
@@ -519,9 +521,11 @@ def update_fields_settings(self, model_cls, fields_setting):
def save_import_settings(self):
extension_filter = "JSON (*.json)"
- template_filepath = get_filepath(self, extension_filter)
+ template_filepath = get_filepath(self, extension_filter, default_settings_entry=self.LAST_CONFIG_DIR_ENTRY)
if not template_filepath:
return
+ settings = QgsSettings()
+ settings.setValue(self.LAST_CONFIG_DIR_ENTRY, os.path.dirname(template_filepath))
try:
import_settings = self.collect_settings()
with open(template_filepath, "w") as template_file:
@@ -532,9 +536,13 @@ def save_import_settings(self):
def load_import_settings(self):
extension_filter = "JSON (*.json)"
- template_filepath = get_filepath(self, extension_filter, save=False)
+ template_filepath = get_filepath(
+ self, extension_filter, save=False, default_settings_entry=self.LAST_CONFIG_DIR_ENTRY
+ )
if not template_filepath:
return
+ settings = QgsSettings()
+ settings.setValue(self.LAST_CONFIG_DIR_ENTRY, os.path.dirname(template_filepath))
try:
with open(template_filepath, "r") as template_file:
import_settings = json.loads(template_file.read())
diff --git a/threedi_schematisation_editor/custom_widgets/ui/import_structures.ui b/threedi_schematisation_editor/custom_widgets/ui/import_structures.ui
index f8324fe..d9e4ca5 100644
--- a/threedi_schematisation_editor/custom_widgets/ui/import_structures.ui
+++ b/threedi_schematisation_editor/custom_widgets/ui/import_structures.ui
@@ -410,6 +410,27 @@
+
+ structure_layer_cbo
+ edit_channels_cb
+ create_manholes_cb
+ create_nodes_cb
+ selected_only_cb
+ length_source_field_cbo
+ length_fallback_value_dsb
+ azimuth_source_field_cbo
+ azimuth_fallback_value_sb
+ tab_widget
+ structure_tv
+ connection_node_tv
+ manhole_tv
+ save_pb
+ load_pb
+ snap_gb
+ snap_dsb
+ run_pb
+ close_pb
+
diff --git a/threedi_schematisation_editor/custom_widgets/ui/load_schematisation.ui b/threedi_schematisation_editor/custom_widgets/ui/load_schematisation.ui
index 665fb96..57cdca8 100644
--- a/threedi_schematisation_editor/custom_widgets/ui/load_schematisation.ui
+++ b/threedi_schematisation_editor/custom_widgets/ui/load_schematisation.ui
@@ -127,10 +127,10 @@
- load_pb
- cancle_pb
load_tab
schematisation_tv
+ cancle_pb
+ load_pb
diff --git a/threedi_schematisation_editor/forms/ui/channel.ui b/threedi_schematisation_editor/forms/ui/channel.ui
index dae3cdc..acb0cf4 100644
--- a/threedi_schematisation_editor/forms/ui/channel.ui
+++ b/threedi_schematisation_editor/forms/ui/channel.ui
@@ -26,7 +26,7 @@
0
- 0
+ -5
515
929
@@ -1839,14 +1839,69 @@
+ scrollArea
+ tabWidget
id
code
display_name
calculation_type
dist_calc_points
+ dist_calc_points_clear
zoom_category
+ exchange_thickness
+ exchange_thickness_clear
+ hydraulic_conductivity_in
+ hydraulic_conductivity_in_clear
+ hydraulic_conductivity_out
+ hydraulic_conductivity_out_clear
connection_node_start_id
connection_node_end_id
+ connection_node_1_id
+ connection_node_1_code
+ connection_node_1_initial_waterlevel
+ connection_node_1_initial_waterlevel_clear
+ connection_node_1_storage_area
+ connection_node_1_storage_area_clear
+ connection_node_2_id
+ connection_node_2_code
+ connection_node_2_initial_waterlevel
+ connection_node_2_initial_waterlevel_clear
+ connection_node_2_storage_area
+ connection_node_2_storage_area_clear
+ cross_section_locations
+ cross_section_location_id
+ cross_section_location_bank_level
+ cross_section_location_bank_level_clear
+ cross_section_location_code
+ cross_section_location_reference_level
+ cross_section_location_reference_level_clear
+ cross_section_location_cross_section_shape
+ cross_section_location_cross_section_width
+ cross_section_location_cross_section_width_clear
+ cross_section_location_cross_section_height
+ cross_section_location_cross_section_height_clear
+ cross_section_location_cross_section_table_widget
+ cross_section_location_cross_section_table_delete
+ cross_section_location_cross_section_table_copy
+ cross_section_location_cross_section_table_paste
+ cross_section_location_cross_section_table_add
+ cross_section_location_friction_type
+ cross_section_location_friction_value
+ cross_section_location_friction_value_clear
+ cross_section_location_cross_section_friction_widget
+ cross_section_location_cross_section_friction_clear
+ cross_section_location_cross_section_friction_copy
+ cross_section_location_vegetation_stem_density
+ cross_section_location_vegetation_stem_density_clear
+ cross_section_location_vegetation_stem_diameter
+ cross_section_location_vegetation_stem_diameter_clear
+ cross_section_location_vegetation_height
+ cross_section_location_vegetation_height_clear
+ cross_section_location_vegetation_drag_coefficient
+ cross_section_location_vegetation_drag_coefficient_clear
+ cross_section_location_cross_section_vegetation_widget
+ cross_section_location_cross_section_vegetation_clear
+ cross_section_location_cross_section_vegetation_copy
diff --git a/threedi_schematisation_editor/forms/ui/connection_node.ui b/threedi_schematisation_editor/forms/ui/connection_node.ui
index c25dffc..f0785c2 100644
--- a/threedi_schematisation_editor/forms/ui/connection_node.ui
+++ b/threedi_schematisation_editor/forms/ui/connection_node.ui
@@ -239,6 +239,15 @@
+
+ scrollArea
+ id
+ code
+ initial_waterlevel
+ initial_waterlevel_clear
+ storage_area
+ storage_area_clear
+
diff --git a/threedi_schematisation_editor/forms/ui/cross_section_location.ui b/threedi_schematisation_editor/forms/ui/cross_section_location.ui
index 36d4bf9..55d102c 100644
--- a/threedi_schematisation_editor/forms/ui/cross_section_location.ui
+++ b/threedi_schematisation_editor/forms/ui/cross_section_location.ui
@@ -26,7 +26,7 @@
0
- -412
+ 0
515
915
@@ -976,6 +976,43 @@
+
+ scrollArea
+ id
+ bank_level
+ bank_level_clear
+ code
+ reference_level
+ reference_level_clear
+ cross_section_shape
+ cross_section_width
+ cross_section_width_clear
+ cross_section_height
+ cross_section_height_clear
+ cross_section_table_widget
+ cross_section_table_delete
+ cross_section_table_copy
+ cross_section_table_paste
+ cross_section_table_add
+ friction_type
+ friction_value
+ friction_value_clear
+ cross_section_friction_widget
+ cross_section_friction_clear
+ cross_section_friction_copy
+ vegetation_stem_density
+ vegetation_stem_density_clear
+ vegetation_stem_diameter
+ vegetation_stem_diameter_clear
+ vegetation_height
+ vegetation_height_clear
+ vegetation_drag_coefficient
+ vegetation_drag_coefficient_clear
+ cross_section_vegetation_widget
+ cross_section_vegetation_clear
+ cross_section_vegetation_copy
+ channel_id
+
diff --git a/threedi_schematisation_editor/forms/ui/culvert.ui b/threedi_schematisation_editor/forms/ui/culvert.ui
index a719cc7..44bd37b 100644
--- a/threedi_schematisation_editor/forms/ui/culvert.ui
+++ b/threedi_schematisation_editor/forms/ui/culvert.ui
@@ -1317,28 +1317,50 @@ coefficient positive
+ scrollArea
+ tabWidget
id
code
display_name
calculation_type
dist_calc_points
+ dist_calc_points_clear
invert_level_start_point
+ invert_level_start_point_clear
invert_level_end_point
+ invert_level_end_point_clear
discharge_coefficient_positive
+ discharge_coefficient_positive_clear
friction_value
+ friction_value_clear
friction_type
discharge_coefficient_negative
+ discharge_coefficient_negative_clear
zoom_category
+ cross_section_shape
+ cross_section_width
+ cross_section_width_clear
+ cross_section_height
+ cross_section_height_clear
+ cross_section_table_widget
+ cross_section_table_delete
+ cross_section_table_copy
+ cross_section_table_paste
+ cross_section_table_add
connection_node_start_id
connection_node_end_id
connection_node_1_id
connection_node_1_code
connection_node_1_initial_waterlevel
+ connection_node_1_initial_waterlevel_clear
connection_node_1_storage_area
+ connection_node_1_storage_area_clear
connection_node_2_id
connection_node_2_code
connection_node_2_initial_waterlevel
+ connection_node_2_initial_waterlevel_clear
connection_node_2_storage_area
+ connection_node_2_storage_area_clear
diff --git a/threedi_schematisation_editor/forms/ui/exchange_line.ui b/threedi_schematisation_editor/forms/ui/exchange_line.ui
index c65f20a..07c4f92 100644
--- a/threedi_schematisation_editor/forms/ui/exchange_line.ui
+++ b/threedi_schematisation_editor/forms/ui/exchange_line.ui
@@ -244,6 +244,14 @@
+
+ scrollArea
+ id
+ code
+ exchange_level
+ exchange_level_clear
+ channel_id
+
diff --git a/threedi_schematisation_editor/forms/ui/impervious_surface_map.ui b/threedi_schematisation_editor/forms/ui/impervious_surface_map.ui
index bd5d4f3..f7e680d 100644
--- a/threedi_schematisation_editor/forms/ui/impervious_surface_map.ui
+++ b/threedi_schematisation_editor/forms/ui/impervious_surface_map.ui
@@ -253,6 +253,14 @@
+
+ scrollArea
+ id
+ connection_node_id
+ percentage
+ percentage_clear
+ impervious_surface_id
+
diff --git a/threedi_schematisation_editor/forms/ui/manhole.ui b/threedi_schematisation_editor/forms/ui/manhole.ui
index 6eb862a..4f72009 100644
--- a/threedi_schematisation_editor/forms/ui/manhole.ui
+++ b/threedi_schematisation_editor/forms/ui/manhole.ui
@@ -836,22 +836,36 @@
+ scrollArea
id
code
display_name
calculation_type
shape
width
+ width_clear
length
+ length_clear
bottom_level
+ bottom_level_clear
surface_level
+ surface_level_clear
drain_level
+ drain_level_clear
zoom_category
manhole_indicator
+ exchange_thickness
+ exchange_thickness_clear
+ hydraulic_conductivity_in
+ hydraulic_conductivity_in_clear
+ hydraulic_conductivity_out
+ hydraulic_conductivity_out_clear
connection_node_id
connection_node_code
connection_node_initial_waterlevel
+ connection_node_initial_waterlevel_clear
connection_node_storage_area
+ connection_node_storage_area_clear
diff --git a/threedi_schematisation_editor/forms/ui/orifice.ui b/threedi_schematisation_editor/forms/ui/orifice.ui
index 4edbacf..97844a8 100644
--- a/threedi_schematisation_editor/forms/ui/orifice.ui
+++ b/threedi_schematisation_editor/forms/ui/orifice.ui
@@ -1228,27 +1228,47 @@ coefficient positive
+ scrollArea
+ tabWidget
id
code
display_name
crest_level
+ crest_level_clear
crest_type
discharge_coefficient_positive
+ discharge_coefficient_positive_clear
friction_value
+ friction_value_clear
friction_type
discharge_coefficient_negative
+ discharge_coefficient_negative_clear
zoom_category
sewerage
+ cross_section_shape
+ cross_section_width
+ cross_section_width_clear
+ cross_section_height
+ cross_section_height_clear
+ cross_section_table_widget
+ cross_section_table_delete
+ cross_section_table_copy
+ cross_section_table_paste
+ cross_section_table_add
connection_node_start_id
connection_node_end_id
connection_node_1_id
connection_node_1_code
connection_node_1_initial_waterlevel
+ connection_node_1_initial_waterlevel_clear
connection_node_1_storage_area
+ connection_node_1_storage_area_clear
connection_node_2_id
connection_node_2_code
connection_node_2_initial_waterlevel
+ connection_node_2_initial_waterlevel_clear
connection_node_2_storage_area
+ connection_node_2_storage_area_clear
diff --git a/threedi_schematisation_editor/forms/ui/pipe.ui b/threedi_schematisation_editor/forms/ui/pipe.ui
index 8b3caa0..30c32c7 100644
--- a/threedi_schematisation_editor/forms/ui/pipe.ui
+++ b/threedi_schematisation_editor/forms/ui/pipe.ui
@@ -2632,18 +2632,40 @@
+ scrollArea
+ tabWidget
id
code
display_name
calculation_type
dist_calc_points
+ dist_calc_points_clear
invert_level_start_point
+ invert_level_start_point_clear
invert_level_end_point
+ invert_level_end_point_clear
friction_value
+ friction_value_clear
friction_type
material
zoom_category
sewerage_type
+ exchange_thickness
+ exchange_thickness_clear
+ hydraulic_conductivity_in
+ hydraulic_conductivity_in_clear
+ hydraulic_conductivity_out
+ hydraulic_conductivity_out_clear
+ cross_section_shape
+ cross_section_width
+ cross_section_width_clear
+ cross_section_height
+ cross_section_height_clear
+ cross_section_table_widget
+ cross_section_table_delete
+ cross_section_table_copy
+ cross_section_table_paste
+ cross_section_table_add
connection_node_start_id
connection_node_end_id
manhole_1_id
@@ -2652,32 +2674,58 @@
manhole_1_calculation_type
manhole_1_shape
manhole_1_width
+ manhole_1_width_clear
manhole_1_length
+ manhole_1_length_clear
manhole_1_bottom_level
+ manhole_1_bottom_level_clear
manhole_1_surface_level
+ manhole_1_surface_level_clear
manhole_1_drain_level
+ manhole_1_drain_level_clear
manhole_1_zoom_category
manhole_1_manhole_indicator
+ manhole_1_exchange_thickness
+ manhole_1_exchange_thickness_clear
+ manhole_1_hydraulic_conductivity_in
+ manhole_1_hydraulic_conductivity_in_clear
+ manhole_1_hydraulic_conductivity_out
+ manhole_1_hydraulic_conductivity_out_clear
connection_node_1_id
connection_node_1_code
connection_node_1_initial_waterlevel
+ connection_node_1_initial_waterlevel_clear
connection_node_1_storage_area
+ connection_node_1_storage_area_clear
manhole_2_id
manhole_2_code
manhole_2_display_name
manhole_2_calculation_type
manhole_2_shape
manhole_2_width
+ manhole_2_width_clear
manhole_2_length
+ manhole_2_length_clear
manhole_2_bottom_level
+ manhole_2_bottom_level_clear
manhole_2_surface_level
+ manhole_2_surface_level_clear
manhole_2_drain_level
+ manhole_2_drain_level_clear
manhole_2_zoom_category
manhole_2_manhole_indicator
+ manhole_2_exchange_thickness
+ manhole_2_exchange_thickness_clear
+ manhole_2_hydraulic_conductivity_in
+ manhole_2_hydraulic_conductivity_in_clear
+ manhole_2_hydraulic_conductivity_out
+ manhole_2_hydraulic_conductivity_out_clear
connection_node_2_id
connection_node_2_code
connection_node_2_initial_waterlevel
+ connection_node_2_initial_waterlevel_clear
connection_node_2_storage_area
+ connection_node_2_storage_area_clear
diff --git a/threedi_schematisation_editor/forms/ui/potential_breach.ui b/threedi_schematisation_editor/forms/ui/potential_breach.ui
index b8759b2..c01a60f 100644
--- a/threedi_schematisation_editor/forms/ui/potential_breach.ui
+++ b/threedi_schematisation_editor/forms/ui/potential_breach.ui
@@ -356,6 +356,18 @@
+
+ scrollArea
+ id
+ code
+ display_name
+ exchange_level
+ exchange_level_clear
+ maximum_breach_depth
+ maximum_breach_depth_clear
+ levee_material
+ channel_id
+
diff --git a/threedi_schematisation_editor/forms/ui/pumpstation.ui b/threedi_schematisation_editor/forms/ui/pumpstation.ui
index 0f81156..dda6fa5 100644
--- a/threedi_schematisation_editor/forms/ui/pumpstation.ui
+++ b/threedi_schematisation_editor/forms/ui/pumpstation.ui
@@ -686,20 +686,27 @@
+ scrollArea
id
code
display_name
start_level
+ start_level_clear
lower_stop_level
+ lower_stop_level_clear
upper_stop_level
+ upper_stop_level_clear
capacity
+ capacity_clear
type
zoom_category
sewerage
connection_node_id
connection_node_code
connection_node_initial_waterlevel
+ connection_node_initial_waterlevel_clear
connection_node_storage_area
+ connection_node_storage_area_clear
diff --git a/threedi_schematisation_editor/forms/ui/pumpstation_map.ui b/threedi_schematisation_editor/forms/ui/pumpstation_map.ui
index e920394..2dd63c5 100644
--- a/threedi_schematisation_editor/forms/ui/pumpstation_map.ui
+++ b/threedi_schematisation_editor/forms/ui/pumpstation_map.ui
@@ -1087,6 +1087,8 @@
+ scrollArea
+ tabWidget
id
code
display_name
@@ -1094,9 +1096,13 @@
pumpstation_code
pumpstation_display_name
pumpstation_start_level
+ pumpstation_start_level_clear
pumpstation_lower_stop_level
+ pumpstation_lower_stop_level_clear
pumpstation_upper_stop_level
+ pumpstation_upper_stop_level_clear
pumpstation_capacity
+ pumpstation_capacity_clear
pumpstation_type
pumpstation_zoom_category
pumpstation_sewerage
@@ -1105,11 +1111,15 @@
connection_node_1_id
connection_node_1_code
connection_node_1_initial_waterlevel
+ connection_node_1_initial_waterlevel_clear
connection_node_1_storage_area
+ connection_node_1_storage_area_clear
connection_node_2_id
connection_node_2_code
connection_node_2_initial_waterlevel
+ connection_node_2_initial_waterlevel_clear
connection_node_2_storage_area
+ connection_node_2_storage_area_clear
diff --git a/threedi_schematisation_editor/forms/ui/surface_map.ui b/threedi_schematisation_editor/forms/ui/surface_map.ui
index d544466..d6f4c45 100644
--- a/threedi_schematisation_editor/forms/ui/surface_map.ui
+++ b/threedi_schematisation_editor/forms/ui/surface_map.ui
@@ -253,6 +253,14 @@
+
+ scrollArea
+ id
+ connection_node_id
+ percentage
+ percentage_clear
+ surface_id
+
diff --git a/threedi_schematisation_editor/forms/ui/weir.ui b/threedi_schematisation_editor/forms/ui/weir.ui
index 879084c..52f7eac 100644
--- a/threedi_schematisation_editor/forms/ui/weir.ui
+++ b/threedi_schematisation_editor/forms/ui/weir.ui
@@ -1229,28 +1229,48 @@ coefficient positive
+ scrollArea
+ tabWidget
id
code
display_name
crest_level
+ crest_level_clear
crest_type
discharge_coefficient_positive
+ discharge_coefficient_positive_clear
friction_value
+ friction_value_clear
friction_type
discharge_coefficient_negative
+ discharge_coefficient_negative_clear
zoom_category
sewerage
external
+ cross_section_shape
+ cross_section_width
+ cross_section_width_clear
+ cross_section_height
+ cross_section_height_clear
+ cross_section_table_widget
+ cross_section_table_delete
+ cross_section_table_copy
+ cross_section_table_paste
+ cross_section_table_add
connection_node_start_id
connection_node_end_id
connection_node_1_id
connection_node_1_code
connection_node_1_initial_waterlevel
+ connection_node_1_initial_waterlevel_clear
connection_node_1_storage_area
+ connection_node_1_storage_area_clear
connection_node_2_id
connection_node_2_code
connection_node_2_initial_waterlevel
+ connection_node_2_initial_waterlevel_clear
connection_node_2_storage_area
+ connection_node_2_storage_area_clear