Safe Haskell | None |
---|---|
Language | Haskell2010 |
GCode evaluator
Evaluates RS274 GCode
Synopsis
- data IPState = IPState {}
- defaultModals :: Map RS274Group Code
- newState :: IPState
- step :: IPState -> GCode -> (Maybe Code, IPState, GCode)
- evalSteps :: [Code] -> [([Maybe Code], IPState, [Code])]
- toMillimeters :: Map RS274Group Code -> Code -> Code
- toAbsolute :: Map RS274Group Code -> Code -> Code
- toAbsoluteArcs :: Map RS274Group Code -> Code -> Code
- codeActive :: Code -> Map RS274Group Code -> Bool
- isMotion :: Code -> Bool
- updateCodeAndModals :: Code -> Map RS274Group Code -> (Code, Map RS274Group Code)
- updateModals :: Map RS274Group Code -> Code -> Map RS274Group Code
- updateFromCurrentModals :: Map RS274Group Code -> Code -> Code
- incomplete :: Code -> Bool
- updateIncompleteFromCurrentModals :: Map RS274Group Code -> Code -> Code
- appendOnlyAxes :: Ord k => Map k b -> Map k b -> Map k b
- updateAxes :: Ord k => Map k a -> Map k a -> Map k a
- updateLimitsCode :: Limits -> Code -> Limits
- updateLimits :: Limits -> Axes -> Limits
- eval :: GCode -> ([Code], IPState)
- evalToCanon :: GCode -> ([Canon], IPState)
- evalToCanonAnn :: GCode -> ([Ann Canon], IPState)
- toCanonAnn :: Code -> IPState -> [Ann Canon]
- evalWith :: (Code -> IPState -> Maybe a) -> GCode -> ([a], IPState)
- evalWith' :: (Code -> IPState -> [a]) -> GCode -> ([a], IPState)
- totalize :: GCode -> GCode
Documentation
Interpreter state
IPState | |
|
defaultModals :: Map RS274Group Code Source #
Default modals
evalSteps :: [Code] -> [([Maybe Code], IPState, [Code])] Source #
Evaluate GCode and return each evaluation step
in absolute mode
with millimeters as units
with total commands in modal groups
toMillimeters :: Map RS274Group Code -> Code -> Code Source #
Convert all axis coordinates from inches to millimeters if needed
toAbsolute :: Map RS274Group Code -> Code -> Code Source #
Convert all motion coordinates from relative to absolute
toAbsoluteArcs :: Map RS274Group Code -> Code -> Code Source #
Convert all arc coordinates from relative to absolute
codeActive :: Code -> Map RS274Group Code -> Bool Source #
Return True if code
is active (present) in modals
updateCodeAndModals :: Code -> Map RS274Group Code -> (Code, Map RS274Group Code) Source #
Update code
according to current modals
then update modals
with a resulting code
Return updated code and modals
updateModals :: Map RS274Group Code -> Code -> Map RS274Group Code Source #
Update modal groups according to Code c
updateFromCurrentModals :: Map RS274Group Code -> Code -> Code Source #
Take current motion group modal code and update this motion code with missing coordinates of the stored one
incomplete :: Code -> Bool Source #
Return True if this code contains only coordinates
updateIncompleteFromCurrentModals :: Map RS274Group Code -> Code -> Code Source #
Update incomplete motion Code with the stored one
appendOnlyAxes :: Ord k => Map k b -> Map k b -> Map k b Source #
Update axes that aren't defined in target
updateAxes :: Ord k => Map k a -> Map k a -> Map k a Source #
Update (replace) target
axes with from
axes
evalToCanonAnn :: GCode -> ([Ann Canon], IPState) Source #
Evaluate GCode to annotated canonnical representation
toCanonAnn :: Code -> IPState -> [Ann Canon] Source #
Same as toCanon but result is wrapped in Ann
according to current interpreter line