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
Beep
Information about a requested beep or null if none is requested
public BeepRequest? Beep { get; set; }
Property Value
CurrentTool
Number of the currently selected tool or -1 if none is selected
[Live]
public int CurrentTool { get; set; }
Property Value
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
GpOut
List of general-purpose output ports
public StaticModelCollection<GpOutputPort?> GpOut { get; }
Property Value
- 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
LogFile
Log file being written to or null if logging is disabled
[SbcProperty(true)]
public string? LogFile { get; set; }
Property Value
LogLevel
Current log level
[SbcProperty(true)]
public EventLogLevel LogLevel { get; set; }
Property Value
MachineMode
Current mode of operation
public MachineMode MachineMode { get; set; }
Property Value
MacroRestarted
Indicates if the current macro file was restarted after a pause
public bool MacroRestarted { get; set; }
Property Value
MessageBox
Details about a requested message box or null if none is requested
public MessageBox? MessageBox { get; set; }
Property Value
MsUpTime
Millisecond fraction of UpTime
[Live]
public int MsUpTime { get; set; }
Property Value
NextTool
Number of the next tool to be selected
[Obsolete("use move.motionSystems[].nextTool instead")]
public int NextTool { get; set; }
Property Value
PluginsStarted
This value is set to true when the plugins have been started
[SbcProperty(false)]
public bool PluginsStarted { get; set; }
Property Value
PowerFailScript
Script to execute when the power fails
public string PowerFailScript { get; set; }
Property Value
PreviousTool
Number of the previous tool
[Obsolete("use move.motionSystems[].previousTool instead")]
public int PreviousTool { get; set; }
Property Value
RestorePoints
List of restore points
[Obsolete("use move.motionSystems[].restorePoints instead")]
public StaticModelCollection<RestorePoint> RestorePoints { get; }
Property Value
StartupError
First error on start-up or null if there was none
[SbcProperty(true)]
public StartupError? StartupError { get; set; }
Property Value
Status
Current state of the machine
[Live]
public MachineStatus Status { get; set; }
Property Value
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
UpTime
How long the machine has been running (in s)
[Live]
public int UpTime { get; set; }
Property Value
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
fromIStaticModelObjectOther 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
jsonElementJsonElementElement to update this intance from
ignoreSbcPropertiesboolWhether 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
readerUtf8JsonReaderReader to update this intance from
ignoreSbcPropertiesboolWhether SBC properties are ignored
Remarks
This method is auto-generated
Exceptions
- JsonException
Failed to deserialize data