Table of Contents

Class SimpleCode

Namespace
DuetAPI.Commands
Assembly
DuetAPI.dll

Perform a simple G/M/T-code

[RequiredPermissions(SbcPermissions.CommandExecution)]
public class SimpleCode : Command<string>
Inheritance
SimpleCode
Derived
Inherited Members

Remarks

Internally the code passed is populated as a full Code instance and on completion its Result is transformed back into a basic string. This is useful for minimal extensions that do not require granular control of the code details. Except for certain cases, it is NOT recommended for usage in InterceptionMode because it renders the internal code buffer useless.

Constructors

SimpleCode()

public SimpleCode()

Properties

Channel

Destination channel

public CodeChannel Channel { get; set; }

Property Value

CodeChannel

Code

Code to parse and execute

public string Code { get; set; }

Property Value

string

ExecuteAsynchronously

Whether this code may be executed asynchronously. If set, the code reply is output as a generic message

public bool ExecuteAsynchronously { get; set; }

Property Value

bool

Methods

UpdateFromJson(JsonElement)

Update this instance from a given JSON element

public override void UpdateFromJson(JsonElement jsonElement)

Parameters

jsonElement JsonElement

Element to update this intance from

Remarks

This method is auto-generated

Exceptions

JsonException

Failed to deserialize data

UpdateFromJsonReader(ref Utf8JsonReader)

Update this instance from a given JSON element

public override void UpdateFromJsonReader(ref Utf8JsonReader reader)

Parameters

reader Utf8JsonReader

Reader to update this intance from

Remarks

This method is auto-generated

Exceptions

JsonException

Failed to deserialize data