Table of Contents

Class ObjectModel

Namespace
DuetAPI.ObjectModel
Assembly
DuetAPI.dll

Representation of the Duet3D object model

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

Constructors

ObjectModel()

public ObjectModel()

Properties

Boards

List of connected boards

public StaticModelCollection<Board> Boards { get; }

Property Value

StaticModelCollection<Board>

Remarks

The first item represents the main board

See Also

Directories

Information about the individual directories

public Directories Directories { get; }

Property Value

Directories

Remarks

This may not be available in RepRapFirmware if no mass storages are available

Fans

List of configured fans

[Live]
public StaticModelCollection<Fan?> Fans { get; }

Property Value

StaticModelCollection<Fan>
See Also

Global

Dictionary of global variables vs JSON values

public JsonModelDictionary Global { get; }

Property Value

JsonModelDictionary

Remarks

When DSF attempts to reconnect to RRF, this may be set to null to clear the contents

Heat

Information about the heat subsystem

[Live]
public Heat Heat { get; }

Property Value

Heat

Inputs

Information about every available G/M/T-code channel

public Inputs Inputs { get; }

Property Value

Inputs

Job

Information about the current job

[Live]
public Job Job { get; }

Property Value

Job

LedStrips

List of configured LED strips

public StaticModelCollection<LedStrip> LedStrips { get; }

Property Value

StaticModelCollection<LedStrip>
See Also

Limits

Machine configuration limits

[Verbose]
public Limits Limits { get; }

Property Value

Limits

Messages

Generic messages that do not belong explicitly to codes being executed. This includes status messages, generic errors and outputs generated by M118

[SbcProperty(false)]
public MessageCollection Messages { get; }

Property Value

MessageCollection
See Also

Move

Information about the move subsystem

[Live]
public Move Move { get; }

Property Value

Move

Network

Information about connected network adapters

public Network Network { get; }

Property Value

Network

Plugins

Dictionary of loaded plugins where each key is the plugin identifier

[SbcProperty(false)]
public StaticModelDictionary<Plugin> Plugins { get; }

Property Value

StaticModelDictionary<Plugin>

Remarks

This is only populated by DSF in SBC mode, however it may be populated manually as well in standalone mode. Values in this dictionary cannot become null. If a value is changed to null, the corresponding item is deleted

SBC

Information about the SBC which Duet Software Framework is running on. This is null if the system is operating in standalone mode

[SbcProperty(false)]
public SBC? SBC { get; set; }

Property Value

SBC

Sensors

Information about connected sensors including Z-probes and endstops

[Live]
public Sensors Sensors { get; }

Property Value

Sensors

Spindles

List of configured CNC spindles

[Live]
public StaticModelCollection<Spindle?> Spindles { get; }

Property Value

StaticModelCollection<Spindle>
See Also

State

Information about the machine state

[Live]
public State State { get; }

Property Value

State

Tools

List of configured tools

[Live]
public StaticModelCollection<Tool?> Tools { get; }

Property Value

StaticModelCollection<Tool>
See Also

Volumes

List of available mass storages

[SbcProperty(true)]
public StaticModelCollection<Volume> Volumes { get; }

Property Value

StaticModelCollection<Volume>
See Also

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

ToString()

Convert this instance to a JSON text

public override string ToString()

Returns

string

JSON object

ToUtf8Json()

Serialize this instance to a UTF-8 string

public byte[] ToUtf8Json()

Returns

byte[]

UpdateFromFirmwareJson(string?, JsonElement, int, bool)

Update a specific key of this instance from a given JSON element as provided by the firmware

public bool UpdateFromFirmwareJson(string? key, JsonElement jsonElement, int offset = 0, bool last = true)

Parameters

key string

Property name to update

jsonElement JsonElement

Element to update this intance from

offset int

Index offset

last bool

Whether this is the last update

Returns

bool

Whether the key could be updated

UpdateFromFirmwareJsonReader(string?, ref Utf8JsonReader, int, bool)

Update a specific key of this instance from a given JSON reader as provided by the firmware

public bool UpdateFromFirmwareJsonReader(string? key, ref Utf8JsonReader reader, int offset = 0, bool last = true)

Parameters

key string

Property name to update

reader Utf8JsonReader

JSON reader

offset int

Index offset

last bool

Whether this is the last update. May be used to flag whether move.axes is about to be updated, too

Returns

bool

Whether the key could be updated

UpdateFromJson(string, JsonElement)

Update a specific key of this instance from a given JSON element

public bool UpdateFromJson(string key, JsonElement jsonElement)

Parameters

key string

Property name to update

jsonElement JsonElement

Element to update this intance from

Returns

bool

Whether the key could be updated

UpdateFromJson(JsonElement)

Update this instance from a given JSON element

public bool UpdateFromJson(JsonElement jsonElement)

Parameters

jsonElement JsonElement

Element to update this intance from

Returns

bool

Whether the key could be updated

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(string, ref Utf8JsonReader)

Update a specific key of this instance from a given JSON reader

public bool UpdateFromJsonReader(string key, ref Utf8JsonReader reader)

Parameters

key string

Property name to update

reader Utf8JsonReader

JSON reader

Returns

bool

Whether the key could be updated

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

Events

OnDeserializationFailed

Static event to be called when the deserialization of a property failed. If an event handler is assigned, potential JsonExceptions are suppressed and the event is called instead

public static event DeserializationFailedEventHandler? OnDeserializationFailed

Event Type

DeserializationFailedEventHandler