From e0cee0fbef4048e276ec1245a16345d9a3b24ab3 Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby Date: Tue, 26 Aug 2025 11:50:01 +0200 Subject: [PATCH] Meshing: Fix meshing M file import. --- src/Meshing/Mage.py | 8 ++++++-- src/Model/Geometry/ProfileXYZ.py | 17 +++++++++-------- src/Model/Geometry/Reach.py | 7 ++++++- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/Meshing/Mage.py b/src/Meshing/Mage.py index f99d3178..d02122bd 100644 --- a/src/Meshing/Mage.py +++ b/src/Meshing/Mage.py @@ -343,7 +343,9 @@ class MeshingWithMageMailleurTT(AMeshingTool): ) ) ) + logger.info("Waiting ...") proc.waitForFinished() + logger.info(f"Waiting ... Done (status : {proc.exitCode()})") if proc.exitCode() != 0: logger.error( @@ -352,7 +354,7 @@ class MeshingWithMageMailleurTT(AMeshingTool): f"{logger_color_reset()}" ) outputs = proc.readAllStandardOutput() - logger.debug(outputs) + logger.warning(outputs) errors = proc.readAllStandardError() logger.error( @@ -418,7 +420,9 @@ class MeshingWithMageMailleurTT(AMeshingTool): ) ) ) + logger.debug("Waiting ...") proc.waitForFinished() + logger.debug(f"Waiting ... Done (status : {proc.exitCode()})") if proc.exitCode() != 0: logger.error( @@ -427,7 +431,7 @@ class MeshingWithMageMailleurTT(AMeshingTool): f"{logger_color_reset()}" ) outputs = proc.readAllStandardOutput() - logger.debug(outputs) + logger.warning(outputs) errors = proc.readAllStandardError() logger.error( diff --git a/src/Model/Geometry/ProfileXYZ.py b/src/Model/Geometry/ProfileXYZ.py index eed41d82..e3591f54 100644 --- a/src/Model/Geometry/ProfileXYZ.py +++ b/src/Model/Geometry/ProfileXYZ.py @@ -442,12 +442,17 @@ class ProfileXYZ(Profile, SQLSubModel): Nothing. """ for point in list_points: - pt = PointXYZ(*point, profile=self, status=self._status) - self.points.append(pt) + named_args = { + "x": point[0], + "y": point[1], + "z": point[2], + "name": point[3], + } + + pt = PointXYZ(id=-1, **named_args, profile=self, status=self._status) + self._points.append(pt) self.modified() - self.tab_up_to_date = False - self.station_up_to_date = False def get_point_i(self, index: int) -> PointXYZ: """Get point at index. @@ -510,8 +515,6 @@ class ProfileXYZ(Profile, SQLSubModel): self.points.append(point_xyz) self.modified() - self.tab_up_to_date = False - self.station_up_to_date = False def insert(self, index: int): """Insert a new point at index. @@ -531,8 +534,6 @@ class ProfileXYZ(Profile, SQLSubModel): self._points.insert(index, point) self.modified() - self.tab_up_to_date = False - self.station_up_to_date = False return point diff --git a/src/Model/Geometry/Reach.py b/src/Model/Geometry/Reach.py index 1a15c2aa..119868cc 100644 --- a/src/Model/Geometry/Reach.py +++ b/src/Model/Geometry/Reach.py @@ -617,6 +617,8 @@ class Reach(SQLSubModel): """ imported_profiles = [] + logger.info(f"import reach from {file_path_name}") + try: list_profile, list_header = self.read_file_st(str(file_path_name)) profile_header = ["num", "code1", "code2", @@ -629,7 +631,10 @@ class Reach(SQLSubModel): d[profile_header[i]] = data prof = ProfileXYZ( - **d, reach=self, status=self._status + id=-1, + **d, + reach=self, + status=self._status ) prof.import_points(profile)