Table of Contents

Class InterceptInitMessage

Namespace
DuetAPI.Connection.InitMessages
Assembly
DuetAPI.dll

Enter interception mode Whenever a code is received, the connection must respond with one of

  • Cancel to cancel the code
  • Ignore to pass through the code without modifications
  • Resolve to resolve the current code and to return a message In addition the interceptor may issue custom commands once a code has been received
public sealed class InterceptInitMessage : ClientInitMessage
Inheritance
InterceptInitMessage
Inherited Members

Remarks

If this connection mode is used to implement new G/M/T-codes, always call the Flush command before further actions are started and make sure it returns true before the code is further processed. This step is mandatory to guarantee that the new code is executed when all other codes have finished and not when a code is being fed for the internal G-code buffer. If the flush command returns false, it is recommended to send Cancel to resolve the command. DCS follows the same pattern for internally processed codes, too. If a code from a macro file is intercepted, make sure to set the IsFromMacro flag if new codes are inserted, else they will be started when the macro file(s) have finished. This step is obsolete if a SimpleCode is inserted.

Constructors

InterceptInitMessage()

Creates a new init message instance

public InterceptInitMessage()

Properties

AutoEvaluateExpressions

Automatically evaluate expression parameters to their final values before sending it over to the client. This requires AutoFlush to be true and happens when the remaining codes have been processed.

public bool AutoEvaluateExpressions { get; set; }

Property Value

bool

AutoFlush

Automatically flush the code channel before notifying the client in case a code filter is specified

public bool AutoFlush { get; set; }

Property Value

bool

Remarks

This option makes extra Flush calls in the interceptor implementation obsolete. It is highly recommended to enable this in order to avoid potential deadlocks when dealing with macros! This option is only used if at least one filter is used

Channels

List of channel where codes may be intercepted. If the list is empty, all available channels are used

public List<CodeChannel> Channels { get; set; }

Property Value

List<CodeChannel>

Filters

List of G/M/T-codes to filter or Q for comments

public List<string> Filters { get; set; }

Property Value

List<string>

Remarks

This may only specify the code type and major/minor number (e.g. G1 or M105). Alternatively keyword types may be specified (e.g. if or elif). Asterisks are supported, too (e.g. T*)

InterceptionMode

Defines in what mode commands are supposed to be intercepted

public InterceptionMode InterceptionMode { get; set; }

Property Value

InterceptionMode

PriorityCodes

Defines if either regular or priority codes are supposed to be intercepted

public bool PriorityCodes { get; set; }

Property Value

bool
See Also