x axis change

This commit is contained in:
2026-08-02 11:41:34 +02:00
parent e85c507d7f
commit 51d01ad208
5 changed files with 69 additions and 15 deletions

View File

@@ -77,3 +77,21 @@ class ChangeSimulationPlotSignalsCommand(QUndoCommand):
def undo(self) -> None:
self.root.plot_tabs[self.index].signals = list(self.old_signals)
self.changed(self.index)
class ChangeSimulationPlotXAxisCommand(QUndoCommand):
def __init__(self, root: SimulationRoot, index: int, x_axis: str | None, changed: ChangedCallback) -> None:
super().__init__("Change plot x axis")
self.root = root
self.index = index
self.old_x_axis = root.plot_tabs[index].x_axis
self.x_axis = x_axis
self.changed = changed
def redo(self) -> None:
self.root.plot_tabs[self.index].x_axis = self.x_axis
self.changed(self.index)
def undo(self) -> None:
self.root.plot_tabs[self.index].x_axis = self.old_x_axis
self.changed(self.index)