Table of Contents

Class MachiningSession

Namespace
Hi.MachiningProcs
Assembly
HiMech.dll

Represents a machining session that manages the execution and optimization of machining operations. Provides functionality for controlling the machining process, handling optimization options, and managing session state. Implements IDisposable to clean up SessionWriters on session end.

public class MachiningSession : IDisposable
Inheritance
MachiningSession
Implements
Inherited Members
Extension Methods

Properties

CurrentSourceCommand

Gets or sets the current source command being processed.

public IIndexedFileLine CurrentSourceCommand { get; set; }

Property Value

IIndexedFileLine

Data

Gets or sets the data dictionary for the player session.

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

Property Value

Dictionary<object, object>

IsNcOptOptionListUpdatedByStep

Internal Use Only.

public bool IsNcOptOptionListUpdatedByStep { get; set; }

Property Value

bool

NcOptOption

Gets or sets the NC optimization options for UI operations.

public NcOptOption NcOptOption { get; set; }

Property Value

NcOptOption

PacePlayee

Internal set only.

public PacePlayee PacePlayee { get; set; }

Property Value

PacePlayee

PostBlockScripts

Per-line scripts injected externally (without modifying NC files). Key: FileLineIndex of the NC block. Value: C# script text to execute after the NC block. Consumed by CsScriptEndSemantic.

public Dictionary<FileLineIndex, string> PostBlockScripts { get; }

Property Value

Dictionary<FileLineIndex, string>

PreBlockScripts

Per-line scripts injected externally (without modifying NC files). Key: FileLineIndex of the NC block. Value: C# script text to execute before the NC block. Consumed by CsScriptBeginSemantic.

public Dictionary<FileLineIndex, string> PreBlockScripts { get; }

Property Value

Dictionary<FileLineIndex, string>

SessionWriters

StreamWriters registered during the session (e.g. by diagnostic output methods). Key: relative output file path. Disposed automatically when the session ends.

public Dictionary<string, StreamWriter> SessionWriters { get; }

Property Value

Dictionary<string, StreamWriter>

StepIndexToNcOptOptionSortedList

Gets or sets the mapping of step indices to NC optimization options. For internal use only. Takes effect during internal optimization process.

public SortedList<int, NcOptOption> StepIndexToNcOptOptionSortedList { get; set; }

Property Value

SortedList<int, NcOptOption>

StepTaskBundle

Gets or sets the current step task bundle.

public MachiningParallelProc.StepTaskBundle StepTaskBundle { get; set; }

Property Value

MachiningParallelProc.StepTaskBundle

Methods

BeginPreserve()

Begins a preserve section in the optimization process.

public void BeginPreserve()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

EndPreserve()

Ends a preserve section in the optimization process.

public void EndPreserve()

Preserve()

Preserves one line of NC code in the optimization process.

public void Preserve()

RunMachiningStepBuilt(MachiningStep, MachiningStep)

Internal use only. Invokes MachiningStepBuilt.

public void RunMachiningStepBuilt(MachiningStep preStep, MachiningStep curStep)

Parameters

preStep MachiningStep
curStep MachiningStep

RunMachiningStepSelected(MachiningStep)

Internal use only. Invokes MachiningStepSelected.

public void RunMachiningStepSelected(MachiningStep machiningStep)

Parameters

machiningStep MachiningStep

RunSourcedActEntry(SourcedActEntry)

Internal use only. Invokes SourcedActEntry.

public void RunSourcedActEntry(SourcedActEntry entry)

Parameters

entry SourcedActEntry

RunSyntaxPieceRan(SyntaxPiece)

Internal use only. Invokes SyntaxPieceRan.

public void RunSyntaxPieceRan(SyntaxPiece syntaxPiece)

Parameters

syntaxPiece SyntaxPiece

UpdateNcOptOptionMapIfNeeded(int)

Updates the NC optimization option map if needed. Internal use only.

public bool UpdateNcOptOptionMapIfNeeded(int stepIndex)

Parameters

stepIndex int

The index of the step to update.

Returns

bool

True if the map was updated; otherwise, false.

Events

MachiningStepBuilt

Event triggered when a machining step is built.

public event MachiningActRunner.MachiningStepBuiltDelegate MachiningStepBuilt

Event Type

MachiningActRunner.MachiningStepBuiltDelegate

MachiningStepSelected

Event triggered when a machining step is selected.

public event Action<MachiningStep> MachiningStepSelected

Event Type

Action<MachiningStep>

OnCurrentLineEnd

Event raised when the current line ends. The event buffer is cleared on every line change.

public event Action<CancellationToken> OnCurrentLineEnd

Event Type

Action<CancellationToken>

SourcedActEntry

Event triggered for each SourcedActEntry produced during NC/CSV execution.

public event Action<SourcedActEntry> SourcedActEntry

Event Type

Action<SourcedActEntry>

SyntaxPieceRan

Event triggered when a syntax piece has been executed.

public event Action<SyntaxPiece> SyntaxPieceRan

Event Type

Action<SyntaxPiece>