From 786baebbf892e4367100cdf1af9d7363a1cba37c Mon Sep 17 00:00:00 2001 From: Christopher Olah Date: Sat, 2 Feb 2013 10:25:16 -0500 Subject: [PATCH] Confirm dangerous extruder target temperatures. Protect the user from typos in setting the extruder temp by confirming them with the user if they exceed 250. --- pronsole.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pronsole.py b/pronsole.py index e40a942..0a68beb 100755 --- a/pronsole.py +++ b/pronsole.py @@ -956,6 +956,17 @@ class pronsole(cmd.Cmd): l = l.replace(i, self.temps[i]) f = float(l) if f>=0: + if f > 250: + def confirm(): + print f, " is a high temperature to set your extruder to. Are you sure you want to do that?" + y_or_n = raw_input("y/n: ") + if y_or_n == "y": + return True + elif y_or_n != "n": + return confirm() + return False + if not confirm(): + return if self.p.online: self.p.send_now("M104 S"+l) print "Setting hotend temperature to ", f, " degrees Celsius."