Class SimpleCode
- Namespace
- DuetControlServer.Commands
- Assembly
- DuetControlServer.dll
Implementation of the SimpleCode command
public sealed class SimpleCode : SimpleCode, IConnectionCommand
- Inheritance
-
SimpleCode
- Implements
- Inherited Members
Constructors
SimpleCode(CodeFactory, ObjectModel, IHostApplicationLifetime)
Implementation of the SimpleCode command
public SimpleCode(CodeFactory codeFactory, ObjectModel model, IHostApplicationLifetime lifetime)
Parameters
codeFactoryCodeFactoryCode factory
modelObjectModelObject model
lifetimeIHostApplicationLifetimeHost application lifetime
Properties
Connection
Source connection of this command
public Connection? Connection { get; set; }
Property Value
IsFromFirmware
Indicates if the code comes from the firmware. Only used internally
[JsonIgnore]
public bool IsFromFirmware { get; set; }
Property Value
Methods
ExecuteAsync(CancellationToken)
Converts simple G/M/T-codes to a regular Code instances, executes them and returns the result as text
public override Task<string> ExecuteAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenOptional cancellation token
Returns
Exceptions
- OperationCanceledException
Code has been cancelled
ParseAsync()
Parse codes from the given input string asynchronously
public IAsyncEnumerable<Code> ParseAsync()
Returns
- IAsyncEnumerable<Code>
Parsed G/M/T-codes