Cura plugin

More refinement
master
WHPThomas 2013-09-26 05:03:08 +10:00
parent ab258e459b
commit fef289d700
1 changed files with 7 additions and 29 deletions

36
gpx.py
View File

@ -3,31 +3,8 @@
#Help: GPX
#Depend: GCode
#Type: postprocess
#Param: machineType(str:r2) Machine type
#Param: gpxPath(str:/Applications/GPX) GPX path
## gpx.py - cura plugin
##
## install in ~/.cura/plugins
##
## Created by WHPThomas <me(at)henri(dot)net> on 9/25/13.
##
## Copyright (c) 2013 WHPThomas, All rights reserved.
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software Foundation,
## Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#Param: machineType(str:r2) Machine type
import platform
import os
@ -39,14 +16,15 @@ def getGpxAppName():
if os.path.exists(gpxPath + '/gpx.exe'):
return gpxPath + '/gpx.exe'
return gpxPath + 'gpx.exe'
if os.path.isfile(gpxPath + '/' + configFile):
return gpxPath + '/' + configFile
return gpxPath + configFile
if os.path.isfile(gpxPath + '/gpx'):
return gpxPath + '/gpx'
return gpxPath + 'gpx'
x3gFile = profile.getPreference('lastFile')
x3gFile = x3gFile[0:x3gFile.rfind('.')] + '.x3g'
commandList = [getGpxAppName(), '-p', '-r']
commandList += ['-m', machineType]
commandList += ['"' + filename + '"', '"' + x3gFile + '"']
call(commandList)
commandList += [filename, x3gFile]
call(commandList)