Fixed some more problems with first run wizard. Made print window X/Y/Z move buttons work.
This commit is contained in:
parent
af6d6a18d8
commit
c37c0f2bde
4 changed files with 22 additions and 8 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue