vm

package
v0.0.0-...-51c6363 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2020 License: MIT Imports: 7 Imported by: 8

Documentation

Index

Constants

View Source
const (
	MoveModeNone   = iota
	MoveModeRapid  = iota
	MoveModeLinear = iota
	MoveModeCWArc  = iota
	MoveModeCCWArc = iota
	MoveModeDwell  = iota
)

Constants for move modes

View Source
const (
	PlaneXY = iota
	PlaneXZ = iota
	PlaneYZ = iota
)

Constants for plane selection

View Source
const (
	FeedModeUnitsMin = iota
	FeedModeUnitsRev = iota
	FeedModeInvTime  = iota
)

Constants for feedrate mode

View Source
const (
	CutCompModeNone  = iota
	CutCompModeOuter = iota
	CutCompModeInner = iota
)

Constants for cutter compensation mode

Variables

This section is empty.

Functions

This section is empty.

Types

type CoordinateSystem

type CoordinateSystem struct {
	// contains filtered or unexported fields
}

func (*CoordinateSystem) ApplyCoordinateSystem

func (c *CoordinateSystem) ApplyCoordinateSystem(x, y, z float64) (float64, float64, float64)

func (*CoordinateSystem) CancelOverride

func (c *CoordinateSystem) CancelOverride()

func (*CoordinateSystem) DisableOffset

func (c *CoordinateSystem) DisableOffset()

func (*CoordinateSystem) EnableOffset

func (c *CoordinateSystem) EnableOffset()

func (*CoordinateSystem) EraseOffset

func (c *CoordinateSystem) EraseOffset()

func (*CoordinateSystem) GetCoordinateSystem

func (c *CoordinateSystem) GetCoordinateSystem() vector.Vector

func (*CoordinateSystem) OffsetActive

func (c *CoordinateSystem) OffsetActive() bool

func (*CoordinateSystem) Override

func (c *CoordinateSystem) Override()

func (*CoordinateSystem) OverrideActive

func (c *CoordinateSystem) OverrideActive() bool

func (*CoordinateSystem) SelectCoordinateSystem

func (c *CoordinateSystem) SelectCoordinateSystem(s int)

func (*CoordinateSystem) SetCoordinateSystem

func (c *CoordinateSystem) SetCoordinateSystem(x, y, z float64, s int)

func (*CoordinateSystem) SetOffset

func (c *CoordinateSystem) SetOffset(x, y, z float64)

type Machine

type Machine struct {
	State     State
	Positions []Position

	// Regular states
	Completed    bool
	Imperial     bool
	AbsoluteMove bool
	AbsoluteArc  bool
	MovePlane    int

	// Coordinate systems
	CoordinateSystem CoordinateSystem

	// Positions
	StoredPos1 vector.Vector
	StoredPos2 vector.Vector

	// Arc settings
	MaxArcDeviation  float64
	MinArcLineLength float64

	// Options
	IgnoreBlockDelete   bool
	AllowRemainingWords bool
}

Machine state and settings

func (*Machine) Dump

func (vm *Machine) Dump()

Dumps the entire machine

func (*Machine) ETA

func (m *Machine) ETA() time.Duration

Estimate runtime for job

func (*Machine) EnforceSpindle

func (vm *Machine) EnforceSpindle(enabled, clockwise bool, speed float64)

Enforce spindle mode

func (*Machine) FeedrateMultiplier

func (vm *Machine) FeedrateMultiplier(feedMultiplier float64)

Increase feedrate

func (*Machine) FindSafetyHeight

func (vm *Machine) FindSafetyHeight() float64

Detect the highest Z position

func (*Machine) FlipXY

func (vm *Machine) FlipXY()

Flips the X and Y axes of all moves

func (*Machine) Info

func (vm *Machine) Info() (minx, miny, minz, maxx, maxy, maxz float64, feedrates []float64)

Generate move information

func (*Machine) Init

func (vm *Machine) Init()

Initialize the VM to sane default values

func (*Machine) LimitFeedrate

func (vm *Machine) LimitFeedrate(feed float64)

Limit feedrate.

func (*Machine) MoveMultiplier

func (vm *Machine) MoveMultiplier(moveMultiplier float64)

Multiply move distances - This makes no sense - Dangerous.

func (*Machine) Process

func (vm *Machine) Process(doc *gcode.Document) (err error)

Process AST

func (*Machine) Return

func (vm *Machine) Return(disableSpindle, disableCoolant bool)

Ensure return to X0 Y0 Z0. Simply adds a what is necessary to move back to X0 Y0 Z0.

func (*Machine) SetSafetyHeight

func (vm *Machine) SetSafetyHeight(height float64) error

Set safety-height. Scans for the highest position on the Y axis, and afterwards replaces all instances of this position with the requested height.

type Position

type Position struct {
	State   State
	X, Y, Z float64
}

Position and state

func (*Position) Dump

func (m *Position) Dump()

Dump position in (sort of) human readable format

func (Position) Vector

func (p Position) Vector() vector.Vector

type State

type State struct {
	Feedrate           float64
	SpindleSpeed       float64
	MoveMode           int
	FeedMode           int
	SpindleEnabled     bool
	SpindleClockwise   bool
	FloodCoolant       bool
	MistCoolant        bool
	ToolIndex          int
	NextToolIndex      int
	ToolLengthIndex    int
	CutterCompensation int
	DwellTime          float64
}

Move state

func NewState

func NewState() State

NewState returns an initialized State.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL