Table of Contents

Class MCodeEffects

Namespace
Hi.NcParsers.Dependencys
Assembly
HiMech.dll

What one machine-declared M-code does. Real-machine OEM M-codes are frequently composite — e.g. an M13 that means “spindle CW + flood coolant on” — so a declaration carries every effect the code performs rather than a single meaning, and additionally an UnmodeledNote for the parts this simulation does not model. Declaring only the known parts and staying loud about the rest keeps a composite code from being half-consumed silently. Stored per machine in MCodeDeclarations and consumed by MCodeExpansionSyntax, which expands the declared code into the canonical ISO flags the regular consumers already understand.

public class MCodeEffects
Inheritance
MCodeEffects
Inherited Members
Extension Methods

Properties

CoolantMode

Coolant mode the code commands (expands to M07/M08/M09): one of Mist, Flood, Off. null/empty when the code does not touch coolant.

public string CoolantMode { get; set; }

Property Value

string

IsEmpty

True when the declaration carries no effect and no note — such an entry means “consume this code silently; it is irrelevant to simulation”.

public bool IsEmpty { get; }

Property Value

bool

IsSpindleDirectionOnly

True when SpindleDirection is the declaration's sole content. The two consumption paths partition on this: only such declarations resolve through TryResolveDirection(string, out SpindleDirection) (whose caller consumes the whole flag in place, preserving legacy behavior), and MCodeExpansionSyntax deliberately skips them and expands only composite declarations, so no effect is swallowed and nothing is translated twice.

public bool IsSpindleDirectionOnly { get; }

Property Value

bool

IsToolChange

The code performs a tool change (expands to M06) — the machine-configurable trigger real controllers declare via e.g. Siemens MD22560 $MC_TOOL_CHANGE_M_CODE.

public bool IsToolChange { get; set; }

Property Value

bool

SpindleDirection

Spindle direction the code commands (expands to M03/M04/M05), or null when the code does not touch the spindle.

public SpindleDirection? SpindleDirection { get; set; }

Property Value

SpindleDirection?

UnmodeledNote

Free-text description of what the code additionally does on the real machine that this simulation does not model (e.g. “chip conveyor forward”). When set, consuming the code emits one informational diagnostic per occurrence instead of staying silent — a declaration must not downgrade the visible Parsing–Unconsumed warning into nothing.

public string UnmodeledNote { get; set; }

Property Value

string

Methods

Clone()

Returns an independent copy of this declaration.

public MCodeEffects Clone()

Returns

MCodeEffects

NormalizeCoolantMode(string)

Maps a raw coolant-mode string to the canonical Coolant constant (case-insensitive), or null when the value names no known mode.

public static string NormalizeCoolantMode(string value)

Parameters

value string

Returns

string