fix feedrate update

Fix machinestate to handle drill moves and tests
move feed and rapid declarations to PathGeom
This commit is contained in:
sliptonic
2021-12-22 18:09:52 -06:00
parent 18582ff9af
commit 95a83c811b
4 changed files with 38 additions and 8 deletions

View File

@@ -29,6 +29,7 @@ __contributors__ = ""
import PathScripts.PathLog as PathLog
import FreeCAD
from dataclasses import dataclass, field
from PathScripts.PathGeom import CmdMoveRapid, CmdMoveAll, CmdMoveDrill
if True:
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
@@ -92,6 +93,13 @@ class MachineState:
self.WCS = command.Name
return not oldstate == self.getState()
if command.Name in CmdMoveDrill:
oldZ = self.Z
for p in command.Parameters:
self.__setattr__(p, command.Parameters[p])
self.__setattr__("Z", oldZ)
return not oldstate == self.getState()
for p in command.Parameters:
self.__setattr__(p, command.Parameters[p])
@@ -116,3 +124,12 @@ class MachineState:
state['T'] = self.T
return state
def getPosition(self):
"""
Returns a vector of the current machine position
"""
# This is technical debt. The actual position may include a rotation
# component as well. We should probably be returning a placement
return FreeCAD.Vector(self.X, self.Y, self.Z)