Skip to content

Commit

Permalink
Missing classes (#111)
Browse files Browse the repository at this point in the history
Import/export missing classes
Fixes #98

Note: commit of the sql session is very slow. Expect some minutes waiting after closing the import selection dialog
  • Loading branch information
domi4484 committed Jan 31, 2024
1 parent 3d74a1f commit 3ee2088
Show file tree
Hide file tree
Showing 8 changed files with 3,004 additions and 98 deletions.
160 changes: 80 additions & 80 deletions datamodel/changelogs/0001/03_tww_db_dss.sql

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions plugin/teksi_wastewater/interlis/interlis_importer_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ def interlis_import(self, xtf_file_input, show_selection_dialog=False, logs_next
)

# Import from xtf file to ili2pg model
self._progress_done(40, "Importing XTF data...")
self._progress_done(30, "Importing XTF data...")
self._import_xtf_file(xtf_file_input=xtf_file_input)

# Import from the temporary ili2pg model
self._progress_done(50, "Converting to Teksi Wastewater...")
self._progress_done(40, "Converting to Teksi Wastewater...")
tww_session = self._import_from_intermediate_schema(import_model)

if show_selection_dialog:
self._progress_done(80, "Import objects selection...")
self._progress_done(90, "Import objects selection...")
import_dialog = InterlisImportSelectionDialog()
import_dialog.init_with_session(tww_session)
QApplication.restoreOverrideCursor()
Expand All @@ -116,12 +116,12 @@ def interlis_import(self, xtf_file_input, show_selection_dialog=False, logs_next
raise InterlisImporterExporterStopped()
QApplication.setOverrideCursor(Qt.WaitCursor)
else:
self._progress_done(80, "Commit session...")
self._progress_done(90, "Commit session...")
tww_session.commit()
tww_session.close()

# Update main_cover and main_wastewater_node
self._progress_done(90, "Update main cover and refresh materialized views...")
self._progress_done(95, "Update main cover and refresh materialized views...")
self._import_update_main_cover_and_refresh_mat_views()

self._progress_done(100)
Expand Down Expand Up @@ -448,9 +448,9 @@ def _init_model_classes(self, model):
self._progress_done(self.current_progress + 1)

def _progress_done_intermediate_schema(self):
self._progress_done(self.current_progress + 1)
self._progress_done(self.current_progress + 0.5)

def _progress_done(self, progress, text=None):
self.current_progress = progress
if self.progress_done_callback:
self.progress_done_callback(progress, text)
self.progress_done_callback(int(progress), text)
Loading

0 comments on commit 3ee2088

Please sign in to comment.