x axis change
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user