From: daid Date: Fri, 28 Mar 2014 08:31:33 +0000 (+0100) Subject: Add bfb extension when using BFB style GCode. X-Git-Tag: 14.06~47 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=4252b6da8704fcf45563e35177197ec500c83d17;p=cura.git Add bfb extension when using BFB style GCode. --- diff --git a/Cura/cura.py b/Cura/cura.py index ed82e8e4..50e9fd92 100644 --- a/Cura/cura.py +++ b/Cura/cura.py @@ -70,7 +70,7 @@ def main(): engine.wait() if not options.output: - options.output = args[0] + '.gcode' + options.output = args[0] + profile.getGCodeExtension() with open(options.output, "wb") as f: f.write(engine.getResult().getGCode()) print 'GCode file saved : %s' % options.output diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index dceb8e03..6bf47fd1 100644 --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@ -457,7 +457,7 @@ class mainWindow(wx.Frame): def OnLoadProfileFromGcode(self, e): dlg=wx.FileDialog(self, _("Select gcode file to load profile from"), os.path.split(profile.getPreference('lastFile'))[0], style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST) - dlg.SetWildcard("gcode files (*.gcode)|*.gcode;*.g") + dlg.SetWildcard("gcode files (*%s)|*%s;*%s" % (profile.getGCodeExtension(), profile.getGCodeExtension(), profile.getGCodeExtension()[0:2])) if dlg.ShowModal() == wx.ID_OK: gcodeFile = dlg.GetPath() f = open(gcodeFile, 'r') diff --git a/Cura/gui/sceneView.py b/Cura/gui/sceneView.py index 4b87954e..e4a1a586 100644 --- a/Cura/gui/sceneView.py +++ b/Cura/gui/sceneView.py @@ -252,7 +252,7 @@ class SceneView(openglGui.glGuiPanel): dlg.Destroy() else: drive = drives[0] - filename = self._scene._objectList[0].getName() + '.gcode' + filename = self._scene._objectList[0].getName() + profile.getGCodeExtension() threading.Thread(target=self._saveGCode,args=(drive[1] + filename, drive[1])).start() elif connectionGroup is not None: connections = connectionGroup.getAvailableConnections() @@ -303,9 +303,9 @@ class SceneView(openglGui.glGuiPanel): if len(self._scene._objectList) < 1: return dlg=wx.FileDialog(self, _("Save toolpath"), os.path.dirname(profile.getPreference('lastFile')), style=wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) - filename = self._scene._objectList[0].getName() + '.gcode' + filename = self._scene._objectList[0].getName() + profile.getGCodeExtension() dlg.SetFilename(filename) - dlg.SetWildcard('Toolpath (*.gcode)|*.gcode;*.g') + dlg.SetWildcard('Toolpath (*%s)|*%s;*%s' % (profile.getGCodeExtension(), profile.getGCodeExtension(), profile.getGCodeExtension()[0:2])) if dlg.ShowModal() != wx.ID_OK: dlg.Destroy() return diff --git a/Cura/util/profile.py b/Cura/util/profile.py index b43ce677..dfb45bf4 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -1001,6 +1001,11 @@ def minimalExtruderCount(): return 2 return 1 +def getGCodeExtension(): + if getMachineSetting('gcode_flavor') == 'BFB': + return '.bfb' + return '.gcode' + ######################################################### ## Alteration file functions #########################################################