-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | GCode processor
--
-- GCode parser, pretty-printer and processing utils
@package gcodehs
@version 0.1.2.0
module Data.GCode.Ann
data Ann a
SrcLine :: Integer -> a -> Ann a
stripAnnotation :: Ann a -> a
instance GHC.Base.Functor Data.GCode.Ann.Ann
instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.GCode.Ann.Ann a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.GCode.Ann.Ann a)
instance GHC.Show.Show a => GHC.Show.Show (Data.GCode.Ann.Ann a)
module Data.GCode.TH
genShortcuts :: Name -> Q [Dec]
genWriterEndos :: Name -> Q [Dec]
-- | GCode types
--
-- This module exports types for constructing Code values
module Data.GCode.Types
-- | Code class
data Class
-- | G-code
G :: Class
-- | M-code
M :: Class
-- | T-code (select tool)
T :: Class
-- | Stand-alone P-code
PStandalone :: Class
-- | Stand-alone F-code
FStandalone :: Class
-- | Stand-alone S-code
SStandalone :: Class
-- | Axis letter
data AxisDesignator
-- | X-axis
X :: AxisDesignator
-- | Y-axis
Y :: AxisDesignator
-- | Z-axis
Z :: AxisDesignator
-- | A-axis
A :: AxisDesignator
-- | B-axis
B :: AxisDesignator
-- | C-axis
C :: AxisDesignator
-- | U-axis
U :: AxisDesignator
-- | V-axis
V :: AxisDesignator
-- | W-axis
W :: AxisDesignator
-- | Extruder axis
E :: AxisDesignator
L :: AxisDesignator
-- | Param letter
data ParamDesignator
-- | S parameter - usually spindle RPM
S :: ParamDesignator
-- | P parameter
P :: ParamDesignator
-- | F parameter - usually feedrate
F :: ParamDesignator
-- | H paramater - used by tool length offset
H :: ParamDesignator
-- | R parameter
R :: ParamDesignator
-- | X offset for arcs
I :: ParamDesignator
-- | Y offset for arcs
J :: ParamDesignator
-- | Z offset for arcs
K :: ParamDesignator
allClasses :: [Class]
allAxisDesignators :: [AxisDesignator]
-- | Return Axes with each known at zero position
zeroAxes :: Axes
allParamDesignators :: [ParamDesignator]
asChars :: Show a => [a] -> [Char]
-- | Map of AxisDesignator to Double
type Axes = Map AxisDesignator Double
-- | Map of ParamDesignator to Double
type Params = Map ParamDesignator Double
-- | Map of AxisDesignator to pair of Doubles indicating
-- lower and upper limits of travel
type Limits = Map AxisDesignator (Double, Double)
-- | Map of ParamDesignator to pair of Doubles indicating
-- lower and upper limits of this parameter
type ParamLimits = Map ParamDesignator (Double, Double)
data Code
Code :: Maybe Class -> Maybe Int -> Maybe Int -> Axes -> Params -> ByteString -> Code
-- | Code Class (M in M5)
[codeCls] :: Code -> Maybe Class
-- | Code value (81 in G81)
[codeNum] :: Code -> Maybe Int
-- | Code subcode (1 in G92.1)
[codeSub] :: Code -> Maybe Int
-- | Code Axes
[codeAxes] :: Code -> Axes
-- | Code Params
[codeParams] :: Code -> Params
-- | Comment following this Code
[codeComment] :: Code -> ByteString
-- | Standalone comment
Comment :: ByteString -> Code
-- | Empty lines
Empty :: Code
-- | Parser unhandled lines
Other :: ByteString -> Code
-- | List of Codes
type GCode = [Code]
-- | Convert Char representation of a code to its Class
toCodeClass :: Char -> Maybe Class
-- | Convert Char representation of an axis to its
-- AxisDesignator
toAxis :: Char -> Maybe AxisDesignator
-- | Convert Char representation of a param to its
-- ParamDesignator
toParam :: Char -> Maybe ParamDesignator
(&) :: a -> (a -> c) -> c
cls :: Class -> Code -> Code
axis :: AxisDesignator -> Double -> Code -> Code
param :: ParamDesignator -> Double -> Code -> Code
num :: Int -> Code -> Code
sub :: Int -> Code -> Code
axes :: Axes -> Code -> Code
params :: Params -> Code -> Code
comment :: ByteString -> Code -> Code
emptyCode :: Code
defaultPrec :: Int
data Style
Style :: Int -> Bool -> Style
[stylePrecision] :: Style -> Int
[styleColorful] :: Style -> Bool
defaultStyle :: Style
instance GHC.Show.Show Data.GCode.Types.Style
instance GHC.Classes.Ord Data.GCode.Types.Code
instance GHC.Classes.Eq Data.GCode.Types.Code
instance GHC.Show.Show Data.GCode.Types.Code
instance GHC.Classes.Ord Data.GCode.Types.ParamDesignator
instance GHC.Classes.Eq Data.GCode.Types.ParamDesignator
instance GHC.Enum.Enum Data.GCode.Types.ParamDesignator
instance GHC.Show.Show Data.GCode.Types.ParamDesignator
instance GHC.Classes.Ord Data.GCode.Types.AxisDesignator
instance GHC.Classes.Eq Data.GCode.Types.AxisDesignator
instance GHC.Enum.Enum Data.GCode.Types.AxisDesignator
instance GHC.Show.Show Data.GCode.Types.AxisDesignator
instance GHC.Classes.Ord Data.GCode.Types.Class
instance GHC.Classes.Eq Data.GCode.Types.Class
instance GHC.Enum.Enum Data.GCode.Types.Class
instance GHC.Show.Show Data.GCode.Types.Class
module Data.GCode.RS274.Types
data GCodeDef
GCodeDef :: Maybe Class -> Maybe Int -> Maybe Int -> RS274Group -> RS274Name -> String -> GCodeDef
[defCls] :: GCodeDef -> Maybe Class
[defNum] :: GCodeDef -> Maybe Int
[defSub] :: GCodeDef -> Maybe Int
[defGroup] :: GCodeDef -> RS274Group
[defName] :: GCodeDef -> RS274Name
[defHelp] :: GCodeDef -> String
defGCD :: GCodeDef
defG :: GCodeDef
defM :: GCodeDef
g :: Int -> RS274Name -> GCodeDef
m :: Int -> RS274Name -> GCodeDef
gsub :: Int -> Int -> RS274Name -> GCodeDef
msub :: Int -> Int -> RS274Name -> GCodeDef
-- | Add help text to GCodeDef
help :: String -> GCodeDef -> GCodeDef
-- | Turn GCodeDef into Code
toCode :: GCodeDef -> Code
makeGroup :: RS274Group -> [GCodeDef] -> [GCodeDef]
data RS274Name
Unnamed :: RS274Name
Rapid :: RS274Name
Move :: RS274Name
ArcCW :: RS274Name
ArcCCW :: RS274Name
Dwell :: RS274Name
CubicSpline :: RS274Name
QuadSpline :: RS274Name
NURBS :: RS274Name
XYPlane :: RS274Name
ZXPlane :: RS274Name
YZPlane :: RS274Name
UVPlane :: RS274Name
WUPlane :: RS274Name
VWPlane :: RS274Name
Inches :: RS274Name
Millimeters :: RS274Name
SpindleSync :: RS274Name
RigidTap :: RS274Name
Probe :: RS274Name
DrillingCycleCB :: RS274Name
ThreadingCycle :: RS274Name
DrillingCycleCancel :: RS274Name
DrillingCycle :: RS274Name
DrillingCycleDwell :: RS274Name
DrillingCyclePeck :: RS274Name
BoringCycle :: RS274Name
BoringCycleDwell :: RS274Name
Absolute :: RS274Name
Relative :: RS274Name
ArcAbsolute :: RS274Name
ArcRelative :: RS274Name
LatheDiameter :: RS274Name
LatheRadius :: RS274Name
InverseTime :: RS274Name
UnitsPerMinute :: RS274Name
UnitsPerRevolution :: RS274Name
SpindleOrient :: RS274Name
SpindleStop :: RS274Name
SpindleCW :: RS274Name
SpindleCCW :: RS274Name
SpindleModeConstantSurfaceSpeed :: RS274Name
SpindleModeRPM :: RS274Name
CoolantMist :: RS274Name
CoolantFlood :: RS274Name
CoolantStop :: RS274Name
ToolLength :: RS274Name
ToolLengthDynamic :: RS274Name
ToolLengthAdd :: RS274Name
ToolLengthCancel :: RS274Name
Pause :: RS274Name
OptionalPause :: RS274Name
ProgramEnd :: RS274Name
PalletChange :: RS274Name
PalletChangePause :: RS274Name
CutterCompensationOff :: RS274Name
CutterCompensationLeft :: RS274Name
CutterCompensationDynamicLeft :: RS274Name
CutterCompensationRight :: RS274Name
CutterCompensationDynamicRight :: RS274Name
ToolChange :: RS274Name
SetCurrentTool :: RS274Name
SetToolTable :: RS274Name
StoredPositionMove :: RS274Name
StoredPositionSet :: RS274Name
ToolChangePositionMove :: RS274Name
ToolChangePositionSet :: RS274Name
MoveInMachineCoordinates :: RS274Name
CoordinateSystemOffset :: RS274Name
ResetOffsetsParams :: RS274Name
ResetOffsets :: RS274Name
RestoreOffsets :: RS274Name
OverridesEnable :: RS274Name
OverridesDisable :: RS274Name
FeedRateOverride :: RS274Name
SpindleSpeedOverride :: RS274Name
AdaptiveFeedControl :: RS274Name
FeedStopControl :: RS274Name
ExtruderAbsolute :: RS274Name
ExtruderRelative :: RS274Name
SetExtruderTemperature :: RS274Name
GetExtruderTemperature :: RS274Name
SetExtruderTemperatureAndWait :: RS274Name
SetBedTemperature :: RS274Name
SetBedTemperatureAndWait :: RS274Name
SetChamberTemperature :: RS274Name
SetChamberTemperatureAndWait :: RS274Name
CancelWaitTemperature :: RS274Name
FanOn :: RS274Name
FanOff :: RS274Name
GetCurrentPosition :: RS274Name
DisplayMessage :: RS274Name
DisableActuators :: RS274Name
AutoBedLevel :: RS274Name
data RS274Group
Motion :: RS274Group
Cycles :: RS274Group
Distance :: RS274Group
ArcDistance :: RS274Group
FeedRateMode :: RS274Group
SpindleControl :: RS274Group
CoolantControl :: RS274Group
Stopping :: RS274Group
Units :: RS274Group
Plane :: RS274Group
ToolLengthOffset :: RS274Group
CutterRadius :: RS274Group
LatheDiameterMode :: RS274Group
OtherModal :: RS274Group
NonModal :: RS274Group
Unknown :: RS274Group
Extruder :: RS274Group
Heating :: RS274Group
Cooling :: RS274Group
PrinterMisc :: RS274Group
groupMotion :: [GCodeDef]
groupPlane :: [GCodeDef]
groupUnits :: [GCodeDef]
groupCutterRadius :: [GCodeDef]
groupToolLengthOffset :: [GCodeDef]
groupCycles :: [GCodeDef]
groupDistance :: [GCodeDef]
groupArcDistance :: [GCodeDef]
groupLatheDiameterMode :: [GCodeDef]
groupFeedRateMode :: [GCodeDef]
groupSpindleControl :: [GCodeDef]
groupStopping :: [GCodeDef]
groupCoolantControl :: [GCodeDef]
groupNonModal :: [GCodeDef]
groupOtherModal :: [GCodeDef]
groupExtruder :: [GCodeDef]
groupHeating :: [GCodeDef]
groupCooling :: [GCodeDef]
groupPrinterMisc :: [GCodeDef]
cncGroups :: [(RS274Group, [GCodeDef])]
printerGroups :: [(RS274Group, [GCodeDef])]
allGroups :: [(RS274Group, [GCodeDef])]
groupNames :: [RS274Group]
-- | All GCodeDefs known to us
allCodes :: [GCodeDef]
instance GHC.Classes.Ord Data.GCode.RS274.Types.GCodeDef
instance GHC.Classes.Eq Data.GCode.RS274.Types.GCodeDef
instance GHC.Show.Show Data.GCode.RS274.Types.GCodeDef
instance GHC.Show.Show Data.GCode.RS274.Types.RS274Group
instance GHC.Classes.Ord Data.GCode.RS274.Types.RS274Group
instance GHC.Classes.Eq Data.GCode.RS274.Types.RS274Group
instance GHC.Show.Show Data.GCode.RS274.Types.RS274Name
instance GHC.Classes.Ord Data.GCode.RS274.Types.RS274Name
instance GHC.Classes.Eq Data.GCode.RS274.Types.RS274Name
module Data.GCode.RS274
autoBedLevel :: Code
disableActuators :: Code
displayMessage :: Code
getCurrentPosition :: Code
fanOff :: Code
fanOn :: Code
cancelWaitTemperature :: Code
setChamberTemperatureAndWait :: Code
setChamberTemperature :: Code
setBedTemperatureAndWait :: Code
setBedTemperature :: Code
setExtruderTemperatureAndWait :: Code
getExtruderTemperature :: Code
setExtruderTemperature :: Code
extruderRelative :: Code
extruderAbsolute :: Code
feedStopControl :: Code
adaptiveFeedControl :: Code
spindleSpeedOverride :: Code
feedRateOverride :: Code
overridesDisable :: Code
overridesEnable :: Code
restoreOffsets :: Code
resetOffsets :: Code
resetOffsetsParams :: Code
coordinateSystemOffset :: Code
moveInMachineCoordinates :: Code
toolChangePositionSet :: Code
toolChangePositionMove :: Code
storedPositionSet :: Code
storedPositionMove :: Code
setToolTable :: Code
setCurrentTool :: Code
toolChange :: Code
cutterCompensationDynamicRight :: Code
cutterCompensationRight :: Code
cutterCompensationDynamicLeft :: Code
cutterCompensationLeft :: Code
cutterCompensationOff :: Code
palletChangePause :: Code
palletChange :: Code
programEnd :: Code
optionalPause :: Code
pause :: Code
toolLengthCancel :: Code
toolLengthAdd :: Code
toolLengthDynamic :: Code
toolLength :: Code
coolantStop :: Code
coolantFlood :: Code
coolantMist :: Code
spindleModeRPM :: Code
spindleModeConstantSurfaceSpeed :: Code
spindleCCW :: Code
spindleCW :: Code
spindleStop :: Code
spindleOrient :: Code
unitsPerRevolution :: Code
unitsPerMinute :: Code
inverseTime :: Code
latheRadius :: Code
latheDiameter :: Code
arcRelative :: Code
arcAbsolute :: Code
relative :: Code
absolute :: Code
boringCycleDwell :: Code
boringCycle :: Code
drillingCyclePeck :: Code
drillingCycleDwell :: Code
drillingCycle :: Code
drillingCycleCancel :: Code
threadingCycle :: Code
drillingCycleCB :: Code
probe :: Code
rigidTap :: Code
spindleSync :: Code
millimeters :: Code
inches :: Code
vWPlane :: Code
wUPlane :: Code
uVPlane :: Code
yZPlane :: Code
zXPlane :: Code
xYPlane :: Code
nURBS :: Code
quadSpline :: Code
cubicSpline :: Code
dwell :: Code
arcCCW :: Code
arcCW :: Code
move :: Code
rapid :: Code
unnamed :: Code
isAutoBedLevel :: Code -> Bool
isDisableActuators :: Code -> Bool
isDisplayMessage :: Code -> Bool
isGetCurrentPosition :: Code -> Bool
isFanOff :: Code -> Bool
isFanOn :: Code -> Bool
isCancelWaitTemperature :: Code -> Bool
isSetChamberTemperatureAndWait :: Code -> Bool
isSetChamberTemperature :: Code -> Bool
isSetBedTemperatureAndWait :: Code -> Bool
isSetBedTemperature :: Code -> Bool
isSetExtruderTemperatureAndWait :: Code -> Bool
isGetExtruderTemperature :: Code -> Bool
isSetExtruderTemperature :: Code -> Bool
isExtruderRelative :: Code -> Bool
isExtruderAbsolute :: Code -> Bool
isFeedStopControl :: Code -> Bool
isAdaptiveFeedControl :: Code -> Bool
isSpindleSpeedOverride :: Code -> Bool
isFeedRateOverride :: Code -> Bool
isOverridesDisable :: Code -> Bool
isOverridesEnable :: Code -> Bool
isRestoreOffsets :: Code -> Bool
isResetOffsets :: Code -> Bool
isResetOffsetsParams :: Code -> Bool
isCoordinateSystemOffset :: Code -> Bool
isMoveInMachineCoordinates :: Code -> Bool
isToolChangePositionSet :: Code -> Bool
isToolChangePositionMove :: Code -> Bool
isStoredPositionSet :: Code -> Bool
isStoredPositionMove :: Code -> Bool
isSetToolTable :: Code -> Bool
isSetCurrentTool :: Code -> Bool
isToolChange :: Code -> Bool
isCutterCompensationDynamicRight :: Code -> Bool
isCutterCompensationRight :: Code -> Bool
isCutterCompensationDynamicLeft :: Code -> Bool
isCutterCompensationLeft :: Code -> Bool
isCutterCompensationOff :: Code -> Bool
isPalletChangePause :: Code -> Bool
isPalletChange :: Code -> Bool
isProgramEnd :: Code -> Bool
isOptionalPause :: Code -> Bool
isPause :: Code -> Bool
isToolLengthCancel :: Code -> Bool
isToolLengthAdd :: Code -> Bool
isToolLengthDynamic :: Code -> Bool
isToolLength :: Code -> Bool
isCoolantStop :: Code -> Bool
isCoolantFlood :: Code -> Bool
isCoolantMist :: Code -> Bool
isSpindleModeRPM :: Code -> Bool
isSpindleModeConstantSurfaceSpeed :: Code -> Bool
isSpindleCCW :: Code -> Bool
isSpindleCW :: Code -> Bool
isSpindleStop :: Code -> Bool
isSpindleOrient :: Code -> Bool
isUnitsPerRevolution :: Code -> Bool
isUnitsPerMinute :: Code -> Bool
isInverseTime :: Code -> Bool
isLatheRadius :: Code -> Bool
isLatheDiameter :: Code -> Bool
isArcRelative :: Code -> Bool
isArcAbsolute :: Code -> Bool
isRelative :: Code -> Bool
isAbsolute :: Code -> Bool
isBoringCycleDwell :: Code -> Bool
isBoringCycle :: Code -> Bool
isDrillingCyclePeck :: Code -> Bool
isDrillingCycleDwell :: Code -> Bool
isDrillingCycle :: Code -> Bool
isDrillingCycleCancel :: Code -> Bool
isThreadingCycle :: Code -> Bool
isDrillingCycleCB :: Code -> Bool
isProbe :: Code -> Bool
isRigidTap :: Code -> Bool
isSpindleSync :: Code -> Bool
isMillimeters :: Code -> Bool
isInches :: Code -> Bool
isVWPlane :: Code -> Bool
isWUPlane :: Code -> Bool
isUVPlane :: Code -> Bool
isYZPlane :: Code -> Bool
isZXPlane :: Code -> Bool
isXYPlane :: Code -> Bool
isNURBS :: Code -> Bool
isQuadSpline :: Code -> Bool
isCubicSpline :: Code -> Bool
isDwell :: Code -> Bool
isArcCCW :: Code -> Bool
isArcCW :: Code -> Bool
isMove :: Code -> Bool
isRapid :: Code -> Bool
isUnnamed :: Code -> Bool
namesToCodes :: Map RS274Name Code
codesToNames :: Map Code RS274Name
codesToGroups :: Map Code RS274Group
codesToDefs :: Map Code GCodeDef
codeIsRS274 :: Code -> RS274Name -> Bool
codeInGroup :: Code -> RS274Group -> Bool
explain :: Code -> [Char]
codeFromName :: RS274Name -> Code
eqClassNumSub :: Code -> Code -> Bool
decimate :: Code -> Code
copyClassNumSub :: Code -> Code -> Code
copyClass :: Code -> Code -> Code
-- | GCode pretty-printing functions
--
-- Please do note that these are extremely slow as they do conversion
-- from ByteStrings to Text and vice-verse. Float formatting is probably
-- not the fastest as well. Colorfull versions are especially slow.
module Data.GCode.Pretty
-- | Pretty-print GCode using colors
ppGCode :: GCode -> String
-- | Pretty-print single Code using colors
ppGCodeLine :: Code -> String
-- | Pretty-print GCode without colors
ppGCodeCompact :: GCode -> String
-- | Pretty-print single Code without colors
ppGCodeLineCompact :: Code -> String
-- | Pretty-print GCode with specified Style
ppGCodeStyle :: Style -> GCode -> String
-- | Pretty-print single Code with specified Style
ppGCodeLineStyle :: Style -> Code -> String
ppAxes :: Style -> [(AxisDesignator, Double)] -> Doc
ppAxesMap :: Style -> Map AxisDesignator Double -> Doc
-- | GCode parsing functions
module Data.GCode.Parse
-- | Parse lines of G-code into GCode
parseGCode :: Parser GCode
-- | Parse single line of G-code into Code
parseGCodeLine :: Parser Code
-- | Parse lines of G-code returning either parsing error or GCode
parseOnlyGCode :: ByteString -> Either String GCode
module Data.GCode.Monad
autoBedLevel :: (Code -> Code) -> ProgramWriter ()
disableActuators :: (Code -> Code) -> ProgramWriter ()
displayMessage :: (Code -> Code) -> ProgramWriter ()
getCurrentPosition :: (Code -> Code) -> ProgramWriter ()
fanOff :: (Code -> Code) -> ProgramWriter ()
fanOn :: (Code -> Code) -> ProgramWriter ()
cancelWaitTemperature :: (Code -> Code) -> ProgramWriter ()
setChamberTemperatureAndWait :: (Code -> Code) -> ProgramWriter ()
setChamberTemperature :: (Code -> Code) -> ProgramWriter ()
setBedTemperatureAndWait :: (Code -> Code) -> ProgramWriter ()
setBedTemperature :: (Code -> Code) -> ProgramWriter ()
setExtruderTemperatureAndWait :: (Code -> Code) -> ProgramWriter ()
getExtruderTemperature :: (Code -> Code) -> ProgramWriter ()
setExtruderTemperature :: (Code -> Code) -> ProgramWriter ()
extruderRelative :: (Code -> Code) -> ProgramWriter ()
extruderAbsolute :: (Code -> Code) -> ProgramWriter ()
feedStopControl :: (Code -> Code) -> ProgramWriter ()
adaptiveFeedControl :: (Code -> Code) -> ProgramWriter ()
spindleSpeedOverride :: (Code -> Code) -> ProgramWriter ()
feedRateOverride :: (Code -> Code) -> ProgramWriter ()
overridesDisable :: (Code -> Code) -> ProgramWriter ()
overridesEnable :: (Code -> Code) -> ProgramWriter ()
restoreOffsets :: (Code -> Code) -> ProgramWriter ()
resetOffsets :: (Code -> Code) -> ProgramWriter ()
resetOffsetsParams :: (Code -> Code) -> ProgramWriter ()
coordinateSystemOffset :: (Code -> Code) -> ProgramWriter ()
moveInMachineCoordinates :: (Code -> Code) -> ProgramWriter ()
toolChangePositionSet :: (Code -> Code) -> ProgramWriter ()
toolChangePositionMove :: (Code -> Code) -> ProgramWriter ()
storedPositionSet :: (Code -> Code) -> ProgramWriter ()
storedPositionMove :: (Code -> Code) -> ProgramWriter ()
setToolTable :: (Code -> Code) -> ProgramWriter ()
setCurrentTool :: (Code -> Code) -> ProgramWriter ()
toolChange :: (Code -> Code) -> ProgramWriter ()
cutterCompensationDynamicRight :: (Code -> Code) -> ProgramWriter ()
cutterCompensationRight :: (Code -> Code) -> ProgramWriter ()
cutterCompensationDynamicLeft :: (Code -> Code) -> ProgramWriter ()
cutterCompensationLeft :: (Code -> Code) -> ProgramWriter ()
cutterCompensationOff :: (Code -> Code) -> ProgramWriter ()
palletChangePause :: (Code -> Code) -> ProgramWriter ()
palletChange :: (Code -> Code) -> ProgramWriter ()
programEnd :: (Code -> Code) -> ProgramWriter ()
optionalPause :: (Code -> Code) -> ProgramWriter ()
pause :: (Code -> Code) -> ProgramWriter ()
toolLengthCancel :: (Code -> Code) -> ProgramWriter ()
toolLengthAdd :: (Code -> Code) -> ProgramWriter ()
toolLengthDynamic :: (Code -> Code) -> ProgramWriter ()
toolLength :: (Code -> Code) -> ProgramWriter ()
coolantStop :: (Code -> Code) -> ProgramWriter ()
coolantFlood :: (Code -> Code) -> ProgramWriter ()
coolantMist :: (Code -> Code) -> ProgramWriter ()
spindleModeRPM :: (Code -> Code) -> ProgramWriter ()
spindleModeConstantSurfaceSpeed :: (Code -> Code) -> ProgramWriter ()
spindleCCW :: (Code -> Code) -> ProgramWriter ()
spindleCW :: (Code -> Code) -> ProgramWriter ()
spindleStop :: (Code -> Code) -> ProgramWriter ()
spindleOrient :: (Code -> Code) -> ProgramWriter ()
unitsPerRevolution :: (Code -> Code) -> ProgramWriter ()
unitsPerMinute :: (Code -> Code) -> ProgramWriter ()
inverseTime :: (Code -> Code) -> ProgramWriter ()
latheRadius :: (Code -> Code) -> ProgramWriter ()
latheDiameter :: (Code -> Code) -> ProgramWriter ()
arcRelative :: (Code -> Code) -> ProgramWriter ()
arcAbsolute :: (Code -> Code) -> ProgramWriter ()
relative :: (Code -> Code) -> ProgramWriter ()
absolute :: (Code -> Code) -> ProgramWriter ()
boringCycleDwell :: (Code -> Code) -> ProgramWriter ()
boringCycle :: (Code -> Code) -> ProgramWriter ()
drillingCyclePeck :: (Code -> Code) -> ProgramWriter ()
drillingCycleDwell :: (Code -> Code) -> ProgramWriter ()
drillingCycle :: (Code -> Code) -> ProgramWriter ()
drillingCycleCancel :: (Code -> Code) -> ProgramWriter ()
threadingCycle :: (Code -> Code) -> ProgramWriter ()
drillingCycleCB :: (Code -> Code) -> ProgramWriter ()
probe :: (Code -> Code) -> ProgramWriter ()
rigidTap :: (Code -> Code) -> ProgramWriter ()
spindleSync :: (Code -> Code) -> ProgramWriter ()
millimeters :: (Code -> Code) -> ProgramWriter ()
inches :: (Code -> Code) -> ProgramWriter ()
vWPlane :: (Code -> Code) -> ProgramWriter ()
wUPlane :: (Code -> Code) -> ProgramWriter ()
uVPlane :: (Code -> Code) -> ProgramWriter ()
yZPlane :: (Code -> Code) -> ProgramWriter ()
zXPlane :: (Code -> Code) -> ProgramWriter ()
xYPlane :: (Code -> Code) -> ProgramWriter ()
nURBS :: (Code -> Code) -> ProgramWriter ()
quadSpline :: (Code -> Code) -> ProgramWriter ()
cubicSpline :: (Code -> Code) -> ProgramWriter ()
dwell :: (Code -> Code) -> ProgramWriter ()
arcCCW :: (Code -> Code) -> ProgramWriter ()
arcCW :: (Code -> Code) -> ProgramWriter ()
move :: (Code -> Code) -> ProgramWriter ()
rapid :: (Code -> Code) -> ProgramWriter ()
unnamed :: (Code -> Code) -> ProgramWriter ()
autoBedLevel' :: ProgramWriter ()
disableActuators' :: ProgramWriter ()
displayMessage' :: ProgramWriter ()
getCurrentPosition' :: ProgramWriter ()
fanOff' :: ProgramWriter ()
fanOn' :: ProgramWriter ()
cancelWaitTemperature' :: ProgramWriter ()
setChamberTemperatureAndWait' :: ProgramWriter ()
setChamberTemperature' :: ProgramWriter ()
setBedTemperatureAndWait' :: ProgramWriter ()
setBedTemperature' :: ProgramWriter ()
setExtruderTemperatureAndWait' :: ProgramWriter ()
getExtruderTemperature' :: ProgramWriter ()
setExtruderTemperature' :: ProgramWriter ()
extruderRelative' :: ProgramWriter ()
extruderAbsolute' :: ProgramWriter ()
feedStopControl' :: ProgramWriter ()
adaptiveFeedControl' :: ProgramWriter ()
spindleSpeedOverride' :: ProgramWriter ()
feedRateOverride' :: ProgramWriter ()
overridesDisable' :: ProgramWriter ()
overridesEnable' :: ProgramWriter ()
restoreOffsets' :: ProgramWriter ()
resetOffsets' :: ProgramWriter ()
resetOffsetsParams' :: ProgramWriter ()
coordinateSystemOffset' :: ProgramWriter ()
moveInMachineCoordinates' :: ProgramWriter ()
toolChangePositionSet' :: ProgramWriter ()
toolChangePositionMove' :: ProgramWriter ()
storedPositionSet' :: ProgramWriter ()
storedPositionMove' :: ProgramWriter ()
setToolTable' :: ProgramWriter ()
setCurrentTool' :: ProgramWriter ()
toolChange' :: ProgramWriter ()
cutterCompensationDynamicRight' :: ProgramWriter ()
cutterCompensationRight' :: ProgramWriter ()
cutterCompensationDynamicLeft' :: ProgramWriter ()
cutterCompensationLeft' :: ProgramWriter ()
cutterCompensationOff' :: ProgramWriter ()
palletChangePause' :: ProgramWriter ()
palletChange' :: ProgramWriter ()
programEnd' :: ProgramWriter ()
optionalPause' :: ProgramWriter ()
pause' :: ProgramWriter ()
toolLengthCancel' :: ProgramWriter ()
toolLengthAdd' :: ProgramWriter ()
toolLengthDynamic' :: ProgramWriter ()
toolLength' :: ProgramWriter ()
coolantStop' :: ProgramWriter ()
coolantFlood' :: ProgramWriter ()
coolantMist' :: ProgramWriter ()
spindleModeRPM' :: ProgramWriter ()
spindleModeConstantSurfaceSpeed' :: ProgramWriter ()
spindleCCW' :: ProgramWriter ()
spindleCW' :: ProgramWriter ()
spindleStop' :: ProgramWriter ()
spindleOrient' :: ProgramWriter ()
unitsPerRevolution' :: ProgramWriter ()
unitsPerMinute' :: ProgramWriter ()
inverseTime' :: ProgramWriter ()
latheRadius' :: ProgramWriter ()
latheDiameter' :: ProgramWriter ()
arcRelative' :: ProgramWriter ()
arcAbsolute' :: ProgramWriter ()
relative' :: ProgramWriter ()
absolute' :: ProgramWriter ()
boringCycleDwell' :: ProgramWriter ()
boringCycle' :: ProgramWriter ()
drillingCyclePeck' :: ProgramWriter ()
drillingCycleDwell' :: ProgramWriter ()
drillingCycle' :: ProgramWriter ()
drillingCycleCancel' :: ProgramWriter ()
threadingCycle' :: ProgramWriter ()
drillingCycleCB' :: ProgramWriter ()
probe' :: ProgramWriter ()
rigidTap' :: ProgramWriter ()
spindleSync' :: ProgramWriter ()
millimeters' :: ProgramWriter ()
inches' :: ProgramWriter ()
vWPlane' :: ProgramWriter ()
wUPlane' :: ProgramWriter ()
uVPlane' :: ProgramWriter ()
yZPlane' :: ProgramWriter ()
zXPlane' :: ProgramWriter ()
xYPlane' :: ProgramWriter ()
nURBS' :: ProgramWriter ()
quadSpline' :: ProgramWriter ()
cubicSpline' :: ProgramWriter ()
dwell' :: ProgramWriter ()
arcCCW' :: ProgramWriter ()
arcCW' :: ProgramWriter ()
move' :: ProgramWriter ()
rapid' :: ProgramWriter ()
unnamed' :: ProgramWriter ()
data Program
Program :: GCode -> Program
[programCode] :: Program -> GCode
type ProgramWriter a = Writer (Endo Program) a
gen :: Code -> ProgramWriter ()
prog :: ProgramWriter a -> Program
generateName :: RS274Name -> ProgramWriter ()
generateNameArgs :: RS274Name -> (Code -> Code) -> ProgramWriter ()
instance GHC.Show.Show Data.GCode.Monad.Program
instance GHC.Classes.Eq Data.GCode.Monad.Program
module Data.GCode.Canon
data Plane
XY :: Plane
YZ :: Plane
ZX :: Plane
UV :: Plane
WU :: Plane
VW :: Plane
data CutterCompenstationSide
CutterCompensationRight :: CutterCompenstationSide
CutterCompensationLeft :: CutterCompenstationSide
CutterCompensationOff :: CutterCompenstationSide
type Speed = Double
type Seconds = Double
data RotationDirection
ClockWise :: RotationDirection
CounterClockWise :: RotationDirection
data LengthUnit
Inches :: LengthUnit
MilliMeters :: LengthUnit
CentiMeters :: LengthUnit
Meters :: LengthUnit
data HeaterType
HeatedExtruder :: HeaterType
HeatedBed :: HeaterType
HeatedChamber :: HeaterType
-- | Some heater with id or Nothing for current / default
data Heater
Heater :: HeaterType -> Maybe Int -> Heater
-- | Tool length compensation
data CompensationMode
-- | Tool length compensation is disabled
NoCompensation :: CompensationMode
-- | Following moves will take into account tool offset from tool table
LengthTable :: CompensationMode
-- | Apply dynamic offset
Dynamic :: Axes -> CompensationMode
-- | Add tool offset of the tool specified by the parameter to currently
-- selected tool offset
Add :: Int -> CompensationMode
data ArcParams
ArcParams :: Double -> Double -> Double -> Double -> Int -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> ArcParams
-- | first second coordinates according to selected plane
[arcFirstEnd] :: ArcParams -> Double
[arcSecondEnd] :: ArcParams -> Double
[arcFirstAxis] :: ArcParams -> Double
[arcSecondAxis] :: ArcParams -> Double
[arcRotation] :: ArcParams -> Int
[arcAxisEndPoint] :: ArcParams -> Double
[arcA] :: ArcParams -> Double
[arcB] :: ArcParams -> Double
[arcC] :: ArcParams -> Double
[arcU] :: ArcParams -> Double
[arcV] :: ArcParams -> Double
[arcW] :: ArcParams -> Double
data Canon
-- | Rapid motion to end position specified by Axes
StraightTraverse :: Axes -> Canon
-- | Machining motion
StraightFeed :: Axes -> Canon
-- | Straight probe towards workpeice
StraightProbe :: Axes -> Canon
-- | Set coordinates to provided values without motion
SetCoords :: Axes -> Canon
-- | Movement along arc
ArcFeed :: ArcParams -> Canon
-- | End of the program
ProgramEnd :: Canon
-- | Set feed rate for machining moves
SetFeedRate :: Speed -> Canon
-- | Set feed rate for travel moves
SetTraverseRate :: Speed -> Canon
-- | Set plane
PlaneSelect :: Plane -> Canon
-- | Do nothing for specified number of seconds
PauseSeconds :: Double -> Canon
SpindleStart :: RotationDirection -> Bool -> Canon
-- | Rotate spindle according to RotationDirection
[spindleDirection] :: Canon -> RotationDirection
-- | Wait for spindle to reach desired RPM
[spindleWaitForSpeed] :: Canon -> Bool
-- | Stop spindle
SpindleStop :: Canon
-- | Set spindle RPM
SpindleSpeed :: Speed -> Canon
-- | Enable mist coolant
CoolantMist :: Canon
-- | Enable flood coolant
CoolantFlood :: Canon
-- | Stop all coolant flows Tools
CoolantStop :: Canon
-- | Select tool by its index
ToolSelect :: Int -> Canon
-- | Perform tool change
ToolChange :: Canon
-- | Enable tool length compensation Printer
ToolLengthCompensation :: CompensationMode -> Canon
-- | Enable fan
FanOn :: Canon
-- | Disable fan
FanOff :: Canon
-- | Set temperature of the specific heater
SetTemperature :: Heater -> Double -> Canon
-- | Set temperature and wait for it to be reached
SetTemperatureWait :: Heater -> Double -> Canon
-- | Cancel all temperature waits
CancelWaitTemperature :: Canon
-- | Perform automated bed leveling Misc
LevelBed :: Canon
-- | Disable power to motors
DisableMotors :: Axes -> Canon
-- | Display a message, typically on LCD
DisplayMessage :: ByteString -> Canon
-- | Just a comment
Comment :: ByteString -> Canon
-- | State of the Canon interpreter
data CanonState
CanonState :: Axes -> Speed -> Speed -> Plane -> CanonState
-- | Position
[canonPosition] :: CanonState -> Axes
-- | Speed for travel moves
[canonTraverseRate] :: CanonState -> Speed
-- | Speed for machining moves
[canonFeedRate] :: CanonState -> Speed
-- | Selected plane
[canonPlane] :: CanonState -> Plane
-- | Initial state of the Canon interpreter
initCanonState :: CanonState
-- | Step Canon interpreter, returning new state
stepCanon :: CanonState -> Canon -> CanonState
-- | Fully eval list of Canon commands.
--
-- Slow, only useful for testing, use Pipes variant instead
evalCanon :: (CanonState -> CanonState -> Canon -> [a]) -> [Canon] -> [a]
instance GHC.Classes.Ord Data.GCode.Canon.CanonState
instance GHC.Classes.Eq Data.GCode.Canon.CanonState
instance GHC.Show.Show Data.GCode.Canon.CanonState
instance GHC.Classes.Ord Data.GCode.Canon.Canon
instance GHC.Classes.Eq Data.GCode.Canon.Canon
instance GHC.Show.Show Data.GCode.Canon.Canon
instance GHC.Classes.Ord Data.GCode.Canon.ArcParams
instance GHC.Show.Show Data.GCode.Canon.ArcParams
instance GHC.Classes.Eq Data.GCode.Canon.ArcParams
instance GHC.Classes.Ord Data.GCode.Canon.CompensationMode
instance GHC.Classes.Eq Data.GCode.Canon.CompensationMode
instance GHC.Show.Show Data.GCode.Canon.CompensationMode
instance GHC.Classes.Ord Data.GCode.Canon.Heater
instance GHC.Classes.Eq Data.GCode.Canon.Heater
instance GHC.Show.Show Data.GCode.Canon.Heater
instance GHC.Classes.Ord Data.GCode.Canon.HeaterType
instance GHC.Classes.Eq Data.GCode.Canon.HeaterType
instance GHC.Show.Show Data.GCode.Canon.HeaterType
instance GHC.Classes.Ord Data.GCode.Canon.LengthUnit
instance GHC.Classes.Eq Data.GCode.Canon.LengthUnit
instance GHC.Show.Show Data.GCode.Canon.LengthUnit
instance GHC.Classes.Ord Data.GCode.Canon.RotationDirection
instance GHC.Classes.Eq Data.GCode.Canon.RotationDirection
instance GHC.Show.Show Data.GCode.Canon.RotationDirection
instance GHC.Classes.Ord Data.GCode.Canon.CutterCompenstationSide
instance GHC.Classes.Eq Data.GCode.Canon.CutterCompenstationSide
instance GHC.Show.Show Data.GCode.Canon.CutterCompenstationSide
instance GHC.Classes.Ord Data.GCode.Canon.Plane
instance GHC.Classes.Eq Data.GCode.Canon.Plane
instance GHC.Show.Show Data.GCode.Canon.Plane
module Data.GCode.Line
data Line
Line :: LineType -> Axes -> Axes -> Line
data LineType
-- | Travel move
LineTraverse :: LineType
-- | Machining/drawing move
LineDrawing :: LineType
-- | Produced by set coordinates SetCoords
LineJump :: LineType
-- | Given two states of Canon interpreter output Line or
-- empty list if no line is produced by this Canon.
toLines :: CanonState -> CanonState -> Canon -> [Line]
-- | Pretty print Line
prettyLine :: Style -> Line -> String
instance GHC.Classes.Ord Data.GCode.Line.Line
instance GHC.Show.Show Data.GCode.Line.Line
instance GHC.Classes.Eq Data.GCode.Line.Line
instance GHC.Classes.Ord Data.GCode.Line.LineType
instance GHC.Show.Show Data.GCode.Line.LineType
instance GHC.Classes.Eq Data.GCode.Line.LineType
-- | GCode pretty-printing functions
--
-- Utilities for manipulating and filtering GCode
module Data.GCode.Utils
-- | True if Code is a G-code
isG :: Code -> Bool
-- | True if Code is a M-code
isM :: Code -> Bool
-- | True if Code is a G{N} code
isGN :: Int -> Code -> Bool
-- | True if Code has a coordinate in axis a
hasAxis :: AxisDesignator -> Code -> Bool
getAxis :: AxisDesignator -> Code -> Maybe Double
getAxes :: [AxisDesignator] -> Code -> [Maybe Double]
getAxesToList :: Code -> [(AxisDesignator, Double)]
-- | True if Code contains X axis
hasX :: Code -> Bool
-- | True if Code contains Y axis
hasY :: Code -> Bool
-- | True if Code contains Z axis
hasZ :: Code -> Bool
-- | True if Code contains E axis
hasE :: Code -> Bool
-- | True if Code contains parameter with ParamDesignator
hasParam :: ParamDesignator -> Code -> Bool
-- | Get parameter if defined
getParam :: ParamDesignator -> Code -> Maybe Double
-- | True if Code contains feedrate parameter (e.g. G0 F3000)
hasFeedrate :: Code -> Bool
-- | Filter G-codes
gcodes :: [Code] -> [Code]
-- | Filter M-codes
mcodes :: [Code] -> [Code]
-- | Filter rapid moves
rapids :: [Code] -> [Code]
-- | Filter moves
moves :: [Code] -> [Code]
-- | Replace Class of Code (e.g. for chaning G0 to M0)
replaceClass :: Class -> Code -> Code
-- | Replace code value of Code (e.g. for chaning G0 to G1)
replaceCode :: Int -> Code -> Code
-- | Replace axis with AxisDesignator in Code returning new
-- Code
replaceAxis :: AxisDesignator -> Double -> Code -> Code
-- | Apply function to axis specified by AxisDesignator
modifyAxis :: AxisDesignator -> (Double -> Double) -> Code -> Code
-- | Apply function to axes specified by '[AxisDesignator]'
modifyAxes :: [AxisDesignator] -> (Double -> Double) -> Code -> Code
-- | Test if Code has X and Y axes
hasXY :: Code -> Bool
-- | Apply function to X and Y axes
modifyXY :: (Double -> Double -> (Double, Double)) -> Code -> Code
-- | Replace or add axis with AxisDesignator in Code
-- returning new Code
addReplaceAxis :: AxisDesignator -> Double -> Code -> Code
-- | Replace X axis coordnate
replaceX :: Double -> Code -> Code
-- | Replace Y axis coordinate
replaceY :: Double -> Code -> Code
-- | Replace Z axis coordinate
replaceZ :: Double -> Code -> Code
-- | Replace E axis coordinate
replaceE :: Double -> Code -> Code
-- | Replace or add X axis coordinate
addReplaceX :: Double -> Code -> Code
-- | Replace or add Y axis coordinate
addReplaceY :: Double -> Code -> Code
-- | Replace or add Z axis coordinate
addReplaceZ :: Double -> Code -> Code
-- | Replace or add E axis coordinate
addReplaceE :: Double -> Code -> Code
-- | Replace parameter with ParamDesignator in Code returning
-- new Code
replaceParam :: ParamDesignator -> Double -> Code -> Code
-- | Apply function to parameter with ParamDesignator
modifyParam :: ParamDesignator -> (Double -> Double) -> Code -> Code
-- | Apply function to parameters specified by '[ParamDesignator]'
modifyParams :: [ParamDesignator] -> (Double -> Double) -> Code -> Code
-- | Apply function to parameters specified by '[ParamDesignator]'
--
-- Function gets ParameterDesignator passed as its first
-- argument
modifyParamsWithKey :: [ParamDesignator] -> (ParamDesignator -> Double -> Double) -> Code -> Code
-- | Replace or add parameter with ParamDesignator in Code
-- returning new Code
addReplaceParam :: ParamDesignator -> Double -> Code -> Code
-- | Replace feedrate (F parameter) in Code returning new
-- Code
replaceFeedrate :: Double -> Code -> Code
-- | Apply function to feedrate
modifyFeedrate :: (Double -> Double) -> Code -> Code
-- | Sum of all axis distances of this Code
travelDistance :: Code -> Double
-- | Round x with specified precision
roundprec :: (Integral a, RealFrac b, Fractional c) => a -> b -> c
-- | GCode generation
--
-- GCode generation functions & shortcuts
module Data.GCode.Generate
-- | Generate G Code
g :: Code
-- | Generate M Code
m :: Code
-- | Generate S (set spindle feedrate) Code
s :: Code
-- | Set GCode number
(<#>) :: Code -> Int -> Code
-- | Set GCode feedrate (F parameter)
feed :: Double -> Code -> Code
-- | Set x axis target
x :: Double -> Code -> Code
-- | Set y axis target
y :: Double -> Code -> Code
-- | Set z axis target
z :: Double -> Code -> Code
-- | Set x, y coordinates for this Code
xy :: Double -> Double -> Code -> Code
-- | Set x, y and z coordinates
xyz :: Double -> Double -> Double -> Code -> Code
-- | Set G0 and x, y coordinates
movexy :: Double -> Double -> Code
-- | Set i, j parameters for this Code
ij :: Double -> Double -> Code -> Code
arc :: Code
-- | Generate points on a rectangle
rectangle :: (Num a, Num b) => a -> b -> [(a, b)]
-- | Rotate X/Y coordinates by angle by
rot :: Floating b => b -> b -> b -> (b, b)
-- | Generate a list of points laying on a circle with radius r,
-- divides circle in steps number of points
circle :: (Floating b, Enum b) => b -> b -> [(b, b)]
-- | As circle with rotated by rin
circle' :: (Floating b, Enum b) => b -> b -> b -> [(b, b)]
-- | As circle but origin is the same as end point
closedCircle :: (Floating a, Enum a) => a -> a -> [(a, a)]
-- | Join list of GCodes with travel moves inbetween
travelCat :: Code -> Code -> [GCode] -> [Code]
-- | Join list of drilling GCodes with travel moves inbetween
travelCatDrill :: Code -> [GCode] -> [Code]
-- | Prepend codes with tool up command, rapid move to block start and tool
-- down command
--
-- Prepends up GCode representing tool moving up before rapid
-- move followed by down command to move tool down again.
travel :: Code -> Code -> GCode -> GCode
-- | Prepend drilling codes with tool up command and rapid moves
--
-- Prepends up GCode representing tool moving up before rapid
-- move to start of this block
travelDrills :: Code -> GCode -> GCode
-- | Take X and Y coordinates of this code and turn it into rapid move
asRapidXY :: Code -> Code
module Data.GCode.Generate.ExamplesMonad
xprog :: Program
withState :: Program
module Data.GCode.Canon.Convert
-- | Convert code to its canonical representation
toCanon :: Code -> [Canon]
ifHasParam :: (Monoid (f a), Applicative f) => ParamDesignator -> Code -> (Double -> a) -> f a
ifNonEmptyAxes :: (Applicative f, Monoid (f a)) => Code -> (Axes -> a) -> f a
getParamOrFail :: ParamDesignator -> Code -> [Char] -> Double
isCommentOnly :: Code -> Bool
-- | GCode evaluator
--
-- Evaluates RS274 GCode
module Data.GCode.Eval
-- | Interpreter state
data IPState
IPState :: Map RS274Group Code -> Axes -> Integer -> IPState
[ipModalGroups] :: IPState -> Map RS274Group Code
[ipPosition] :: IPState -> Axes
[ipLine] :: IPState -> Integer
-- | Default modals
defaultModals :: Map RS274Group Code
-- | Create new interpreter state
newState :: IPState
-- | Step Code interpreter
step :: IPState -> GCode -> (Maybe Code, IPState, GCode)
-- | Evaluate GCode and return each evaluation step
evalSteps :: [Code] -> [([Maybe Code], IPState, [Code])]
-- | Convert all axis coordinates from inches to millimeters if needed
toMillimeters :: Map RS274Group Code -> Code -> Code
-- | Convert all motion coordinates from relative to absolute
toAbsolute :: Map RS274Group Code -> Code -> Code
-- | Convert all arc coordinates from relative to absolute
toAbsoluteArcs :: Map RS274Group Code -> Code -> Code
-- | Return True if code is active (present) in modals
codeActive :: Code -> Map RS274Group Code -> Bool
-- | Return True if code is a motion comand
isMotion :: Code -> Bool
-- | Update code according to current modals then update
-- modals with a resulting code
--
-- Return updated code and modals
updateCodeAndModals :: Code -> Map RS274Group Code -> (Code, Map RS274Group Code)
-- | Update modal groups according to Code c
updateModals :: Map RS274Group Code -> Code -> Map RS274Group Code
-- | Take current motion group modal code and update this motion code with
-- missing coordinates of the stored one
updateFromCurrentModals :: Map RS274Group Code -> Code -> Code
-- | Return True if this code contains only coordinates
incomplete :: Code -> Bool
-- | Update incomplete motion Code with the stored one
updateIncompleteFromCurrentModals :: Map RS274Group Code -> Code -> Code
-- | Update axes that aren't defined in target
appendOnlyAxes :: Ord k => Map k b -> Map k b -> Map k b
-- | Update (replace) target axes with from axes
updateAxes :: Ord k => Map k a -> Map k a -> Map k a
-- | Update Limits from this Code
updateLimitsCode :: Limits -> Code -> Limits
-- | Update Limits from Axes
updateLimits :: Limits -> Axes -> Limits
-- | Fully evaluate GCode
eval :: GCode -> ([Code], IPState)
-- | Evaluate GCode to canonical representation
evalToCanon :: GCode -> ([Canon], IPState)
-- | Evaluate GCode to annotated canonnical representation
evalToCanonAnn :: GCode -> ([Ann Canon], IPState)
-- | Same as toCanon but result is wrapped in Ann according to
-- current interpreter line
toCanonAnn :: Code -> IPState -> [Ann Canon]
-- | Evaluate GCode and and apply function f to each successfuly
-- evaluated Code
--
-- Slow due to list concatenation, use streaming variants from
-- Pipes instead.
evalWith :: (Code -> IPState -> Maybe a) -> GCode -> ([a], IPState)
evalWith' :: (Code -> IPState -> [a]) -> GCode -> ([a], IPState)
-- | Walk GCode adding missing axes coordinates according to previous moves
--
-- For example G0 X1 G0 Y2 G0 Z3
--
-- becomes G0 X1 G0 X1 Y2 G0 X1 Y2 Z3
--
-- also
--
-- G0 X1 Y2 Z2
--
-- becomes
--
-- G0 X1 G0 X1 Y2 Z2
totalize :: GCode -> GCode
instance GHC.Classes.Ord Data.GCode.Eval.IPState
instance GHC.Show.Show Data.GCode.Eval.IPState
instance GHC.Classes.Eq Data.GCode.Eval.IPState
module Data.GCode.Pipes
parseProducer :: Handle -> Producer Code (SafeT IO) (Either (ParsingError, Producer ByteString (SafeT IO) ()) ())
parseProducer' :: MonadIO m => Int -> Handle -> Producer Code m (Either (ParsingError, Producer ByteString m ()) ())
withFile :: FilePath -> (Handle -> SafeT IO r) -> IO r
pipeToList :: FilePath -> Proxy () Code () a (SafeT IO) () -> IO [a]
gcodeToCanonList :: FilePath -> IO [Canon]
gcodeToLines :: FilePath -> IO [Line]
gcodePipe :: FilePath -> Consumer Code (SafeT IO) () -> IO ()
runPipe :: FilePath -> Maybe FilePath -> Pipe Code ByteString (SafeT IO) () -> IO ()
foldedPipe :: FilePath -> (Producer Code (SafeT IO) () -> Effect (SafeT IO) r) -> IO r
totalizeP :: Pipe Code Code (SafeT IO) ()
evalP :: Pipe Code Code (SafeT IO) ()
evalCanonP :: Pipe Code Canon (SafeT IO) ()
evalCanonLinesP :: Pipe Code Line (SafeT IO) ()
prettySinkWith :: (a -> ByteString) -> Pipe a ByteString (SafeT IO) ()
prettySink :: Pipe Code ByteString (SafeT IO) ()
compactSink :: Pipe Code ByteString (SafeT IO) ()
addNewLine :: ByteString -> ByteString
wrapPrinter :: (a -> String) -> a -> ByteString
-- | This module is an entry point to gcodehs library
--
-- This module re-exports most of the Data.GCode submodules.
module Data.GCode
module Data.GCode.Pipes.Transform
translateXY :: Functor m => Double -> Double -> Pipe Code Code m r
translateZ :: Functor m => Double -> Pipe Code Code m r
rotate :: Functor m => Double -> Pipe Code Code m r
scaleFeedrate :: Functor m => Double -> Pipe Code Code m r
scaleXY :: Functor m => Double -> Double -> Pipe Code Code m r
-- | Examples of GCode generation
module Data.GCode.Generate.Examples
allExamples :: [(String, GCode)]
preamble :: [Code]
postamble :: [Code]
returnZ :: Double
safeZ :: Double
workZ :: Double
rapidFeedrate :: Double
downFeedrate :: Double
up :: Code
down :: Code
program :: [Code] -> [Code]
rectangle10mm20mm :: GCode
encoderWheel :: (GCode, GCode)