From ee031a873e68c8598d7411b8a992fb0f2e04abbc Mon Sep 17 00:00:00 2001 From: daid Date: Thu, 6 Nov 2014 10:12:26 +0100 Subject: [PATCH] Add raft airgap setting. Add new machine menu option to machine menu. --- Cura/gui/firmwareInstall.py | 12 +++++++++--- Cura/gui/mainWindow.py | 11 ++++++----- Cura/util/profile.py | 3 ++- Cura/util/sliceEngine.py | 3 ++- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Cura/gui/firmwareInstall.py b/Cura/gui/firmwareInstall.py index fb3f3cc7..8c030a79 100644 --- a/Cura/gui/firmwareInstall.py +++ b/Cura/gui/firmwareInstall.py @@ -239,7 +239,10 @@ class AutoUpdateFirmware(wx.Dialog): self._serial = None time.sleep(0.5) self.OnInstall() - self._serial = serial.Serial(self.port, 250000) + try: + self._serial = serial.Serial(self.port, 250000) + except: + pass time.sleep(0.5) def OnSerialRead(self): @@ -247,8 +250,11 @@ class AutoUpdateFirmware(wx.Dialog): if self._serial is None: time.sleep(0.5) else: - line = self._serial.readline() - wx.CallAfter(self._addTermLog, line) + try: + line = self._serial.readline() + wx.CallAfter(self._addTermLog, line) + except: + pass def OnInstall(self): wx.CallAfter(self.okButton.Disable) diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index 5bed7e9c..789b65f8 100644 --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@ -173,8 +173,6 @@ class mainWindow(wx.Frame): self.normalModeOnlyItems.append(i) self.Bind(wx.EVT_MENU, self.OnExpertOpen, i) expertMenu.AppendSeparator() - #i = expertMenu.Append(-1, _("Run first run wizard...")) - #self.Bind(wx.EVT_MENU, self.OnFirstRunWizard, i) self.bedLevelWizardMenuItem = expertMenu.Append(-1, _("Run bed leveling wizard...")) self.Bind(wx.EVT_MENU, self.OnBedLevelWizard, self.bedLevelWizardMenuItem) self.headOffsetWizardMenuItem = expertMenu.Append(-1, _("Run head offset wizard...")) @@ -463,7 +461,8 @@ class mainWindow(wx.Frame): self.Bind(wx.EVT_MENU, lambda e: self.OnSelectMachine(e.GetId() - 0x1000), i) self.machineMenu.AppendSeparator() - + i = self.machineMenu.Append(-1, _("Add new machine...")) + self.Bind(wx.EVT_MENU, self.OnAddNewMachine, i) i = self.machineMenu.Append(-1, _("Machine settings...")) self.Bind(wx.EVT_MENU, self.OnMachineSettings, i) @@ -549,11 +548,13 @@ class mainWindow(wx.Frame): #For some reason my Ubuntu 10.10 crashes here. firmwareInstall.InstallFirmware(self, filename) - def OnFirstRunWizard(self, e): + def OnAddNewMachine(self, e): self.Hide() - configWizard.configWizard() + profile.setActiveMachine(profile.getMachineCount()) + configWizard.configWizard(True) self.Show() self.reloadSettingPanels() + self.updateMachineMenu() def OnSelectMachine(self, index): profile.setActiveMachine(index) diff --git a/Cura/util/profile.py b/Cura/util/profile.py index c46f98e7..3fb40835 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -236,7 +236,8 @@ setting('raft_base_thickness', 0.3, float, 'expert', _('Raft')).setRange(0).setL setting('raft_base_linewidth', 1.0, float, 'expert', _('Raft')).setRange(0).setLabel(_("Base line width (mm)"), _("When you are using the raft this is the width of the base layer lines which are put down.")) setting('raft_interface_thickness', 0.27, float, 'expert', _('Raft')).setRange(0).setLabel(_("Interface thickness (mm)"), _("When you are using the raft this is the thickness of the interface layer which is put down.")) setting('raft_interface_linewidth', 0.4, float, 'expert', _('Raft')).setRange(0).setLabel(_("Interface line width (mm)"), _("When you are using the raft this is the width of the interface layer lines which are put down.")) -setting('raft_airgap', 0.22, float, 'expert', _('Raft')).setRange(0).setLabel(_("Airgap"), _("Gap between the last layer of the raft and the first printing layer. A small gap of 0.2mm works wonders on PLA and makes the raft easy to remove.")) +setting('raft_airgap_all', 0.0, float, 'expert', _('Raft')).setRange(0).setLabel(_("Airgap"), _("Gap between the last layer of the raft the whole print.")) +setting('raft_airgap', 0.22, float, 'expert', _('Raft')).setRange(0).setLabel(_("First Layer Airgap"), _("Gap between the last layer of the raft and the first printing layer. A small gap of 0.2mm works wonders on PLA and makes the raft easy to remove. This value is added on top of the 'Airgap' setting.")) setting('raft_surface_layers', 2, int, 'expert', _('Raft')).setRange(0).setLabel(_("Surface layers"), _("Amount of surface layers put on top of the raft, these are fully filled layers on which the model is printed.")) setting('fix_horrible_union_all_type_a', True, bool, 'expert', _('Fix horrible')).setLabel(_("Combine everything (Type-A)"), _("This expert option adds all parts of the model together. The result is usually that internal cavities disappear. Depending on the model this can be intended or not. Enabling this option is at your own risk. Type-A is dependent on the model normals and tries to keep some internal holes intact. Type-B ignores all internal holes and only keeps the outside shape per layer.")) setting('fix_horrible_union_all_type_b', False, bool, 'expert', _('Fix horrible')).setLabel(_("Combine everything (Type-B)"), _("This expert option adds all parts of the model together. The result is usually that internal cavities disappear. Depending on the model this can be intended or not. Enabling this option is at your own risk. Type-A is dependent on the model normals and tries to keep some internal holes intact. Type-B ignores all internal holes and only keeps the outside shape per layer.")) diff --git a/Cura/util/sliceEngine.py b/Cura/util/sliceEngine.py index dcf0fe95..9f01374c 100644 --- a/Cura/util/sliceEngine.py +++ b/Cura/util/sliceEngine.py @@ -523,7 +523,8 @@ class Engine(object): settings['raftInterfaceThickness'] = int(profile.getProfileSettingFloat('raft_interface_thickness') * 1000) settings['raftInterfaceLinewidth'] = int(profile.getProfileSettingFloat('raft_interface_linewidth') * 1000) settings['raftInterfaceLineSpacing'] = int(profile.getProfileSettingFloat('raft_interface_linewidth') * 1000 * 2.0) - settings['raftAirGapLayer0'] = int(profile.getProfileSettingFloat('raft_airgap') * 1000) + settings['raftAirGapLayer0'] = int(profile.getProfileSettingFloat('raft_airgap') * 1000 + profile.getProfileSettingFloat('raft_airgap_all') * 1000) + settings['raftAirGap'] = int(profile.getProfileSettingFloat('raft_airgap_all') * 1000) settings['raftBaseSpeed'] = int(profile.getProfileSettingFloat('bottom_layer_speed')) settings['raftFanSpeed'] = 100 settings['raftSurfaceThickness'] = settings['raftInterfaceThickness'] -- 2.30.2