Class InterceptInitMessage
Enter interception mode Whenever a code is received, the connection must respond with one of
Cancel to cancel the codeIgnore to pass through the code without modificationsResolve to resolve the current code and to return a message In addition the interceptor may issue custom commands once a code has been received
Inherited Members
Namespace: DuetAPI.Connection.InitMessages
Assembly: DuetAPI.dll
Syntax
public sealed class InterceptInitMessage : ClientInitMessage
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
Declaration
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.
Declaration
public bool AutoEvaluateExpressions { get; set; }
Property Value
Type | Description |
---|---|
bool |
AutoFlush
Automatically flush the code channel before notifying the client in case a code filter is specified
Declaration
public bool AutoFlush { get; set; }
Property Value
Type | Description |
---|---|
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!
Channels
List of channel where codes may be intercepted. If the list is empty, all available channels are used
Declaration
public List<CodeChannel> Channels { get; set; }
Property Value
Type | Description |
---|---|
List<CodeChannel> |
Filters
List of G/M/T-codes to filter or Q for comments
Declaration
public List<string> Filters { get; set; }
Property Value
Type | Description |
---|---|
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
Declaration
public InterceptionMode InterceptionMode { get; set; }
Property Value
Type | Description |
---|---|
InterceptionMode |
PriorityCodes
Defines if either regular or priority codes are supposed to be intercepted
Declaration
public bool PriorityCodes { get; set; }
Property Value
Type | Description |
---|---|
bool |