Ejemplo n.º 1
0
    def OnHeatRun(self):
        self.heatButton.Enable(False)
        self.extrudeButton.Enable(False)
        self.comm = machineCom.MachineCom()
        if not self.comm.isOpen():
            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 'start' in line:
                break
            #Wait 3 seconds for the SD card init to timeout if we have SD in our firmware but there is no SD card found.
        time.sleep(3)

        self.sendGCommand(
            'M104 S200'
        )  #Set the temperature to 200C, should be enough to get PLA and ABS out.
        wx.MessageBox(
            'Wait till you can remove the filament from the machine, and press OK.\n(Temperature is set to 200C)',
            'Machine heatup', wx.OK | wx.ICON_INFORMATION)
        self.sendGCommand('M104 S0')
        time.sleep(1)
        self.comm.close()
        self.heatButton.Enable(True)
        self.extrudeButton.Enable(True)
Ejemplo n.º 2
0
    def OnExtrudeRun(self):
        self.heatButton.Enable(False)
        self.extrudeButton.Enable(False)
        currentEValue = float(self.stepsPerEInput.GetValue())
        self.comm = machineCom.MachineCom()
        if not self.comm.isOpen():
            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 == '':
                return
            if 'start' in line:
                break
            #Wait 3 seconds for the SD card init to timeout if we have SD in our firmware but there is no SD card found.
        time.sleep(3)

        self.sendGCommand('M302')  #Disable cold extrusion protection
        self.sendGCommand("M92 E%f" % (currentEValue))
        self.sendGCommand("G92 E0")
        self.sendGCommand("G1 E100 F600")
        time.sleep(15)
        self.comm.close()
        self.extrudeButton.Enable()
        self.heatButton.Enable()
Ejemplo n.º 3
0
	def __init__(self, portName, baudrate):
		self._comm = None
		self._gcodeList = []

		try:
			baudrate = int(baudrate)
		except ValueError:
			baudrate = 0
		self._comm = machineCom.MachineCom(portName, baudrate, callbackObject=self)
Ejemplo n.º 4
0
    def __init__(self, parent):
        super(debuggerWindow, self).__init__(parent,
                                             title='Cura - PID Debugger')

        self.machineCom = None
        self.machineCom = machineCom.MachineCom(callbackObject=self)
        self.coolButton = wx.Button(self, -1, '0C')
        self.heatupButton = wx.Button(self, -1, '200C')
        self.heatupButton2 = wx.Button(self, -1, '260C')
        self.heatupButton3 = wx.Button(self, -1, '300C')
        self.fanOn = wx.Button(self, -1, 'Fan ON')
        self.fanOn50 = wx.Button(self, -1, 'Fan ON 50%')
        self.fanOff = wx.Button(self, -1, 'Fan OFF')
        self.graph = temperatureGraph(self)
        self.targetTemp = 0
        self.pValue = wx.TextCtrl(self, -1, '0')
        self.iValue = wx.TextCtrl(self, -1, '0')
        self.dValue = wx.TextCtrl(self, -1, '0')

        self.sizer = wx.GridBagSizer(0, 0)
        self.SetSizer(self.sizer)
        self.sizer.Add(self.graph, pos=(0, 0), span=(1, 8), flag=wx.EXPAND)
        self.sizer.Add(self.coolButton, pos=(1, 0), flag=wx.EXPAND)
        self.sizer.Add(self.heatupButton, pos=(1, 1), flag=wx.EXPAND)
        self.sizer.Add(self.heatupButton2, pos=(1, 2), flag=wx.EXPAND)
        self.sizer.Add(self.heatupButton3, pos=(1, 3), flag=wx.EXPAND)
        self.sizer.Add(self.fanOn, pos=(1, 4), flag=wx.EXPAND)
        self.sizer.Add(self.fanOn50, pos=(1, 5), flag=wx.EXPAND)
        self.sizer.Add(self.fanOff, pos=(1, 6), flag=wx.EXPAND)
        self.sizer.Add(self.pValue, pos=(2, 0), flag=wx.EXPAND)
        self.sizer.Add(self.iValue, pos=(2, 1), flag=wx.EXPAND)
        self.sizer.Add(self.dValue, pos=(2, 2), flag=wx.EXPAND)
        self.sizer.AddGrowableCol(7)
        self.sizer.AddGrowableRow(0)

        wx.EVT_CLOSE(self, self.OnClose)
        self.Bind(wx.EVT_BUTTON, lambda e: self.setTemp(0), self.coolButton)
        self.Bind(wx.EVT_BUTTON, lambda e: self.setTemp(200),
                  self.heatupButton)
        self.Bind(wx.EVT_BUTTON, lambda e: self.setTemp(260),
                  self.heatupButton2)
        self.Bind(wx.EVT_BUTTON, lambda e: self.setTemp(300),
                  self.heatupButton3)
        self.Bind(wx.EVT_BUTTON, lambda e: self.machineCom.sendCommand('M106'),
                  self.fanOn)
        self.Bind(wx.EVT_BUTTON,
                  lambda e: self.machineCom.sendCommand('M106 S128'),
                  self.fanOn50)
        self.Bind(wx.EVT_BUTTON, lambda e: self.machineCom.sendCommand('M107'),
                  self.fanOff)
        self.Bind(wx.EVT_TEXT, self.updatePID, self.pValue)
        self.Bind(wx.EVT_TEXT, self.updatePID, self.iValue)
        self.Bind(wx.EVT_TEXT, self.updatePID, self.dValue)

        self.Layout()
        self.Fit()
Ejemplo n.º 5
0
 def OnConnect(self, e=None):
     if self.comm is not None:
         self.comm.close()
         del self.comm
         self.comm = None
         wx.CallAfter(self.OnConnect)
         return
     self.connectButton.Enable(False)
     self.comm = machineCom.MachineCom(callbackObject=self)
     self.infoBox.SetBusy('Connecting to machine.')
     self._wizardState = 0
Ejemplo n.º 6
0
 def OnCheckClick(self, e=None):
     self.errorLogButton.Show(False)
     if self.comm is not None:
         self.comm.close()
         del self.comm
         self.comm = None
         wx.CallAfter(self.OnCheckClick)
         return
     self.infoBox.SetBusy(_("Connecting to machine."))
     self.commState.SetBitmap(self.unknownBitmap)
     self.comm = machineCom.MachineCom(callbackObject=self)
     self.checkupState = 0
Ejemplo n.º 7
0
 def OnConnect(self, e):
     if self.machineCom is not None:
         self.machineCom.close()
     self.machineCom = machineCom.MachineCom(callbackObject=self)
     self.UpdateButtonStates()
     taskbar.setBusy(self, True)
Ejemplo n.º 8
0
    def __init__(self, portName):
        self._comm = None
        self._gcodeList = []

        self._comm = machineCom.MachineCom(portName, callbackObject=self)