ProjectTab package
Project Tab Module
Project management tab with MVP architecture for CSV file editing and project tracking.
- author:
Dipl.-Ing. (FH) Jonas Pfeiffer
- class districtheatingsim.gui.ProjectTab.project_tab.ProjectModel[source]
Bases:
objectModel for managing project data including CSV and GeoJSON file operations.
- create_csv_from_geojson(geojson_file_path, output_file_path, default_values, project_crs='EPSG:25833')[source]
Create the building CSV from a GeoJSON (thin wrapper over the GUI-free
districtheatingsim.geocoding.building_csv.geojson_to_building_csv()).- Parameters:
geojson_file_path – Input GeoJSON file path.
output_file_path – Output CSV file path.
default_values – Default values for building parameters.
project_crs – CRS of the GeoJSON coordinates.
- Returns:
Output file path.
- Return type:
- class districtheatingsim.gui.ProjectTab.project_tab.ProjectPresenter(model, view, folder_manager, data_manager, config_manager)[source]
Bases:
objectPresenter managing interaction between ProjectModel and ProjectTabView.
- __init__(model, view, folder_manager, data_manager, config_manager)[source]
Initialize project presenter.
- Parameters:
model (ProjectModel) – Data model.
view (ProjectTabView) – View component.
folder_manager (object) – Folder manager.
data_manager (object) – Data manager.
config_manager (object) – Configuration manager.
- on_variant_folder_changed(path)[source]
Handle project folder change.
- Parameters:
path (str) – New project folder path.
- on_tree_view_double_clicked(index)[source]
Handle double-click on file tree view.
- Parameters:
index (QModelIndex) – Tree view index.
- import_csv()[source]
Open a CSV file, show the column-mapping dialog, and load the result.
If the source CSV already uses the internal column schema (all required columns present with the expected names) it is loaded directly without showing the mapping dialog. Otherwise the CsvImportDialog is shown so the user can assign source columns to target fields and supply default values for missing ones.
- load_csv(file_path)[source]
Load CSV file into table view.
- Parameters:
file_path (str) – Path to CSV file.
- save_csv(show_dialog=True)[source]
Save current table data to CSV file.
- Parameters:
show_dialog (bool) – Show confirmation dialog if True.
- create_csv(fname=None, show_dialog=True)[source]
Create new CSV file with default building data headers.
- on_geojson_conversion_progress(current, total, message)[source]
Handle progress updates from GeoJSON conversion thread.
- on_geojson_conversion_done(output_file_path)[source]
Handle completion of GeoJSON conversion.
- Parameters:
output_file_path (str) – Path to created CSV file.
- on_geojson_conversion_error(error_message)[source]
Handle error during GeoJSON conversion.
- Parameters:
error_message (str) – Error message.
- geocode_addresses(inputfilename)[source]
Start geocoding thread for address processing.
- Parameters:
inputfilename (str) – Path to CSV file for geocoding.
- on_geocode_done(result)[source]
Handle geocoding completion.
- Parameters:
result (tuple) – Tuple of (filename, summary_dict) emitted by GeocodingThread.
- on_geocode_error(error_message)[source]
Handle geocoding errors.
- Parameters:
error_message (str) – Error message to display.
- check_csv_status(csv_file_path)[source]
Check detailed CSV status: missing, available without coordinates, or with coordinates.
- class districtheatingsim.gui.ProjectTab.project_tab.ProjectTabView(presenter=None, parent=None)[source]
Bases:
QWidgetView component for project tab UI with file browser and CSV editor.
- __init__(presenter=None, parent=None)[source]
Initialize project tab view.
- Parameters:
presenter (ProjectPresenter) – Presenter instance for signal connections.
parent (QWidget) – Parent widget.
- set_crs(crs: str)[source]
Set the CRS combo box to the given EPSG code (blocks signal to avoid loop).
- Parameters:
crs (str) – EPSG code string, e.g.
"EPSG:25833"
- update_tree_view(path)[source]
Update file tree view root path.
- Parameters:
path (str) – New root path.
Show table context menu.
- Parameters:
position (QPoint) – Menu position.
- get_selected_file_path(index)[source]
Get selected file path from tree view.
- Parameters:
index (QModelIndex) – Tree view index.
- Returns:
Selected file path.
- Return type:
- update_progress(progress, csv_status=None)[source]
Update progress bar value and CSV status label with color-coded status.
- class districtheatingsim.gui.ProjectTab.project_tab.ProjectTab(folder_manager, data_manager, config_manager, parent=None)[source]
Bases:
QWidgetMain project tab widget integrating MVP components.
Note
Central interface for project management with file operations and progress tracking functionality.
Project Tab Dialogs Module
Dialog windows for project tab functionality including data input and progress display.
- author:
Dipl.-Ing. (FH) Jonas Pfeiffer
- class districtheatingsim.gui.ProjectTab.project_tab_dialogs.RowInputDialog(headers, parent=None)[source]
Bases:
QDialogDialog for adding new table rows with input fields.
- class districtheatingsim.gui.ProjectTab.project_tab_dialogs.OSMImportDialog(parent=None, sample_utm_coords=None, project_crs: str = 'EPSG:25833')[source]
Bases:
QDialogDialog for OSM data import with default building parameters.
- class districtheatingsim.gui.ProjectTab.project_tab_dialogs.ProcessDetailsDialog(process_steps, parent=None)[source]
Bases:
QDialogDialog displaying detailed project progress information.
- __init__(process_steps, parent=None)[source]
Initialize process details dialog.
- Parameters:
process_steps (list) – List of process step dictionaries with progress info.
parent (QWidget) – Parent widget.
- class districtheatingsim.gui.ProjectTab.project_tab_dialogs.BuildingCSVDialog(headers, data=None, parent=None)[source]
Bases:
QDialogDialog for tabular input and editing of Quartier IST.csv building data.