Class MacroFile
Class representing a macro being executed
Implements
Inherited Members
Namespace: DuetControlServer.Files
Assembly: DuetControlServer.dll
Syntax
public sealed class MacroFile : CodeFile, IDisposable
Constructors
MacroFile(MacroFile, CodeChannel)
Copy constructor
Declaration
public MacroFile(MacroFile copyFrom, CodeChannel channel)
Parameters
Type | Name | Description |
---|---|---|
MacroFile | copyFrom | File to copy from |
CodeChannel | channel | Code channel to assign |
Properties
CancellationToken
Cancellation token that is triggered when the file is cancelled/aborted
Declaration
public CancellationToken CancellationToken { get; }
Property Value
Type | Description |
---|---|
CancellationToken |
IsAborted
Indicates if the macro file has been aborted
Declaration
public bool IsAborted { get; }
Property Value
Type | Description |
---|---|
bool |
IsConfig
Whether this file is config.g or config.g.bak
Declaration
public bool IsConfig { get; }
Property Value
Type | Description |
---|---|
bool |
IsConfigOverride
Whether this file is config-override.g
Declaration
public bool IsConfigOverride { get; }
Property Value
Type | Description |
---|---|
bool |
IsDsfConfig
Whether this file is dsf-config.g
Declaration
public bool IsDsfConfig { get; }
Property Value
Type | Description |
---|---|
bool |
IsExecuting
Indicates if the macro file is being executed
Declaration
public bool IsExecuting { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsNested
Indicates if this macro was started from a G/M/T-code
Declaration
public bool IsNested { get; }
Property Value
Type | Description |
---|---|
bool |
IsPausable
Indicates if this macro can be aborted on a pause request
Declaration
public bool IsPausable { get; set; }
Property Value
Type | Description |
---|---|
bool |
JustStarted
Indicates if the macro file has just started
Declaration
public bool JustStarted { get; set; }
Property Value
Type | Description |
---|---|
bool |
SourceConnection
IPC connection that (indirectly) requested this macro file
Declaration
public int SourceConnection { get; }
Property Value
Type | Description |
---|---|
int |
WasStarted
Indicates if the macro was ever started
Declaration
public bool WasStarted { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
Abort()
Abort this macro
Declaration
public void Abort()
Dispose()
Dispose this instance
Declaration
public override void Dispose()
Overrides
Open(string, string, CodeChannel, Code?, int)
Create a macro file for execution on the given channel
Declaration
public static MacroFile? Open(string fileName, string physicalFile, CodeChannel channel, Code? startCode = null, int sourceConnection = 0)
Parameters
Type | Name | Description |
---|---|---|
string | fileName | Filename of the macro |
string | physicalFile | Physical path of the macro |
CodeChannel | channel | Code requesting the macro |
Code | startCode | |
int | sourceConnection | Original IPC connection requesting this macro file |
Returns
Type | Description |
---|---|
MacroFile | Macro file or null if it could not be opened |
Start(bool)
Start executing this macro file in the background
Declaration
public void Start(bool notifyFirmware = true)
Parameters
Type | Name | Description |
---|---|---|
bool | notifyFirmware |
WaitForFinishAsync()
Wait for this macro to finish asynchronously
Declaration
public Task WaitForFinishAsync()
Returns
Type | Description |
---|---|
Task | Asynchronous task |
Remarks
This task is always resolved and never cancelled