Table of Contents

Class State

Namespace
DuetAPI.ObjectModel
Assembly
DuetAPI.dll

Information about the machine state

public class State : ModelObject, INotifyPropertyChanging, IStaticModelObject, IModelObject, ICloneable, INotifyPropertyChanged
Inheritance
State
Implements
Inherited Members

Constructors

State()

public State()

Properties

AtxPower

State of the ATX power pin (if controlled)

public bool? AtxPower { get; set; }

Property Value

bool?

AtxPowerPort

Port of the ATX power pin or null if not assigned

public string? AtxPowerPort { get; set; }

Property Value

string

Beep

Information about a requested beep or null if none is requested

public BeepRequest? Beep { get; set; }

Property Value

BeepRequest

CurrentTool

Number of the currently selected tool or -1 if none is selected

[Live]
public int CurrentTool { get; set; }

Property Value

int

DeferredPowerDown

When provided it normally has value 0 normally and 1 when a deferred power down is pending

public bool? DeferredPowerDown { get; set; }

Property Value

bool?

Remarks

It is only available after power switching has been enabled by M80 or M81

DisplayMessage

Persistent message to display (see M117)

public string DisplayMessage { get; set; }

Property Value

string

GpOut

List of general-purpose output ports

public StaticModelCollection<GpOutputPort?> GpOut { get; }

Property Value

StaticModelCollection<GpOutputPort>
See Also

LaserPwm

Laser PWM of the next commanded move (0..1) or null if not applicable

[Live]
public float? LaserPwm { get; set; }

Property Value

float?

LogFile

Log file being written to or null if logging is disabled

[SbcProperty(true)]
public string? LogFile { get; set; }

Property Value

string

LogLevel

Current log level

[SbcProperty(true)]
public EventLogLevel LogLevel { get; set; }

Property Value

EventLogLevel

MachineMode

Current mode of operation

public MachineMode MachineMode { get; set; }

Property Value

MachineMode

MacroRestarted

Indicates if the current macro file was restarted after a pause

public bool MacroRestarted { get; set; }

Property Value

bool

MessageBox

Details about a requested message box or null if none is requested

public MessageBox? MessageBox { get; set; }

Property Value

MessageBox

MsUpTime

Millisecond fraction of UpTime

[Live]
public int MsUpTime { get; set; }

Property Value

int

NextTool

Number of the next tool to be selected

[Obsolete("use move.motionSystems[].nextTool instead")]
public int NextTool { get; set; }

Property Value

int

PluginsStarted

This value is set to true when the plugins have been started

[SbcProperty(false)]
public bool PluginsStarted { get; set; }

Property Value

bool

PowerFailScript

Script to execute when the power fails

public string PowerFailScript { get; set; }

Property Value

string

PreviousTool

Number of the previous tool

[Obsolete("use move.motionSystems[].previousTool instead")]
public int PreviousTool { get; set; }

Property Value

int

RestorePoints

List of restore points

[Obsolete("use move.motionSystems[].restorePoints instead")]
public StaticModelCollection<RestorePoint> RestorePoints { get; }

Property Value

StaticModelCollection<RestorePoint>

StartupError

First error on start-up or null if there was none

[SbcProperty(true)]
public StartupError? StartupError { get; set; }

Property Value

StartupError

Status

Current state of the machine

[Live]
public MachineStatus Status { get; set; }

Property Value

MachineStatus

ThisActive

Shorthand for inputs[state.thisInput].active

[Verbose]
public bool? ThisActive { get; set; }

Property Value

bool?

ThisInput

Index of the current G-code input channel (see Inputs)

[Verbose]
public int? ThisInput { get; set; }

Property Value

int?

Remarks

This is primarily intended for macro files to determine on which G-code channel it is running. The value of this property is always null in object model queries

Time

Internal date and time in RepRapFirmware or null if unknown

[Live]
[JsonConverter(typeof(JsonOptionalShortDateTimeConverter))]
public DateTime? Time { get; set; }

Property Value

DateTime?

UpTime

How long the machine has been running (in s)

[Live]
public int UpTime { get; set; }

Property Value

int

Methods

Assign(IStaticModelObject)

Assign the properties from another instance. This is required to update model properties which do not have a setter

public void Assign(IStaticModelObject from)

Parameters

from IStaticModelObject

Other instance

Clone()

Clone this instance

public object Clone()

Returns

object

Cloned instance

Remarks

This method is auto-generated

UpdateFromJson(JsonElement, bool)

Update this instance from a given JSON element

public void UpdateFromJson(JsonElement jsonElement, bool ignoreSbcProperties)

Parameters

jsonElement JsonElement

Element to update this intance from

ignoreSbcProperties bool

Whether SBC properties are ignored

Remarks

This method is auto-generated

Exceptions

JsonException

Failed to deserialize data

UpdateFromJsonReader(ref Utf8JsonReader, bool)

Update this instance from a given JSON element

public void UpdateFromJsonReader(ref Utf8JsonReader reader, bool ignoreSbcProperties)

Parameters

reader Utf8JsonReader

Reader to update this intance from

ignoreSbcProperties bool

Whether SBC properties are ignored

Remarks

This method is auto-generated

Exceptions

JsonException

Failed to deserialize data