From d8c2634a6600149c30c79843358cc77088e9c435 Mon Sep 17 00:00:00 2001 From: Theophile Terraz <theophile.terraz@inrae.fr> Date: Wed, 22 Jan 2025 09:13:13 +0100 Subject: [PATCH] debug --- src/Meshing/Mage.py | 2 +- src/Model/Geometry/ProfileXYZ.py | 4 ++++ src/View/Geometry/Profile/Plot.py | 1 + src/View/Geometry/Profile/UndoCommand.py | 20 ++++++++++++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/Meshing/Mage.py b/src/Meshing/Mage.py index 30b5a7dc..2d28fb04 100644 --- a/src/Meshing/Mage.py +++ b/src/Meshing/Mage.py @@ -410,7 +410,7 @@ class MeshingWithMageMailleurTT(AMeshingTool): str, [ st_file, m_file, - "update_rk", step, + "update_kp", step, limites[0], limites[1], directrices[0], directrices[1], orientation, lm, linear, origin, origin_value diff --git a/src/Model/Geometry/ProfileXYZ.py b/src/Model/Geometry/ProfileXYZ.py index 916d579f..4ade5b68 100644 --- a/src/Model/Geometry/ProfileXYZ.py +++ b/src/Model/Geometry/ProfileXYZ.py @@ -879,3 +879,7 @@ class ProfileXYZ(Profile, SQLSubModel): p.x = p.x + x p.y = p.y + y p.z = p.z + z + + def modified(self): + self.tab_up_to_date = False + self.station_up_to_date = False diff --git a/src/View/Geometry/Profile/Plot.py b/src/View/Geometry/Profile/Plot.py index f8c790f6..6e45f80d 100644 --- a/src/View/Geometry/Profile/Plot.py +++ b/src/View/Geometry/Profile/Plot.py @@ -444,6 +444,7 @@ class Plot(PamhyrPlot): @timer def update(self): + self.draw() self.draw_highligth() self.update_idle() diff --git a/src/View/Geometry/Profile/UndoCommand.py b/src/View/Geometry/Profile/UndoCommand.py index a381feee..e533c7d6 100644 --- a/src/View/Geometry/Profile/UndoCommand.py +++ b/src/View/Geometry/Profile/UndoCommand.py @@ -42,9 +42,11 @@ class SetXCommand(SetDataCommand): def undo(self): self._profile.point(self._index).x = self._old + self._profile.modified() def redo(self): self._profile.point(self._index).x = self._new + self._profile.modified() class SetYCommand(SetDataCommand): @@ -54,9 +56,11 @@ class SetYCommand(SetDataCommand): def undo(self): self._profile.point(self._index).y = self._old + self._profile.modified() def redo(self): self._profile.point(self._index).y = self._new + self._profile.modified() class SetZCommand(SetDataCommand): @@ -66,9 +70,11 @@ class SetZCommand(SetDataCommand): def undo(self): self._profile.point(self._index).z = self._old + self._profile.modified() def redo(self): self._profile.point(self._index).z = self._new + self._profile.modified() class SetNameCommand(SetDataCommand): @@ -94,12 +100,14 @@ class AddCommand(QUndoCommand): def undo(self): self._profile.delete_i([self._index]) + self._profile.modified() def redo(self): if self._point is None: self._point = self._profile.insert(self._index) else: self._profile.insert_point(self._index, self._point) + self._profile.modified() class DelCommand(QUndoCommand): @@ -117,9 +125,11 @@ class DelCommand(QUndoCommand): def undo(self): for row, point in self._points: self._profile.insert_point(row, point) + self._profile.modified() def redo(self): self._profile.delete_i(self._rows) + self._profile.modified() class SortCommand(QUndoCommand): @@ -143,9 +153,11 @@ class SortCommand(QUndoCommand): def undo(self): self._profile.sort_with_indexes(self._indexes) + self._profile.modified() def redo(self): self._profile.sort(self._column, self._reverse) + self._profile.modified() class MoveCommand(QUndoCommand): @@ -161,12 +173,14 @@ class MoveCommand(QUndoCommand): self._profile.move_up_point(self._i) else: self._profile.move_down_point(self._i) + self._profile.modified() def redo(self): if self._up: self._profile.move_up_point(self._i) else: self._profile.move_down_point(self._i) + self._profile.modified() class ReverseCommand(QUndoCommand): @@ -177,9 +191,11 @@ class ReverseCommand(QUndoCommand): def undo(self): self._profile.reverse() + self._profile.modified() def redo(self): self._profile.reverse() + self._profile.modified() class PurgeCommand(QUndoCommand): @@ -192,9 +208,11 @@ class PurgeCommand(QUndoCommand): def undo(self): self._profile._points = self._old.copy() + self._profile.modified() def redo(self): self._profile.purge(self._np_purge) + self._profile.modified() class PasteCommand(QUndoCommand): @@ -210,7 +228,9 @@ class PasteCommand(QUndoCommand): def undo(self): for ind in range(len(self._points)): self._profile.delete_i([self._row]) + self._profile.modified() def redo(self): for point in self._points: self._profile.insert_point(self._row, point) + self._profile.modified() -- GitLab