Skip to main content

PrinterStatus

Struct PrinterStatus 

Source
pub struct PrinterStatus {
Show 51 fields pub gcode_state: Option<String>, pub print_error: Option<i64>, pub error: Option<DeviceError>, pub mc_percent: Option<i64>, pub layer_num: Option<i64>, pub total_layer_num: Option<i64>, pub remaining_time_min: Option<i64>, pub stg_cur: Option<i64>, pub stage: Option<String>, pub home_flag: Option<i64>, pub nozzle_temper: Option<f64>, pub nozzle_target: Option<f64>, pub bed_temper: Option<f64>, pub bed_target: Option<f64>, pub chamber_temper_raw: Option<f64>, pub cooling_fan_speed: Option<i64>, pub spd_lvl: Option<i64>, pub subtask_name: Option<String>, pub filament: Option<Filament>, pub lights: Vec<LightReport>, pub ipcam: Option<Ipcam>, pub big_fan1_speed: Option<i64>, pub big_fan2_speed: Option<i64>, pub heatbreak_fan_speed: Option<i64>, pub fan_gear: Option<i64>, pub spd_mag: Option<i64>, pub gcode_file: Option<String>, pub gcode_file_prepare_percent: Option<i64>, pub mc_print_stage: Option<i64>, pub mc_print_sub_stage: Option<i64>, pub mc_print_line_number: Option<i64>, pub print_type: Option<String>, pub stg: Vec<i64>, pub nozzle_diameter: Option<String>, pub nozzle_type: Option<String>, pub sdcard: Option<bool>, pub ams_status: Option<i64>, pub ams_rfid_status: Option<i64>, pub hw_switch_state: Option<i64>, pub wifi_signal: Option<String>, pub task_id: Option<String>, pub subtask_id: Option<String>, pub project_id: Option<String>, pub profile_id: Option<String>, pub sequence_id: Option<String>, pub lifecycle: Option<String>, pub ams: Option<Ams>, pub upgrade: Option<Upgrade>, pub online: Option<Online>, pub upload: Option<Upload>, pub hms: Vec<HmsAlert>,
}
Expand description

The fields of a printer print report that matter for monitoring.

Fields§

§gcode_state: Option<String>

Coarse job state, e.g. IDLE, RUNNING, PAUSE, FINISH, FAILED.

§print_error: Option<i64>

print_error code (0 = none).

§error: Option<DeviceError>

Typed view of a non-zero print_error (a device-level fault, distinct from HMS — observed: a failing SD card surfaced 0x0500C010 here while hms was empty). None when there is no active error.

§mc_percent: Option<i64>

Progress percentage (mc_percent).

§layer_num: Option<i64>

Current layer / total layers.

§total_layer_num: Option<i64>§remaining_time_min: Option<i64>

Remaining time in minutes (mc_remaining_time).

§stg_cur: Option<i64>

Current stage id (stg_cur). Read together with gcode_state: stage 0 is the no-special-stage default and appears while idle too.

§stage: Option<String>

Decoded name of stg_cur (e.g. auto_bed_leveling), or None for an unknown/future stage id. See crate::core::stage.

§home_flag: Option<i64>

home_flag bitfield (per-axis homed state); it changes during a home/move, so it’s one of the few report signals that reflect ad-hoc motion.

§nozzle_temper: Option<f64>

Nozzle / bed temperatures and their targets (°C).

§nozzle_target: Option<f64>§bed_temper: Option<f64>§bed_target: Option<f64>§chamber_temper_raw: Option<f64>

Raw chamber_temper value as reported. On A1/P1 this is emitted but is not a real sensor — call PrinterStatus::real_chamber_temperature for a value only when the model actually has a chamber sensor.

§cooling_fan_speed: Option<i64>

Part-cooling fan speed (cooling_fan_speed; arrives as a string).

§spd_lvl: Option<i64>

Active print-speed level (spd_lvl): 1 silent, 2 standard, 3 sport, 4 ludicrous. How a print_speed command is verified.

§subtask_name: Option<String>

Name of the running subtask/job (empty when idle).

§filament: Option<Filament>

The currently-loaded filament (the one the print uses), resolved from ams.tray_now → the matching AMS tray or the external spool. None when nothing is loaded or the report doesn’t carry AMS data.

§lights: Vec<LightReport>

All lights_report entries (each {node, mode}), e.g. chamber_light=off. This is the printer’s actual light state — distinct from a ledctrl ACK, which only confirms acceptance (observed: a faulty unit ACKs ledctrl but lights_report stays off). Look a node up with PrinterStatus::light_mode.

§ipcam: Option<Ipcam>

Camera/timelapse settings from the ipcam report node. None when the report carries no ipcam object.

§big_fan1_speed: Option<i64>

Aux/part fan #1 (big_fan1_speed).

§big_fan2_speed: Option<i64>

Chamber/second big fan (big_fan2_speed; 0 on the fanless-chamber A1).

§heatbreak_fan_speed: Option<i64>

Hotend/heatbreak fan (heatbreak_fan_speed). Dead → heat creep / jams.

§fan_gear: Option<i64>

Packed per-fan gear bitfield (fan_gear).

§spd_mag: Option<i64>

Feed-rate override percent (spd_mag, 100 = nominal); distinct from the named spd_lvl tier and what actually moves the ETA.

§gcode_file: Option<String>

Filename currently loaded/printing (gcode_file); None when idle.

§gcode_file_prepare_percent: Option<i64>

Pre-print file preparation/download progress (gcode_file_prepare_percent). Lets a viewer tell “preparing” from a stalled mc_percent == 0.

§mc_print_stage: Option<i64>

Coarse motion-controller phase (mc_print_stage), cross-checks stg_cur.

§mc_print_sub_stage: Option<i64>

Finer sub-phase within mc_print_stage (mc_print_sub_stage).

§mc_print_line_number: Option<i64>

Current gcode line number (mc_print_line_number); increments within a layer, so it is a fine-grained liveness/stall signal.

§print_type: Option<String>

Job source/type (print_type), e.g. idle / local / cloud.

§stg: Vec<i64>

Queue of upcoming stage ids (stg); stg_cur is the current one.

§nozzle_diameter: Option<String>

Installed nozzle diameter in mm (nozzle_diameter, e.g. 0.4).

§nozzle_type: Option<String>

Nozzle material (nozzle_type, e.g. stainless_steel / hardened).

§sdcard: Option<bool>

Whether an SD card is present/mounted (sdcard).

§ams_status: Option<i64>

Top-level AMS state machine (ams_status): idle/loading/unloading code.

§ams_rfid_status: Option<i64>

Top-level AMS RFID read state (ams_rfid_status).

§hw_switch_state: Option<i64>

Hardware switch / filament-presence / door sensor bits (hw_switch_state).

§wifi_signal: Option<String>

Wi-Fi signal strength (wifi_signal, e.g. -50dBm). The capture’s <redacted> sentinel is filtered to None.

§task_id: Option<String>

Cloud/print task id (task_id).

§subtask_id: Option<String>

Subtask id (subtask_id), pairs with subtask_name.

§project_id: Option<String>

Project id (project_id).

§profile_id: Option<String>

Slicing/print profile id (profile_id).

§sequence_id: Option<String>

The printer’s own report counter (sequence_id); detects dropped/reordered reports.

§lifecycle: Option<String>

Device lifecycle/build channel (lifecycle, e.g. product).

§ams: Option<Ams>

Full AMS inventory (all units & trays), built from ams + vt_tray. filament above remains a convenience pointer to the loaded tray.

§upgrade: Option<Upgrade>

Firmware-update availability/progress (upgrade_state).

§online: Option<Online>

Peripheral online state (online: AHB / RFID bus presence).

§upload: Option<Upload>

In-progress file upload/transfer (upload).

§hms: Vec<HmsAlert>

Decoded HMS alerts (the device’s primary fault/warning channel). Empty when healthy; separate from error/print_error. See crate::core::hms.

Implementations§

Source§

impl PrinterStatus

Source

pub fn from_state(state: &Value) -> Self

Extract a PrinterStatus from the merged report state (the object that contains the print key). Missing fields become None.

Source

pub fn timelapse_mode(&self) -> Option<&str>

The printer’s current timelapse setting (enable/disable) from the ipcam report node, if present. Used to verify an ipcam_timelapse command took effect.

Source

pub fn light_mode(&self, node: &str) -> Option<&str>

The mode (on/off) of a lights_report node (e.g. chamber_light), if reported. Used to verify a ledctrl command took effect.

Source

pub fn real_chamber_temperature( &self, hardware: &HardwareFeatures, ) -> Option<f64>

The chamber temperature only if the model has a real chamber sensor. Models that merely echo a synthetic chamber_temper (A1 / P1) get None.

Source

pub fn state(&self) -> Option<GcodeState>

The parsed coarse job state, if a gcode_state was reported.

Trait Implementations§

Source§

impl Clone for PrinterStatus

Source§

fn clone(&self) -> PrinterStatus

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PrinterStatus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PrinterStatus

Source§

fn default() -> PrinterStatus

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for PrinterStatus

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for PrinterStatus

Source§

fn eq(&self, other: &PrinterStatus) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for PrinterStatus

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for PrinterStatus

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more