[path] Add feeds to PathDressupHoldingTags output

This commit is contained in:
Sabin Iacob
2017-04-19 19:45:05 +03:00
committed by Yorik van Havre
parent 907aea9273
commit f6db8a6344

View File

@@ -809,9 +809,39 @@ class ObjectDressup:
edge = None
t = 0
#for cmd in commands:
# print(cmd)
return Path.Path(commands)
lastCmd = Path.Command('G0', {'X': 0.0, 'Y': 0.0, 'Z': 0.0});
outCommands = []
horizFeed = obj.ToolController.HorizFeed.Value
vertFeed = obj.ToolController.VertFeed.Value
horizRapid = obj.ToolController.HorizRapid.Value
vertRapid = obj.ToolController.VertRapid.Value
for cmd in commands:
params = cmd.Parameters
zVal = params.get('Z', None)
zVal2 = lastCmd.Parameters.get('Z', None)
zVal = zVal and round(zVal, 8)
zVal2 = zVal2 and round(zVal2, 8)
if cmd.Name in ['G1', 'G2', 'G3', 'G01', 'G02', 'G03']:
if zVal is not None and zVal2 != zVal:
params['F'] = vertFeed
else:
params['F'] = horizFeed
lastCmd = cmd
elif cmd.Name in ['G0', 'G00']:
if zVal is not None and zVal2 != zVal:
params['F'] = vertRapid
else:
params['F'] = horizRapid
lastCmd = cmd
outCommands.append(Path.Command(cmd.Name, params))
return Path.Path(outCommands)
def problems(self):
return filter(lambda m: m.haveProblem, self.mappers)