If gcode tags have integer values then export them as integer, else export them as float

master
Daid 2012-05-09 20:16:32 +02:00
parent a9143d4c2c
commit 9fe9117226
1 changed files with 10 additions and 6 deletions

View File

@ -359,12 +359,16 @@ def calculateSolidLayerCount():
def replaceTagMatch(m):
tag = m.group(0)[1:-1]
if tag in ['print_speed', 'retraction_speed', 'travel_speed', 'max_z_speed', 'bottom_layer_speed', 'cool_min_feedrate']:
return str(getProfileSettingFloat(tag) * 60)
if isProfileSetting(tag):
return str(getProfileSettingFloat(tag))
if isPreference(tag):
return str(getProfileSettingFloat(tag))
return tag
f = getProfileSettingFloat(tag) * 60
elif isProfileSetting(tag):
f = getProfileSettingFloat(tag)
elif isPreference(tag):
f = getProfileSettingFloat(tag)
else:
return tag
if (f % 1) == 0:
return str(int(f))
return str(f)
### Get aleration raw contents. (Used internally in Cura)
def getAlterationFile(filename):