+ profile.putMachineSetting('toolhead', 'Single Extruder v2 (0.5mm nozzle)')
+ profile.putMachineSetting('toolhead_shortname', '0.5 nozzle')
+ profile.putMachineSetting('machine_type', 'lulzbot_TAZ_%d_05nozzle' % taz_version)
+
+class LulzbotFirmwareUpdatePage(InfoPage):
+ def __init__(self, parent):
+ super(LulzbotFirmwareUpdatePage, self).__init__(parent, _("LulzBot Firmware Update"))
+
+ self.AddText(_("Your LulzBot printer\'s firmware will now be updated.\n" +
+ "Note: this will overwrite your existing firmware."))
+ self.AddSeperator()
+ self.AddText(_("Follow these steps to prevent writing firmware to the wrong device:\n" +
+ " 1) Unplug all USB devices from your computer\n" +
+ " 2) Plug your 3D Printer into the computer with a USB cable\n" +
+ " 3) Turn on your 3D Printer\n" +
+ " 4) Click \"Flash the firmware\""))
+ self.AddHiddenSeperator()
+ upgradeButton, skipUpgradeButton = self.AddDualButton(_('Flash the firmware'), _('Skip upgrade'))
+ upgradeButton.Bind(wx.EVT_BUTTON, self.OnUpgradeClick)
+ skipUpgradeButton.Bind(wx.EVT_BUTTON, self.OnSkipClick)
+
+ def AllowNext(self):
+ return version.isDevVersion()
+
+ def OnUpgradeClick(self, e):
+ if firmwareInstall.InstallFirmware():
+ self.GetParent().FindWindowById(wx.ID_FORWARD).Enable()
+ self.GetParent().ShowPage(self.GetNext())
+
+ def OnSkipClick(self, e):
+ dlg = wx.MessageDialog(self,
+ _("CAUTION: Updating firmware is necessary when changing the\n" \
+ "tool head on your LulzBot desktop 3D Printer." \
+ "\n\n" +
+ "Are you sure you want to skip the firmware update?"),
+ _('Skip firmware update?'),
+ wx.YES_NO | wx.ICON_EXCLAMATION)
+ skip = dlg.ShowModal() == wx.ID_YES
+ dlg.Destroy()
+ if skip:
+ self.GetParent().FindWindowById(wx.ID_FORWARD).Enable()
+ self.GetParent().ShowPage(self.GetNext())
+
+class LulzbotChangeToolheadWizard(wx.wizard.Wizard):
+ def __init__(self):
+ super(LulzbotChangeToolheadWizard, self).__init__(None, -1, _("Change LulzBot Tool Head Wizard"))
+
+ self._nozzle_size = profile.getProfileSettingFloat('nozzle_size')
+ self._machine_name = profile.getMachineSetting('machine_name')
+ self._machine_type = profile.getMachineSetting('machine_type')
+ self._extruder_amount = int(profile.getMachineSettingFloat('extruder_amount'))
+
+ self.Bind(wx.wizard.EVT_WIZARD_PAGE_CHANGED, self.OnPageChanged)
+ self.Bind(wx.wizard.EVT_WIZARD_PAGE_CHANGING, self.OnPageChanging)
+ self.Bind(wx.wizard.EVT_WIZARD_CANCEL, self.OnCancel)
+
+ self.lulzbotReadyPage = LulzbotReadyPage(self)
+ self.lulzbotFirmwarePage = LulzbotFirmwareUpdatePage(self)
+ self.lulzbotMiniToolheadPage = LulzbotMiniToolheadSelectPage(self, False)
+ self.lulzbotTazToolheadPage = LulzbotTazToolheadSelectPage(self)
+ self.lulzbotTazHotendPage = LulzbotHotendSelectPage(self, False)
+ self.lulzbotTaz5NozzleSelectPage = LulzbotTaz5NozzleSelectPage(self)
+ self.lulzbotTazBedSelectPage = LulzbotTazBedSelectPage(self)
+ self.lulzbotTazSelectPage = LulzbotTazSelectPage(self)
+ self.lulzbotTaz6SelectPage = LulzbotTaz6SelectPage(self)
+
+ wx.wizard.WizardPageSimple.Chain(self.lulzbotMiniToolheadPage, self.lulzbotReadyPage)
+ wx.wizard.WizardPageSimple.Chain(self.lulzbotTazHotendPage, self.lulzbotTazToolheadPage)
+
+ if profile.getMachineSetting('machine_type').startswith('lulzbot_mini'):
+ self.RunWizard(self.lulzbotMiniToolheadPage)
+ else:
+ self.RunWizard(self.lulzbotTazHotendPage)
+ self.Destroy()
+
+ def OnPageChanging(self, e):
+ e.GetPage().StoreData()
+
+ def OnPageChanged(self, e):
+ if e.GetPage().AllowNext():
+ self.FindWindowById(wx.ID_FORWARD).Enable()
+ else:
+ self.FindWindowById(wx.ID_FORWARD).Disable()
+ if e.GetPage().AllowBack():
+ self.FindWindowById(wx.ID_BACKWARD).Enable()
+ else:
+ self.FindWindowById(wx.ID_BACKWARD).Disable()
+ if hasattr(e.GetPage(), 'OnPageShown'):
+ e.GetPage().OnPageShown()
+
+ def OnCancel(self, e):
+ profile.putProfileSetting('nozzle_size', self._nozzle_size)
+ profile.putMachineSetting('machine_name', self._machine_name)
+ profile.putMachineSetting('machine_type', self._machine_type)
+ profile.putMachineSetting('extruder_amount', self._extruder_amount)