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')
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)
-
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)
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)
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:
return
self.pluginConfig.append(newConfig)
profile.setPluginConfig(self.pluginConfig)
+ self.callback()
def OnRem(self, e):
panel = e.GetEventObject().GetParent()
self.pluginConfig.pop(idx)
profile.setPluginConfig(self.pluginConfig)
+ self.callback()
def OnHelp(self, e):
panel = e.GetEventObject().GetParent()
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;
returnCode = self._process.wait()
try:
if returnCode == 0:
+ profile.runPostProcessingPlugins(self._exportFilename)
self._callback(1.0, True)
else:
self._callback(-1.0, False)