Merge branch 'maintenance' into devel

This commit is contained in:
Gina Häußge committed 2017-01-11 12:15:07 +01:00
commit 3e03f7c12a
6 files changed
+46 -17

No files matched your search

+5 -4
View File
@@ -266,6 +266,7 @@ class CuraPlugin(octoprint.plugin.SlicerPlugin,
working_dir = os.path.dirname(executable)
slicing_profile = Profile(self._load_profile(profile_path), printer_profile, posX, posY)
engine_settings = self._convert_to_engine(profile_path, printer_profile, posX, posY)
# Start building the argument list for the CuraEngine command execution
@@ -375,11 +376,11 @@ class CuraPlugin(octoprint.plugin.SlicerPlugin,
if not tool_key in analysis["filament"]:
analysis["filament"][tool_key] = dict()
if profile.get_float("filament_diameter") != None:
if profile.get("gcode_flavor") == GcodeFlavors.ULTIGCODE or profile.get("gcode_flavor") == GcodeFlavors.REPRAP_VOLUME:
analysis["filament"][tool_key] = _get_usage_from_volume(filament, profile.get_float("filament_diameter"))
if slicing_profile.get_float("filament_diameter") is not None:
if slicing_profile.get("gcode_flavor") == GcodeFlavors.ULTIGCODE or slicing_profile.get("gcode_flavor") == GcodeFlavors.REPRAP_VOLUME:
analysis["filament"][tool_key] = _get_usage_from_volume(filament, slicing_profile.get_float("filament_diameter"))
else:
analysis["filament"][tool_key] = _get_usage_from_length(filament, profile.get_float("filament_diameter"))
analysis["filament"][tool_key] = _get_usage_from_length(filament, slicing_profile.get_float("filament_diameter"))
except:
pass
+1 -1
View File
@@ -230,7 +230,7 @@ def setTimelapseConfig():
except ValueError:
return make_response("Invalid value for retraction Z-Hop: %r" % data["retractionZHop"])
else:
if retractionZHop > 0:
if retractionZHop >= 0:
config["options"]["retractionZHop"] = retractionZHop
else:
return make_response("Invalid value for retraction Z-Hop: %d" % retractionZHop)
+30 -7
View File
@@ -260,6 +260,7 @@ class gcode(object):
if ';' in line:
comment = line[line.find(';')+1:].strip()
if comment.startswith("filament_diameter"):
# Slic3r
filamentValue = comment.split("=", 1)[1].strip()
try:
self._filamentDiameter = float(filamentValue)
@@ -269,6 +270,7 @@ class gcode(object):
except ValueError:
self._filamentDiameter = 0.0
elif comment.startswith("CURA_PROFILE_STRING") or comment.startswith("CURA_OCTO_PROFILE_STRING"):
# Cura 15.04.* & OctoPrint Cura plugin
if comment.startswith("CURA_PROFILE_STRING"):
prefix = "CURA_PROFILE_STRING:"
else:
@@ -280,6 +282,13 @@ class gcode(object):
self._filamentDiameter = float(curaOptions["filament_diameter"])
except:
self._filamentDiameter = 0.0
elif comment.startswith("filamentDiameter,"):
# Simplify3D
filamentValue = comment.split(",", 1)[1].strip()
try:
self._filamentDiameter = float(filamentValue)
except ValueError:
self._filamentDiameter = 0.0
line = line[0:line.find(';')]
G = getCodeInt(line, 'G')
@@ -294,15 +303,28 @@ class gcode(object):
e = getCodeFloat(line, 'E')
f = getCodeFloat(line, 'F')
if x is not None or y is not None or z is not None:
# this is a move
move = True
else:
# print head stays on position
move = False
oldPos = pos
newPos = Vector3D(x if x is not None else pos.x,
y if y is not None else pos.y,
z if z is not None else pos.z)
# Use new coordinates if provided. If not provided, use prior coordinates in absolute
# and 0.0 in relative mode.
newPos = Vector3D(x if x is not None else (pos.x if posAbs else 0.0),
y if y is not None else (pos.y if posAbs else 0.0),
z if z is not None else (pos.z if posAbs else 0.0))
if posAbs:
# Absolute mode: scale coordinates and apply offsets
pos = newPos * scale + posOffset
else:
# Relative mode: scale and add to current position
pos += newPos * scale
if f is not None and f != 0:
feedrate = f
@@ -310,10 +332,12 @@ class gcode(object):
if absoluteE:
# make sure e is relative
e -= currentE[currentExtruder]
# If move includes extrusion, calculate new min/max coordinates of model
if e > 0.0:
# extrusion -> relevant for print area & dimensions
# If move with extrusion, calculate new min/max coordinates of model
if e > 0.0 and move:
# extrusion and move -> relevant for print area & dimensions
self._minMax.record(pos)
totalExtrusion[currentExtruder] += e
currentE[currentExtruder] += e
maxExtrusion[currentExtruder] = max(maxExtrusion[currentExtruder],
@@ -417,7 +441,6 @@ class gcode(object):
if throttle is not None:
throttle()
if self.progressCallback is not None:
self.progressCallback(100.0)