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
impl PrinterStatus
Sourcepub fn from_state(state: &Value) -> Self
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.
Sourcepub fn timelapse_mode(&self) -> Option<&str>
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.
Sourcepub fn light_mode(&self, node: &str) -> Option<&str>
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.
Sourcepub fn real_chamber_temperature(
&self,
hardware: &HardwareFeatures,
) -> Option<f64>
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.
Sourcepub fn state(&self) -> Option<GcodeState>
pub fn state(&self) -> Option<GcodeState>
The parsed coarse job state, if a gcode_state was reported.
Trait Implementations§
Source§impl Clone for PrinterStatus
impl Clone for PrinterStatus
Source§fn clone(&self) -> PrinterStatus
fn clone(&self) -> PrinterStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PrinterStatus
impl Debug for PrinterStatus
Source§impl Default for PrinterStatus
impl Default for PrinterStatus
Source§fn default() -> PrinterStatus
fn default() -> PrinterStatus
Source§impl<'de> Deserialize<'de> for PrinterStatus
impl<'de> Deserialize<'de> for PrinterStatus
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for PrinterStatus
impl PartialEq for PrinterStatus
Source§fn eq(&self, other: &PrinterStatus) -> bool
fn eq(&self, other: &PrinterStatus) -> bool
self and other values to be equal, and is used by ==.