Skip to content

Commit

Permalink
Clear Laserpath on Selection Change.
Browse files Browse the repository at this point in the history
+control Clear Laserpath
  • Loading branch information
tatarize committed Jul 21, 2020
1 parent 8238f8c commit eada116
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions wxMeerK40t.py
Expand Up @@ -498,7 +498,7 @@ def foo():
device.threaded(foo)

device.control_instance_add("Crash Thread", test_crash_in_thread)

device.control_instance_add("Clear Laserpath", self.clear_laserpath)
self.SetSize((device.window_width, device.window_height))
self.interval = 1.0 / float(device.fps)
self.schedule()
Expand Down Expand Up @@ -758,7 +758,6 @@ def clear_recent(self):
break
self.populate_recent_menu()


def save_recent(self, pathname):
recent = list()
for i in range(10):
Expand Down Expand Up @@ -849,11 +848,16 @@ def bed_changed(self, *args):
self.on_size(None)

def on_emphasized_elements_changed(self, *args):
self.clear_laserpath()
self.request_refresh()

def on_element_alteration(self, *args):
self.device.signal('rebuild_tree')

def clear_laserpath(self):
self.laserpath = [[0, 0] for i in range(1000)], [[0, 0] for i in range(1000)]
self.laserpath_index = 0

def on_erase(self, event):
pass

Expand Down Expand Up @@ -992,8 +996,7 @@ def on_click_new(self, event): # wxGlade: MeerK40t.<event_handler>
kernel = self.device.device_root
self.working_file = None
kernel.elements.clear_all()
self.laserpath = [[0, 0] for i in range(1000)], [[0, 0] for i in range(1000)]
self.laserpath_index = 0
self.clear_laserpath()
self.request_refresh()
self.device.signal('rebuild_tree', 0)

Expand Down

0 comments on commit eada116

Please sign in to comment.