From: daid303 Date: Thu, 2 May 2013 08:34:39 +0000 (+0200) Subject: Add plugins, fix re-slicing when you edit the start/end gcode. X-Git-Tag: 13.05~32 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=68fc669b495ceca09df3e8e5cd489144c17533da;p=cura.git Add plugins, fix re-slicing when you edit the start/end gcode. --- diff --git a/Cura/gui/alterationPanel.py b/Cura/gui/alterationPanel.py index f2b8f8ca..69898753 100644 --- a/Cura/gui/alterationPanel.py +++ b/Cura/gui/alterationPanel.py @@ -6,9 +6,10 @@ from Cura.gui.util import gcodeTextArea from Cura.util import profile class alterationPanel(wx.Panel): - def __init__(self, parent): + def __init__(self, parent, callback): wx.Panel.__init__(self, parent,-1) + self.callback = callback self.alterationFileList = ['start.gcode', 'end.gcode']#, 'nextobject.gcode', 'replace.csv' #if int(profile.getPreference('extruder_amount')) > 1: # self.alterationFileList.append('switchExtruder.gcode') @@ -44,7 +45,7 @@ class alterationPanel(wx.Panel): def OnFocusLost(self, e): if self.currentFile == self.list.GetSelection(): profile.setAlterationFile(self.alterationFileList[self.list.GetSelection()], self.textArea.GetValue()) + self.callback() def updateProfileToControls(self): self.OnSelect(None) - diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index a32ee365..1b3ff645 100644 --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@ -449,14 +449,14 @@ class normalSettingsPanel(configBase.configPanelBase): self.SizeLabelWidths(left, right) #Plugin page - self.pluginPanel = pluginPanel.pluginPanel(self.nb) - if len(self.pluginPanel.pluginList) > 0 and False: + self.pluginPanel = pluginPanel.pluginPanel(self.nb, callback) + if len(self.pluginPanel.pluginList) > 0: self.nb.AddPage(self.pluginPanel, "Plugins") else: self.pluginPanel.Show(False) #Alteration page - self.alterationPanel = alterationPanel.alterationPanel(self.nb) + self.alterationPanel = alterationPanel.alterationPanel(self.nb, callback) self.nb.AddPage(self.alterationPanel, "Start/End-GCode") self.Bind(wx.EVT_SIZE, self.OnSize) diff --git a/Cura/gui/pluginPanel.py b/Cura/gui/pluginPanel.py index e665f14b..a07c6476 100644 --- a/Cura/gui/pluginPanel.py +++ b/Cura/gui/pluginPanel.py @@ -8,10 +8,11 @@ from Cura.util import profile from Cura.util import explorer class pluginPanel(wx.Panel): - def __init__(self, parent): + def __init__(self, parent, callback): wx.Panel.__init__(self, parent,-1) #Plugin page self.pluginList = profile.getPluginList() + self.callback = callback sizer = wx.GridBagSizer(2, 2) self.SetSizer(sizer) @@ -124,6 +125,7 @@ class pluginPanel(wx.Panel): for k in panel.paramCtrls.keys(): self.pluginConfig[idx]['params'][k] = panel.paramCtrls[k].GetValue() profile.setPluginConfig(self.pluginConfig) + self.callback() def OnAdd(self, e): if self.listbox.GetSelection() < 0: @@ -135,6 +137,7 @@ class pluginPanel(wx.Panel): return self.pluginConfig.append(newConfig) profile.setPluginConfig(self.pluginConfig) + self.callback() def OnRem(self, e): panel = e.GetEventObject().GetParent() @@ -154,6 +157,7 @@ class pluginPanel(wx.Panel): self.pluginConfig.pop(idx) profile.setPluginConfig(self.pluginConfig) + self.callback() def OnHelp(self, e): panel = e.GetEventObject().GetParent() diff --git a/Cura/gui/sceneView.py b/Cura/gui/sceneView.py index 22961d9e..ff46ccb2 100644 --- a/Cura/gui/sceneView.py +++ b/Cura/gui/sceneView.py @@ -692,6 +692,8 @@ class SceneView(openglGui.glGuiPanel): self._zoom = self._animZoom.getPosition() if self._animZoom.isDone(): self._animZoom = None + if self.viewMode == 'gcode' and self._gcode is not None: + self._viewTarget[2] = self._gcode.layerList[self.layerSelect.getValue()][-1].points[0][2] if self._objectShader is None: self._objectShader = opengl.GLShader(""" varying float light_amount; diff --git a/Cura/util/sliceEngine.py b/Cura/util/sliceEngine.py index 04b03e84..4f96171f 100644 --- a/Cura/util/sliceEngine.py +++ b/Cura/util/sliceEngine.py @@ -178,6 +178,7 @@ class Slicer(object): returnCode = self._process.wait() try: if returnCode == 0: + profile.runPostProcessingPlugins(self._exportFilename) self._callback(1.0, True) else: self._callback(-1.0, False)