def __init__(self, parent):
        super(decideToUpdateSigma, self).__init__(parent, _('Firmware Updater'))

        self._port = 'AUTO'
        self._baudrate = 250000

        if self._port == 'AUTO':
            print 'entramos en port auto despues de baudrate'
            programmer = stk500v2.Stk500v2()
            print 'antes',self._port
            if not programmer.isConnected():
                print 'not connected'
                for self._port in machineCom.serialList(False):
                    try:
                        print 'despues',self._port
                        programmer.connect(self._port)
                        print 'lo que devuelve', programmer.isConnected()
                        print self._baudrate
                        profile.putMachineSetting('serial_port_auto', self._port)
                        print 'hemos llegado despues del port'
                        print self._port
                        #wx.MessageBox('esto es lo que tenemoss',self._port)
                        programmer.close()
                        self._serial = serial.Serial(str(self._port), self._baudrate, timeout=1)
                        print self._serial
                        profile.putMachineSetting('self_serial', self._serial)
                        self._state = 'Online'
                        print 'bueno', self._state
                        break
                    except ispBase.IspError as (e):
                        self._state = 'Offline'
                        pass
                    programmer.close()
                if self._port not in machineCom.serialList(False):
                    self._state = 'Offline'
                    print 'malo',self._state


        if self._state == 'Offline':
            self.AddText(_('Please connect your printer to the computer.\n\n'
                           'In case you already had it connected and it was not detected,\n'
                           'please disconnect and connect again.\n\n'
                           'Once you have done this, you may press Connect && Upgrade to\n'
                           'continue with the process.\n\n'
                           '(Note: this may take a minute)\n'))
            connectButton = self.AddButton('Connect && Upgrade')
            connectButton.Bind(wx.EVT_BUTTON, self.OnWantToConnect)
            self.AddSeperator()
        if self._state == 'Online':
            self.AddText(_('We have detected a printer, please press Upgrade to continue\n'
                           'with the process.\n\n'
                           '(Note: this may take a minute)\n'))
            upgradeButton = self.AddButton('Upgrade')
            upgradeButton.Bind(wx.EVT_BUTTON, self.OnWantToUpgrade)
            self.AddSeperator()
Esempio n. 2
0
	def OnRun(self):
		hexFile = intelHex.readHex(self.filename)
		wx.CallAfter(self.updateLabel, "Connecting to machine...")
		programmer = stk500v2.Stk500v2()
		programmer.progressCallback = self.OnProgress
		if self.port == 'AUTO':
			for self.port in machineCom.serialList():
				try:
					programmer.connect(self.port)
					break
				except ispBase.IspError:
					pass
		else:
			try:
				programmer.connect(self.port)
			except ispBase.IspError:
				pass
				
		if programmer.isConnected():
			wx.CallAfter(self.updateLabel, "Uploading firmware...")
			try:
				programmer.programChip(hexFile)
				wx.CallAfter(self.updateLabel, "Done!\nInstalled firmware: %s" % (os.path.basename(self.filename)))
			except ispBase.IspError as e:
				wx.CallAfter(self.updateLabel, "Failed to write firmware.\n" + str(e))
				
			programmer.close()
			wx.CallAfter(self.okButton.Enable)
			return
		wx.MessageBox('Failed to find machine for firmware upgrade\nIs your machine connected to the PC?', 'Firmware update', wx.OK | wx.ICON_ERROR)
		wx.CallAfter(self.Close)
Esempio n. 3
0
	def OnRun(self):
		wx.CallAfter(self.updateLabel, _("Reading firmware..."))
		hexFile = intelHex.readHex(self.filename)
		wx.CallAfter(self.updateLabel, _("Connecting to machine..."))
		programmer = stk500v2.Stk500v2()
		programmer.progressCallback = self.OnProgress
		if self.port == 'AUTO':
			wx.CallAfter(self.updateLabel, _("Please connect the printer to your\ncomputer with a USB cable and power it on."))
			while not programmer.isConnected():
				for self.port in machineCom.serialList(True):
					try:
						programmer.connect(self.port)
						break
					except ispBase.IspError:
						programmer.close()
				time.sleep(1)
				if not self:
					#Window destroyed
					return
		else:
			try:
				programmer.connect(self.port)
			except ispBase.IspError:
				programmer.close()
			if not self:
				#Window destroyed
				return

		self.cancelButton.Disable()
		self.okButton.SetLabel(_('Ok'))

		if not programmer.isConnected():
			self.show_connect_dialog = True
			wx.CallAfter(self.Close)
			return


		if self._machine_type == 'ultimaker':
			if programmer.hasChecksumFunction():
				wx.CallAfter(self.updateLabel, _("Failed to install firmware:\nThis firmware is not compatible with this machine.\nTrying to install UMO firmware on an UM2 or UMO+?"))
				programmer.close()
				wx.CallAfter(self.okButton.Enable)
				return
		if self._machine_type == 'ultimaker_plus' or self._machine_type == 'ultimaker2':
			if not programmer.hasChecksumFunction():
				wx.CallAfter(self.updateLabel, _("Failed to install firmware:\nThis firmware is not compatible with this machine.\nTrying to install UM2 or UMO+ firmware on an UMO?"))
				programmer.close()
				wx.CallAfter(self.okButton.Enable)
				return

		wx.CallAfter(self.updateLabel, _("Uploading firmware..."))
		try:
			programmer.programChip(hexFile)
			self.success = True
			wx.CallAfter(self.updateLabel, _("Done!"))
		except ispBase.IspError as e:
			wx.CallAfter(self.updateLabel, _("Failed to write firmware.\n") + str(e))

		programmer.close()
		wx.CallAfter(self.okButton.Enable)
	def OnCustomFirmware(self, e):
		dlg=wx.FileDialog(self, "Open firmware to upload", os.path.split(profile.getPreference('lastFile'))[0], style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)
		dlg.SetWildcard("HEX file (*.hex)|*.hex;*.HEX")
		if dlg.ShowModal() == wx.ID_OK:
			filename = dlg.GetPath()
			if not(os.path.exists(filename)):
				return
			#For some reason my Ubuntu 10.10 crashes here.
			self.port in machineCom.serialList(True)
			firmwareInstall.InstallFirmware(filename)
    def OnRun(self):
        wx.CallAfter(self.updateLabel, _("Reading firmware..."))
        hexFile = intelHex.readHex(self.filename)
        wx.CallAfter(self.updateLabel, _("Connecting to machine..."))
        programmer = stk500v2.Stk500v2()
        programmer.progressCallback = self.OnProgress
        if self.port == 'AUTO':
            wx.CallAfter(self.updateLabel, _("Please connect the printer to\nyour computer with the USB cable."))
            while not programmer.isConnected():
                for self.port in machineCom.serialList(True):
                    try:
                        programmer.connect(self.port)
                        break
                    except ispBase.IspError:
                        programmer.close()
                time.sleep(1)
                if not self:
                    #Window destroyed
                    return
        else:
            try:
                programmer.connect(self.port)
            except ispBase.IspError:
                programmer.close()

        if not programmer.isConnected():
            wx.MessageBox(_("Failed to find machine for firmware upgrade\nIs your machine connected to the PC?"),
                          _("Firmware update"), wx.OK | wx.ICON_ERROR)
            wx.CallAfter(self.Close)
            return

        if self._default_firmware:
            if self._machine_type == 'BCN3DSigma':
                if programmer.hasChecksumFunction():
                    wx.CallAfter(self.updateLabel, _("Failed to install firmware:\nThis firmware is not compatible with this machine.\nTrying to install UMO firmware on an UM2 or UMO+?"))
                    programmer.close()
                    wx.CallAfter(self.okButton.Enable)
                    return
            if self._machine_type == 'ultimaker' or self._machine_type == 'ultimaker2':
                if not programmer.hasChecksumFunction():
                    wx.CallAfter(self.updateLabel, _("Failed to install firmware:\nThis firmware is not compatible with this machine.\nTrying to install UM2 or UMO+ firmware on an UMO?"))
                    programmer.close()
                    wx.CallAfter(self.okButton.Enable)
                    return

        wx.CallAfter(self.updateLabel, _("Uploading firmware..."))
        try:
            programmer.programChip(hexFile)
            wx.CallAfter(self.updateLabel, _("Done!\nInstalled firmware: %s") % (os.path.basename(self.filename)))
        except ispBase.IspError as e:
            wx.CallAfter(self.showError, e)

        programmer.close()
        wx.CallAfter(self.okButton.Enable)
	def getAvailableConnections(self):
		if profile.getMachineSetting('serial_port') == 'AUTO':
			serialList = machineCom.serialList(True)
		else:
			serialList = [profile.getMachineSetting('serial_port')]
		for port in serialList:
			if port not in self._connectionMap:
				self._connectionMap[port] = serialConnection(port)
		for key in self._connectionMap.keys():
			if key not in serialList and not self._connectionMap[key].isActiveConnectionOpen():
				self._connectionMap.pop(key)
		return self._connectionMap.values()
    def OnWantToConnect(self,e):
        self._port = 'AUTO'
        self._baudrate = 250000

        if self._port == 'AUTO':
            print 'entramos en port auto despues de baudrate'
            programmer = stk500v2.Stk500v2()
            print 'antes', self._port
            if not programmer.isConnected():
                print 'not connected'
                for self._port in machineCom.serialList(False):
                    try:
                        print 'despues', self._port
                        programmer.connect(self._port)
                        print 'lo que devuelve', programmer.isConnected()
                        print self._baudrate
                        profile.putMachineSetting('serial_port_auto', self._port)
                        print 'hemos llegado despues del port'
                        print self._port
                        programmer.close()
                        self._serial = serial.Serial(str(self._port), self._baudrate, timeout=1)
                        print self._serial
                        profile.putMachineSetting('self_serial', self._serial)
                        self._state = 'Online'
                        print 'bueno', self._state
                        break
                    except ispBase.IspError as (e):
                        self._state = 'Offline'
                        pass
                    programmer.close()
                if self._port not in machineCom.serialList(False):
                    self._state = 'Offline'
                    print 'malo', self._state

        if self._state == 'Online':
            self._serial.close()
            self.readFirstLine()
            self.getFirmwareHardware()
Esempio n. 8
0
    def OnRun(self):
        wx.CallAfter(self.updateLabel, _("Reading firmware..."))
        hexFile = intelHex.readHex(self.filename)
        wx.CallAfter(self.updateLabel, _("Connecting to machine..."))
        programmer = stk500v2.Stk500v2()
        programmer.progressCallback = self.OnProgress
        if self.port == "AUTO":
            wx.CallAfter(self.updateLabel, _("Please connect the printer to\nyour computer with the USB cable."))
            while not programmer.isConnected():
                for self.port in machineCom.serialList(True):
                    try:
                        programmer.connect(self.port)
                        break
                    except ispBase.IspError:
                        pass
                time.sleep(1)
                if not self:
                    # Window destroyed
                    return
        else:
            try:
                programmer.connect(self.port)
            except ispBase.IspError:
                pass

        if not programmer.isConnected():
            wx.MessageBox(
                _("Failed to find machine for firmware upgrade\nIs your machine connected to the PC?"),
                _("Firmware update"),
                wx.OK | wx.ICON_ERROR,
            )
            wx.CallAfter(self.Close)
            return

        wx.CallAfter(self.updateLabel, _("Uploading firmware..."))
        try:
            programmer.programChip(hexFile)
            wx.CallAfter(self.updateLabel, _("Done!\nInstalled firmware: %s") % (os.path.basename(self.filename)))
        except ispBase.IspError as e:
            wx.CallAfter(self.updateLabel, _("Failed to write firmware.\n") + str(e))

        programmer.close()
        wx.CallAfter(self.okButton.Enable)
Esempio n. 9
0
 def _monitor(self):
     programmer = stk500v2.Stk500v2()
     if self._port == 'AUTO':
         while not programmer.isConnected():
             for self._port in machineCom.serialList(False):
                 try:
                     programmer.connect(self._port)
                     if programmer.isConnected():
                         return self._serial
                 except ispBase.IspError:
                     programmer.close()
             time.sleep(1)
             if not self:
                 #Window destroyed
                 return
     else:
         try:
             programmer.connect(self._port)
         except ispBase.IspError:
             programmer.close()
Esempio n. 10
0
	def OnInstall(self):
		wx.CallAfter(self.okButton.Disable)
		wx.CallAfter(self.updateLabel, _("Reading firmware..."))
		hexFile = intelHex.readHex(self.filename)
		wx.CallAfter(self.updateLabel, _("Connecting to machine..."))
		programmer = stk500v2.Stk500v2()
		programmer.progressCallback = self.OnProgress
		if self.port == 'AUTO':
			wx.CallAfter(self.updateLabel, _("Please connect the printer to your\ncomputer with a USB cable and power it on."))
			while not programmer.isConnected():
				for self.port in machineCom.serialList(True):
					try:
						programmer.connect(self.port)
						break
					except ispBase.IspError:
						pass
				time.sleep(1)
				if not self:
					#Window destroyed
					return
		else:
			try:
				programmer.connect(self.port)
			except ispBase.IspError:
				pass

		if not programmer.isConnected():
			wx.CallAfter(self.updateLabel, _("Failed to connect to programmer.\n"))
			return

		wx.CallAfter(self.updateLabel, _("Uploading firmware..."))
		try:
			programmer.programChip(hexFile)
			wx.CallAfter(self.updateLabel, _("Done!\nInstalled firmware: %s") % (os.path.basename(self.filename)))
		except ispBase.IspError as e:
			wx.CallAfter(self.updateLabel, _("Failed to write firmware.\n") + str(e))

		programmer.close()
		wx.CallAfter(self.okButton.Enable)
Esempio n. 11
0
	def OnInstall(self):
		wx.CallAfter(self.okButton.Disable)
		wx.CallAfter(self.updateLabel, _("Reading firmware..."))
		hexFile = intelHex.readHex(self.filename)
		wx.CallAfter(self.updateLabel, _("Connecting to machine..."))
		programmer = stk500v2.Stk500v2()
		programmer.progressCallback = self.OnProgress
		if self.port == 'AUTO':
			wx.CallAfter(self.updateLabel, _("Please connect the printer to\nyour computer with the USB cable."))
			while not programmer.isConnected():
				for self.port in machineCom.serialList(True):
					try:
						programmer.connect(self.port)
						break
					except ispBase.IspError:
						pass
				time.sleep(1)
				if not self:
					#Window destroyed
					return
		else:
			try:
				programmer.connect(self.port)
			except ispBase.IspError:
				pass

		if not programmer.isConnected():
			wx.CallAfter(self.updateLabel, _("Failed to connect to programmer.\n"))
			return

		wx.CallAfter(self.updateLabel, _("Uploading firmware..."))
		try:
			programmer.programChip(hexFile)
			wx.CallAfter(self.updateLabel, _("Done!\nInstalled firmware: %s") % (os.path.basename(self.filename)))
		except ispBase.IspError as e:
			wx.CallAfter(self.updateLabel, _("Failed to write firmware.\n") + str(e))

		programmer.close()
		wx.CallAfter(self.okButton.Enable)
Esempio n. 12
0
    def OnRun(self):
        wx.CallAfter(self.updateLabel, "Reading firmware...")
        hexFile = intelHex.readHex(self.filename)
        wx.CallAfter(self.updateLabel, "Connecting to machine...")
        programmer = stk500v2.Stk500v2()
        programmer.progressCallback = self.OnProgress
        if self.port == 'AUTO':
            for self.port in machineCom.serialList(True):
                try:
                    programmer.connect(self.port)
                    break
                except ispBase.IspError:
                    pass
        else:
            try:
                programmer.connect(self.port)
            except ispBase.IspError:
                pass

        if programmer.isConnected():
            wx.CallAfter(self.updateLabel, "Uploading firmware...")
            try:
                programmer.programChip(hexFile)
                wx.CallAfter(
                    self.updateLabel, "Done!\nInstalled firmware: %s" %
                    (os.path.basename(self.filename)))
            except ispBase.IspError as e:
                wx.CallAfter(self.updateLabel,
                             "Failed to write firmware.\n" + str(e))

            programmer.close()
            wx.CallAfter(self.okButton.Enable)
            return
        wx.MessageBox(
            'Failed to find machine for firmware upgrade\nIs your machine connected to the PC?',
            'Firmware update', wx.OK | wx.ICON_ERROR)
        wx.CallAfter(self.Close)
Esempio n. 13
0
    def OnRun(self):
        wx.CallAfter(self.updateLabel, _("Reading firmware..."))
        hexFile = intelHex.readHex(self.filename)
        wx.CallAfter(self.updateLabel, _("Connecting to machine..."))
        programmer = stk500v2.Stk500v2()
        programmer.progressCallback = self.OnProgress
        if self.port == 'AUTO':
            wx.CallAfter(
                self.updateLabel,
                _("Please connect the printer to\nyour computer with the USB cable."
                  ))
            while not programmer.isConnected():
                for self.port in machineCom.serialList(True):
                    try:
                        programmer.connect(self.port)
                        break
                    except ispBase.IspError:
                        programmer.close()
                time.sleep(1)
                if not self:
                    #Window destroyed
                    return
        else:
            try:
                programmer.connect(self.port)
            except ispBase.IspError:
                programmer.close()

        if not programmer.isConnected():
            wx.MessageBox(
                _("Failed to find machine for firmware upgrade\nIs your machine connected to the PC?"
                  ), _("Firmware update"), wx.OK | wx.ICON_ERROR)
            wx.CallAfter(self.Close)
            return

        if self._machine_type == 'ultimaker':
            if programmer.hasChecksumFunction():
                wx.CallAfter(
                    self.updateLabel,
                    _("Failed to install firmware:\nThis firmware is not compatible with this machine.\nTrying to install UMO firmware on an UM2 or UMO+?"
                      ))
                programmer.close()
                wx.CallAfter(self.okButton.Enable)
                return
        if self._machine_type == 'ultimaker_plus' or self._machine_type == 'ultimaker2':
            if not programmer.hasChecksumFunction():
                wx.CallAfter(
                    self.updateLabel,
                    _("Failed to install firmware:\nThis firmware is not compatible with this machine.\nTrying to install UM2 or UMO+ firmware on an UMO?"
                      ))
                programmer.close()
                wx.CallAfter(self.okButton.Enable)
                return

        wx.CallAfter(self.updateLabel, _("Uploading firmware..."))
        try:
            programmer.programChip(hexFile)
            wx.CallAfter(
                self.updateLabel,
                _("Done!\nInstalled firmware: %s") %
                (os.path.basename(self.filename)))
        except ispBase.IspError as e:
            wx.CallAfter(self.updateLabel,
                         _("Failed to write firmware.\n") + str(e))

        programmer.close()
        wx.CallAfter(self.okButton.Enable)
Esempio n. 14
0
    def OnRun(self):
        wx.CallAfter(self.updateLabel, _("Reading firmware..."))
        hexFile = intelHex.readHex(self.filename)
        wx.CallAfter(self.updateLabel, _("Connecting to machine..."))
        programmer = stk500v2.Stk500v2()
        programmer.progressCallback = self.OnProgress
        if self.port == 'AUTO':
            wx.CallAfter(
                self.updateLabel,
                _("Please connect the printer to your\ncomputer with a USB cable and power it on."
                  ))
            while not programmer.isConnected():
                for self.port in machineCom.serialList(True):
                    try:
                        programmer.connect(self.port)
                        break
                    except ispBase.IspError:
                        programmer.close()
                time.sleep(1)
                if not self:
                    #Window destroyed
                    return
        else:
            try:
                programmer.connect(self.port)
            except ispBase.IspError:
                programmer.close()
            if not self:
                #Window destroyed
                return

        self.cancelButton.Disable()
        self.okButton.SetLabel(_('Ok'))

        if not programmer.isConnected():
            self.show_connect_dialog = True
            wx.CallAfter(self.Close)
            return

        if self._machine_type == 'ultimaker':
            if programmer.hasChecksumFunction():
                wx.CallAfter(
                    self.updateLabel,
                    _("Failed to install firmware:\nThis firmware is not compatible with this machine.\nTrying to install UMO firmware on an UM2 or UMO+?"
                      ))
                programmer.close()
                wx.CallAfter(self.okButton.Enable)
                return
        if self._machine_type == 'ultimaker_plus' or self._machine_type == 'ultimaker2':
            if not programmer.hasChecksumFunction():
                wx.CallAfter(
                    self.updateLabel,
                    _("Failed to install firmware:\nThis firmware is not compatible with this machine.\nTrying to install UM2 or UMO+ firmware on an UMO?"
                      ))
                programmer.close()
                wx.CallAfter(self.okButton.Enable)
                return

        wx.CallAfter(self.updateLabel, _("Uploading firmware..."))
        try:
            programmer.programChip(hexFile)
            self.success = True
            wx.CallAfter(self.updateLabel, _("Done!"))
        except ispBase.IspError as e:
            wx.CallAfter(self.updateLabel,
                         _("Failed to write firmware.\n") + str(e))

        programmer.close()
        wx.CallAfter(self.okButton.Enable)
Esempio n. 15
0
    def __init__(self, parent):
        super(machineSettingsDialog, self).__init__(None,
                                                    title="Machine settings")

        wx.EVT_CLOSE(self, self.OnClose)

        self.parent = parent
        extruderCount = int(profile.getMachineSetting('extruder_amount'))

        self.panel = configBase.configPanelBase(self)
        self.SetSizer(wx.BoxSizer(wx.HORIZONTAL))
        self.GetSizer().Add(self.panel, 1, wx.EXPAND)
        self.nb = wx.Notebook(self.panel)
        self.panel.SetSizer(wx.BoxSizer(wx.VERTICAL))
        self.panel.GetSizer().Add(self.nb, 1, wx.EXPAND)

        for idx in xrange(0, profile.getMachineCount()):
            left, right, main = self.panel.CreateConfigPanel(self.nb)
            configBase.TitleRow(left, _("Machine settings"))
            configBase.SettingRow(left, 'steps_per_e', index=idx)
            configBase.SettingRow(left, 'machine_width', index=idx)
            configBase.SettingRow(left, 'machine_depth', index=idx)
            configBase.SettingRow(left, 'machine_height', index=idx)
            configBase.SettingRow(left, 'extruder_amount', index=idx)
            configBase.SettingRow(left, 'has_heated_bed', index=idx)
            configBase.SettingRow(left, 'machine_center_is_zero', index=idx)
            configBase.SettingRow(left, 'relative_extrusion', index=idx)
            configBase.SettingRow(left, 'machine_shape', index=idx)
            configBase.SettingRow(left, 'gcode_flavor', index=idx)

            configBase.TitleRow(right, _("Printer head size"))
            configBase.SettingRow(right, 'extruder_head_size_min_x', index=idx)
            configBase.SettingRow(right, 'extruder_head_size_min_y', index=idx)
            configBase.SettingRow(right, 'extruder_head_size_max_x', index=idx)
            configBase.SettingRow(right, 'extruder_head_size_max_y', index=idx)
            configBase.SettingRow(right,
                                  'extruder_head_size_height',
                                  index=idx)

            for i in xrange(1, extruderCount):
                configBase.TitleRow(left, _("Extruder %d") % (i + 1))
                configBase.SettingRow(left,
                                      'extruder_offset_x%d' % (i),
                                      index=idx)
                configBase.SettingRow(left,
                                      'extruder_offset_y%d' % (i),
                                      index=idx)

            configBase.TitleRow(right, _("Communication settings"))
            configBase.SettingRow(right,
                                  'serial_port',
                                  ['AUTO'] + machineCom.serialList(),
                                  index=idx)
            configBase.SettingRow(right,
                                  'serial_baud', ['AUTO'] +
                                  map(str, machineCom.baudrateList()),
                                  index=idx)

            self.nb.AddPage(
                main,
                profile.getMachineSetting('machine_name', idx).title())

        self.nb.SetSelection(int(profile.getPreferenceFloat('active_machine')))

        self.buttonPanel = wx.Panel(self.panel)
        self.panel.GetSizer().Add(self.buttonPanel)

        self.buttonPanel.SetSizer(wx.BoxSizer(wx.HORIZONTAL))
        self.okButton = wx.Button(self.buttonPanel, -1, 'Ok')
        self.okButton.Bind(wx.EVT_BUTTON, lambda e: self.Close())
        self.buttonPanel.GetSizer().Add(self.okButton, flag=wx.ALL, border=5)

        self.addButton = wx.Button(self.buttonPanel, -1, 'Add new machine')
        self.addButton.Bind(wx.EVT_BUTTON, self.OnAddMachine)
        self.buttonPanel.GetSizer().Add(self.addButton, flag=wx.ALL, border=5)

        self.remButton = wx.Button(self.buttonPanel, -1, 'Remove machine')
        self.remButton.Bind(wx.EVT_BUTTON, self.OnRemoveMachine)
        self.buttonPanel.GetSizer().Add(self.remButton, flag=wx.ALL, border=5)

        main.Fit()
        self.Fit()
Esempio n. 16
0
    def __init__(self, parent):
        super(machineSettingsDialog,
              self).__init__(parent, title=_("Machine settings"))

        wx.EVT_CLOSE(self, self.OnClose)

        self.parent = parent

        self.panel = configBase.configPanelBase(self)
        self.SetSizer(wx.BoxSizer(wx.HORIZONTAL))
        self.GetSizer().Add(self.panel, 1, wx.EXPAND)
        self.nb = wx.Notebook(self.panel)
        self.panel.SetSizer(wx.BoxSizer(wx.VERTICAL))
        self.panel.GetSizer().Add(self.nb, 1, wx.EXPAND)

        for idx in xrange(0, profile.getMachineCount()):
            printer_type = profile.getMachineSetting('machine_type', idx)
            extruderCount = int(
                profile.getMachineSetting('extruder_amount', idx))
            left, right, main = self.panel.CreateConfigPanel(self.nb)
            configBase.TitleRow(left, _("Machine settings"))
            configBase.SettingRow(left, 'steps_per_e', index=idx)
            configBase.SettingRow(left, 'machine_width', index=idx)
            configBase.SettingRow(left, 'machine_depth', index=idx)
            configBase.SettingRow(left, 'machine_height', index=idx)
            if not printer_type.startswith(
                    'lulzbot_TAZ_6'
            ):  #Disabled for TAZ 6, use LCD controller instead
                configBase.SettingRow(left, 'extruder_z_offset', index=idx)
            configBase.SettingRow(left, 'extruder_amount', index=idx)
            configBase.SettingRow(left, 'has_heated_bed', index=idx)
            configBase.SettingRow(left, 'machine_center_is_zero', index=idx)
            configBase.SettingRow(left, 'machine_shape', index=idx)
            configBase.SettingRow(left, 'gcode_flavor', index=idx)
            configBase.SettingRow(left,
                                  'machine_startup_energy_PLA',
                                  index=idx)
            configBase.SettingRow(left, 'machine_run_energy_PLA', index=idx)
            configBase.SettingRow(left,
                                  'machine_startup_energy_ABS',
                                  index=idx)
            configBase.SettingRow(left, 'machine_run_energy_ABS', index=idx)
            configBase.SettingRow(left,
                                  'machine_startup_energy_HIPS',
                                  index=idx)
            configBase.SettingRow(left, 'machine_run_energy_HIPS', index=idx)
            configBase.SettingRow(left,
                                  'machine_startup_energy_PETT',
                                  index=idx)
            configBase.SettingRow(left, 'machine_run_energy_PETT', index=idx)
            configBase.SettingRow(left,
                                  'machine_startup_energy_Nylon',
                                  index=idx)
            configBase.SettingRow(left, 'machine_run_energy_Nylon', index=idx)
            configBase.SettingRow(left,
                                  'machine_startup_energy_Other',
                                  index=idx)
            configBase.SettingRow(left, 'machine_run_energy_Other', index=idx)

            if printer_type.startswith('lulzbot_'):
                configBase.TitleRow(right, _("Tool Head"))
                row = configBase.ToolHeadRow(right, 'toolhead', index=idx)
                row.button.Bind(wx.EVT_BUTTON, self.OnChangeToolheadButton)

            configBase.TitleRow(right, _("Printer head size"))
            configBase.SettingRow(right, 'extruder_head_size_min_x', index=idx)
            configBase.SettingRow(right, 'extruder_head_size_min_y', index=idx)
            configBase.SettingRow(right, 'extruder_head_size_max_x', index=idx)
            configBase.SettingRow(right, 'extruder_head_size_max_y', index=idx)
            configBase.SettingRow(right,
                                  'extruder_head_size_height',
                                  index=idx)

            for i in xrange(1, extruderCount):
                configBase.TitleRow(left, _("Extruder %d") % (i + 1))
                configBase.SettingRow(left,
                                      'extruder_offset_x%d' % (i),
                                      index=idx)
                configBase.SettingRow(left,
                                      'extruder_offset_y%d' % (i),
                                      index=idx)

            configBase.TitleRow(right, _("Communication settings"))
            serial_list = ['AUTO'] + machineCom.serialList()
            serial_list_labels = serial_list[:]
            if profile.getMachineSetting('serial_port') not in serial_list:
                serial_list.append(profile.getMachineSetting('serial_port'))
                serial_list_labels.append(
                    profile.getMachineSetting('serial_port') +
                    _(" (Currently unavailable)"))
            configBase.SettingRow(right,
                                  'serial_port',
                                  serial_list,
                                  serial_list_labels,
                                  index=idx)
            configBase.SettingRow(right,
                                  'serial_baud', ['AUTO'] +
                                  map(str, machineCom.baudrateList()),
                                  index=idx)

            machine_name = profile.getMachineName(idx)
            machine_title = machine_name.title()
            machine_title = machine_title.replace('Taz', 'TAZ')
            machine_title = machine_title.replace('Lulzbot', 'LulzBot')
            self.nb.AddPage(main, machine_title)

        self.nb.SetSelection(int(profile.getPreferenceFloat('active_machine')))

        self.buttonPanel = wx.Panel(self.panel)
        self.panel.GetSizer().Add(self.buttonPanel)

        self.buttonPanel.SetSizer(wx.BoxSizer(wx.HORIZONTAL))
        self.okButton = wx.Button(self.buttonPanel, -1, _('Ok'))
        self.okButton.Bind(wx.EVT_BUTTON, lambda e: self.Close())
        self.buttonPanel.GetSizer().Add(self.okButton, flag=wx.ALL, border=5)

        self.addButton = wx.Button(self.buttonPanel, -1, _('Add new machine'))
        self.addButton.Bind(wx.EVT_BUTTON, self.OnAddMachine)
        self.buttonPanel.GetSizer().Add(self.addButton, flag=wx.ALL, border=5)

        self.remButton = wx.Button(self.buttonPanel, -1, _('Remove machine'))
        self.remButton.Bind(wx.EVT_BUTTON, self.OnRemoveMachine)
        self.buttonPanel.GetSizer().Add(self.remButton, flag=wx.ALL, border=5)

        self.renButton = wx.Button(self.buttonPanel, -1,
                                   _('Change machine name'))
        self.renButton.Bind(wx.EVT_BUTTON, self.OnRenameMachine)
        self.buttonPanel.GetSizer().Add(self.renButton, flag=wx.ALL, border=5)

        main.Fit()
        self.Fit()
Esempio n. 17
0
	def __init__(self, parent):
		super(machineSettingsDialog, self).__init__(None, title="Machine settings")

		wx.EVT_CLOSE(self, self.OnClose)

		self.parent = parent
		extruderCount = int(profile.getMachineSetting('extruder_amount'))

		self.panel = configBase.configPanelBase(self)
		self.SetSizer(wx.BoxSizer(wx.HORIZONTAL))
		self.GetSizer().Add(self.panel, 1, wx.EXPAND)
		self.nb = wx.Notebook(self.panel)
		self.panel.SetSizer(wx.BoxSizer(wx.VERTICAL))
		self.panel.GetSizer().Add(self.nb, 1, wx.EXPAND)

		for idx in xrange(0, profile.getMachineCount()):
			left, right, main = self.panel.CreateConfigPanel(self.nb)
			configBase.TitleRow(left, _("Machine settings"))
			configBase.SettingRow(left, 'steps_per_e', index=idx)
			configBase.SettingRow(left, 'machine_width', index=idx)
			configBase.SettingRow(left, 'machine_depth', index=idx)
			configBase.SettingRow(left, 'machine_height', index=idx)
			configBase.SettingRow(left, 'extruder_amount', index=idx)
			configBase.SettingRow(left, 'has_heated_bed', index=idx)
			configBase.SettingRow(left, 'machine_center_is_zero', index=idx)
			configBase.SettingRow(left, 'gcode_flavor', index=idx)

			configBase.TitleRow(right, _("Printer head size"))
			configBase.SettingRow(right, 'extruder_head_size_min_x', index=idx)
			configBase.SettingRow(right, 'extruder_head_size_min_y', index=idx)
			configBase.SettingRow(right, 'extruder_head_size_max_x', index=idx)
			configBase.SettingRow(right, 'extruder_head_size_max_y', index=idx)
			configBase.SettingRow(right, 'extruder_head_size_height', index=idx)

			for i in xrange(1, extruderCount):
				configBase.TitleRow(left, _("Extruder %d") % (i+1))
				configBase.SettingRow(left, 'extruder_offset_x%d' % (i), index=idx)
				configBase.SettingRow(left, 'extruder_offset_y%d' % (i), index=idx)

			configBase.TitleRow(right, _("Communication settings"))
			configBase.SettingRow(right, 'serial_port', ['AUTO'] + machineCom.serialList(), index=idx)
			configBase.SettingRow(right, 'serial_baud', ['AUTO'] + map(str, machineCom.baudrateList()), index=idx)

			self.nb.AddPage(main, profile.getMachineSetting('machine_name', idx).title())

		self.nb.SetSelection(int(profile.getPreferenceFloat('active_machine')))

		self.buttonPanel = wx.Panel(self.panel)
		self.panel.GetSizer().Add(self.buttonPanel)

		self.buttonPanel.SetSizer(wx.BoxSizer(wx.HORIZONTAL))
		self.okButton = wx.Button(self.buttonPanel, -1, 'Ok')
		self.okButton.Bind(wx.EVT_BUTTON, lambda e: self.Close())
		self.buttonPanel.GetSizer().Add(self.okButton, flag=wx.ALL, border=5)

		self.addButton = wx.Button(self.buttonPanel, -1, 'Add new machine')
		self.addButton.Bind(wx.EVT_BUTTON, self.OnAddMachine)
		self.buttonPanel.GetSizer().Add(self.addButton, flag=wx.ALL, border=5)

		self.remButton = wx.Button(self.buttonPanel, -1, 'Remove machine')
		self.remButton.Bind(wx.EVT_BUTTON, self.OnRemoveMachine)
		self.buttonPanel.GetSizer().Add(self.remButton, flag=wx.ALL, border=5)

		main.Fit()
		self.Fit()
Esempio n. 18
0
    def __init__(self, parent):
        super(preferencesDialog, self).__init__(None,
                                                title="Preferences",
                                                style=wx.DEFAULT_DIALOG_STYLE)

        wx.EVT_CLOSE(self, self.OnClose)

        self.parent = parent
        self.oldExtruderAmount = int(profile.getPreference('extruder_amount'))

        self.panel = configBase.configPanelBase(self)

        left, right, main = self.panel.CreateConfigPanel(self)
        configBase.TitleRow(left, 'Machine settings')
        c = configBase.SettingRow(left,
                                  'Steps per E',
                                  'steps_per_e',
                                  '0',
                                  'Amount of steps per mm filament extrusion',
                                  type='preference')
        validators.validFloat(c, 0.1)
        c = configBase.SettingRow(left,
                                  'Maximum width (mm)',
                                  'machine_width',
                                  '205',
                                  'Size of the machine in mm',
                                  type='preference')
        validators.validFloat(c, 10.0)
        c = configBase.SettingRow(left,
                                  'Maximum depth (mm)',
                                  'machine_depth',
                                  '205',
                                  'Size of the machine in mm',
                                  type='preference')
        validators.validFloat(c, 10.0)
        c = configBase.SettingRow(left,
                                  'Maximum height (mm)',
                                  'machine_height',
                                  '200',
                                  'Size of the machine in mm',
                                  type='preference')
        validators.validFloat(c, 10.0)
        c = configBase.SettingRow(left,
                                  'Extruder count',
                                  'extruder_amount', ['1', '2', '3', '4'],
                                  'Amount of extruders in your machine.',
                                  type='preference')
        c = configBase.SettingRow(
            left,
            'Heated bed',
            'has_heated_bed',
            False,
            'If you have an heated bed, this enabled heated bed settings',
            type='preference')

        for i in xrange(1, self.oldExtruderAmount):
            configBase.TitleRow(left, 'Extruder %d' % (i + 1))
            c = configBase.SettingRow(
                left,
                'Offset X',
                'extruder_offset_x%d' % (i),
                '0.0',
                'The offset of your secondary extruder compared to the primary.',
                type='preference')
            validators.validFloat(c)
            c = configBase.SettingRow(
                left,
                'Offset Y',
                'extruder_offset_y%d' % (i),
                '0.0',
                'The offset of your secondary extruder compared to the primary.',
                type='preference')
            validators.validFloat(c)

        configBase.TitleRow(left, 'Colours')
        c = configBase.SettingRow(left,
                                  'Model colour',
                                  'model_colour',
                                  wx.Colour(0, 0, 0),
                                  '',
                                  type='preference')
        for i in xrange(1, self.oldExtruderAmount):
            c = configBase.SettingRow(left,
                                      'Model colour (%d)' % (i + 1),
                                      'model_colour%d' % (i + 1),
                                      wx.Colour(0, 0, 0),
                                      '',
                                      type='preference')

        configBase.TitleRow(right, 'Filament settings')
        c = configBase.SettingRow(
            right,
            'Density (kg/m3)',
            'filament_density',
            '1300',
            'Weight of the filament per m3. Around 1300 for PLA. And around 1040 for ABS. This value is used to estimate the weight if the filament used for the print.',
            type='preference')
        validators.validFloat(c, 500.0, 3000.0)
        c = configBase.SettingRow(
            right,
            'Cost (price/kg)',
            'filament_cost_kg',
            '0',
            'Cost of your filament per kg, to estimate the cost of the final print.',
            type='preference')
        validators.validFloat(c, 0.0)
        c = configBase.SettingRow(
            right,
            'Cost (price/m)',
            'filament_cost_meter',
            '0',
            'Cost of your filament per meter, to estimate the cost of the final print.',
            type='preference')
        validators.validFloat(c, 0.0)

        configBase.TitleRow(right, 'Communication settings')
        c = configBase.SettingRow(
            right,
            'Serial port',
            'serial_port', ['AUTO'] + machineCom.serialList(),
            'Serial port to use for communication with the printer',
            type='preference')
        c = configBase.SettingRow(
            right,
            'Baudrate',
            'serial_baud', ['AUTO'] + map(str, machineCom.baudrateList()),
            'Speed of the serial port communication\nNeeds to match your firmware settings\nCommon values are 250000, 115200, 57600',
            type='preference')

        configBase.TitleRow(right, 'Slicer settings')
        #c = configBase.SettingRow(right, 'Slicer selection', 'slicer', ['Cura (Skeinforge based)', 'Slic3r'], 'Which slicer to use to slice objects. Usually the Cura engine produces the best results. But Slic3r is developing fast and is faster with slicing.', type = 'preference')
        c = configBase.SettingRow(
            right,
            'Save profile on slice',
            'save_profile',
            False,
            'When slicing save the profile as [stl_file]_profile.ini next to the model.',
            type='preference')

        configBase.TitleRow(right, 'SD Card settings')
        if len(profile.getSDcardDrives()) > 1:
            c = configBase.SettingRow(
                right,
                'SD card drive',
                'sdpath',
                profile.getSDcardDrives(),
                'Location of your SD card, when using the copy to SD feature.',
                type='preference')
        else:
            c = configBase.SettingRow(
                right,
                'SD card path',
                'sdpath',
                '',
                'Location of your SD card, when using the copy to SD feature.',
                type='preference')
        c = configBase.SettingRow(
            right,
            'Copy to SD with 8.3 names',
            'sdshortnames',
            False,
            'Save the gcode files in short filenames, so they are properly shown on the UltiController',
            type='preference')

        configBase.TitleRow(right, 'Cura settings')
        c = configBase.SettingRow(
            right,
            'Check for updates',
            'check_for_updates',
            True,
            'Check for newer versions of Cura on startup',
            type='preference')

        c = configBase.SettingRow(right,
                                  'Prompt for filename',
                                  'filename_prompt',
                                  False,
                                  'Prompt for a filename when saving files',
                                  type='preference')
        c = configBase.SettingRow(
            right,
            'Prompt on overwrite file',
            'file_overwrite_prompt',
            False,
            'Prompt for overwrite when output file already exits',
            type='preference')

        self.okButton = wx.Button(right, -1, 'Ok')
        right.GetSizer().Add(self.okButton, (right.GetSizer().GetRows(), 0),
                             flag=wx.BOTTOM,
                             border=5)
        self.okButton.Bind(wx.EVT_BUTTON, self.OnClose)

        self.MakeModal(True)
        main.Fit()
        self.Fit()
Esempio n. 19
0
	def __init__(self, parent):
		super(preferencesDialog, self).__init__(None, title=language.getText("Preferences"))
		
		wx.EVT_CLOSE(self, self.OnClose)
		
		self.parent = parent
		self.oldExtruderAmount = int(profile.getPreference('extruder_amount'))

		self.panel = configBase.configPanelBase(self)
		
		left, right, main = self.panel.CreateConfigPanel(self)
		configBase.TitleRow(left, language.getText('Machine settings'))
		configBase.SettingRow(left, 'steps_per_e')
		configBase.SettingRow(left, 'machine_width')
		configBase.SettingRow(left, 'machine_depth')
		configBase.SettingRow(left, 'machine_height')
		configBase.SettingRow(left, 'extruder_amount')
		configBase.SettingRow(left, 'has_heated_bed')

		configBase.TitleRow(left, language.getText('Printer head size'))
		configBase.SettingRow(left, 'extruder_head_size_min_x')
		configBase.SettingRow(left, 'extruder_head_size_min_y')
		configBase.SettingRow(left, 'extruder_head_size_max_x')
		configBase.SettingRow(left, 'extruder_head_size_max_y')
		configBase.SettingRow(left, 'extruder_head_size_height')

		for i in xrange(1, self.oldExtruderAmount):
			configBase.TitleRow(left, 'Extruder %d' % (i+1))
			configBase.SettingRow(left, 'extruder_offset_x%d' % (i))
			configBase.SettingRow(left, 'extruder_offset_y%d' % (i))

		configBase.TitleRow(right, language.getText('Colours'))
		configBase.SettingRow(right, 'model_colour', wx.Colour)
		for i in xrange(1, self.oldExtruderAmount):
			configBase.SettingRow(right, 'model_colour%d' % (i+1), wx.Colour)

		configBase.TitleRow(right, language.getText('Filament settings'))
		configBase.SettingRow(right, 'filament_physical_density')
		configBase.SettingRow(right, 'filament_cost_kg')
		configBase.SettingRow(right, 'filament_cost_meter')

		configBase.TitleRow(right, language.getText('Communication settings'))
		configBase.SettingRow(right, 'serial_port', ['AUTO'] + machineCom.serialList())
		configBase.SettingRow(right, 'serial_baud', ['AUTO'] + map(str, machineCom.baudrateList()))

		#configBase.TitleRow(right, 'Slicer settings')
		#configBase.SettingRow(right, 'save_profile')

		#configBase.TitleRow(right, 'SD Card settings')

		configBase.TitleRow(right, language.getText('Cura settings'))
		configBase.SettingRow(right, 'auto_detect_sd')
		configBase.SettingRow(right, 'check_for_updates')
		configBase.SettingRow(right, 'submit_slice_information')

		self.okButton = wx.Button(right, -1, language.getText('Ok'))
		right.GetSizer().Add(self.okButton, (right.GetSizer().GetRows(), 0), flag=wx.BOTTOM, border=5)
		self.okButton.Bind(wx.EVT_BUTTON, lambda e: self.Close())
		
		main.Fit()
		self.Fit()
Esempio n. 20
0
	def __init__(self, parent):
		super(preferencesDialog, self).__init__(None, title="Preferences", style=wx.DEFAULT_DIALOG_STYLE)
		
		wx.EVT_CLOSE(self, self.OnClose)
		
		self.parent = parent
		self.oldExtruderAmount = int(profile.getPreference('extruder_amount'))

		self.panel = configBase.configPanelBase(self)
		
		left, right, main = self.panel.CreateConfigPanel(self)
		configBase.TitleRow(left, 'Machine settings')
		c = configBase.SettingRow(left, 'Steps per E', 'steps_per_e', '0', 'Amount of steps per mm filament extrusion', type = 'preference')
		validators.validFloat(c, 0.1)
		c = configBase.SettingRow(left, 'Maximum width (mm)', 'machine_width', '205', 'Size of the machine in mm', type = 'preference')
		validators.validFloat(c, 10.0)
		c = configBase.SettingRow(left, 'Maximum depth (mm)', 'machine_depth', '205', 'Size of the machine in mm', type = 'preference')
		validators.validFloat(c, 10.0)
		c = configBase.SettingRow(left, 'Maximum height (mm)', 'machine_height', '200', 'Size of the machine in mm', type = 'preference')
		validators.validFloat(c, 10.0)
		c = configBase.SettingRow(left, 'Extruder count', 'extruder_amount', ['1', '2', '3', '4'], 'Amount of extruders in your machine.', type = 'preference')
		c = configBase.SettingRow(left, 'Heated bed', 'has_heated_bed', False, 'If you have an heated bed, this enabled heated bed settings', type = 'preference')
		
		for i in xrange(1, self.oldExtruderAmount):
			configBase.TitleRow(left, 'Extruder %d' % (i+1))
			c = configBase.SettingRow(left, 'Offset X', 'extruder_offset_x%d' % (i), '0.0', 'The offset of your secondary extruder compared to the primary.', type = 'preference')
			validators.validFloat(c)
			c = configBase.SettingRow(left, 'Offset Y', 'extruder_offset_y%d' % (i), '0.0', 'The offset of your secondary extruder compared to the primary.', type = 'preference')
			validators.validFloat(c)

		configBase.TitleRow(left, 'Colours')
		c = configBase.SettingRow(left, 'Model colour', 'model_colour', wx.Colour(0,0,0), '', type = 'preference')
		for i in xrange(1, self.oldExtruderAmount):
			c = configBase.SettingRow(left, 'Model colour (%d)' % (i+1), 'model_colour%d' % (i+1), wx.Colour(0,0,0), '', type = 'preference')

		configBase.TitleRow(right, 'Filament settings')
		c = configBase.SettingRow(right, 'Density (kg/m3)', 'filament_density', '1300', 'Weight of the filament per m3. Around 1300 for PLA. And around 1040 for ABS. This value is used to estimate the weight if the filament used for the print.', type = 'preference')
		validators.validFloat(c, 500.0, 3000.0)
		c = configBase.SettingRow(right, 'Cost (price/kg)', 'filament_cost_kg', '0', 'Cost of your filament per kg, to estimate the cost of the final print.', type = 'preference')
		validators.validFloat(c, 0.0)
		c = configBase.SettingRow(right, 'Cost (price/m)', 'filament_cost_meter', '0', 'Cost of your filament per meter, to estimate the cost of the final print.', type = 'preference')
		validators.validFloat(c, 0.0)
		
		configBase.TitleRow(right, 'Communication settings')
		c = configBase.SettingRow(right, 'Serial port', 'serial_port', ['AUTO'] + machineCom.serialList(), 'Serial port to use for communication with the printer', type = 'preference')
		c = configBase.SettingRow(right, 'Baudrate', 'serial_baud', ['AUTO'] + map(str, machineCom.baudrateList()), 'Speed of the serial port communication\nNeeds to match your firmware settings\nCommon values are 250000, 115200, 57600', type = 'preference')

		configBase.TitleRow(right, 'Slicer settings')
		#c = configBase.SettingRow(right, 'Slicer selection', 'slicer', ['Cura (Skeinforge based)', 'Slic3r'], 'Which slicer to use to slice objects. Usually the Cura engine produces the best results. But Slic3r is developing fast and is faster with slicing.', type = 'preference')
		c = configBase.SettingRow(right, 'Save profile on slice', 'save_profile', False, 'When slicing save the profile as [stl_file]_profile.ini next to the model.', type = 'preference')

		configBase.TitleRow(right, 'SD Card settings')
		if len(profile.getSDcardDrives()) > 1:
			c = configBase.SettingRow(right, 'SD card drive', 'sdpath', profile.getSDcardDrives(), 'Location of your SD card, when using the copy to SD feature.', type = 'preference')
		else:
			c = configBase.SettingRow(right, 'SD card path', 'sdpath', '', 'Location of your SD card, when using the copy to SD feature.', type = 'preference')
		c = configBase.SettingRow(right, 'Copy to SD with 8.3 names', 'sdshortnames', False, 'Save the gcode files in short filenames, so they are properly shown on the UltiController', type = 'preference')

		configBase.TitleRow(right, 'Cura settings')
		c = configBase.SettingRow(right, 'Check for updates', 'check_for_updates', True, 'Check for newer versions of Cura on startup', type = 'preference')

		self.okButton = wx.Button(right, -1, 'Ok')
		right.GetSizer().Add(self.okButton, (right.GetSizer().GetRows(), 0), flag=wx.BOTTOM, border=5)
		self.okButton.Bind(wx.EVT_BUTTON, self.OnClose)
		
		self.MakeModal(True)
		main.Fit()
		self.Fit()
Esempio n. 21
0
	def __init__(self, parent):
		super(machineSettingsDialog, self).__init__(parent, title=_("Machine settings"))

		wx.EVT_CLOSE(self, self.OnClose)

		self.parent = parent

		self.panel = configBase.configPanelBase(self)
		self.SetSizer(wx.BoxSizer(wx.HORIZONTAL))
		self.GetSizer().Add(self.panel, 1, wx.EXPAND)
		self.nb = wx.Notebook(self.panel)
		self.panel.SetSizer(wx.BoxSizer(wx.VERTICAL))
		self.panel.GetSizer().Add(self.nb, 1, wx.EXPAND)

		for idx in xrange(0, profile.getMachineCount()):
			printer_type = profile.getMachineSetting('machine_type', idx)
			extruderCount = int(profile.getMachineSetting('extruder_amount', idx))
			left, right, main = self.panel.CreateConfigPanel(self.nb)
			configBase.TitleRow(left, _("Machine settings"))
			configBase.SettingRow(left, 'steps_per_e', index=idx)
			configBase.SettingRow(left, 'machine_width', index=idx)
			configBase.SettingRow(left, 'machine_depth', index=idx)
			configBase.SettingRow(left, 'machine_height', index=idx)
			if not printer_type.startswith('lulzbot_TAZ_6'): #Disabled for TAZ 6, use LCD controller instead
				configBase.SettingRow(left, 'extruder_z_offset', index=idx)
			configBase.SettingRow(left, 'extruder_amount', index=idx)
			configBase.SettingRow(left, 'has_heated_bed', index=idx)
			configBase.SettingRow(left, 'machine_center_is_zero', index=idx)
			configBase.SettingRow(left, 'machine_shape', index=idx)
			configBase.SettingRow(left, 'gcode_flavor', index=idx)

			if printer_type.startswith('lulzbot_'):
				configBase.TitleRow(right, _("Tool Head"))
				row = configBase.ToolHeadRow(right, 'toolhead', index=idx)
				row.button.Bind(wx.EVT_BUTTON, self.OnChangeToolheadButton)

			configBase.TitleRow(right, _("Printer head size"))
			configBase.SettingRow(right, 'extruder_head_size_min_x', index=idx)
			configBase.SettingRow(right, 'extruder_head_size_min_y', index=idx)
			configBase.SettingRow(right, 'extruder_head_size_max_x', index=idx)
			configBase.SettingRow(right, 'extruder_head_size_max_y', index=idx)
			configBase.SettingRow(right, 'extruder_head_size_height', index=idx)

			for i in xrange(1, extruderCount):
				configBase.TitleRow(left, _("Extruder %d") % (i+1))
				configBase.SettingRow(left, 'extruder_offset_x%d' % (i), index=idx)
				configBase.SettingRow(left, 'extruder_offset_y%d' % (i), index=idx)

			configBase.TitleRow(right, _("Communication settings"))
			serial_list = ['AUTO'] + machineCom.serialList()
			serial_list_labels = serial_list[:]
			if profile.getMachineSetting('serial_port') not in serial_list:
				serial_list.append(profile.getMachineSetting('serial_port'))
				serial_list_labels.append(profile.getMachineSetting('serial_port') + _(" (Currently unavailable)"))
			configBase.SettingRow(right, 'serial_port', serial_list, serial_list_labels, index=idx)
			configBase.SettingRow(right, 'serial_baud', ['AUTO'] + map(str, machineCom.baudrateList()), index=idx)

			self.nb.AddPage(main, profile.getMachineName(idx))

		self.nb.SetSelection(int(profile.getPreferenceFloat('active_machine')))

		self.buttonPanel = wx.Panel(self.panel)
		self.panel.GetSizer().Add(self.buttonPanel)

		self.buttonPanel.SetSizer(wx.BoxSizer(wx.HORIZONTAL))
		self.okButton = wx.Button(self.buttonPanel, -1, _('Ok'))
		self.okButton.Bind(wx.EVT_BUTTON, lambda e: self.Close())
		self.buttonPanel.GetSizer().Add(self.okButton, flag=wx.ALL, border=5)

		self.addButton = wx.Button(self.buttonPanel, -1, _('Add new machine'))
		self.addButton.Bind(wx.EVT_BUTTON, self.OnAddMachine)
		self.buttonPanel.GetSizer().Add(self.addButton, flag=wx.ALL, border=5)

		self.remButton = wx.Button(self.buttonPanel, -1, _('Remove machine'))
		self.remButton.Bind(wx.EVT_BUTTON, self.OnRemoveMachine)
		self.buttonPanel.GetSizer().Add(self.remButton, flag=wx.ALL, border=5)

		self.renButton = wx.Button(self.buttonPanel, -1, _('Change machine name'))
		self.renButton.Bind(wx.EVT_BUTTON, self.OnRenameMachine)
		self.buttonPanel.GetSizer().Add(self.renButton, flag=wx.ALL, border=5)

		main.Fit()
		self.Fit()