From: Daid Date: Thu, 10 May 2012 19:29:42 +0000 (+0200) Subject: Fixed some more problems with first run wizard. Made print window X/Y/Z move buttons... X-Git-Tag: RC3~7 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=c37c0f2bdedc5d895738e59d6536086dd269fa7b;p=cura.git Fixed some more problems with first run wizard. Made print window X/Y/Z move buttons work. --- diff --git a/Cura/avr_isp/stk500v2.py b/Cura/avr_isp/stk500v2.py index e076e669..58991b59 100644 --- a/Cura/avr_isp/stk500v2.py +++ b/Cura/avr_isp/stk500v2.py @@ -24,6 +24,7 @@ class Stk500v2(ispBase.IspBase): #Reset the controller self.serial.setDTR(1) + time.sleep(0.1) self.serial.setDTR(0) time.sleep(0.2) diff --git a/Cura/gui/configWizard.py b/Cura/gui/configWizard.py index 50f84989..5efd6339 100644 --- a/Cura/gui/configWizard.py +++ b/Cura/gui/configWizard.py @@ -375,8 +375,9 @@ class UltimakerCalibrateStepsPerEPage(InfoPage): currentEValue = float(self.stepsPerEInput.GetValue()) self.comm = machineCom.MachineCom() if not self.comm.isOpen(): - wx.CallAfter(self.AddProgressText, "Error: Failed to open serial port to machine") - wx.CallAfter(self.AddProgressText, "If this keeps happening, try disconnecting and reconnecting the USB cable") + wx.MessageBox("Error: Failed to open serial port to machine\nIf this keeps happening, try disconnecting and reconnecting the USB cable", 'Printer error', wx.OK | wx.ICON_INFORMATION) + self.heatButton.Enable(True) + self.extrudeButton.Enable(True) return while True: line = self.comm.readline() @@ -400,14 +401,19 @@ class UltimakerCalibrateStepsPerEPage(InfoPage): threading.Thread(target=self.OnHeatRun).start() def OnHeatRun(self): + self.heatButton.Enable(False) + self.extrudeButton.Enable(False) self.comm = machineCom.MachineCom() if not self.comm.isOpen(): - wx.CallAfter(self.AddProgressText, "Error: Failed to open serial port to machine") - wx.CallAfter(self.AddProgressText, "If this keeps happening, try disconnecting and reconnecting the USB cable") + wx.MessageBox("Error: Failed to open serial port to machine\nIf this keeps happening, try disconnecting and reconnecting the USB cable", 'Printer error', wx.OK | wx.ICON_INFORMATION) + self.heatButton.Enable(True) + self.extrudeButton.Enable(True) return while True: line = self.comm.readline() if line == '': + self.heatButton.Enable(True) + self.extrudeButton.Enable(True) return if line.startswith('start'): break @@ -419,6 +425,8 @@ class UltimakerCalibrateStepsPerEPage(InfoPage): self.sendGCommand('M104 S0') time.sleep(1) self.comm.close() + self.heatButton.Enable(True) + self.extrudeButton.Enable(True) def sendGCommand(self, cmd): self.comm.sendCommand(cmd) #Disable cold extrusion protection diff --git a/Cura/gui/machineCom.py b/Cura/gui/machineCom.py index 73837d48..6e6e7e43 100644 --- a/Cura/gui/machineCom.py +++ b/Cura/gui/machineCom.py @@ -156,10 +156,12 @@ class MachineCom(): print "Connecting to: %s %i" % (port, baudrate) programmer.connect(port) programmer.close() + time.sleep(1) self.serial = Serial(port, baudrate, timeout=2) break - except ispBase.IspError: + except ispBase.IspError as (e): print "Error while connecting to %s %i" % (port, baudrate) + print e pass except: print "Unexpected error while connecting to serial port:" + port, sys.exc_info()[0] diff --git a/Cura/gui/printWindow.py b/Cura/gui/printWindow.py index 5f68556d..d03a556a 100644 --- a/Cura/gui/printWindow.py +++ b/Cura/gui/printWindow.py @@ -65,6 +65,7 @@ class PrintCommandButton(buttons.GenBitmapButton): self.Bind(wx.EVT_BUTTON, self.OnClick) def OnClick(self, e): + self.parent.sendCommand("G91") self.parent.sendCommand(self.command) e.Skip() @@ -134,6 +135,8 @@ class printWindow(wx.Frame): sizer.Add(PrintCommandButton(self, 'G1 X-10 F6000', 'print-move-x-10.png'), pos=(3,1)) sizer.Add(PrintCommandButton(self, 'G1 X-1 F6000', 'print-move-x-1.png'), pos=(3,2)) + sizer.Add(PrintCommandButton(self, 'G28 X0 Y0', 'exit.png'), pos=(3,3)) + sizer.Add(PrintCommandButton(self, 'G1 X1 F6000', 'print-move-x1.png'), pos=(3,4)) sizer.Add(PrintCommandButton(self, 'G1 X10 F6000', 'print-move-x10.png'), pos=(3,5)) sizer.Add(PrintCommandButton(self, 'G1 X100 F6000', 'print-move-x100.png'), pos=(3,6)) @@ -142,9 +145,9 @@ class printWindow(wx.Frame): sizer.Add(PrintCommandButton(self, 'G1 Z1 F200', 'object-max-size.png'), pos=(1,6)) sizer.Add(PrintCommandButton(self, 'G1 Z0.1 F200', 'object-max-size.png'), pos=(2,6)) - sizer.Add(PrintCommandButton(self, 'G1 Z0.1 F200', 'object-max-size.png'), pos=(4,6)) - sizer.Add(PrintCommandButton(self, 'G1 Z1 F200', 'object-max-size.png'), pos=(5,6)) - sizer.Add(PrintCommandButton(self, 'G1 Z10 F200', 'object-max-size.png'), pos=(6,6)) + sizer.Add(PrintCommandButton(self, 'G1 Z-0.1 F200', 'object-max-size.png'), pos=(4,6)) + sizer.Add(PrintCommandButton(self, 'G1 Z-1 F200', 'object-max-size.png'), pos=(5,6)) + sizer.Add(PrintCommandButton(self, 'G1 Z-10 F200', 'object-max-size.png'), pos=(6,6)) self.sizer.AddGrowableRow(3) self.sizer.AddGrowableCol(0)