From: daid303 Date: Mon, 22 Apr 2013 15:28:09 +0000 (+0200) Subject: Fix simple mode for steamengine. X-Git-Tag: 13.05~63 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=149e5222f4643b4f7b1c5060384293a5ecd71a35;p=cura.git Fix simple mode for steamengine. --- diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index bd78aa4a..34ab293b 100644 --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@ -147,7 +147,7 @@ class mainWindow(wx.Frame): self.splitter.Bind(wx.EVT_SPLITTER_DCLICK, lambda evt: evt.Veto()) ##Gui components## - self.simpleSettingsPanel = simpleMode.simpleModePanel(self.leftPane) + self.simpleSettingsPanel = simpleMode.simpleModePanel(self.leftPane, lambda : self.scene.sceneUpdated()) self.normalSettingsPanel = normalSettingsPanel(self.leftPane, lambda : self.scene.sceneUpdated()) self.leftSizer = wx.BoxSizer(wx.VERTICAL) diff --git a/Cura/gui/sceneView.py b/Cura/gui/sceneView.py index b5e3ebd7..bb7149aa 100644 --- a/Cura/gui/sceneView.py +++ b/Cura/gui/sceneView.py @@ -103,7 +103,7 @@ class SceneView(openglGui.glGuiPanel): self._slicer = sliceEngine.Slicer(self._updateSliceProgress) self._sceneUpdateTimer = wx.Timer(self) - self.Bind(wx.EVT_TIMER, lambda e : self._slicer.runSlicer(self._scene), self._sceneUpdateTimer) + self.Bind(wx.EVT_TIMER, self._onRunSlicer, self._sceneUpdateTimer) self.Bind(wx.EVT_MOUSEWHEEL, self.OnMouseWheel) self.OnViewChange() @@ -337,6 +337,13 @@ class SceneView(openglGui.glGuiPanel): self._scene.setSizeOffsets(numpy.array(profile.calculateObjectSizeOffsets(), numpy.float32)) self.QueueRefresh() + def _onRunSlicer(self, e): + if self._isSimpleMode: + self.GetTopLevelParent().simpleSettingsPanel.setupSlice() + self._slicer.runSlicer(self._scene) + if self._isSimpleMode: + profile.resetTempOverride() + def _updateSliceProgress(self, progressValue, ready): self.printButton.setDisabled(not ready) self.printButton.setProgressBar(progressValue) diff --git a/Cura/gui/simpleMode.py b/Cura/gui/simpleMode.py index 3f61e00b..ef6616aa 100644 --- a/Cura/gui/simpleMode.py +++ b/Cura/gui/simpleMode.py @@ -6,9 +6,10 @@ from Cura.util import profile class simpleModePanel(wx.Panel): "Main user interface window for Quickprint mode" - def __init__(self, parent): + def __init__(self, parent, callback): super(simpleModePanel, self).__init__(parent) - + self._callback = callback + #toolsMenu = wx.Menu() #i = toolsMenu.Append(-1, 'Switch to Normal mode...') #self.Bind(wx.EVT_MENU, self.OnNormalSwitch, i) @@ -27,7 +28,6 @@ class simpleModePanel(wx.Panel): self.printMaterialDiameter = wx.TextCtrl(printMaterialPanel, -1, profile.getProfileSetting('filament_diameter')) self.printSupport = wx.CheckBox(self, -1, 'Print support structure') - self.printSupport.Hide() sizer = wx.GridBagSizer() self.SetSizer(sizer) @@ -52,16 +52,26 @@ class simpleModePanel(wx.Panel): printMaterialPanel.GetSizer().Add(boxsizer, flag=wx.EXPAND) sizer.Add(printMaterialPanel, (1,0), flag=wx.EXPAND) - #sb = wx.StaticBox(self, label="Other:") - #boxsizer = wx.StaticBoxSizer(sb, wx.VERTICAL) - #boxsizer.Add(self.printSupport) - #sizer.Add(boxsizer, (2,0), flag=wx.EXPAND) + sb = wx.StaticBox(self, label="Other:") + boxsizer = wx.StaticBoxSizer(sb, wx.VERTICAL) + boxsizer.Add(self.printSupport) + sizer.Add(boxsizer, (2,0), flag=wx.EXPAND) self.printTypeNormal.SetValue(True) self.printMaterialPLA.SetValue(True) + self.printTypeHigh.Bind(wx.EVT_RADIOBUTTON, lambda e: self._callback()) + self.printTypeNormal.Bind(wx.EVT_RADIOBUTTON, lambda e: self._callback()) + self.printTypeLow.Bind(wx.EVT_RADIOBUTTON, lambda e: self._callback()) + #self.printTypeJoris.Bind(wx.EVT_RADIOBUTTON, lambda e: self._callback()) + + self.printMaterialPLA.Bind(wx.EVT_RADIOBUTTON, lambda e: self._callback()) + self.printMaterialABS.Bind(wx.EVT_RADIOBUTTON, lambda e: self._callback()) + + self.printSupport.Bind(wx.EVT_CHECKBOX, lambda e: self._callback()) + def setupSlice(self): - put = profile.putProfileSetting + put = profile.setTempOverride get = profile.getProfileSetting put('layer_height', '0.2')