From: daid Date: Tue, 20 Mar 2012 11:22:44 +0000 (+0100) Subject: Load GCode file after slicing if we still have the same model loaded X-Git-Tag: RC1~49 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=c9bd9940c170e8a587160ca49a06a53db3a90dae;p=cura.git Load GCode file after slicing if we still have the same model loaded --- diff --git a/SkeinPyPy/newui/preview3d.py b/SkeinPyPy/newui/preview3d.py index dc663b69..040579a7 100644 --- a/SkeinPyPy/newui/preview3d.py +++ b/SkeinPyPy/newui/preview3d.py @@ -102,8 +102,13 @@ class previewPanel(wx.Panel): self.gcodeFilename = filename[: filename.rfind('.')] + "_export.gcode" self.logFilename = filename[: filename.rfind('.')] + "_export.log" #Do the STL file loading in a background thread so we don't block the UI. - thread = threading.Thread(target=self.doFileLoad) - thread.start() + threading.Thread(target=self.doFileLoad).start() + + def loadReModelFile(self, filename): + #Only load this again if the filename matches the file we have already loaded (for auto loading GCode after slicing) + if self.modelFilename != filename: + return + threading.Thread(target=self.doFileLoad).start() def doFileLoad(self): if os.path.isfile(self.modelFilename) and self.modelFileTime != os.stat(self.modelFilename).st_mtime: diff --git a/SkeinPyPy/newui/sliceProgessPanel.py b/SkeinPyPy/newui/sliceProgessPanel.py index f9d33a94..6b45a12b 100644 --- a/SkeinPyPy/newui/sliceProgessPanel.py +++ b/SkeinPyPy/newui/sliceProgessPanel.py @@ -91,6 +91,7 @@ class sliceProgessPanel(wx.Panel): self.sizer.Layout() self.Layout() self.abort = True + self.mainWindow.preview3d.loadReModelFile(self.filename) def SetProgress(self, stepName, layer, maxLayer): if self.prevStep != stepName: