From 2421afa48ccaf67ebbb0e41199cfb597d7725993 Mon Sep 17 00:00:00 2001 From: Guillaume Seguin Date: Tue, 28 Feb 2012 03:06:55 +0100 Subject: [PATCH 1/6] Replace "T:" and "B:" in temp monitoring display since a B might be in the translation for Heater --- pronterface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pronterface.py b/pronterface.py index f69d567..8f11348 100755 --- a/pronterface.py +++ b/pronterface.py @@ -1156,7 +1156,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): string+=_("Loaded ")+os.path.split(self.filename)[1]+" " except: pass - string+=(self.tempreport.replace("\r","").replace("T",_("Hotend")).replace("B",_("Bed")).replace("\n","").replace("ok ",""))+" " + string+=(self.tempreport.replace("\r","").replace("T:",_("Hotend") + ":").replace("B:",_("Bed") + ":").replace("\n","").replace("ok ",""))+" " wx.CallAfter(self.tempdisp.SetLabel,self.tempreport.strip().replace("ok ","")) try: self.hottgauge.SetValue(float(filter(lambda x:x.startswith("T:"),self.tempreport.split())[0].split(":")[1])) From 9b32c9ae9e057d7a1d96372ddb541795a3bab8dd Mon Sep 17 00:00:00 2001 From: Guillaume Seguin Date: Tue, 28 Feb 2012 03:08:56 +0100 Subject: [PATCH 2/6] Reset Print button and status when resetting machine --- pronterface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pronterface.py b/pronterface.py index 8f11348..2aa3a31 100755 --- a/pronterface.py +++ b/pronterface.py @@ -1551,11 +1551,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole): dlg=wx.MessageDialog(self, _("Are you sure you want to reset the printer?"), _("Reset?"), wx.YES|wx.NO) if dlg.ShowModal()==wx.ID_YES: self.p.reset() + self.p.printing=0 + wx.CallAfter(self.printbtn.SetLabel, _("Print")) if self.paused: self.p.paused=0 - self.p.printing=0 wx.CallAfter(self.pausebtn.SetLabel, _("Pause")) - wx.CallAfter(self.printbtn.SetLabel, _("Print")) self.paused=0 def get_build_dimensions(self,bdim): From 501254a72f66fff6d7f12988d9e1d98066f03189 Mon Sep 17 00:00:00 2001 From: Nathan Zadoks Date: Thu, 1 Mar 2012 14:12:10 +0100 Subject: [PATCH 3/6] Made greetings configurable (no longer just 'start') --- printcore.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/printcore.py b/printcore.py index fe8f8bf..c753c53 100755 --- a/printcore.py +++ b/printcore.py @@ -47,6 +47,7 @@ class printcore(): self.endcb=None#impl () self.onlinecb=None#impl () self.loud=False#emit sent and received lines to terminal + self.greetings=['start','Grbl '] if port is not None and baud is not None: #print port, baud self.connect(port, baud) @@ -115,10 +116,10 @@ class printcore(): print "RECV: ",line.rstrip() if(line.startswith('DEBUG_')): continue - if(line.startswith('start') or line.startswith('ok')): + if(line.startswith(tuple(self.greetings)) or line.startswith('ok')): self.clear=True - if(line.startswith('start') or line.startswith('ok') or "T:" in line): - if (not self.online or line.startswith('start')) and self.onlinecb is not None: + if(line.startswith(tuple(self.greetings)) or line.startswith('ok') or "T:" in line): + if (not self.online or line.startswith(tuple(self.greetings))) and self.onlinecb is not None: try: self.onlinecb() except: From c2baae7bbbc7a166961a8ef4cb3a677812eeec0a Mon Sep 17 00:00:00 2001 From: Nathan Zadoks Date: Thu, 1 Mar 2012 14:13:57 +0100 Subject: [PATCH 4/6] Lines starting with $ are now passed through too. --- pronsole.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pronsole.py b/pronsole.py index cc6c189..3179e56 100755 --- a/pronsole.py +++ b/pronsole.py @@ -274,7 +274,7 @@ class pronsole(cmd.Cmd): self.helpdict["temperature_pla"] = _("Extruder temp for PLA (default: 185 deg C)") self.helpdict["xy_feedrate"] = _("Feedrate for Control Panel Moves in X and Y (default: 3000mm/min)") self.helpdict["z_feedrate"] = _("Feedrate for Control Panel Moves in Z (default: 200mm/min)") - + self.commandprefixes='MGT$' def set_temp_preset(self,key,value): if not key.startswith("bed"): @@ -870,14 +870,14 @@ class pronsole(cmd.Cmd): print "! os.listdir('.')" def default(self,l): - if(l[0]=='M' or l[0]=="G" or l[0]=='T'): + if(l[0] in self.commandprefixes.upper()): if(self.p and self.p.online): print "SENDING:"+l self.p.send_now(l) else: print "Printer is not online." return - if(l[0]=='m' or l[0]=="g" or l[0]=='t'): + elif(l[0] in self.commandprefixes.lower()): if(self.p and self.p.online): print "SENDING:"+l.upper() self.p.send_now(l.upper()) From 6fb50be6f4f0aedc9d6af382fc96dbfb449bba4e Mon Sep 17 00:00:00 2001 From: hurzl Date: Mon, 5 Mar 2012 10:42:14 +0100 Subject: [PATCH 5/6] zoom by shift+key --- gviz.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gviz.py b/gviz.py index e2bd119..e919b71 100755 --- a/gviz.py +++ b/gviz.py @@ -47,13 +47,21 @@ class window(wx.Frame): else: event.Skip() + def key(self, event): x=event.GetKeyCode() + if event.ShiftDown(): + cx,cy=self.p.translate + if x==wx.WXK_UP: + self.p.zoom(cx,cy,1.2) + if x==wx.WXK_DOWN: + self.p.zoom(cx,cy,1/1.2) + else: + if x==wx.WXK_UP: + self.p.layerup() + if x==wx.WXK_DOWN: + self.p.layerdown() #print x - if x==wx.WXK_UP: - self.p.layerup() - if x==wx.WXK_DOWN: - self.p.layerdown() #print p.lines.keys() def zoom(self, event): From 87eabd654fbb1224cb93ecef3edf56face6e561e Mon Sep 17 00:00:00 2001 From: OhmEye Date: Thu, 15 Mar 2012 10:43:01 -1000 Subject: [PATCH 6/6] Added wildcard filter for All Files for FileDialog --- pronterface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pronterface.py b/pronterface.py index cad6ec5..15bf673 100755 --- a/pronterface.py +++ b/pronterface.py @@ -1363,7 +1363,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): except: pass dlg=wx.FileDialog(self,_("Open file to print"),basedir,style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST) - dlg.SetWildcard(_("OBJ, STL, and GCODE files (;*.gcode;*.gco;*.g;*.stl;*.STL;*.obj;*.OBJ;)")) + dlg.SetWildcard(_("OBJ, STL, and GCODE files (*.gcode;*.gco;*.g;*.stl;*.STL;*.obj;*.OBJ)|*.gcode;*.gco;*.g;*.stl;*.STL;*.obj;*.OBJ|All Files (*.*)|*.*")) if(filename is not None or dlg.ShowModal() == wx.ID_OK): if filename is not None: name=filename