chiark / gitweb /
Add bfb extension when using BFB style GCode.
authordaid <daid303@gmail.com>
Fri, 28 Mar 2014 08:31:33 +0000 (09:31 +0100)
committerdaid <daid303@gmail.com>
Fri, 28 Mar 2014 08:31:33 +0000 (09:31 +0100)
Cura/cura.py
Cura/gui/mainWindow.py
Cura/gui/sceneView.py
Cura/util/profile.py

index ed82e8e46aab1360d89dc02dc30198f0fbb824f4..50e9fd9201d21bfc7391f3f21f6809b27dcdf8dc 100644 (file)
@@ -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
index dceb8e03fdb0f72b17509e7e05d31a951217a46e..6bf47fd13fc085badf5b9002188c56576590281a 100644 (file)
@@ -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')
index 4b87954e3eac9889e226020b34fc1837e9bc6200..e4a1a586a1acb0bdefd76ee66ad6098cf5c01849 100644 (file)
@@ -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
index b43ce677810bfba5a6c4e9e4298b25dc8123f828..dfb45bf45b94b3b7e47e1123384057af28856779 100644 (file)
@@ -1001,6 +1001,11 @@ def minimalExtruderCount():
                return 2
        return 1
 
+def getGCodeExtension():
+       if getMachineSetting('gcode_flavor') == 'BFB':
+               return '.bfb'
+       return '.gcode'
+
 #########################################################
 ## Alteration file functions
 #########################################################