chiark / gitweb /
Fix plugin support, fix the pauzeAtZ plugin.
authordaid303 <daid303@gmail.com>
Mon, 10 Jun 2013 07:43:27 +0000 (09:43 +0200)
committerdaid303 <daid303@gmail.com>
Mon, 10 Jun 2013 07:43:27 +0000 (09:43 +0200)
Cura/gui/mainWindow.py
Cura/gui/pluginPanel.py
Cura/plugins/pauseAtZ.py
Cura/util/profile.py
Cura/util/sliceEngine.py
Cura/util/validators.py

index a2829b2a7d1f72c4a0a1257f51879b09f7f551f0..47f94967d5cbcbbfb6156f6c425d3b024ddb269c 100644 (file)
@@ -261,8 +261,9 @@ class mainWindow(wx.Frame):
                prefDialog.Show()
 
        def OnDropFiles(self, files):
-               profile.setPluginConfig([])
-               self.updateProfileToControls()
+               if len(files) > 0:
+                       profile.setPluginConfig([])
+                       self.updateProfileToControls()
                self.scene.loadScene(files)
 
        def OnModelMRU(self, e):
index 83a50d68ed2a8f8a28e8dd347d7c34b6dc8419d4..abf89c7149c83147c60f534d4a33c4b755b79561 100644 (file)
@@ -59,6 +59,7 @@ class pluginPanel(wx.Panel):
        
        def updateProfileToControls(self):
                self.pluginConfig = profile.getPluginConfig()
+               print 'pluginPanel::updateProfileToControls', self.pluginConfig
                for p in self.panelList:
                        p.Show(False)
                        self.pluginEnabledPanel.GetSizer().Detach(p)
@@ -121,6 +122,7 @@ class pluginPanel(wx.Panel):
                return True
        
        def OnSettingChange(self, e):
+               print 'pluginPanel::OnSettingChange'
                for panel in self.panelList:
                        idx = self.panelList.index(panel)
                        for k in panel.paramCtrls.keys():
index ec13b130af2e137fe53748c01c7766fb365fc4ff..119bfcb57d86c98008a8a876a41c7d512c897ae0 100644 (file)
@@ -25,10 +25,11 @@ def getValue(line, key, default = None):
 with open(filename, "r") as f:
        lines = f.readlines()
 
-z = 0
-x = 0
-y = 0
+z = 0.
+x = 0.
+y = 0.
 pauseState = 0
+currentSectionType = 'CUSTOM'
 with open(filename, "w") as f:
        for line in lines:
                if line.startswith(';'):
@@ -36,7 +37,7 @@ with open(filename, "w") as f:
                                currentSectionType = line[6:].strip()
                        f.write(line)
                        continue
-               if getValue(line, 'G', None) == 1:
+               if getValue(line, 'G', None) == 1 or getValue(line, 'G', None) == 0:
                        newZ = getValue(line, 'Z', z)
                        x = getValue(line, 'X', x)
                        y = getValue(line, 'Y', y)
index 831f7d53a148617592840c3c879619181ca1274c..0fa2554170801adce09d83965543e590ee0a741e 100644 (file)
@@ -781,12 +781,15 @@ def getAlterationFileContents(filename, extruderCount = 1):
 
 def getPluginConfig():
        try:
-               return pickle.loads(getProfileSetting('plugin_config'))
+               return pickle.loads(str(getProfileSetting('plugin_config')))
        except:
                return []
 
 def setPluginConfig(config):
        putProfileSetting('plugin_config', pickle.dumps(config))
+       print 'setPluginConfig:', config
+       locationInfo = traceback.extract_tb(sys.exc_info()[2])[-1]
+       print "%s: '%s' @ %s:%s:%d" % (str(sys.exc_info()[0].__name__), str(sys.exc_info()[1]), os.path.basename(locationInfo[0]), locationInfo[2], locationInfo[1])
 
 def getPluginBasePaths():
        ret = []
@@ -835,7 +838,7 @@ def getPluginList():
 def runPostProcessingPlugins(gcodefilename):
        pluginConfigList = getPluginConfig()
        pluginList = getPluginList()
-       
+
        for pluginConfig in pluginConfigList:
                plugin = None
                for pluginTest in pluginList:
index d7d6255f811352d0d822ea0cf550b493f3b3f1fd..87a986e88f3feef60a90f566d4e985af078fb720 100644 (file)
@@ -188,7 +188,7 @@ class Slicer(object):
                returnCode = self._process.wait()
                try:
                        if returnCode == 0:
-                               profile.runPostProcessingPlugins(self._exportFilename)
+                               print profile.runPostProcessingPlugins(self._exportFilename)
                                self._callback(1.0, True)
                        else:
                                for line in self._sliceLog:
index 901450106615cef98f02b7a54b36c4dc0e9384f6..4a072905f9aad2424bccae122e4a32391155ae9e 100644 (file)
@@ -82,6 +82,8 @@ class wallThicknessValidator(object):
                                return WARNING, 'Trying to print walls thinner then the 0.8 * nozzle size. Small chance that this will produce usable results'
                        if wallThickness < nozzleSize:
                                return SUCCESS, ''
+                       if nozzleSize <= 0:
+                               return ERROR, 'Incorrect nozzle size'
                        
                        lineCount = int(wallThickness / nozzleSize)
                        lineWidth = wallThickness / lineCount