Class ChannelProcessor
Class delegating parallel G/M/T-code execution for a single code channel. Every instance holds the code pipeline elements through which incoming G/M/T-codes are sent. Note that code files and events disrupting the code flow require their own stack level to maintain the correct order of code execution.
Inherited Members
Namespace: DuetControlServer.Codes
Assembly: DuetControlServer.dll
Syntax
public class ChannelProcessorConstructors
ChannelProcessor(CodeChannel)
Constructor of this class
Declaration
public ChannelProcessor(CodeChannel channel)Parameters
| Type | Name | Description | 
|---|---|---|
| CodeChannel | channel | 
Fields
Channel
Channel of this pipeline
Declaration
public readonly CodeChannel ChannelField Value
| Type | Description | 
|---|---|
| CodeChannel | 
Logger
Logger instance
Declaration
public readonly Logger LoggerField Value
| Type | Description | 
|---|---|
| Logger | 
Methods
Diagnostics(StringBuilder)
Get diagnostics from this pipeline
Declaration
public void Diagnostics(StringBuilder builder)Parameters
| Type | Name | Description | 
|---|---|---|
| StringBuilder | builder | String builder to write to | 
FlushAsync(Code, bool, bool)
Wait for all pending codes on the same stack level as the given code to finish. By default this replaces all expressions as well for convenient parsing by the code processors.
Declaration
public Task<bool> FlushAsync(Code code, bool evaluateExpressions = true, bool evaluateAll = true)Parameters
| Type | Name | Description | 
|---|---|---|
| Code | code | Code waiting for the flush | 
| bool | evaluateExpressions | Evaluate all expressions when pending codes have been flushed | 
| bool | evaluateAll | Evaluate the expressions or only SBC fields if evaluateExpressions is set to true | 
Returns
| Type | Description | 
|---|---|
| Task<bool> | Whether the codes have been flushed successfully | 
FlushAsync(CodeFile)
Wait for all pending codes on the same stack level as the given file to finish
Declaration
public Task<bool> FlushAsync(CodeFile file)Parameters
| Type | Name | Description | 
|---|---|---|
| CodeFile | file | Code file | 
Returns
| Type | Description | 
|---|---|
| Task<bool> | Whether the codes have been flushed successfully | 
FlushAsync(bool)
Wait for all pending codes to finish
Declaration
public Task<bool> FlushAsync(bool flushAll)Parameters
| Type | Name | Description | 
|---|---|---|
| bool | flushAll | Whether to flush all states | 
Returns
| Type | Description | 
|---|---|
| Task<bool> | Whether the codes have been flushed successfully | 
IsIdle(Code?)
Check if all stages starting with a certain one are idle
Declaration
public bool IsIdle(Code? code = null)Parameters
| Type | Name | Description | 
|---|---|---|
| Code | code | Optional code requesting the check | 
Returns
| Type | Description | 
|---|---|
| bool | True if the pipeline is empty | 
Pop()
Pop the last state from the stack
Declaration
public void Pop()Push(CodeFile?)
Push a new state on the stack
Declaration
public PipelineStackItem Push(CodeFile? file)Parameters
| Type | Name | Description | 
|---|---|---|
| CodeFile | file | 
Returns
| Type | Description | 
|---|---|
| PipelineStackItem | New pipeline state of the firmware for the SPI connector | 
Run()
Lifecycle of this pipeline
Declaration
public Task Run()Returns
| Type | Description | 
|---|---|
| Task | Asynchronous task | 
SetJobFile(CodeFile?)
Set the job file of this channel
Declaration
public void SetJobFile(CodeFile? file)Parameters
| Type | Name | Description | 
|---|---|---|
| CodeFile | file | Job file | 
WriteCode(Code, PipelineStage)
Execute a given code on this pipeline stage. This should not be used unless the corresponding code channel is unbounded
Declaration
public void WriteCode(Code code, PipelineStage stage)Parameters
| Type | Name | Description | 
|---|---|---|
| Code | code | Code to enqueue | 
| PipelineStage | stage | 
WriteCodeAsync(Code, PipelineStage)
Execute a given code on a given pipeline stage
Declaration
public ValueTask WriteCodeAsync(Code code, PipelineStage stage)Parameters
| Type | Name | Description | 
|---|---|---|
| Code | code | Code to enqueue | 
| PipelineStage | stage | Stage level to enqueue it at | 
Returns
| Type | Description | 
|---|---|
| ValueTask |