Adding graph capability to main menu

This commit is contained in:
Jordan
2021-09-21 21:19:39 -04:00
committed by jordanruthe
parent 141bc38876
commit 5bfcd0108a
6 changed files with 401 additions and 40 deletions

View File

@@ -501,12 +501,16 @@ class KlipperScreen(Gtk.Window):
def _remove_current_panel(self, pop=True, show=True):
if len(self._cur_panels) > 0:
self.base_panel.remove(self.panels[self._cur_panels[-1]].get_content())
if hasattr(self.panels[self._cur_panels[-1]], "deactivate"):
self.panels[self._cur_panels[-1]].deactivate()
self.remove_subscription(self._cur_panels[-1])
if pop is True:
self._cur_panels.pop()
if len(self._cur_panels) > 0:
self.base_panel.add_content(self.panels[self._cur_panels[-1]])
self.base_panel.show_back(False if len(self._cur_panels) == 1 else True)
if hasattr(self.panels[self._cur_panels[-1]], "activate"):
self.panels[self._cur_panels[-1]].activate()
if hasattr(self.panels[self._cur_panels[-1]], "process_update"):
self.panels[self._cur_panels[-1]].process_update("notify_status_update",
self.printer.get_updates())
@@ -842,7 +846,10 @@ class KlipperScreen(Gtk.Window):
if data is False:
logging.info("Error getting printer object data")
return False
logging.info("Startup data: %s" % data['result']['status'])
tempstore = self.apiclient.send_request("server/temperature_store")
if tempstore is not False:
self.printer.init_temp_store(tempstore['result'])
self.printer.process_update(data['result']['status'])
self.files.initialize()