Fix Path Keep View and Sim in Sync,typo Linuxcnc_post
This commit is contained in:
committed by
Yorik van Havre
parent
636f361268
commit
b6304d16a7
@@ -186,10 +186,10 @@ class PathSimulation:
|
||||
(pathSolid, self.curpos) = self.GetPathSolid(self.tool, cmd, self.curpos)
|
||||
if cmd.Name in ['G81', 'G82', 'G83']:
|
||||
if self.firstDrill:
|
||||
extendcommand = Path.Command('G1', {"X": 0.0, "Y": 0.0, "Z": cmd.r})
|
||||
extendcommand = Path.Command('G0', {"X": 0.0, "Y": 0.0, "Z": cmd.r})
|
||||
self.curpos = self.RapidMove(extendcommand, self.curpos)
|
||||
self.firstDrill = False
|
||||
extendcommand = Path.Command('G1', {"X": cmd.x, "Y": cmd.y, "Z": cmd.r})
|
||||
extendcommand = Path.Command('G0', {"X": cmd.x, "Y": cmd.y, "Z": cmd.r})
|
||||
self.curpos = self.RapidMove(extendcommand, self.curpos)
|
||||
extendcommand = Path.Command('G1', {"X": cmd.x, "Y": cmd.y, "Z": cmd.z})
|
||||
self.curpos = self.RapidMove(extendcommand, self.curpos)
|
||||
@@ -242,9 +242,9 @@ class PathSimulation:
|
||||
if cmd.Name in ['G81', 'G82', 'G83']:
|
||||
extendcommands = []
|
||||
if self.firstDrill:
|
||||
extendcommands.append(Path.Command('G1', {"X": 0.0, "Y": 0.0, "Z": cmd.r}))
|
||||
extendcommands.append(Path.Command('G0', {"X": 0.0, "Y": 0.0, "Z": cmd.r}))
|
||||
self.firstDrill = False
|
||||
extendcommands.append(Path.Command('G1', {"X": cmd.x, "Y": cmd.y, "Z": cmd.r}))
|
||||
extendcommands.append(Path.Command('G0', {"X": cmd.x, "Y": cmd.y, "Z": cmd.r}))
|
||||
extendcommands.append(Path.Command('G1', {"X": cmd.x, "Y": cmd.y, "Z": cmd.z}))
|
||||
extendcommands.append(Path.Command('G1', {"X": cmd.x, "Y": cmd.y, "Z": cmd.r}))
|
||||
for ecmd in extendcommands:
|
||||
|
||||
@@ -272,7 +272,7 @@ def parse(pathobj):
|
||||
params = ['X', 'Y', 'Z', 'A', 'B', 'C', 'I', 'J', 'F', 'S', 'T', 'Q', 'R', 'L', 'H', 'D', 'P']
|
||||
# keep track for no doubles
|
||||
currLocation = {}
|
||||
firstmove = Path.Command("G0", {"X": -1, "Y": -1, "Z": -1, "F": -1})
|
||||
firstmove = Path.Command("G0", {"X": -1, "Y": -1, "Z": -1, "F": 0.0})
|
||||
currLocation.update(firstmove.Parameters)
|
||||
|
||||
if hasattr(pathobj, "Group"): # We have a compound or project.
|
||||
@@ -306,8 +306,11 @@ def parse(pathobj):
|
||||
if param == 'F' and (currLocation[param] == c.Parameters[param] and OUTPUT_DOUBLES):
|
||||
if c.Name not in ["G0", "G00"]: # linuxcnc doesn't use rapid speeds
|
||||
speed = Units.Quantity(c.Parameters['F'], FreeCAD.Units.Velocity)
|
||||
outstring.append(
|
||||
if speed.getValueAs(UNIT_SPEED_FORMAT) > 0.0:
|
||||
outstring.append(
|
||||
param + format(float(speed.getValueAs(UNIT_SPEED_FORMAT)), precision_string))
|
||||
else:
|
||||
continue
|
||||
elif param == 'T':
|
||||
outstring.append(param + str(int(c.Parameters['T'])))
|
||||
elif param == 'H':
|
||||
|
||||
Reference in New Issue
Block a user