Skip to content

Commit

Permalink
Added fixes for the issues: #149, #254.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldebek committed Sep 23, 2024
1 parent 43da745 commit 02de611
Show file tree
Hide file tree
Showing 18 changed files with 314 additions and 7 deletions.
2 changes: 1 addition & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
12 changes: 10 additions & 2 deletions threedi_schematisation_editor/custom_widgets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand All @@ -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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,27 @@
<header>qgsmaplayercombobox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>structure_layer_cbo</tabstop>
<tabstop>edit_channels_cb</tabstop>
<tabstop>create_manholes_cb</tabstop>
<tabstop>create_nodes_cb</tabstop>
<tabstop>selected_only_cb</tabstop>
<tabstop>length_source_field_cbo</tabstop>
<tabstop>length_fallback_value_dsb</tabstop>
<tabstop>azimuth_source_field_cbo</tabstop>
<tabstop>azimuth_fallback_value_sb</tabstop>
<tabstop>tab_widget</tabstop>
<tabstop>structure_tv</tabstop>
<tabstop>connection_node_tv</tabstop>
<tabstop>manhole_tv</tabstop>
<tabstop>save_pb</tabstop>
<tabstop>load_pb</tabstop>
<tabstop>snap_gb</tabstop>
<tabstop>snap_dsb</tabstop>
<tabstop>run_pb</tabstop>
<tabstop>close_pb</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@
</customwidget>
</customwidgets>
<tabstops>
<tabstop>load_pb</tabstop>
<tabstop>cancle_pb</tabstop>
<tabstop>load_tab</tabstop>
<tabstop>schematisation_tv</tabstop>
<tabstop>cancle_pb</tabstop>
<tabstop>load_pb</tabstop>
</tabstops>
<resources/>
<connections/>
Expand Down
57 changes: 56 additions & 1 deletion threedi_schematisation_editor/forms/ui/channel.ui
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<y>-5</y>
<width>515</width>
<height>929</height>
</rect>
Expand Down Expand Up @@ -1839,14 +1839,69 @@
</layout>
</widget>
<tabstops>
<tabstop>scrollArea</tabstop>
<tabstop>tabWidget</tabstop>
<tabstop>id</tabstop>
<tabstop>code</tabstop>
<tabstop>display_name</tabstop>
<tabstop>calculation_type</tabstop>
<tabstop>dist_calc_points</tabstop>
<tabstop>dist_calc_points_clear</tabstop>
<tabstop>zoom_category</tabstop>
<tabstop>exchange_thickness</tabstop>
<tabstop>exchange_thickness_clear</tabstop>
<tabstop>hydraulic_conductivity_in</tabstop>
<tabstop>hydraulic_conductivity_in_clear</tabstop>
<tabstop>hydraulic_conductivity_out</tabstop>
<tabstop>hydraulic_conductivity_out_clear</tabstop>
<tabstop>connection_node_start_id</tabstop>
<tabstop>connection_node_end_id</tabstop>
<tabstop>connection_node_1_id</tabstop>
<tabstop>connection_node_1_code</tabstop>
<tabstop>connection_node_1_initial_waterlevel</tabstop>
<tabstop>connection_node_1_initial_waterlevel_clear</tabstop>
<tabstop>connection_node_1_storage_area</tabstop>
<tabstop>connection_node_1_storage_area_clear</tabstop>
<tabstop>connection_node_2_id</tabstop>
<tabstop>connection_node_2_code</tabstop>
<tabstop>connection_node_2_initial_waterlevel</tabstop>
<tabstop>connection_node_2_initial_waterlevel_clear</tabstop>
<tabstop>connection_node_2_storage_area</tabstop>
<tabstop>connection_node_2_storage_area_clear</tabstop>
<tabstop>cross_section_locations</tabstop>
<tabstop>cross_section_location_id</tabstop>
<tabstop>cross_section_location_bank_level</tabstop>
<tabstop>cross_section_location_bank_level_clear</tabstop>
<tabstop>cross_section_location_code</tabstop>
<tabstop>cross_section_location_reference_level</tabstop>
<tabstop>cross_section_location_reference_level_clear</tabstop>
<tabstop>cross_section_location_cross_section_shape</tabstop>
<tabstop>cross_section_location_cross_section_width</tabstop>
<tabstop>cross_section_location_cross_section_width_clear</tabstop>
<tabstop>cross_section_location_cross_section_height</tabstop>
<tabstop>cross_section_location_cross_section_height_clear</tabstop>
<tabstop>cross_section_location_cross_section_table_widget</tabstop>
<tabstop>cross_section_location_cross_section_table_delete</tabstop>
<tabstop>cross_section_location_cross_section_table_copy</tabstop>
<tabstop>cross_section_location_cross_section_table_paste</tabstop>
<tabstop>cross_section_location_cross_section_table_add</tabstop>
<tabstop>cross_section_location_friction_type</tabstop>
<tabstop>cross_section_location_friction_value</tabstop>
<tabstop>cross_section_location_friction_value_clear</tabstop>
<tabstop>cross_section_location_cross_section_friction_widget</tabstop>
<tabstop>cross_section_location_cross_section_friction_clear</tabstop>
<tabstop>cross_section_location_cross_section_friction_copy</tabstop>
<tabstop>cross_section_location_vegetation_stem_density</tabstop>
<tabstop>cross_section_location_vegetation_stem_density_clear</tabstop>
<tabstop>cross_section_location_vegetation_stem_diameter</tabstop>
<tabstop>cross_section_location_vegetation_stem_diameter_clear</tabstop>
<tabstop>cross_section_location_vegetation_height</tabstop>
<tabstop>cross_section_location_vegetation_height_clear</tabstop>
<tabstop>cross_section_location_vegetation_drag_coefficient</tabstop>
<tabstop>cross_section_location_vegetation_drag_coefficient_clear</tabstop>
<tabstop>cross_section_location_cross_section_vegetation_widget</tabstop>
<tabstop>cross_section_location_cross_section_vegetation_clear</tabstop>
<tabstop>cross_section_location_cross_section_vegetation_copy</tabstop>
</tabstops>
<resources/>
<connections/>
Expand Down
9 changes: 9 additions & 0 deletions threedi_schematisation_editor/forms/ui/connection_node.ui
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,15 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>scrollArea</tabstop>
<tabstop>id</tabstop>
<tabstop>code</tabstop>
<tabstop>initial_waterlevel</tabstop>
<tabstop>initial_waterlevel_clear</tabstop>
<tabstop>storage_area</tabstop>
<tabstop>storage_area_clear</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
39 changes: 38 additions & 1 deletion threedi_schematisation_editor/forms/ui/cross_section_location.ui
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-412</y>
<y>0</y>
<width>515</width>
<height>915</height>
</rect>
Expand Down Expand Up @@ -976,6 +976,43 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>scrollArea</tabstop>
<tabstop>id</tabstop>
<tabstop>bank_level</tabstop>
<tabstop>bank_level_clear</tabstop>
<tabstop>code</tabstop>
<tabstop>reference_level</tabstop>
<tabstop>reference_level_clear</tabstop>
<tabstop>cross_section_shape</tabstop>
<tabstop>cross_section_width</tabstop>
<tabstop>cross_section_width_clear</tabstop>
<tabstop>cross_section_height</tabstop>
<tabstop>cross_section_height_clear</tabstop>
<tabstop>cross_section_table_widget</tabstop>
<tabstop>cross_section_table_delete</tabstop>
<tabstop>cross_section_table_copy</tabstop>
<tabstop>cross_section_table_paste</tabstop>
<tabstop>cross_section_table_add</tabstop>
<tabstop>friction_type</tabstop>
<tabstop>friction_value</tabstop>
<tabstop>friction_value_clear</tabstop>
<tabstop>cross_section_friction_widget</tabstop>
<tabstop>cross_section_friction_clear</tabstop>
<tabstop>cross_section_friction_copy</tabstop>
<tabstop>vegetation_stem_density</tabstop>
<tabstop>vegetation_stem_density_clear</tabstop>
<tabstop>vegetation_stem_diameter</tabstop>
<tabstop>vegetation_stem_diameter_clear</tabstop>
<tabstop>vegetation_height</tabstop>
<tabstop>vegetation_height_clear</tabstop>
<tabstop>vegetation_drag_coefficient</tabstop>
<tabstop>vegetation_drag_coefficient_clear</tabstop>
<tabstop>cross_section_vegetation_widget</tabstop>
<tabstop>cross_section_vegetation_clear</tabstop>
<tabstop>cross_section_vegetation_copy</tabstop>
<tabstop>channel_id</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
22 changes: 22 additions & 0 deletions threedi_schematisation_editor/forms/ui/culvert.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1317,28 +1317,50 @@ coefficient positive</string>
</layout>
</widget>
<tabstops>
<tabstop>scrollArea</tabstop>
<tabstop>tabWidget</tabstop>
<tabstop>id</tabstop>
<tabstop>code</tabstop>
<tabstop>display_name</tabstop>
<tabstop>calculation_type</tabstop>
<tabstop>dist_calc_points</tabstop>
<tabstop>dist_calc_points_clear</tabstop>
<tabstop>invert_level_start_point</tabstop>
<tabstop>invert_level_start_point_clear</tabstop>
<tabstop>invert_level_end_point</tabstop>
<tabstop>invert_level_end_point_clear</tabstop>
<tabstop>discharge_coefficient_positive</tabstop>
<tabstop>discharge_coefficient_positive_clear</tabstop>
<tabstop>friction_value</tabstop>
<tabstop>friction_value_clear</tabstop>
<tabstop>friction_type</tabstop>
<tabstop>discharge_coefficient_negative</tabstop>
<tabstop>discharge_coefficient_negative_clear</tabstop>
<tabstop>zoom_category</tabstop>
<tabstop>cross_section_shape</tabstop>
<tabstop>cross_section_width</tabstop>
<tabstop>cross_section_width_clear</tabstop>
<tabstop>cross_section_height</tabstop>
<tabstop>cross_section_height_clear</tabstop>
<tabstop>cross_section_table_widget</tabstop>
<tabstop>cross_section_table_delete</tabstop>
<tabstop>cross_section_table_copy</tabstop>
<tabstop>cross_section_table_paste</tabstop>
<tabstop>cross_section_table_add</tabstop>
<tabstop>connection_node_start_id</tabstop>
<tabstop>connection_node_end_id</tabstop>
<tabstop>connection_node_1_id</tabstop>
<tabstop>connection_node_1_code</tabstop>
<tabstop>connection_node_1_initial_waterlevel</tabstop>
<tabstop>connection_node_1_initial_waterlevel_clear</tabstop>
<tabstop>connection_node_1_storage_area</tabstop>
<tabstop>connection_node_1_storage_area_clear</tabstop>
<tabstop>connection_node_2_id</tabstop>
<tabstop>connection_node_2_code</tabstop>
<tabstop>connection_node_2_initial_waterlevel</tabstop>
<tabstop>connection_node_2_initial_waterlevel_clear</tabstop>
<tabstop>connection_node_2_storage_area</tabstop>
<tabstop>connection_node_2_storage_area_clear</tabstop>
</tabstops>
<resources/>
<connections/>
Expand Down
8 changes: 8 additions & 0 deletions threedi_schematisation_editor/forms/ui/exchange_line.ui
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,14 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>scrollArea</tabstop>
<tabstop>id</tabstop>
<tabstop>code</tabstop>
<tabstop>exchange_level</tabstop>
<tabstop>exchange_level_clear</tabstop>
<tabstop>channel_id</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,14 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>scrollArea</tabstop>
<tabstop>id</tabstop>
<tabstop>connection_node_id</tabstop>
<tabstop>percentage</tabstop>
<tabstop>percentage_clear</tabstop>
<tabstop>impervious_surface_id</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
14 changes: 14 additions & 0 deletions threedi_schematisation_editor/forms/ui/manhole.ui
Original file line number Diff line number Diff line change
Expand Up @@ -836,22 +836,36 @@
</layout>
</widget>
<tabstops>
<tabstop>scrollArea</tabstop>
<tabstop>id</tabstop>
<tabstop>code</tabstop>
<tabstop>display_name</tabstop>
<tabstop>calculation_type</tabstop>
<tabstop>shape</tabstop>
<tabstop>width</tabstop>
<tabstop>width_clear</tabstop>
<tabstop>length</tabstop>
<tabstop>length_clear</tabstop>
<tabstop>bottom_level</tabstop>
<tabstop>bottom_level_clear</tabstop>
<tabstop>surface_level</tabstop>
<tabstop>surface_level_clear</tabstop>
<tabstop>drain_level</tabstop>
<tabstop>drain_level_clear</tabstop>
<tabstop>zoom_category</tabstop>
<tabstop>manhole_indicator</tabstop>
<tabstop>exchange_thickness</tabstop>
<tabstop>exchange_thickness_clear</tabstop>
<tabstop>hydraulic_conductivity_in</tabstop>
<tabstop>hydraulic_conductivity_in_clear</tabstop>
<tabstop>hydraulic_conductivity_out</tabstop>
<tabstop>hydraulic_conductivity_out_clear</tabstop>
<tabstop>connection_node_id</tabstop>
<tabstop>connection_node_code</tabstop>
<tabstop>connection_node_initial_waterlevel</tabstop>
<tabstop>connection_node_initial_waterlevel_clear</tabstop>
<tabstop>connection_node_storage_area</tabstop>
<tabstop>connection_node_storage_area_clear</tabstop>
</tabstops>
<resources/>
<connections/>
Expand Down
Loading

0 comments on commit 02de611

Please sign in to comment.