Table of Contents

Class SessionMessageHost

Namespace
Hi.MachiningProcs
Assembly
HiMech.dll

Represents a host for managing milling messages with thread-safe operations and stable index tracking.

public class SessionMessageHost : IMessageHost
Inheritance
SessionMessageHost
Implements
Inherited Members
Extension Methods

Properties

IsStableIndexAlwaysAtEnd

Gets or sets whether the stable index should always be at the end of the collection.

public bool IsStableIndexAlwaysAtEnd { get; set; }

Property Value

bool

MessageCollection

Gets or sets the thread-safe collection of milling messages. The getter is for readonly. Do not edit the collection directly.

public SynList<MachiningMessage> MessageCollection { get; }

Property Value

SynList<MachiningMessage>

StableIndex

Gets or sets the stable index. No other data will be inserted before this index. The term stable means it is thread safe to access range from 0 to StableIndex(exclusive).

public int StableIndex { get; }

Property Value

int

Methods

Add(object)

Adds a new entry to the message collection.

public object Add(object entry)

Parameters

entry object

The entry to add.

Returns

object

The added milling message.

Clear()

Clears all messages from the collection.

public void Clear()

GenAlwaysStableTorch(bool)

Generates a new SessionMessageHost.AlwaysStableTorch instance.

public SessionMessageHost.AlwaysStableTorch GenAlwaysStableTorch(bool isStableIndexAlwaysAtEnd)

Parameters

isStableIndexAlwaysAtEnd bool

Whether the index should always be stable.

Returns

SessionMessageHost.AlwaysStableTorch

A new SessionMessageHost.AlwaysStableTorch instance.

GetSourceCommand(MachiningMessage)

Retrieves the source command associated with the specified machining message.

public ISourceCommand GetSourceCommand(MachiningMessage machiningMessage)

Parameters

machiningMessage MachiningMessage

The machining message to find the source command for.

Returns

ISourceCommand

The source command that generated the message, or null if not found.

PopAlwaysStable()

Pops the previous stable index state.

public void PopAlwaysStable()

PushAlwaysStable(bool)

Pushes the current stable index state and sets a new state.

public void PushAlwaysStable(bool isStableIndexAlwaysAtEnd)

Parameters

isStableIndexAlwaysAtEnd bool

The new stable index state.

SetStableIndexToEnd()

Sets the StableIndex to the end of the collection.

public void SetStableIndexToEnd()

Events

CollectionCleared

Event raised when the collection is cleared.

public event Action CollectionCleared

Event Type

Action

CollectionItemAdded

Event raised when a new milling message is added to the collection.

public event Action<SessionMessagePack> CollectionItemAdded

Event Type

Action<SessionMessagePack>

CollectionItemChanged

Event raised when a collection item is changed.

public event Action CollectionItemChanged

Event Type

Action