मुख्य सामग्री पर जाएँ

raygeo.ops.state

Machine state tracking for CNC milling.

Tracks the current or intended machine state at any point in a command sequence, including power level (0.0–1.0), coolant mode, air assist, head coolant, feed rate and rapid rate, active head UID, pulse frequency, and pulse width. State objects are used by Ops to associate machine parameters with moving commands and to detect rapid (non-power) state changes.

AirAssistMode​

Air assist mode for laser or CNC operations.

Controls the air assist state: Off or On.

name​

name: str

value​

value: int

CoolantMode​

Coolant mode for CNC milling operations.

Controls the coolant state: Off, Flood, or Mist.

name​

name: str

value​

value: int

HeadCoolantMode​

Head coolant mode for laser or CNC operations.

Controls the head coolant state: Off or On.

name​

name: str

value​

value: int

PowerMode​

Laser power mode for cutting operations.

Controls whether power scales with head speed: Dynamic (speed-proportional, M4) or Constant (fixed, M3).

name​

name: str

value​

value: int

State​

The current state of a CNC machine.

Tracks power level, coolant mode, air assist, head coolant, feed/rapid rates, active head UID, frequency, pulse width, spindle RPM, and coolant mode.

active_head_uid​

active_head_uid: Optional[str]

UID of the active head (if set).

air_assist​

air_assist: Optional[AirAssistMode]

Air assist mode (if set).

coolant​

coolant: Optional[CoolantMode]

Coolant mode (if set).

dwell_ms​

dwell_ms: Optional[float]

Dwell time in milliseconds (if set).

feed_rate​

feed_rate: Optional[int]

Cutting feed rate in mm/s (if set).

frequency​

frequency: Optional[int]

Laser pulse frequency in Hz (if set).

head_coolant​

head_coolant: Optional[HeadCoolantMode]

Head coolant mode (if set).

power​

power: float

Laser power level (0.0 – 1.0 typically).

power_mode​

power_mode: Optional[PowerMode]

Laser power mode (if set).

pulse_width​

pulse_width: Optional[float]

Laser pulse width in microseconds (if set).

rapid_rate​

rapid_rate: Optional[int]

Rapid (traverse) rate in mm/s (if set).

spindle_rpm​

spindle_rpm: Optional[int]

Spindle RPM (if set).

allow_rapid_change()​

allow_rapid_change(target: State) -> bool

Check whether the machine can transition from the current state to the target state without a SetPower command.

ParameterTypeDescription
targetStateThe target state to compare against.
ReturnsboolTrue if the change is a rapid (non-power) change.
ComplexityO(1)