chiark / gitweb /
Add plugins, fix re-slicing when you edit the start/end gcode.
authordaid303 <daid303@gmail.com>
Thu, 2 May 2013 08:34:39 +0000 (10:34 +0200)
committerdaid303 <daid303@gmail.com>
Thu, 2 May 2013 08:34:39 +0000 (10:34 +0200)
Cura/gui/alterationPanel.py
Cura/gui/mainWindow.py
Cura/gui/pluginPanel.py
Cura/gui/sceneView.py
Cura/util/sliceEngine.py

index f2b8f8ca0f92251a8ed65c09feaf22a281bbcdf5..6989875334b425e7b89e00ce6d0c3e69e504cc87 100644 (file)
@@ -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)
-
index a32ee36524b46d76f36ba2047f438a21ec9b749f..1b3ff64516b87be8101d95d8f59f6115499a6b90 100644 (file)
@@ -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)
index e665f14b2b0a04ca14df264cdafe0f1424cd2101..a07c64767f6f905dd3df5ba0bb9f492c52d5000c 100644 (file)
@@ -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()
index 22961d9e8435ae003845d8e1565bfff4a82ab5bc..ff46ccb2453631c703afc1ade376d0d54194a105 100644 (file)
@@ -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;
index 04b03e845073c563ba0611a6cfd49fc5e9a2d16e..4f96171f1de5414035775fcf7f3faa8d437f5cd0 100644 (file)
@@ -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)