Class Code
Implementation of the Code command
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: DuetControlServer.Commands
Assembly: DuetControlServer.dll
Syntax
public sealed class Code : Code, IConnectionCommand
Constructors
Code()
Constructor of a new code
Declaration
public Code()
Code(String)
Constructor of a new code which also parses the given text-based G/M/T-code
Declaration
public Code(string code)
Parameters
Type | Name | Description |
---|---|---|
System.String | code |
Fields
FileLocks
Lock around the files being written
Declaration
public static readonly AsyncLock[] FileLocks
Field Value
Type | Description |
---|---|
Nito.AsyncEx.AsyncLock[] |
FilesBeingWritten
Current stream writer of the files being written to (M28/M29)
Declaration
public static readonly StreamWriter[] FilesBeingWritten
Field Value
Type | Description |
---|---|
System.IO.StreamWriter[] |
Properties
Connection
Source connection of this command
Declaration
public Connection Connection { get; set; }
Property Value
Type | Description |
---|---|
Connection |
Methods
CancelPending(CodeChannel)
Cancel pending codes of the given channel
Declaration
public static void CancelPending(CodeChannel channel)
Parameters
Type | Name | Description |
---|---|---|
CodeChannel | channel | Channel to cancel codes from |
EmulatingMarlin()
Check if Marlin is being emulated
Declaration
public async Task<bool> EmulatingMarlin()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | True if Marlin is being emulated |
Execute()
Run an arbitrary G/M/T-code and wait for it to finish
Declaration
public override Task<Message> Execute()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Message> | Result of the code |
Overrides
DuetAPI.Commands.Command<DuetAPI.ObjectModel.Message>.Execute()
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Code has been cancelled |
Reset()
Resets more Code fields
Declaration
public override void Reset()