From: daid Date: Wed, 26 Nov 2014 10:26:39 +0000 (+0100) Subject: Change the order in which the printrbot printers are listed. As requested by Brook... X-Git-Tag: lulzbot-14.12~20 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=b5c8bdd5b050f74b8fb4931d5df8448d4787e59b;p=cura.git Change the order in which the printrbot printers are listed. As requested by Brook. Added 2 new printrbot printers (still need to update data so it matches actual machines). Fixed problem where canceling the machine add wizard caused problems with a ghost machine being added. Added support to load UM2 dual extrusion firmware. --- diff --git a/Cura/gui/configWizard.py b/Cura/gui/configWizard.py index b4722540..387d4d49 100644 --- a/Cura/gui/configWizard.py +++ b/Cura/gui/configWizard.py @@ -226,33 +226,38 @@ class InfoPage(wx.wizard.WizardPageSimple): class PrintrbotPage(InfoPage): def __init__(self, parent): - self._printer_info = { + self._printer_info = [ # X, Y, Z, Filament Diameter, PrintTemperature, Print Speed, Travel Speed, Retract speed, Retract amount - "Original": (130, 130, 130, 2.95, 208, 40, 70, 30, 1), - "Simple Maker's Edition v1": (100, 100, 100, 1.75, 208, 40, 70, 30, 1), - "Simple Maker's Edition v2 (2013 Printrbot Simple)": (100, 100, 100, 1.75, 208, 40, 70, 30, 1), - "Simple Maker's Edition v3 (2014 Printrbot Simple)": (100, 100, 100, 1.75, 208, 40, 70, 30, 1), - "Simple Maker's Edition v4 (Model 1405)": (100, 100, 100, 1.75, 208, 40, 70, 30, 1), - "Simple Metal": (150, 150, 150, 1.75, 208, 40, 70, 30, 1), - "Jr v1": (150, 100, 80, 1.75, 208, 40, 70, 30, 1), - "Jr v2": (150, 150, 150, 1.75, 208, 40, 70, 30, 1), - "LC v2": (150, 150, 150, 1.75, 208, 40, 70, 30, 1), - "Plus v2": (200, 200, 200, 1.75, 208, 40, 70, 30, 1), - "Plus v2.1": (200, 200, 200, 1.75, 208, 40, 70, 30, 1), - "Plus v2.2 (Model 1404/140422)": (250, 250, 250, 1.75, 208, 40, 70, 30, 1), - "Plus v2.3 (Model 140501)": (250, 250, 250, 1.75, 208, 40, 70, 30, 1), - "Plus v2.4 (Model 140507)": (250, 250, 250, 1.75, 208, 40, 70, 30, 1), - } + ("Simple Metal", 150, 150, 150, 1.75, 208, 40, 70, 30, 1), + ("Metal Plus", 150, 150, 150, 1.75, 208, 40, 70, 30, 1),#TODO: Check info + ("Simple Makers Kit", 150, 150, 150, 1.75, 208, 40, 70, 30, 1),#TODO: Check info + (":" + _("Older models"),), + ("Original", 130, 130, 130, 2.95, 208, 40, 70, 30, 1), + ("Simple Maker's Edition v1", 100, 100, 100, 1.75, 208, 40, 70, 30, 1), + ("Simple Maker's Edition v2 (2013 Printrbot Simple)", 100, 100, 100, 1.75, 208, 40, 70, 30, 1), + ("Simple Maker's Edition v3 (2014 Printrbot Simple)", 100, 100, 100, 1.75, 208, 40, 70, 30, 1), + ("Simple Maker's Edition v4 (Model 1405)", 100, 100, 100, 1.75, 208, 40, 70, 30, 1), + ("Jr v1", 150, 100, 80, 1.75, 208, 40, 70, 30, 1), + ("Jr v2", 150, 150, 150, 1.75, 208, 40, 70, 30, 1), + ("LC v2", 150, 150, 150, 1.75, 208, 40, 70, 30, 1), + ("Plus v2", 200, 200, 200, 1.75, 208, 40, 70, 30, 1), + ("Plus v2.1", 200, 200, 200, 1.75, 208, 40, 70, 30, 1), + ("Plus v2.2 (Model 1404/140422)", 250, 250, 250, 1.75, 208, 40, 70, 30, 1), + ("Plus v2.3 (Model 140501)", 250, 250, 250, 1.75, 208, 40, 70, 30, 1), + ("Plus v2.4 (Model 140507)", 250, 250, 250, 1.75, 208, 40, 70, 30, 1), + ] super(PrintrbotPage, self).__init__(parent, _("Printrbot Selection")) self.AddText(_("Select which Printrbot machine you have:")) - keys = self._printer_info.keys() - keys.sort() self._items = [] - for name in keys: - item = self.AddRadioButton(name) - item.data = self._printer_info[name] - self._items.append(item) + for printer in self._printer_info: + if printer[0].startswith(":"): + self.AddSeperator() + self.AddText(printer[0][1:]) + else: + item = self.AddRadioButton(printer[0]) + item.data = printer[1:] + self._items.append(item) def StoreData(self): profile.putMachineSetting('machine_name', 'Printrbot ???') @@ -947,8 +952,13 @@ class configWizard(wx.wizard.Wizard): def __init__(self, addNew = False): super(configWizard, self).__init__(None, -1, _("Configuration Wizard")) + self._old_machine_index = int(profile.getPreferenceFloat('active_machine')) + if addNew: + profile.setActiveMachine(profile.getMachineCount()) + 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.machineSelectPage = MachineSelectPage(self) self.ultimakerSelectParts = SelectParts(self) @@ -994,6 +1004,9 @@ class configWizard(wx.wizard.Wizard): else: self.FindWindowById(wx.ID_BACKWARD).Disable() + def OnCancel(self, e): + profile.setActiveMachine(self._old_machine_index) + class bedLevelWizardMain(InfoPage): def __init__(self, parent): super(bedLevelWizardMain, self).__init__(parent, _("Bed leveling wizard")) diff --git a/Cura/gui/firmwareInstall.py b/Cura/gui/firmwareInstall.py index d2f55dae..1dc9844b 100644 --- a/Cura/gui/firmwareInstall.py +++ b/Cura/gui/firmwareInstall.py @@ -44,6 +44,10 @@ def getDefaultFirmware(machineIndex = None): return resources.getPathForFirmware(name + '.hex') if profile.getMachineSetting('machine_type', machineIndex) == 'ultimaker2': + if profile.getMachineSettingFloat('extruder_amount', machineIndex) > 2: + return None + if profile.getMachineSettingFloat('extruder_amount', machineIndex) == 2: + return resources.getPathForFirmware("MarlinUltimaker2-dual.hex") return resources.getPathForFirmware("MarlinUltimaker2.hex") if profile.getMachineSetting('machine_type', machineIndex) == 'lulzbot_mini': return resources.getPathForFirmware("marlin_mini_2014Q4.hex") diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index 03cc8770..b55f635f 100644 --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@ -558,7 +558,6 @@ class mainWindow(wx.Frame): def OnAddNewMachine(self, e): self.Hide() - profile.setActiveMachine(profile.getMachineCount()) configWizard.configWizard(True) self.Show() self.reloadSettingPanels() diff --git a/Cura/gui/preferencesDialog.py b/Cura/gui/preferencesDialog.py index 35e36558..5ba79c67 100644 --- a/Cura/gui/preferencesDialog.py +++ b/Cura/gui/preferencesDialog.py @@ -138,7 +138,6 @@ class machineSettingsDialog(wx.Dialog): def OnAddMachine(self, e): self.Hide() self.parent.Hide() - profile.setActiveMachine(profile.getMachineCount()) configWizard.configWizard(True) self.parent.Show() self.parent.reloadSettingPanels() diff --git a/package.sh b/package.sh index f3bbbcdd..bc5a8414 100755 --- a/package.sh +++ b/package.sh @@ -165,7 +165,7 @@ cd - gitClone git@github.com:Ultimaker/Ultimaker2Marlin.git _Ultimaker2Marlin cd _Ultimaker2Marlin/Marlin $MAKE -j 3 HARDWARE_MOTHERBOARD=72 ARDUINO_INSTALL_DIR=${ARDUINO_PATH} ARDUINO_VERSION=${ARDUINO_VERSION} BUILD_DIR=_Ultimaker2 DEFINES="'STRING_CONFIG_H_AUTHOR=\"Version:_${BUILD_NAME}\"' TEMP_SENSOR_1=0 EXTRUDERS=1" -$MAKE -j 3 V=1 HARDWARE_MOTHERBOARD=72 ARDUINO_INSTALL_DIR=${ARDUINO_PATH} ARDUINO_VERSION=${ARDUINO_VERSION} BUILD_DIR=_Ultimaker2Dual DEFINES="'STRING_CONFIG_H_AUTHOR=\"Version:_${BUILD_NAME}\"' TEMP_SENSOR_1=20 EXTRUDERS=2" +$MAKE -j 3 HARDWARE_MOTHERBOARD=72 ARDUINO_INSTALL_DIR=${ARDUINO_PATH} ARDUINO_VERSION=${ARDUINO_VERSION} BUILD_DIR=_Ultimaker2Dual DEFINES="'STRING_CONFIG_H_AUTHOR=\"Version:_${BUILD_NAME}\"' TEMP_SENSOR_1=20 EXTRUDERS=2" cd - cp _UltimakerMarlin/Marlin/_UltimakerMarlin_250000/Marlin.hex resources/firmware/MarlinUltimaker-250000.hex