Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

120 connect damo exporter #178

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

120 connect damo exporter #178

wants to merge 19 commits into from

Conversation

Overmeen
Copy link

GUI voor project beginnen / hervatten en exporteren van DAMO obv van poldergrenzen

@Overmeen Overmeen requested a review from wvangerwen December 13, 2024 15:18
Copy link
Collaborator

@wvangerwen wvangerwen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Werking nog niet kunnen controleren omdat ik de local_settings even niet heb. Op basis van de code een aantal vragen.

def export_damo_and_hydamo(self):
"""Handle export of DAMO and HyDAMO."""
file_path = self.dockwidget.SelectPolderFileWidget.filePath()
damo_gpkg_path = os.path.join(self.project.project_folder, "01_source_data", "DAMO.gpkg")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dit zou al in de folderstructuur moeten staan. Dus hier;
self.project.project_folder.source_data.damo


# Load GeoPackage layers into QGIS
try:
damo_gpkg_path = os.path.join(self.project.project_folder, "01_source_data", "DAMO.gpkg")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tweede keer declaren zelfde variabele?

if file_path:
# DAMO export
gdf_polder = gpd.read_file(file_path)
dict_gdfs_damo = DAMO_exporter(gdf_polder, TABLE_NAMES)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zie review Wouter htt. Lijkt me beter om opslaan per tabel te doen?

Daarnaast lijkt me dit functionaliteit die je in htt wilt hebben en niet in de plugin.

- CreateProjectPushButton : QPushButton
- SchematisationBuilderVerticalSpacer : Spacer
- ProjectTabWidget : QTabWidget
- tab_status_0 : QWidget
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zonder het gezien te hebben, is deze naam beschrijvend genoeg?


from hhnk_threedi_plugin.hhnk_toolbox_dockwidget import HHNK_toolboxDockWidget

BASE_FOLDER = r"\\corp.hhnk.nl\data\Hydrologen_data\Data\09.modellen_speeltuin"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dit lijkt niet hier thuis te horen maar in een local_settings of ergens anders?


def populate_combobox(self):
"""Populate the combobox with folder names from the base folder."""
if os.path.exists(BASE_FOLDER):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

liefst zoveel mogelijk pathlib.Path gebruiken.

### Stap 0. Een project beginnen of een bestaand project verder oppakken


... plaatje UI volgt later na evt wijzigingen adhv sprint review
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo's graag opnemen met # TODO

self.dockwidget.CreateProjectPlainTextEdit.clear()
QPlainTextEdit.focusInEvent(self.dockwidget.CreateProjectPlainTextEdit, event)

def load_layers_from_geopackage(self, geopackage_path, group_name):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def on_project_selected(self):
"""Handle project selection from the combo box."""
selected_folder = self.dockwidget.SelectProjectComboBox.currentText()
full_path = os.path.join(BASE_FOLDER, selected_folder)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path(BASE_FOLDER).joinpath(selected_folder)

selected_folder = self.dockwidget.SelectProjectComboBox.currentText()
full_path = os.path.join(BASE_FOLDER, selected_folder)
self.project = Project(full_path)
self.project_status = self.project.retrieve_project_status()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gelijk aan self.project.project_status? Ook daar project.status logischer?

Wat zijn de mogelijke waarden van project_status? Is daar ergens domeintabel van?

Die retrieve_project_status zoals die nu in htt staat lijkt erop dat een @property handiger is?

@property
def status(self):
    return self._status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants