Skip to content

Commit

Permalink
Add setting for graph background color
Browse files Browse the repository at this point in the history
Hide second extruder from graph if not present
Fixes #791
  • Loading branch information
kliment committed Nov 16, 2018
1 parent b59c79b commit 28f753b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions printrun/gui/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def StopPlotting(self):
if self.window: self.window.graph.StopPlotting()

def draw(self, dc, w, h):
dc.SetBackground(wx.Brush(self.root.bgcolor))
dc.SetBackground(wx.Brush(self.root.settings.graph_color_background))
dc.Clear()
gc = wx.GraphicsContext.Create(dc)
self.width = w
Expand All @@ -346,8 +346,9 @@ def draw(self, dc, w, h):
self.drawfanpower(dc, gc)
self.drawextruder0targettemp(dc, gc)
self.drawextruder0temp(dc, gc)
self.drawextruder1targettemp(dc, gc)
self.drawextruder1temp(dc, gc)
if self.extruder1targettemps[-1]>0 or self.extruder1temps[-1]>5:
self.drawextruder1targettemp(dc, gc)
self.drawextruder1temp(dc, gc)

class _YBounds:
"""Small helper class to claculate y bounds dynamically"""
Expand Down
1 change: 1 addition & 0 deletions printrun/pronterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,7 @@ def _add_settings(self, size):
self.settings._add(SpinSetting("preview_grid_step1", 10., 0, 200, _("Fine grid spacing"), _("Fine Grid Spacing"), "Viewer"), self.update_gviz_params)
self.settings._add(SpinSetting("preview_grid_step2", 50., 0, 200, _("Coarse grid spacing"), _("Coarse Grid Spacing"), "Viewer"), self.update_gviz_params)
self.settings._add(StringSetting("bgcolor", self._preferred_bgcolour_hex(), _("Background color"), _("Pronterface background color"), "Colors"), self.reload_ui, validate = check_rgb_color)
self.settings._add(StringSetting("graph_color_background", "#FAFAC7", _("Graph background color"), _("Color of the temperature graph background"), "Colors"), self.reload_ui, validate = check_rgb_color)
self.settings._add(StringSetting("gcview_color_background", "#FAFAC7FF", _("3D view background color"), _("Color of the 3D view background"), "Colors"), self.update_gcview_colors, validate = check_rgba_color)
self.settings._add(StringSetting("gcview_color_travel", "#99999999", _("3D view travel moves color"), _("Color of travel moves in 3D view"), "Colors"), self.update_gcview_colors, validate = check_rgba_color)
self.settings._add(StringSetting("gcview_color_tool0", "#FF000099", _("3D view print moves color"), _("Color of print moves with tool 0 in 3D view"), "Colors"), self.update_gcview_colors, validate = check_rgba_color)
Expand Down

0 comments on commit 28f753b

Please sign in to comment.