Load GCode file after slicing if we still have the same model loaded
This commit is contained in:
parent
7659bfe1a5
commit
c9bd9940c1
2 changed files with 8 additions and 2 deletions
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue