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
|
#Reset the controller
|
||||||
self.serial.setDTR(1)
|
self.serial.setDTR(1)
|
||||||
|
time.sleep(0.1)
|
||||||
self.serial.setDTR(0)
|
self.serial.setDTR(0)
|
||||||
time.sleep(0.2)
|
time.sleep(0.2)
|
||||||
|
|
||||||
|
|
|
@ -375,8 +375,9 @@ class UltimakerCalibrateStepsPerEPage(InfoPage):
|
||||||
currentEValue = float(self.stepsPerEInput.GetValue())
|
currentEValue = float(self.stepsPerEInput.GetValue())
|
||||||
self.comm = machineCom.MachineCom()
|
self.comm = machineCom.MachineCom()
|
||||||
if not self.comm.isOpen():
|
if not self.comm.isOpen():
|
||||||
wx.CallAfter(self.AddProgressText, "Error: Failed to open serial port to machine")
|
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)
|
||||||
wx.CallAfter(self.AddProgressText, "If this keeps happening, try disconnecting and reconnecting the USB cable")
|
self.heatButton.Enable(True)
|
||||||
|
self.extrudeButton.Enable(True)
|
||||||
return
|
return
|
||||||
while True:
|
while True:
|
||||||
line = self.comm.readline()
|
line = self.comm.readline()
|
||||||
|
@ -400,14 +401,19 @@ class UltimakerCalibrateStepsPerEPage(InfoPage):
|
||||||
threading.Thread(target=self.OnHeatRun).start()
|
threading.Thread(target=self.OnHeatRun).start()
|
||||||
|
|
||||||
def OnHeatRun(self):
|
def OnHeatRun(self):
|
||||||
|
self.heatButton.Enable(False)
|
||||||
|
self.extrudeButton.Enable(False)
|
||||||
self.comm = machineCom.MachineCom()
|
self.comm = machineCom.MachineCom()
|
||||||
if not self.comm.isOpen():
|
if not self.comm.isOpen():
|
||||||
wx.CallAfter(self.AddProgressText, "Error: Failed to open serial port to machine")
|
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)
|
||||||
wx.CallAfter(self.AddProgressText, "If this keeps happening, try disconnecting and reconnecting the USB cable")
|
self.heatButton.Enable(True)
|
||||||
|
self.extrudeButton.Enable(True)
|
||||||
return
|
return
|
||||||
while True:
|
while True:
|
||||||
line = self.comm.readline()
|
line = self.comm.readline()
|
||||||
if line == '':
|
if line == '':
|
||||||
|
self.heatButton.Enable(True)
|
||||||
|
self.extrudeButton.Enable(True)
|
||||||
return
|
return
|
||||||
if line.startswith('start'):
|
if line.startswith('start'):
|
||||||
break
|
break
|
||||||
|
@ -419,6 +425,8 @@ class UltimakerCalibrateStepsPerEPage(InfoPage):
|
||||||
self.sendGCommand('M104 S0')
|
self.sendGCommand('M104 S0')
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
self.comm.close()
|
self.comm.close()
|
||||||
|
self.heatButton.Enable(True)
|
||||||
|
self.extrudeButton.Enable(True)
|
||||||
|
|
||||||
def sendGCommand(self, cmd):
|
def sendGCommand(self, cmd):
|
||||||
self.comm.sendCommand(cmd) #Disable cold extrusion protection
|
self.comm.sendCommand(cmd) #Disable cold extrusion protection
|
||||||
|
|
|
@ -156,10 +156,12 @@ class MachineCom():
|
||||||
print "Connecting to: %s %i" % (port, baudrate)
|
print "Connecting to: %s %i" % (port, baudrate)
|
||||||
programmer.connect(port)
|
programmer.connect(port)
|
||||||
programmer.close()
|
programmer.close()
|
||||||
|
time.sleep(1)
|
||||||
self.serial = Serial(port, baudrate, timeout=2)
|
self.serial = Serial(port, baudrate, timeout=2)
|
||||||
break
|
break
|
||||||
except ispBase.IspError:
|
except ispBase.IspError as (e):
|
||||||
print "Error while connecting to %s %i" % (port, baudrate)
|
print "Error while connecting to %s %i" % (port, baudrate)
|
||||||
|
print e
|
||||||
pass
|
pass
|
||||||
except:
|
except:
|
||||||
print "Unexpected error while connecting to serial port:" + port, sys.exc_info()[0]
|
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)
|
self.Bind(wx.EVT_BUTTON, self.OnClick)
|
||||||
|
|
||||||
def OnClick(self, e):
|
def OnClick(self, e):
|
||||||
|
self.parent.sendCommand("G91")
|
||||||
self.parent.sendCommand(self.command)
|
self.parent.sendCommand(self.command)
|
||||||
e.Skip()
|
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-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, '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 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 X10 F6000', 'print-move-x10.png'), pos=(3,5))
|
||||||
sizer.Add(PrintCommandButton(self, 'G1 X100 F6000', 'print-move-x100.png'), pos=(3,6))
|
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 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=(2,6))
|
||||||
|
|
||||||
sizer.Add(PrintCommandButton(self, 'G1 Z0.1 F200', 'object-max-size.png'), pos=(4,6))
|
sizer.Add(PrintCommandButton(self, 'G1 Z-0.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 Z-1 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-10 F200', 'object-max-size.png'), pos=(6,6))
|
||||||
|
|
||||||
self.sizer.AddGrowableRow(3)
|
self.sizer.AddGrowableRow(3)
|
||||||
self.sizer.AddGrowableCol(0)
|
self.sizer.AddGrowableCol(0)
|
||||||
|
|
Loading…
Reference in a new issue