Class MachiningActRunner
- Namespace
- Hi.MachiningProcs
- Assembly
- HiMech.dll
Represents a runner for machining actions that manages milling steps, tool paths, and collision detection.
public class MachiningActRunner : IDisposable
- Inheritance
-
MachiningActRunner
- Implements
- Inherited Members
- Extension Methods
Constructors
MachiningActRunner(Action<Exception>, Action<IEnumerable<MillingStepLuggage>>, Func<MachiningToolHouse>, Func<MachiningEquipment>, Func<WorkpieceService>, Action)
Initializes a new instance.
public MachiningActRunner(Action<Exception> reportException, Action<IEnumerable<MillingStepLuggage>> stepStorageWriter, Func<MachiningToolHouse> machiningToolHouseGetter, Func<MachiningEquipment> machiningEquipmentGetter, Func<WorkpieceService> workpieceServiceGetter, Action resetMillingStepLuggageDbAction)
Parameters
reportExceptionAction<Exception>Error sink for the runner's background infrastructure tasks (bulk writer flush, attachment-memory loose runner) which run outside any single call. Request-scoped progress is passed by method argument, not held here.
stepStorageWriterAction<IEnumerable<MillingStepLuggage>>The action to write milling step luggages to storage.
machiningToolHouseGetterFunc<MachiningToolHouse>The getter function for the machining tool house.
machiningEquipmentGetterFunc<MachiningEquipment>The getter function for the machining equipment.
workpieceServiceGetterFunc<WorkpieceService>The getter function for the workpiece runtime service.
resetMillingStepLuggageDbActionActionAction to reset the milling step luggage database.
Fields
InternalMachiningStepBuilt
Internal callback fired when a step is built (same timing as MachiningStepBuilt); used by host services before UI subscribers.
public MachiningActRunner.MachiningStepBuiltDelegate InternalMachiningStepBuilt
Field Value
Properties
ClStrip
Gets the cutter location strip.
public ClStrip ClStrip { get; }
Property Value
Config
Gets or sets the runner configuration.
public MachiningActRunnerConfig Config { get; set; }
Property Value
EnableMotionDependentMachiningResolution
EnableMotionDependentMachiningResolution. It works on feed per cycle and feed per tooth motion resolution. MachiningResolution_mm changed by the LinearResolution_mm.
public bool EnableMotionDependentMachiningResolution { get; set; }
Property Value
EnableSweeping
Gets whether sweeping is enabled based on the motion resolution type.
public bool EnableSweeping { get; }
Property Value
GrpcPostStepAction
Gets or sets the action to be performed after each step for GRPC service. This is for internal use only.
public static Action<MachiningStep> GrpcPostStepAction { get; set; }
Property Value
MachiningMotionResolution
Gets or sets the machining motion resolution.
public IMachiningMotionResolution MachiningMotionResolution { get; set; }
Property Value
MachiningResolution_mm
Gets or sets the preferred cube width for steps.
public double MachiningResolution_mm { get; set; }
Property Value
MachiningToolHouse
Gets or sets the machining tool house.
public MachiningToolHouse MachiningToolHouse { get; }
Property Value
MachiningVolumeRemovalProc
Gets the machining volume removal processor.
public MachiningVolumeRemovalProc MachiningVolumeRemovalProc { get; }
Property Value
ShellThreadStepIndex
The motion-step index currently managed on the shell session main thread — the index the
next ClStripPos will receive, read straight from
StripPosesCount (the strip is the single source of truth). Decoupled
from the parallel-physics StepTaskBundle.StepIndex, which tracks a different
(emit-thread) progress and may diverge. Use this to anchor a StepDiagnostic
to its motion step.
public int ShellThreadStepIndex { get; }
Property Value
StateActRunner
Gets the state act runner. This property is provided as a member value getter and should not be modified.
public StateActRunner StateActRunner { get; }
Property Value
XyzabcChain
Gets the XYZABC kinematic chain if the current machining chain supports it; otherwise null.
public IXyzabcChain XyzabcChain { get; }
Property Value
Methods
AdjustAptCutterStlResolutionByNcResolutionAndWorkpieceResolution()
Adjusts the APT cutter STL resolution based on NC resolution and workpiece resolution.
public void AdjustAptCutterStlResolutionByNcResolutionAndWorkpieceResolution()
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
protected virtual void Dispose(bool disposing)
Parameters
disposingbool
ExpandToActMcStep(IAct, StepDiagnosticProgress)
Expands an act into machine control steps.
public IEnumerable<IAct> ExpandToActMcStep(IAct act, StepDiagnosticProgress stepDiagnosticProgress)
Parameters
actIActThe act to expand.
stepDiagnosticProgressStepDiagnosticProgressProgress sink for cutter-location strip / per-step updates.
Returns
- IEnumerable<IAct>
A sequence of machine control steps.
GetMillingActRunner()
Gets the current milling act runner instance.
public MachiningActRunner GetMillingActRunner()
Returns
- MachiningActRunner
The current milling act runner instance.
ProcAct(IAct, MachiningSession, IMachiningService, ISentenceCarrier, CancellationToken, StepDiagnosticProgress)
Processes an act with the given parameters.
public IEnumerable<object> ProcAct(IAct act, MachiningSession machiningSession, IMachiningService host, ISentenceCarrier sourceCommand, CancellationToken cancellationToken, StepDiagnosticProgress stepDiagnosticProgress)
Parameters
actIActThe act to process.
machiningSessionMachiningSessionThe milling session.
hostIMachiningServiceThe milling step host.
sourceCommandISentenceCarrierThe source command.
cancellationTokenCancellationTokenThe cancellation token.
stepDiagnosticProgressStepDiagnosticProgressProgress sink for cutter-location strip / per-step updates.
Returns
- IEnumerable<object>
A sequence of processed objects.
ResetMillingStepLuggageDb(StepDiagnosticProgress, IProgress<IMessage>)
Resets the milling step luggage database.
public void ResetMillingStepLuggageDb(StepDiagnosticProgress stepDiagnosticProgress, IProgress<IMessage> messageHost)
Parameters
stepDiagnosticProgressStepDiagnosticProgressThe step-aligned IMessage-channel sink.
messageHostIProgress<IMessage>Sink-agnostic IMessage host; injected by the caller, may be null outside a session.
ResetStateAndClStrip(StepDiagnosticProgress, IProgress<IMessage>)
Resets the state and cutter location strip.
public void ResetStateAndClStrip(StepDiagnosticProgress stepDiagnosticProgress, IProgress<IMessage> messageHost)
Parameters
stepDiagnosticProgressStepDiagnosticProgressThe step-aligned IMessage-channel sink.
messageHostIProgress<IMessage>Sink-agnostic IMessage host; injected by the caller, may be null outside a session.
UpdateByMachiningChain()
Update By MachiningChain. Internal Use Only.
public void UpdateByMachiningChain()
UpdateByMachiningEquipment()
Update By Hi.MachiningProcs.MachiningActRunner.MachiningEquipment. Internal Use Only.
public void UpdateByMachiningEquipment()
WaitAll()
Waits for all pending operations to complete.
public void WaitAll()
WarnIfCurrentToolCutterGeometryUnreasonable(MachiningSession, StepDiagnosticProgress, int?)
Emit one-shot session ConfigurationErrors naming the root cause when the
currently equipped tool's MillingCutter has an unreasonable
upper-beam / shank geometry (see
GetUpperBeamGeometryIssues()) — e.g. an
ExtendedCylinder beam whose FullLength sits below the flute height.
Before this check, such a setting surfaced only as a per-step
NullReferenceException cascade inside the thermal physics, with nothing
naming the beam. Additionally emits a Cutter-Shank–ThermalModelUnavailable
ConfigurationWarning when the shank thermal model cannot be built for a
reason no geometry issue names (e.g. no beam configured at all) — this is the
once-per-tool announcement of the silent per-step fallback in
MillingTemperatureUtil.GetStepTemperature, which is deliberately quiet at
the fallback site to avoid per-step message flooding. Gated by
EnablePhysics; deduped per tool reference
via WarnedCutterGeometryTools, mirroring
WarnIfCurrentToolFluteMaterialMissing(MachiningSession, StepDiagnosticProgress, int?) (same two emission points:
each IActTooling and BeginSession).
public void WarnIfCurrentToolCutterGeometryUnreasonable(MachiningSession machiningSession, StepDiagnosticProgress stepDiagnosticProgress, int? toolId = null)
Parameters
machiningSessionMachiningSessionstepDiagnosticProgressStepDiagnosticProgresstoolIdint?
WarnIfCurrentToolFluteMaterialMissing(MachiningSession, StepDiagnosticProgress, int?)
Emit a one-shot session warning if the currently equipped
Hi.MachiningProcs.MachiningActRunner.MachiningEquipment.MachiningTool is a MillingCutter
without a FluteMaterial. Gated by
EnablePhysics; deduped per tool reference via
WarnedFluteMaterialMissingTools so each offending
tool is mentioned at most once per session. Pass toolId when
known (e.g. from an IActTooling) and the warning will name the ID;
omit it (the BeginSession path) and the warning falls back to “the currently
equipped tool” — the equipped tool may have been set externally and not appear
in MachiningToolHouse, so reverse-looking up an ID is unreliable
and reference equality is the right unit of dedup anyway.
public void WarnIfCurrentToolFluteMaterialMissing(MachiningSession machiningSession, StepDiagnosticProgress stepDiagnosticProgress, int? toolId = null)
Parameters
machiningSessionMachiningSessionstepDiagnosticProgressStepDiagnosticProgresstoolIdint?
Events
MachiningStepBuilt
event to configure steps. The first parameter is the previous step; the second parameter is the current step. The previous step is null if no previous step exists.
public event MachiningActRunner.MachiningStepBuiltDelegate MachiningStepBuilt
Event Type
UiPostStepAction
Event raised after each step for UI updates. This is for internal use only.
public event Action<MachiningStep> UiPostStepAction