#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/Utils/OrcaPrinterAgent.hpp>
Public Member Functions | |
| OrcaPrinterAgent (std::string log_dir) | |
| ~OrcaPrinterAgent () override | |
| void | set_cloud_agent (std::shared_ptr< ICloudServiceAgent > cloud) override |
| int | send_message (std::string dev_id, std::string json_str, int qos, int flag) override |
| int | connect_printer (const PrinterConnectionParams ¶ms) override |
| int | disconnect_printer () override |
| int | send_message_to_printer (std::string dev_id, std::string json_str, int qos, int flag) override |
| bool | start_discovery (bool start, bool sending) override |
| int | bind_detect (std::string dev_ip, std::string sec_link, detectResult &detect) override |
| int | set_server_callback (OnServerErrFn fn) override |
| std::string | get_user_selected_machine () override |
| int | set_user_selected_machine (std::string dev_id) override |
| AgentInfo | get_agent_info () override |
| int | start_print (PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, OnWaitFn wait_fn) override |
| int | start_local_print_with_record (PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, OnWaitFn wait_fn) override |
| int | start_send_gcode_to_sdcard (PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, OnWaitFn wait_fn) override |
| int | start_local_print (PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn) override |
| int | start_sdcard_print (PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn) override |
| int | set_on_ssdp_msg_fn (OnMsgArrivedFn fn) override |
| int | set_on_printer_connected_fn (OnPrinterConnectedFn fn) override |
| int | set_on_subscribe_failure_fn (GetSubscribeFailureFn fn) override |
| int | set_on_message_fn (OnMessageFn fn) override |
| int | set_on_user_message_fn (OnMessageFn fn) override |
| int | set_on_local_connect_fn (OnLocalConnectedFn fn) override |
| int | set_on_local_message_fn (OnMessageFn fn) override |
| int | set_queue_on_main_fn (QueueOnMainFn fn) override |
| virtual int | command_ams_refresh_rfid (std::string, int, int, int, bool) |
| virtual int | command_ams_calibrate (std::string, int, int, bool) |
| virtual int | command_ams_select_tray (std::string, std::string, int, bool) |
| virtual int | command_start_camera (std::string) |
| virtual int | command_xyz_abs (std::string dev_id, int sequence_id, bool lan_mode) |
| virtual int | command_auto_leveling (std::string dev_id, int sequence_id, bool lan_mode) |
| virtual int | command_go_home (std::string dev_id, bool is_printing, bool supports_mqtt_homing, int sequence_id, bool lan_mode) |
| virtual int | command_set_bed (std::string dev_id, int temp, bool supports_mqtt_bed_ctrl, int sequence_id, bool lan_mode) |
| virtual int | command_set_nozzle (std::string dev_id, int temp, int sequence_id, bool lan_mode) |
| virtual int | command_axis_control (std::string dev_id, std::string axis, double unit, double input_val, int speed, bool is_core_xy, bool supports_mqtt_axis_control, int sequence_id, bool lan_mode) |
| virtual std::string | default_lan_username () const |
| virtual int | check_cert () |
| virtual void | install_device_cert (std::string dev_id, bool lan_only) |
| virtual int | ping_bind (std::string ping_code) |
| virtual int | bind (std::string dev_ip, std::string dev_id, std::string dev_model, std::string sec_link, std::string timezone, bool improved, OnUpdateStatusFn update_fn) |
| virtual int | unbind (std::string dev_id) |
| virtual int | request_bind_ticket (std::string *ticket) |
| virtual int | get_hms_snapshot (std::string dev_id, std::string file_name, std::function< void(std::string, int)> callback) |
| virtual int | start_subscribe (std::string module) |
| virtual int | stop_subscribe (std::string module) |
| virtual int | add_subscribe (std::vector< std::string > dev_list) |
| virtual int | del_subscribe (std::vector< std::string > dev_list) |
| virtual FilamentSyncMode | get_filament_sync_mode () const |
| virtual CameraStreamMode | get_camera_stream_mode () const |
| virtual bool | fetch_filament_info (std::string dev_id, FilamentSyncMode sync_mode=FilamentSyncMode::pull) |
| virtual std::string | to_orca_filament_id (const std::string &printer_filament_id) const |
| virtual std::string | from_orca_filament_id (const std::string &orca_filament_id) const |
| virtual std::string | get_camera_url () const |
Static Public Member Functions | |
| static AgentInfo | get_agent_info_static () |
Private Member Functions | |
| int | publish_command_json (std::string dev_id, const nlohmann::json &j, bool lan_mode) |
Private Attributes | |
| std::string | log_dir |
| std::string | selected_machine |
| std::shared_ptr< ICloudServiceAgent > | m_cloud_agent |
| OnMsgArrivedFn | on_ssdp_msg_fn |
| OnPrinterConnectedFn | on_printer_connected_fn |
| GetSubscribeFailureFn | on_subscribe_failure_fn |
| OnMessageFn | on_message_fn |
| OnMessageFn | on_user_message_fn |
| OnLocalConnectedFn | on_local_connect_fn |
| OnMessageFn | on_local_message_fn |
| QueueOnMainFn | queue_on_main_fn |
| OnServerErrFn | on_server_err_fn |
| std::mutex | state_mutex |
OrcaPrinterAgent - Stub implementation for printer operations.
All printer-related operations are currently stubs that return success. Actual printer connectivity requires the BBL SDK or future Orca implementation.
|
explicit |
References log_dir.
|
overridedefault |
|
inlinevirtualinherited |
Subscribe to push streams for specific device identifiers.
Reimplemented in Slic3r::BBLPrinterAgent.
References BAMBU_NETWORK_SUCCESS.
|
inlinevirtualinherited |
Execute the multi-stage printer binding workflow.
Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
References BAMBU_NETWORK_SUCCESS.
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
overridevirtual |
Perform binding detection/handshake on a LAN printer.
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS.
|
inlinevirtualinherited |
Validate current user certificates for the printer.
Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
References BAMBU_NETWORK_SUCCESS.
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
inlinevirtualinherited |
Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
References ORCA_NETWORK_ERR_CMD_NOT_SUPPORTED.
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
inlinevirtualinherited |
Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
References ORCA_NETWORK_ERR_CMD_NOT_SUPPORTED.
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
inlinevirtualinherited |
Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
References ORCA_NETWORK_ERR_CMD_NOT_SUPPORTED.
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
inlinevirtualinherited |
Reimplemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
References publish_command_json().
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
inlinevirtualinherited |
Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
References publish_command_json().
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
inlinevirtualinherited |
Reimplemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
References publish_command_json().
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
inlinevirtualinherited |
Reimplemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
References publish_command_json().
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
inlinevirtualinherited |
Reimplemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
References publish_command_json().
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
inlinevirtualinherited |
Reimplemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
References ORCA_NETWORK_ERR_CMD_NOT_SUPPORTED.
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
inlinevirtualinherited |
Reimplemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
References publish_command_json().
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
overridevirtual |
Establish a direct LAN connection to a printer.
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS.
|
inlinevirtualinherited |
Default LAN account username for this agent's protocol, if it has a fixed one. Returns an empty string if the agent has no fixed default (e.g. caller must supply one).
Reimplemented in Slic3r::BBLPrinterAgent.
|
inlinevirtualinherited |
Remove device-level subscriptions.
Reimplemented in Slic3r::BBLPrinterAgent.
References BAMBU_NETWORK_SUCCESS.
|
overridevirtual |
Tear down the active LAN printer connection.
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS.
|
inlinevirtualinherited |
Refresh filament info from the printer synchronously. Should only be called when get_filament_sync_mode() returns FilamentSyncMode::pull. Populates the MachineObject's DevFilaSystem with fetched filament data.
Reimplemented in Slic3r::CrealityPrintAgent, Slic3r::MoonrakerPrinterAgent, Slic3r::PyPrinterAgentPluginCapabilityTrampoline, Slic3r::QidiPrinterAgent, and Slic3r::SnapmakerPrinterAgent.
References Slic3r::pull.
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
inlinevirtualinherited |
Reimplemented in Slic3r::BBLPrinterAgent.
|
inlineoverridevirtual |
Get agent information.
Implements Slic3r::IPrinterAgent.
References get_agent_info_static().
|
static |
Get agent information.
References Slic3r::ORCA_PRINTER_AGENT_ID, and Slic3r::OrcaPrinterAgent_VERSION.
Referenced by get_agent_info().
|
inlinevirtualinherited |
Get the camera stream mode for this agent. This value can be deterministic and derived at runtime if the printer supports multiple camera stream modes. E.g. LAN => HTTP/HTTPS/RTSP, Cloud => WebRTC.
Reimplemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
References Slic3r::none.
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
inlinevirtualinherited |
Get the current camera stream URL for this agent's active machine. Only meaningful when get_camera_stream_mode() returns an HTTP, HTTPS, or RTSP mode.
Reimplemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
inlinevirtualinherited |
Get the filament synchronization mode for this agent.
Reimplemented in Slic3r::BBLPrinterAgent, Slic3r::MoonrakerPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
References Slic3r::none.
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
inlinevirtualinherited |
Fetch the cloud snapshot image captured at a print failure. Returns 0 if the request was dispatched; the image body arrives via callback(body, http_status).
Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
|
overridevirtual |
Return the currently selected printer ID.
Implements Slic3r::IPrinterAgent.
References selected_machine, and state_mutex.
|
inlinevirtualinherited |
Install or refresh device certificate for LAN TLS.
Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
inlinevirtualinherited |
Ping the binding endpoint to check printer readiness.
Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
References BAMBU_NETWORK_SUCCESS.
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
inlineprivateinherited |
References send_message(), and send_message_to_printer().
Referenced by command_auto_leveling(), command_axis_control(), command_go_home(), command_set_bed(), command_set_nozzle(), and command_xyz_abs().
|
inlinevirtualinherited |
Request a one-time bind ticket from the server.
Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
References BAMBU_NETWORK_SUCCESS.
|
overridevirtual |
Publish a JSON command to a printer through cloud relay.
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS.
|
overridevirtual |
Send a JSON command to a LAN printer (bypassing cloud).
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS.
|
overridevirtual |
Set the cloud agent used for token access. Must be called before any cloud-relay operations.
Implements Slic3r::IPrinterAgent.
References m_cloud_agent, and state_mutex.
|
overridevirtual |
Register LAN connection status callback.
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS, on_local_connect_fn, and state_mutex.
|
overridevirtual |
Register LAN message callback.
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS, on_local_message_fn, and state_mutex.
|
overridevirtual |
Register cloud device message callback.
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS, on_message_fn, and state_mutex.
|
overridevirtual |
Register printer MQTT connection callback.
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS, on_printer_connected_fn, and state_mutex.
|
overridevirtual |
Register SSDP discovery callback.
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS, on_ssdp_msg_fn, and state_mutex.
|
overridevirtual |
Register subscription failure callback.
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS, on_subscribe_failure_fn, and state_mutex.
|
overridevirtual |
Register user-scoped message callback.
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS, on_user_message_fn, and state_mutex.
|
overridevirtual |
Provide main thread queue callback.
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS, queue_on_main_fn, and state_mutex.
|
overridevirtual |
Register callback for fatal HTTP errors.
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS, on_server_err_fn, and state_mutex.
|
overridevirtual |
Update the selected cloud machine preference.
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS, selected_machine, and state_mutex.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Start a local print with cloud record.
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS.
|
overridevirtual |
Start a fully managed cloud print.
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS.
|
overridevirtual |
Start a print from printer's SD card.
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS.
|
overridevirtual |
Upload gcode to printer's SD card without starting.
Implements Slic3r::IPrinterAgent.
References BAMBU_NETWORK_SUCCESS.
|
inlinevirtualinherited |
Subscribe to a logical module (for example app- or tunnel-scoped streams).
Reimplemented in Slic3r::BBLPrinterAgent.
References BAMBU_NETWORK_SUCCESS, and Slic3r::module().
|
inlinevirtualinherited |
Stop listening to a formerly subscribed module.
Reimplemented in Slic3r::BBLPrinterAgent.
References BAMBU_NETWORK_SUCCESS, and Slic3r::module().
|
inlinevirtualinherited |
Translate one filament id across the printer boundary.
Orca content-addresses every system filament; a printer, its AMS and its vendor cloud know only that vendor's own catalog ids. An agent whose printers already speak Orca's ids leaves them alone, and so does an id with no mapping.
Reimplemented in Slic3r::BBLPrinterAgent.
|
inlinevirtualinherited |
Remove the association between account and printer.
Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.
References BAMBU_NETWORK_SUCCESS.
Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().
|
private |
Referenced by OrcaPrinterAgent().
|
private |
Referenced by set_cloud_agent().
|
private |
Referenced by set_on_local_connect_fn().
|
private |
Referenced by set_on_local_message_fn().
|
private |
Referenced by set_on_message_fn().
|
private |
Referenced by set_on_printer_connected_fn().
|
private |
Referenced by set_server_callback().
|
private |
Referenced by set_on_ssdp_msg_fn().
|
private |
Referenced by set_on_subscribe_failure_fn().
|
private |
Referenced by set_on_user_message_fn().
|
private |
Referenced by set_queue_on_main_fn().
|
private |
Referenced by get_user_selected_machine(), and set_user_selected_machine().
|
mutableprivate |
Referenced by get_user_selected_machine(), set_cloud_agent(), set_on_local_connect_fn(), set_on_local_message_fn(), set_on_message_fn(), set_on_printer_connected_fn(), set_on_ssdp_msg_fn(), set_on_subscribe_failure_fn(), set_on_user_message_fn(), set_queue_on_main_fn(), set_server_callback(), and set_user_selected_machine().