Updating target temperatures in UI based on gcode #198

Merged
merged 1 commit into from Mar 20, 2012
View
24 pronterface.py
@@ -199,6 +199,30 @@ def sentcb(self,line):
pass
#threading.Thread(target=self.gviz.addgcode,args=(line,1)).start()
#self.gwindow.p.addgcode(line,hilight=1)
+ if("M104" in line or "M109" in line):
+ if("S" in line):
+ try:
+ temp=float(line.split("S")[1].split("*")[0])
+ self.hottgauge.SetTarget(temp)
+ self.graph.SetExtruder1TargetTemperature(temp)
+ except:
+ pass
+ try:
+ self.sentlines.put_nowait(line)
+ except:
+ pass
+ if("M140" in line):
+ if("S" in line):
+ try:
+ temp=float(line.split("S")[1].split("*")[0])
+ self.bedtgauge.SetTarget(temp)
+ self.graph.SetBedTargetTemperature(temp)
+ except:
+ pass
+ try:
+ self.sentlines.put_nowait(line)
+ except:
+ pass
def do_extrude(self,l=""):
try: