Fix Startup without [virtual_sdcard] (#461)
* Rewrite evaluate_state * Print: Show an error if trying to print without [virtual_sdcard]
This commit is contained in:
parent
0592840ded
commit
d8bc4747e8
@ -118,17 +118,19 @@ class Printer:
|
||||
|
||||
if wh_state == "ready":
|
||||
new_state = "ready"
|
||||
print_state = self.data['print_stats']['state'].lower() # complete, paused, printing, standby
|
||||
idle_state = self.data['idle_timeout']['state'].lower() # idle, printing, ready
|
||||
if print_state == "paused":
|
||||
new_state = "paused"
|
||||
elif idle_state == "printing":
|
||||
if print_state == "complete":
|
||||
new_state = "ready"
|
||||
elif print_state != "printing": # Not printing a file, toolhead moving
|
||||
new_state = "busy"
|
||||
else:
|
||||
new_state = "printing"
|
||||
if self.data['print_stats']:
|
||||
print_state = self.data['print_stats']['state'].lower() # complete, error, paused, printing, standby
|
||||
if print_state == "paused":
|
||||
new_state = "paused"
|
||||
if self.data['idle_timeout']:
|
||||
idle_state = self.data['idle_timeout']['state'].lower() # idle, printing, ready
|
||||
if idle_state == "printing":
|
||||
if print_state == "complete":
|
||||
new_state = "ready"
|
||||
elif print_state != "printing": # Not printing a file, toolhead moving
|
||||
new_state = "busy"
|
||||
else:
|
||||
new_state = "printing"
|
||||
|
||||
if new_state != "busy":
|
||||
self.change_state(new_state)
|
||||
|
@ -428,3 +428,9 @@ class PrintPanel(ScreenPanel):
|
||||
|
||||
def _refresh_files(self, widget):
|
||||
self._files.refresh_files()
|
||||
|
||||
def process_update(self, action, data):
|
||||
if action == "notify_gcode_response":
|
||||
if "unknown" in data.lower():
|
||||
self._screen.show_popup_message("%s" % data)
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user