Commit d1dfdc21 authored by Guillaume Seguin's avatar Guillaume Seguin

Remember watch checkbox configuration

parent b8b5ab03
...@@ -86,6 +86,7 @@ class LeftPane(wx.GridBagSizer): ...@@ -86,6 +86,7 @@ class LeftPane(wx.GridBagSizer):
llts.Add(root.zfeedc,) llts.Add(root.zfeedc,)
root.monitorbox = wx.CheckBox(root.panel,-1, _("Watch")) root.monitorbox = wx.CheckBox(root.panel,-1, _("Watch"))
root.monitorbox.SetValue(bool(root.settings.monitor))
root.monitorbox.SetToolTip(wx.ToolTip("Monitor Temperatures in Graph")) root.monitorbox.SetToolTip(wx.ToolTip("Monitor Temperatures in Graph"))
self.Add(root.monitorbox, pos = (3, 5)) self.Add(root.monitorbox, pos = (3, 5))
root.monitorbox.Bind(wx.EVT_CHECKBOX, root.setmonitor) root.monitorbox.Bind(wx.EVT_CHECKBOX, root.setmonitor)
......
...@@ -171,6 +171,12 @@ class FloatSpinSetting(SpinSetting): ...@@ -171,6 +171,12 @@ class FloatSpinSetting(SpinSetting):
class BooleanSetting(wxSetting): class BooleanSetting(wxSetting):
def _get_value(self):
return bool(self._value)
def _set_value(self, value):
self._value = value
value = property(_get_value, _set_value)
def get_specific_widget(self, parent): def get_specific_widget(self, parent):
import wx import wx
self.widget = wx.CheckBox(parent, -1) self.widget = wx.CheckBox(parent, -1)
...@@ -231,7 +237,9 @@ class Settings(object): ...@@ -231,7 +237,9 @@ class Settings(object):
getattr(self, "_%s_validate"%key)(value) getattr(self, "_%s_validate"%key)(value)
except AttributeError: except AttributeError:
pass pass
setattr(self, key, type(getattr(self, key))(value)) t = type(getattr(self, key))
if t == bool and value == "False": setattr(self, key, False)
else: setattr(self, key, t(value))
try: try:
getattr(self, "_%s_cb"%key)(key, value) getattr(self, "_%s_cb"%key)(key, value)
except AttributeError: except AttributeError:
......
...@@ -174,6 +174,9 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -174,6 +174,9 @@ class PronterWindow(MainWindow, pronsole.pronsole):
def __init__(self, filename = None, size = winsize): def __init__(self, filename = None, size = winsize):
pronsole.pronsole.__init__(self) pronsole.pronsole.__init__(self)
#default build dimensions are 200x200x100 with 0, 0, 0 in the corner of the bed and endstops at 0, 0 and 0 #default build dimensions are 200x200x100 with 0, 0, 0 in the corner of the bed and endstops at 0, 0 and 0
monitorsetting = BooleanSetting("monitor", False)
monitorsetting.hidden = True
self.settings._add(monitorsetting)
self.settings._add(BuildDimensionsSetting("build_dimensions", "200x200x100+0+0+0+0+0+0", _("Build dimensions"), _("Dimensions of Build Platform\n & optional offset of origin\n & optional switch position\n\nExamples:\n XXXxYYY\n XXX,YYY,ZZZ\n XXXxYYYxZZZ+OffX+OffY+OffZ\nXXXxYYYxZZZ+OffX+OffY+OffZ+HomeX+HomeY+HomeZ"))) self.settings._add(BuildDimensionsSetting("build_dimensions", "200x200x100+0+0+0+0+0+0", _("Build dimensions"), _("Dimensions of Build Platform\n & optional offset of origin\n & optional switch position\n\nExamples:\n XXXxYYY\n XXX,YYY,ZZZ\n XXXxYYYxZZZ+OffX+OffY+OffZ\nXXXxYYYxZZZ+OffX+OffY+OffZ+HomeX+HomeY+HomeZ")))
self.settings._add(BooleanSetting("viz3d", False, _("Enable 3D viewer (requires restarting)"), _("Use 3D visualization instead of 2D layered visualization"))) self.settings._add(BooleanSetting("viz3d", False, _("Enable 3D viewer (requires restarting)"), _("Use 3D visualization instead of 2D layered visualization")))
self.settings._add(HiddenSetting("last_bed_temperature", 0.0)) self.settings._add(HiddenSetting("last_bed_temperature", 0.0))
...@@ -1103,6 +1106,7 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -1103,6 +1106,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
def setmonitor(self, e): def setmonitor(self, e):
self.monitor = self.monitorbox.GetValue() self.monitor = self.monitorbox.GetValue()
self.set("monitor", self.monitor)
if self.monitor: if self.monitor:
wx.CallAfter(self.graph.StartPlotting, 1000) wx.CallAfter(self.graph.StartPlotting, 1000)
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment