Add clear graphs context menu item

This commit is contained in:
atse 2023-07-19 13:34:01 +08:00
parent fdf4c4f0d6
commit 001ce432e8
1 changed files with 5 additions and 0 deletions

View File

@ -198,6 +198,11 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
self.thermostat_settings.setMenu(self.menu)
clear = QtGui.QAction("Clear graphs", self.menu)
clear.triggered.connect(self.clear_graphs)
self.menu.addAction(clear)
self.menu.clear = clear
def _set_up_graphs(self):
for graph in self.ch0_t_graph, self.ch0_i_graph, self.ch1_t_graph, self.ch1_i_graph:
time_axis = LiveAxis('bottom', text="Time since Thermostat reset", **{Axis.TICK_FORMAT: Axis.DURATION})