Table of Contents

Class StateActRunner

Namespace
Hi.Numerical.Acts
Assembly
HiMech.dll

Manages the state of numerical control operations during runtime.

The state lives in one NativeActs.StateActRunnerRecord (the mirror of state_act_runner_record_t, 144 bytes) and the state machine runs stateless over it in core.dll -- state_act_runner__init / __reset / __proc_act / __begin_step of inc/mech/acts/acts.hiapi.h, the P10 port of this class's logic (play-core migration P11): the getters and setters read and write the record directly, no handle and no finalizer. The row-data dictionary (Data) stays beside the record, which carries only whether data is pending (has_data).

public class StateActRunner
Inheritance
StateActRunner
Inherited Members
Extension Methods

Constructors

StateActRunner()

Initializes a runner that remembers nothing (state_act_runner__init).

public StateActRunner()

Properties

ActualDateTime

Absolute controller timestamp (wall-clock DateTime) of the step, kept alongside ActualTimecode so the calendar date is not lost. null if not set.

public DateTime? ActualDateTime { get; set; }

Property Value

DateTime?

ActualTimecode

Actual accumulated worked time. Actual Program time. Actual End Timecode. null if not set.

public TimeSpan? ActualTimecode { get; set; }

Property Value

TimeSpan?

BeginSpindleAngle_rad

SpindleAngle_rad as it was when the last IActDuration began — the begin angle of the motion step that act makes.

public double BeginSpindleAngle_rad { get; }

Property Value

double

CommandedClFeedrate_mmdmin

public double CommandedClFeedrate_mmdmin { get; set; }

Property Value

double

CommandedClFeedrate_mmds

The controller's commanded feedrate of the CL point in mm/sec, as last processed: the F word after G94/G95/G93 conversion, or for a rapid the CL path over the act duration (ActRapid). It describes the point the controller moves, not the equipped tool's tip: under RTCP with a tool-length offset that does not match the equipped tool the tip sweeps while the CL point may stand still, so this value is not the real tool-tip feedrate (ActualTipFeedrate_mmds).

public double CommandedClFeedrate_mmds { get; set; }

Property Value

double

CoolantMode

Current coolant delivery mode as last-seen ActCooling. Updated by ProcAct(IAct).

public CoolantMode CoolantMode { get; set; }

Property Value

CoolantMode

Data

State external data.

public Dictionary<string, object> Data { get; set; }

Property Value

Dictionary<string, object>

EndTimecode

Ideal accumulated worked time by simulation. Ideal Program time. The value includes last action duration.

public TimeSpan EndTimecode { get; set; }

Property Value

TimeSpan

IsCoolantOn

Legacy convenience flag. True for Flood / Mist; false for Off / UnDefined.

public bool IsCoolantOn { get; set; }

Property Value

bool

IsRapid

Whether the last processed feedrate act was a rapid traverse (ActRapid): the motion acts that follow it, up to the next ActFeedrate, are G00 moves at CommandedClFeedrate_mmds. False before the first feedrate act and after ResetState().

public bool IsRapid { get; }

Property Value

bool

IsSpindleTurning

Whether the spindle turns: a rotating direction (M03 or M04) and a nonzero speed. M05 keeps the modal S value, so the speed alone does not say.

public bool IsSpindleTurning { get; }

Property Value

bool

SpindleAngleRate_radds

The rate SpindleAngle_rad advances at, radians per second: GetSpindleAngleRate_radds(SpindleDirection, double) of the current direction and speed.

public double SpindleAngleRate_radds { get; }

Property Value

double

SpindleAngle_deg

Spindle rotation angle in degrees.

public double SpindleAngle_deg { get; set; }

Property Value

double

SpindleAngle_rad

Spindle rotation angle in radians, positive the M03 (clockwise) way seen from the spindle toward the tool tip, as last processed: an ActSpindleOrientation sets it, and every IActDuration advances it at SpindleAngleRate_radds — forward under M03, backward under M04, not at all while the spindle is stopped (M05 keeps the modal S value) or its direction is undefined, so the angle of an oriented stop holds until the spindle turns again. The value includes the last action duration, as EndTimecode does.

public double SpindleAngle_rad { get; set; }

Property Value

double

SpindleDirection

Gets or sets the spindle rotation direction.

public SpindleDirection SpindleDirection { get; set; }

Property Value

SpindleDirection

SpindleSpeed_radds

Gets or sets the spindle speed in radians per second.

public double SpindleSpeed_radds { get; set; }

Property Value

double

SpindleSpeed_rpm

Gets or sets the spindle speed in revolutions per minute.

public double SpindleSpeed_rpm { get; set; }

Property Value

double

ToolId

Gets or sets the current tool identifier.

public int ToolId { get; set; }

Property Value

int

Methods

GetSpindleAngleRate_radds(SpindleDirection, double)

The signed rate a spindle angle advances at, radians per second: spindleSpeed_radds under M03 (CW, the positive sense of the angle), its negation under M04 (CCW), and 0 for a stopped or undefined direction.

public static double GetSpindleAngleRate_radds(SpindleDirection spindleDirection, double spindleSpeed_radds)

Parameters

spindleDirection SpindleDirection

The spindle direction.

spindleSpeed_radds double

The spindle speed, radians per second.

Returns

double

The signed rate.

ProcAct(IAct)

filter the same effect action and run the effective action.

public IAct ProcAct(IAct act)

Parameters

act IAct

Returns

IAct

null if the input act is the same effect action. otherwise, return act.

Remarks

The act crosses as its full record (ActRecordUtil.ToRecord), geometry included: a contour or CL move whose path is null throws here, where the earlier runner read only the duration (parser-built acts always carry their path); core.dll reads the kind and the duration.

ResetState()

Resets all state values to their defaults.

public void ResetState()