Commit 0b88c534 authored by Guillaume Seguin's avatar Guillaume Seguin

Refresh 3D bed viz when changing parameters

parent f71ba3d1
......@@ -293,6 +293,11 @@ class GcodeViewMainWrapper(object):
if not self.refresh_timer.IsRunning():
self.refresh_timer.Start()
def recreate_platform(self, build_dimensions, circular):
self.platform = actors.Platform(build_dimensions, circular = circular)
self.objects[0].model = self.platform
wx.CallAfter(self.Refresh)
def addgcode(self, *a):
pass
......@@ -367,6 +372,11 @@ class GcodeViewFrame(GvizBaseFrame):
if not self.refresh_timer.IsRunning():
self.refresh_timer.Start()
def recreate_platform(self, build_dimensions, circular):
self.platform = actors.Platform(build_dimensions, circular = circular)
self.objects[0].model = self.platform
wx.CallAfter(self.Refresh)
def addfile(self, gcode = None):
if self.clonefrom:
self.model = self.clonefrom[-1].model.copy()
......
......@@ -123,7 +123,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self.ui_ready = False
self.settings._add(BooleanSetting("monitor", True, _("Monitor printer status"), _("Regularly monitor printer temperatures (required to have functional temperature graph or gauges)"), "Printer"), self.update_monitor)
self.settings._add(StringSetting("simarrange_path", "", _("Simarrange command"), _("Path to the simarrange binary to use in the STL plater"), "External"))
self.settings._add(BooleanSetting("circular_bed", False, _("Circular build platform"), _("Draw a circular (or oval) build platform instead of a rectangular one"), "Printer"))
self.settings._add(BooleanSetting("circular_bed", False, _("Circular build platform"), _("Draw a circular (or oval) build platform instead of a rectangular one"), "Printer"), self.update_bed_viz)
self.settings._add(SpinSetting("extruders", 0, 1, 5, _("Extruders count"), _("Number of extruders"), "Printer"))
self.settings._add(BooleanSetting("clamp_jogging", False, _("Clamp manual moves"), _("Prevent manual moves from leaving the specified build dimensions"), "Printer"))
self.settings._add(ComboSetting("uimode", "Standard", ["Standard", "Compact", "Tabbed"], _("Interface mode"), _("Standard interface is a one-page, three columns layout with controls/visualization/log\nCompact mode is a one-page, two columns layout with controls + log/visualization\nTabbed mode is a two-pages mode, where the first page shows controls and the second one shows visualization and log."), "UI"), self.reload_ui)
......@@ -964,6 +964,16 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
target_color[i] = v
wx.CallAfter(self.Refresh)
def update_build_dimensions(self, param, value):
pronsole.pronsole.update_build_dimensions(self, param, value)
self.update_bed_viz()
def update_bed_viz(self, *args):
if hasattr(self, "gviz") and hasattr(self.gviz, "recreate_platform"):
self.gviz.recreate_platform(self.build_dimensions_list, self.settings.circular_bed)
if hasattr(self, "gwindow") and hasattr(self.gwindow, "recreate_platform"):
self.gwindow.recreate_platform(self.build_dimensions_list, self.settings.circular_bed)
def setfeeds(self, e):
self.feedrates_changed = True
try:
......
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