OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::PrinterAgentPluginCapability Class Referenceabstract

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/plugin/pluginTypes/printerAgent/PrinterAgentPluginCapability.hpp>

Inheritance diagram for Slic3r::PrinterAgentPluginCapability:
Collaboration diagram for Slic3r::PrinterAgentPluginCapability:

Public Member Functions

PluginCapabilityType get_type () const override
void set_cloud_agent (std::shared_ptr< ICloudServiceAgent > cloud) final override
AgentInfo get_agent_info () override=0
int connect_printer (const PrinterConnectionParams &params) override=0
int send_message (std::string dev_id, std::string json_str, int qos, int flag) override=0
int send_message_to_printer (std::string dev_id, std::string json_str, int qos, int flag) override=0
bool start_discovery (bool start, bool sending) override=0
int bind_detect (std::string dev_ip, std::string sec_link, detectResult &detect) override=0
std::string get_user_selected_machine () override=0
int set_user_selected_machine (std::string dev_id) override=0
int start_send_gcode_to_sdcard (PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, OnWaitFn wait_fn) override=0
int start_local_print (PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn) override=0
int set_server_callback (OnServerErrFn fn) override=0
int start_print (PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, OnWaitFn wait_fn) override=0
int start_local_print_with_record (PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, OnWaitFn wait_fn) override=0
int start_sdcard_print (PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn) override=0
int set_on_ssdp_msg_fn (OnMsgArrivedFn fn) override=0
int set_on_printer_connected_fn (OnPrinterConnectedFn fn) override=0
int set_on_subscribe_failure_fn (GetSubscribeFailureFn fn) override=0
int set_on_message_fn (OnMessageFn fn) override=0
int set_on_user_message_fn (OnMessageFn fn) override=0
int set_on_local_connect_fn (OnLocalConnectedFn fn) override=0
int set_on_local_message_fn (OnMessageFn fn) override=0
int set_queue_on_main_fn (QueueOnMainFn fn) override=0
virtual std::string get_name () const =0
virtual bool has_config_ui () const
virtual std::string get_config_ui () const
virtual nlohmann::json get_default_config () const
virtual void on_load ()
virtual void on_unload ()
virtual void on_cancelled ()
virtual void on_lifecycle_event (LifecycleEvent event, const LifecycleEventContext &ctx)
const std::string & name () const
PluginCapabilityType type () const
PluginCapabilityId identity () const
void set_resolved_identity (std::string name, PluginCapabilityType type)
bool is_enabled () const
void set_enabled (bool enabled)
bool config_ui_available () const
void set_config_ui_available (bool available)
void set_audit_plugin_key (std::string key)
const std::string & audit_plugin_key () const
void increment () const
void decrement () const
int ref_count () const
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 disconnect_printer ()=0
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 void RegisterBindings (pybind11::module_ &module)

Private Member Functions

int publish_command_json (std::string dev_id, const nlohmann::json &j, bool lan_mode)

Private Attributes

std::string m_name
PluginCapabilityType m_type = PluginCapabilityType::Unknown
std::atomic< bool > m_enabled {true}
bool m_config_ui_available = false
std::string m_audit_plugin_key
std::atomic< int > m_refs {0}

Detailed Description

Member Function Documentation

◆ add_subscribe()

virtual int Slic3r::IPrinterAgent::add_subscribe ( std::vector< std::string > dev_list)
inlinevirtualinherited

Subscribe to push streams for specific device identifiers.

Reimplemented in Slic3r::BBLPrinterAgent.

353{ (void) dev_list; return BAMBU_NETWORK_SUCCESS; }
#define BAMBU_NETWORK_SUCCESS
Definition bambu_networking.hpp:16

References BAMBU_NETWORK_SUCCESS.

◆ audit_plugin_key()

const std::string & Slic3r::PluginCapabilityInterface::audit_plugin_key ( ) const
inlineinherited
211{ return m_audit_plugin_key; }
std::string m_audit_plugin_key
Definition PythonPluginInterface.hpp:222

References m_audit_plugin_key.

Referenced by Slic3r::PyPrinterAgentPluginCapabilityTrampoline::log_failure().

Here is the caller graph for this function:

◆ bind()

virtual int Slic3r::IPrinterAgent::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 )
inlinevirtualinherited

Execute the multi-stage printer binding workflow.

Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

276 {
277 (void) dev_ip;
278 (void) dev_id;
279 (void) dev_model;
280 (void) sec_link;
281 (void) timezone;
282 (void) improved;
283 (void) update_fn;
285 }

References BAMBU_NETWORK_SUCCESS.

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the caller graph for this function:

◆ bind_detect()

int Slic3r::PrinterAgentPluginCapability::bind_detect ( std::string dev_ip,
std::string sec_link,
detectResult & detect )
overridepure virtual

Perform binding detection/handshake on a LAN printer.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

Referenced by RegisterBindings().

Here is the caller graph for this function:

◆ check_cert()

virtual int Slic3r::IPrinterAgent::check_cert ( )
inlinevirtualinherited

Validate current user certificates for the printer.

Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

235{ return BAMBU_NETWORK_SUCCESS; }

References BAMBU_NETWORK_SUCCESS.

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the caller graph for this function:

◆ command_ams_calibrate()

virtual int Slic3r::IPrinterAgent::command_ams_calibrate ( std::string ,
int ,
int ,
bool  )
inlinevirtualinherited

Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

#define ORCA_NETWORK_ERR_CMD_NOT_SUPPORTED
Definition IPrinterAgent.hpp:10

References ORCA_NETWORK_ERR_CMD_NOT_SUPPORTED.

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the caller graph for this function:

◆ command_ams_refresh_rfid()

virtual int Slic3r::IPrinterAgent::command_ams_refresh_rfid ( std::string ,
int ,
int ,
int ,
bool  )
inlinevirtualinherited

Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

References ORCA_NETWORK_ERR_CMD_NOT_SUPPORTED.

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the caller graph for this function:

◆ command_ams_select_tray()

virtual int Slic3r::IPrinterAgent::command_ams_select_tray ( std::string ,
std::string ,
int ,
bool  )
inlinevirtualinherited

Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

References ORCA_NETWORK_ERR_CMD_NOT_SUPPORTED.

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the caller graph for this function:

◆ command_auto_leveling()

virtual int Slic3r::IPrinterAgent::command_auto_leveling ( std::string dev_id,
int sequence_id,
bool lan_mode )
inlinevirtualinherited

Reimplemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

141 {
142 nlohmann::json j;
143 j["print"]["command"] = "gcode_line";
144 j["print"]["param"] = "G29 \n";
145 j["print"]["sequence_id"] = std::to_string(sequence_id);
146 return publish_command_json(dev_id, j, lan_mode);
147 }
int publish_command_json(std::string dev_id, const nlohmann::json &j, bool lan_mode)
Definition IPrinterAgent.hpp:125

References publish_command_json().

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_axis_control()

virtual int Slic3r::IPrinterAgent::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 )
inlinevirtualinherited

Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

184 {
185 (void) supports_mqtt_axis_control;
186
187 double value = input_val;
188 if (!is_core_xy && (axis == "Y" || axis == "Z"))
189 value = -input_val;
190
191 std::string value_str = (boost::format("%.1f") % (value * unit)).str();
192 std::string gcode;
193 if (axis == "X" || axis == "Y" || axis == "Z") {
194 gcode = (boost::format("G91 \nG1 %1%%2% F%3%\nG90 \n") % axis % value_str % speed).str();
195 } else if (axis == "E") {
196 gcode = (boost::format("M83 \nG0 %1%%2% F%3%\n") % axis % value_str % speed).str();
197 } else {
198 return -1;
199 }
200
201 nlohmann::json j;
202 j["print"]["command"] = "gcode_line";
203 j["print"]["param"] = gcode;
204 j["print"]["sequence_id"] = std::to_string(sequence_id);
205 return publish_command_json(dev_id, j, lan_mode);
206 }
@ gcode
Definition Time.hpp:14

References publish_command_json().

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_go_home()

virtual int Slic3r::IPrinterAgent::command_go_home ( std::string dev_id,
bool is_printing,
bool supports_mqtt_homing,
int sequence_id,
bool lan_mode )
inlinevirtualinherited

Reimplemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

149 {
150 nlohmann::json j;
151 j["print"]["sequence_id"] = std::to_string(sequence_id);
152 if (supports_mqtt_homing) {
153 j["print"]["command"] = "back_to_center";
154 } else {
155 j["print"]["command"] = "gcode_line";
156 j["print"]["param"] = is_printing ? "G28 X\n" : "G28 \n";
157 }
158 return publish_command_json(dev_id, j, lan_mode);
159 }

References publish_command_json().

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_set_bed()

virtual int Slic3r::IPrinterAgent::command_set_bed ( std::string dev_id,
int temp,
bool supports_mqtt_bed_ctrl,
int sequence_id,
bool lan_mode )
inlinevirtualinherited

Reimplemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

161 {
162 nlohmann::json j;
163 j["print"]["sequence_id"] = std::to_string(sequence_id);
164 if (supports_mqtt_bed_ctrl) {
165 j["print"]["command"] = "set_bed_temp";
166 j["print"]["temp"] = temp;
167 } else {
168 j["print"]["command"] = "gcode_line";
169 j["print"]["param"] = (boost::format("M140 S%1%\n") % temp).str();
170 }
171 return publish_command_json(dev_id, j, lan_mode);
172 }

References publish_command_json().

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_set_nozzle()

virtual int Slic3r::IPrinterAgent::command_set_nozzle ( std::string dev_id,
int temp,
int sequence_id,
bool lan_mode )
inlinevirtualinherited

Reimplemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

174 {
175 nlohmann::json j;
176 j["print"]["command"] = "gcode_line";
177 j["print"]["param"] = (boost::format("M104 S%1%\n") % temp).str();
178 j["print"]["sequence_id"] = std::to_string(sequence_id);
179 return publish_command_json(dev_id, j, lan_mode);
180 }

References publish_command_json().

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ command_start_camera()

virtual int Slic3r::IPrinterAgent::command_start_camera ( std::string )
inlinevirtualinherited

Reimplemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

References ORCA_NETWORK_ERR_CMD_NOT_SUPPORTED.

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the caller graph for this function:

◆ command_xyz_abs()

virtual int Slic3r::IPrinterAgent::command_xyz_abs ( std::string dev_id,
int sequence_id,
bool lan_mode )
inlinevirtualinherited

Reimplemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

133 {
134 nlohmann::json j;
135 j["print"]["command"] = "gcode_line";
136 j["print"]["param"] = "G90 \n";
137 j["print"]["sequence_id"] = std::to_string(sequence_id);
138 return publish_command_json(dev_id, j, lan_mode);
139 }

References publish_command_json().

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_ui_available()

bool Slic3r::PluginCapabilityInterface::config_ui_available ( ) const
inlineinherited
205{ return m_config_ui_available; }
bool m_config_ui_available
Definition PythonPluginInterface.hpp:221

References m_config_ui_available.

◆ connect_printer()

int Slic3r::PrinterAgentPluginCapability::connect_printer ( const PrinterConnectionParams & params)
overridepure virtual

Establish a direct LAN connection to a printer.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

Referenced by RegisterBindings().

Here is the caller graph for this function:

◆ decrement()

void Slic3r::PluginCapabilityInterface::decrement ( ) const
inlineinherited
214{ m_refs.fetch_sub(1, std::memory_order_acq_rel); }
std::atomic< int > m_refs
Definition PythonPluginInterface.hpp:224

References m_refs.

◆ default_lan_username()

virtual std::string Slic3r::IPrinterAgent::default_lan_username ( ) const
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.

212{ return {}; }

◆ del_subscribe()

virtual int Slic3r::IPrinterAgent::del_subscribe ( std::vector< std::string > dev_list)
inlinevirtualinherited

Remove device-level subscriptions.

Reimplemented in Slic3r::BBLPrinterAgent.

358{ (void) dev_list; return BAMBU_NETWORK_SUCCESS; }

References BAMBU_NETWORK_SUCCESS.

◆ disconnect_printer()

virtual int Slic3r::IPrinterAgent::disconnect_printer ( )
pure virtualinherited

Tear down the active LAN printer connection.

Implemented in Slic3r::BBLPrinterAgent, Slic3r::MoonrakerPrinterAgent, Slic3r::OrcaPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the caller graph for this function:

◆ fetch_filament_info()

virtual bool Slic3r::IPrinterAgent::fetch_filament_info ( std::string dev_id,
FilamentSyncMode sync_mode = FilamentSyncMode::pull )
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.

462{ return false; }

References Slic3r::pull.

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the caller graph for this function:

◆ from_orca_filament_id()

virtual std::string Slic3r::IPrinterAgent::from_orca_filament_id ( const std::string & orca_filament_id) const
inlinevirtualinherited

Reimplemented in Slic3r::BBLPrinterAgent.

472{ return orca_filament_id; }

◆ get_agent_info()

AgentInfo Slic3r::PrinterAgentPluginCapability::get_agent_info ( )
overridepure virtual

Get agent information.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

Referenced by RegisterBindings().

Here is the caller graph for this function:

◆ get_camera_stream_mode()

virtual CameraStreamMode Slic3r::IPrinterAgent::get_camera_stream_mode ( ) const
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.

Returns
CameraStreamMode indicating how the camera stream is obtained or used:

Reimplemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

455{ return CameraStreamMode::none; }
@ none
Definition IPrinterAgent.hpp:63

References Slic3r::none.

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the caller graph for this function:

◆ get_camera_url()

virtual std::string Slic3r::IPrinterAgent::get_camera_url ( ) const
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.

478{ return {}; }

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the caller graph for this function:

◆ get_config_ui()

virtual std::string Slic3r::PluginCapabilityInterface::get_config_ui ( ) const
inlinevirtualinherited

◆ get_default_config()

virtual nlohmann::json Slic3r::PluginCapabilityInterface::get_default_config ( ) const
inlinevirtualinherited

◆ get_filament_sync_mode()

virtual FilamentSyncMode Slic3r::IPrinterAgent::get_filament_sync_mode ( ) const
inlinevirtualinherited

Get the filament synchronization mode for this agent.

Returns
FilamentSyncMode indicating how filament data is obtained:
  • subscription: Real-time push updates via MQTT (no fetch needed)
  • pull: On-demand fetch via REST API (call fetch_filament_info())
  • none: Filament synchronization not supported

Reimplemented in Slic3r::BBLPrinterAgent, Slic3r::MoonrakerPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

447{ return FilamentSyncMode::none; }
@ none
Filament synchronization not supported.
Definition IPrinterAgent.hpp:57

References Slic3r::none.

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the caller graph for this function:

◆ get_hms_snapshot()

virtual int Slic3r::IPrinterAgent::get_hms_snapshot ( std::string dev_id,
std::string file_name,
std::function< void(std::string, int)> callback )
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.

312 {
313 (void) dev_id;
314 (void) file_name;
315 (void) callback;
316 return -1;
317 }

◆ get_name()

virtual std::string Slic3r::PluginCapabilityInterface::get_name ( ) const
pure virtualinherited

◆ get_type()

PluginCapabilityType Slic3r::PrinterAgentPluginCapability::get_type ( ) const
inlineoverridevirtual

Reimplemented from Slic3r::PluginCapabilityInterface.

@ PrinterConnection
Definition PythonPluginInterface.hpp:17

References Slic3r::PrinterConnection.

Referenced by RegisterBindings().

Here is the caller graph for this function:

◆ get_user_selected_machine()

std::string Slic3r::PrinterAgentPluginCapability::get_user_selected_machine ( )
overridepure virtual

Return the currently selected printer ID.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

Referenced by RegisterBindings().

Here is the caller graph for this function:

◆ has_config_ui()

virtual bool Slic3r::PluginCapabilityInterface::has_config_ui ( ) const
inlinevirtualinherited

◆ identity()

PluginCapabilityId Slic3r::PluginCapabilityInterface::identity ( ) const
inlineinherited
189{ return {m_type, m_name, m_audit_plugin_key}; }
std::string m_name
Definition PythonPluginInterface.hpp:218
PluginCapabilityType m_type
Definition PythonPluginInterface.hpp:219

References m_audit_plugin_key, m_name, and m_type.

Referenced by Slic3r::anonymous_namespace{PluginConfig.cpp}::capability_identity().

Here is the caller graph for this function:

◆ increment()

void Slic3r::PluginCapabilityInterface::increment ( ) const
inlineinherited
213{ m_refs.fetch_add(1, std::memory_order_acq_rel); }

References m_refs.

◆ install_device_cert()

virtual void Slic3r::IPrinterAgent::install_device_cert ( std::string dev_id,
bool lan_only )
inlinevirtualinherited

Install or refresh device certificate for LAN TLS.

Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

241 {
242 (void) dev_id;
243 (void) lan_only;
244 }

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the caller graph for this function:

◆ is_enabled()

bool Slic3r::PluginCapabilityInterface::is_enabled ( ) const
inlineinherited
199{ return m_enabled.load(std::memory_order_acquire); }
std::atomic< bool > m_enabled
Definition PythonPluginInterface.hpp:220

References m_enabled.

◆ name()

const std::string & Slic3r::PluginCapabilityInterface::name ( ) const
inlineinherited
187{ return m_name; }

References m_name.

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings(), and set_resolved_identity().

Here is the caller graph for this function:

◆ on_cancelled()

◆ on_lifecycle_event()

virtual void Slic3r::PluginCapabilityInterface::on_lifecycle_event ( LifecycleEvent event,
const LifecycleEventContext & ctx )
inlinevirtualinherited

◆ on_load()

virtual void Slic3r::PluginCapabilityInterface::on_load ( )
inlinevirtualinherited

◆ on_unload()

virtual void Slic3r::PluginCapabilityInterface::on_unload ( )
inlinevirtualinherited

◆ ping_bind()

virtual int Slic3r::IPrinterAgent::ping_bind ( std::string ping_code)
inlinevirtualinherited

Ping the binding endpoint to check printer readiness.

Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

261 {
262 (void) ping_code;
264 }

References BAMBU_NETWORK_SUCCESS.

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the caller graph for this function:

◆ publish_command_json()

int Slic3r::IPrinterAgent::publish_command_json ( std::string dev_id,
const nlohmann::json & j,
bool lan_mode )
inlineprivateinherited
126 {
127 return lan_mode ? send_message_to_printer(dev_id, j.dump(), 0, 0)
128 : send_message(dev_id, j.dump(), 0, 0);
129 }
virtual int send_message(std::string dev_id, std::string json_str, int qos, int flag)=0
virtual int send_message_to_printer(std::string dev_id, std::string json_str, int qos, int flag)=0
size_t dump(const PresetBundle &bundle, const Sections &sections, std::ostream &out)
Definition profile_include_dump.cpp:96

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ref_count()

int Slic3r::PluginCapabilityInterface::ref_count ( ) const
inlineinherited
215{ return m_refs.load(std::memory_order_acquire); }

References m_refs.

◆ RegisterBindings()

void Slic3r::PrinterAgentPluginCapability::RegisterBindings ( pybind11::module_ & module)
static
22{
23 auto printer_agent_module = module.def_submodule("printer_agent", "Printer Agent API");
24
25 py::enum_<FilamentSyncMode>(printer_agent_module, "FilamentSyncMode")
26 .value("None_", FilamentSyncMode::none)
27 .value("Subscription", FilamentSyncMode::subscription)
28 .value("Pull", FilamentSyncMode::pull)
29 .export_values();
30
31 py::enum_<CameraStreamMode>(printer_agent_module, "CameraStreamMode")
32 .value("None_", CameraStreamMode::none)
33 .value("HTTP", CameraStreamMode::http)
34 .value("HTTPS", CameraStreamMode::https)
35 .value("HTTP_SNAPSHOT", CameraStreamMode::http_snapshot)
36 .value("RTSP", CameraStreamMode::rtsp)
37 .export_values();
38
39 py::class_<AgentInfo>(printer_agent_module, "AgentInfo")
40 .def(py::init<>())
41 .def(py::init([](std::string id, std::string name, std::string version, std::string description) {
42 return AgentInfo{std::move(id), std::move(name), std::move(version), std::move(description)};
43 }),
44 py::arg("id"), py::arg("name"), py::arg("version"), py::arg("description"))
45 .def_readwrite("id", &AgentInfo::id)
46 .def_readwrite("name", &AgentInfo::name)
47 .def_readwrite("version", &AgentInfo::version)
48 .def_readwrite("description", &AgentInfo::description);
49
50 py::class_<detectResult>(printer_agent_module, "DetectResult")
51 .def(py::init<>())
52 .def_readwrite("result_msg", &detectResult::result_msg)
53 .def_readwrite("command", &detectResult::command)
54 .def_readwrite("dev_id", &detectResult::dev_id)
55 .def_readwrite("model_id", &detectResult::model_id)
56 .def_readwrite("dev_name", &detectResult::dev_name)
57 .def_readwrite("version", &detectResult::version)
58 .def_readwrite("bind_state", &detectResult::bind_state)
59 .def_readwrite("connect_type", &detectResult::connect_type);
60
61 py::class_<PrintParams>(printer_agent_module, "PrintParams")
62 .def(py::init<>())
63 .def_readwrite("dev_id", &PrintParams::dev_id)
64 .def_readwrite("task_name", &PrintParams::task_name)
65 .def_readwrite("project_name", &PrintParams::project_name)
66 .def_readwrite("preset_name", &PrintParams::preset_name)
67 .def_readwrite("filename", &PrintParams::filename)
68 .def_readwrite("config_filename", &PrintParams::config_filename)
69 .def_readwrite("plate_index", &PrintParams::plate_index)
70 .def_readwrite("ftp_folder", &PrintParams::ftp_folder)
71 .def_readwrite("ftp_file", &PrintParams::ftp_file)
72 .def_readwrite("ftp_file_md5", &PrintParams::ftp_file_md5)
73 .def_readwrite("nozzle_mapping", &PrintParams::nozzle_mapping)
74 .def_readwrite("ams_mapping", &PrintParams::ams_mapping)
75 .def_readwrite("ams_mapping2", &PrintParams::ams_mapping2)
76 .def_readwrite("ams_mapping_info", &PrintParams::ams_mapping_info)
77 .def_readwrite("nozzles_info", &PrintParams::nozzles_info)
78 .def_readwrite("connection_type", &PrintParams::connection_type)
79 .def_readwrite("comments", &PrintParams::comments)
80 .def_readwrite("origin_profile_id", &PrintParams::origin_profile_id)
81 .def_readwrite("stl_design_id", &PrintParams::stl_design_id)
82 .def_readwrite("origin_model_id", &PrintParams::origin_model_id)
83 .def_readwrite("print_type", &PrintParams::print_type)
84 .def_readwrite("dst_file", &PrintParams::dst_file)
85 .def_readwrite("dev_name", &PrintParams::dev_name)
86 .def_readwrite("dev_ip", &PrintParams::dev_ip)
87 .def_readwrite("use_ssl_for_ftp", &PrintParams::use_ssl_for_ftp)
88 .def_readwrite("use_ssl_for_mqtt", &PrintParams::use_ssl_for_mqtt)
89 .def_readwrite("username", &PrintParams::username)
90 .def_readwrite("password", &PrintParams::password)
91 .def_readwrite("task_bed_leveling", &PrintParams::task_bed_leveling)
92 .def_readwrite("task_flow_cali", &PrintParams::task_flow_cali)
93 .def_readwrite("task_vibration_cali", &PrintParams::task_vibration_cali)
94 .def_readwrite("task_layer_inspect", &PrintParams::task_layer_inspect)
95 .def_readwrite("task_record_timelapse", &PrintParams::task_record_timelapse)
96 .def_readwrite("task_use_ams", &PrintParams::task_use_ams)
97 .def_readwrite("task_bed_type", &PrintParams::task_bed_type)
98 .def_readwrite("extra_options", &PrintParams::extra_options)
99 .def_readwrite("auto_bed_leveling", &PrintParams::auto_bed_leveling)
100 .def_readwrite("auto_flow_cali", &PrintParams::auto_flow_cali)
101 .def_readwrite("auto_offset_cali", &PrintParams::auto_offset_cali)
102 .def_readwrite("task_ext_change_assist", &PrintParams::task_ext_change_assist)
103 .def_readwrite("try_emmc_print", &PrintParams::try_emmc_print);
104
105 py::class_<PrinterConnectionParams>(printer_agent_module, "PrinterConnectionParams")
106 .def(py::init<>())
107 .def_readwrite("dev_id", &PrinterConnectionParams::dev_id)
108 .def_readwrite("host", &PrinterConnectionParams::host)
109 .def_readwrite("port", &PrinterConnectionParams::port)
110 .def_readwrite("username", &PrinterConnectionParams::username)
111 .def_readwrite("password", &PrinterConnectionParams::password)
112 .def_readwrite("use_ssl", &PrinterConnectionParams::use_ssl)
113 .def_readwrite("ca_file", &PrinterConnectionParams::ca_file);
114
115 py::class_<PrinterAgentPluginCapability, PluginCapabilityInterface, PyPrinterAgentPluginCapabilityTrampoline, std::shared_ptr<PrinterAgentPluginCapability>>(
116 printer_agent_module, "PrinterAgentBase")
117 .def(py::init<>())
119 .def("get_agent_info", &PrinterAgentPluginCapability::get_agent_info)
120 .def("connect_printer", &PrinterAgentPluginCapability::connect_printer)
121 .def("disconnect_printer", &PrinterAgentPluginCapability::disconnect_printer)
122 .def("send_message", &PrinterAgentPluginCapability::send_message)
123 .def("send_message_to_printer", &PrinterAgentPluginCapability::send_message_to_printer)
124 .def("command_ams_refresh_rfid", &PrinterAgentPluginCapability::command_ams_refresh_rfid)
125 .def("command_ams_calibrate", &PrinterAgentPluginCapability::command_ams_calibrate)
126 .def("command_ams_select_tray", &PrinterAgentPluginCapability::command_ams_select_tray)
127 .def("command_start_camera", &PrinterAgentPluginCapability::command_start_camera)
128 .def("command_xyz_abs", &PrinterAgentPluginCapability::command_xyz_abs)
129 .def("command_auto_leveling", &PrinterAgentPluginCapability::command_auto_leveling)
130 .def("command_go_home", &PrinterAgentPluginCapability::command_go_home)
131 .def("command_set_bed", &PrinterAgentPluginCapability::command_set_bed)
132 .def("command_set_nozzle", &PrinterAgentPluginCapability::command_set_nozzle)
133 .def("command_axis_control", &PrinterAgentPluginCapability::command_axis_control)
134 .def("start_discovery", &PrinterAgentPluginCapability::start_discovery)
136 .def("get_user_selected_machine", &PrinterAgentPluginCapability::get_user_selected_machine)
137 .def("set_user_selected_machine", &PrinterAgentPluginCapability::set_user_selected_machine)
138 .def("start_send_gcode_to_sdcard", &PrinterAgentPluginCapability::start_send_gcode_to_sdcard)
139 .def("start_local_print", &PrinterAgentPluginCapability::start_local_print)
140 .def("get_filament_sync_mode", &PrinterAgentPluginCapability::get_filament_sync_mode)
141 .def("get_camera_stream_mode", &PrinterAgentPluginCapability::get_camera_stream_mode)
142 .def("fetch_filament_info", &PrinterAgentPluginCapability::fetch_filament_info)
143 .def("get_camera_url", &PrinterAgentPluginCapability::get_camera_url)
145 .def("install_device_cert", &PrinterAgentPluginCapability::install_device_cert)
150 .def("start_local_print_with_record", &PrinterAgentPluginCapability::start_local_print_with_record)
151 .def("start_sdcard_print", &PrinterAgentPluginCapability::start_sdcard_print);
152}
virtual int ping_bind(std::string ping_code)
Definition IPrinterAgent.hpp:260
virtual int command_start_camera(std::string)
Definition IPrinterAgent.hpp:121
virtual int disconnect_printer()=0
virtual CameraStreamMode get_camera_stream_mode() const
Definition IPrinterAgent.hpp:455
virtual int unbind(std::string dev_id)
Definition IPrinterAgent.hpp:290
virtual int command_set_nozzle(std::string dev_id, int temp, int sequence_id, bool lan_mode)
Definition IPrinterAgent.hpp:173
virtual std::string get_camera_url() const
Definition IPrinterAgent.hpp:478
virtual int command_ams_refresh_rfid(std::string, int, int, int, bool)
Definition IPrinterAgent.hpp:115
virtual int command_auto_leveling(std::string dev_id, int sequence_id, bool lan_mode)
Definition IPrinterAgent.hpp:140
virtual int command_set_bed(std::string dev_id, int temp, bool supports_mqtt_bed_ctrl, int sequence_id, bool lan_mode)
Definition IPrinterAgent.hpp:160
virtual bool fetch_filament_info(std::string dev_id, FilamentSyncMode sync_mode=FilamentSyncMode::pull)
Definition IPrinterAgent.hpp:462
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)
Definition IPrinterAgent.hpp:182
virtual FilamentSyncMode get_filament_sync_mode() const
Definition IPrinterAgent.hpp:447
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)
Definition IPrinterAgent.hpp:274
virtual int command_xyz_abs(std::string dev_id, int sequence_id, bool lan_mode)
Definition IPrinterAgent.hpp:132
virtual void install_device_cert(std::string dev_id, bool lan_only)
Definition IPrinterAgent.hpp:240
virtual int command_ams_calibrate(std::string, int, int, bool)
Definition IPrinterAgent.hpp:117
virtual int command_go_home(std::string dev_id, bool is_printing, bool supports_mqtt_homing, int sequence_id, bool lan_mode)
Definition IPrinterAgent.hpp:148
virtual int command_ams_select_tray(std::string, std::string, int, bool)
Definition IPrinterAgent.hpp:119
virtual int check_cert()
Definition IPrinterAgent.hpp:235
const std::string & name() const
Definition PythonPluginInterface.hpp:187
int connect_printer(const PrinterConnectionParams &params) override=0
PluginCapabilityType get_type() const override
Definition PrinterAgentPluginCapability.hpp:25
int start_sdcard_print(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn) override=0
int start_local_print_with_record(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, OnWaitFn wait_fn) override=0
int start_local_print(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn) override=0
int start_send_gcode_to_sdcard(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, OnWaitFn wait_fn) override=0
int set_user_selected_machine(std::string dev_id) override=0
int start_print(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, OnWaitFn wait_fn) override=0
int bind_detect(std::string dev_ip, std::string sec_link, detectResult &detect) override=0
int send_message(std::string dev_id, std::string json_str, int qos, int flag) override=0
bool start_discovery(bool start, bool sending) override=0
AgentInfo get_agent_info() override=0
int send_message_to_printer(std::string dev_id, std::string json_str, int qos, int flag) override=0
std::string get_user_selected_machine() override=0
std::string connect_type
Definition bambu_networking.hpp:189
std::string result_msg
Definition bambu_networking.hpp:182
std::string filename
Definition bambu_networking.hpp:294
bool use_ssl_for_mqtt
Definition bambu_networking.hpp:317
std::string name
Human-readable agent name, e.g. "Orca", "Bambu Lab".
Definition IPrinterAgent.hpp:32
std::string comments
Definition bambu_networking.hpp:306
bool try_emmc_print
Definition bambu_networking.hpp:336
std::string dev_name
Definition bambu_networking.hpp:186
std::string dev_name
Definition bambu_networking.hpp:312
bool use_ssl_for_ftp
Definition bambu_networking.hpp:316
std::string password
Definition IPrinterAgent.hpp:43
std::string project_name
Definition bambu_networking.hpp:292
bool task_vibration_cali
Definition bambu_networking.hpp:324
std::string dev_id
Definition bambu_networking.hpp:290
std::string dev_id
Definition bambu_networking.hpp:184
std::string ftp_file
Definition bambu_networking.hpp:298
int auto_flow_cali
Definition bambu_networking.hpp:332
bool task_layer_inspect
Definition bambu_networking.hpp:325
std::string extra_options
Definition bambu_networking.hpp:330
std::string password
Definition bambu_networking.hpp:319
bool use_ssl
Definition IPrinterAgent.hpp:44
std::string origin_model_id
Definition bambu_networking.hpp:309
bool task_record_timelapse
Definition bambu_networking.hpp:326
bool task_bed_leveling
Definition bambu_networking.hpp:322
std::string dev_ip
Definition bambu_networking.hpp:315
std::string version
Agent version string, e.g. "1.0.0".
Definition IPrinterAgent.hpp:33
std::string config_filename
Definition bambu_networking.hpp:295
std::string username
Definition bambu_networking.hpp:318
std::string nozzles_info
Definition bambu_networking.hpp:304
std::string ftp_folder
Definition bambu_networking.hpp:297
std::string task_name
Definition bambu_networking.hpp:291
std::string print_type
Definition bambu_networking.hpp:310
std::string connection_type
Definition bambu_networking.hpp:305
std::string port
Definition IPrinterAgent.hpp:41
std::string ams_mapping
Definition bambu_networking.hpp:301
@ https
Definition IPrinterAgent.hpp:65
@ http
Definition IPrinterAgent.hpp:64
@ http_snapshot
Definition IPrinterAgent.hpp:68
@ rtsp
Definition IPrinterAgent.hpp:66
std::string dst_file
Definition bambu_networking.hpp:311
int auto_offset_cali
Definition bambu_networking.hpp:333
bool task_ext_change_assist
Definition bambu_networking.hpp:335
bool task_use_ams
Definition bambu_networking.hpp:328
std::string ams_mapping2
Definition bambu_networking.hpp:302
int plate_index
Definition bambu_networking.hpp:296
int stl_design_id
Definition bambu_networking.hpp:308
std::string ftp_file_md5
Definition bambu_networking.hpp:299
std::string ams_mapping_info
Definition bambu_networking.hpp:303
@ subscription
Real-time push updates via subscription (e.g., MQTT).
Definition IPrinterAgent.hpp:58
@ pull
On-demand fetch via REST API (blocking call).
Definition IPrinterAgent.hpp:59
int auto_bed_leveling
Definition bambu_networking.hpp:331
std::string model_id
Definition bambu_networking.hpp:185
std::string bind_state
Definition bambu_networking.hpp:188
std::string task_bed_type
Definition bambu_networking.hpp:329
bool task_flow_cali
Definition bambu_networking.hpp:323
std::string version
Definition bambu_networking.hpp:187
int origin_profile_id
Definition bambu_networking.hpp:307
std::string nozzle_mapping
Definition bambu_networking.hpp:300
std::string command
Definition bambu_networking.hpp:183
std::string dev_id
Definition IPrinterAgent.hpp:39
std::string id
Unique identifier for the agent, e.g. "orca", "bbl".
Definition IPrinterAgent.hpp:31
std::string username
Definition IPrinterAgent.hpp:42
std::string ca_file
Definition IPrinterAgent.hpp:45
std::string description
Brief description of the agent's capabilities, e.g. "Orca printer agent".
Definition IPrinterAgent.hpp:34
std::string host
Definition IPrinterAgent.hpp:40
std::string preset_name
Definition bambu_networking.hpp:293

References Slic3r::PrintParams::ams_mapping, Slic3r::PrintParams::ams_mapping2, Slic3r::PrintParams::ams_mapping_info, Slic3r::PrintParams::auto_bed_leveling, Slic3r::PrintParams::auto_flow_cali, Slic3r::PrintParams::auto_offset_cali, Slic3r::IPrinterAgent::bind(), bind_detect(), Slic3r::detectResult::bind_state, Slic3r::PrinterConnectionParams::ca_file, Slic3r::IPrinterAgent::check_cert(), Slic3r::detectResult::command, Slic3r::IPrinterAgent::command_ams_calibrate(), Slic3r::IPrinterAgent::command_ams_refresh_rfid(), Slic3r::IPrinterAgent::command_ams_select_tray(), Slic3r::IPrinterAgent::command_auto_leveling(), Slic3r::IPrinterAgent::command_axis_control(), Slic3r::IPrinterAgent::command_go_home(), Slic3r::IPrinterAgent::command_set_bed(), Slic3r::IPrinterAgent::command_set_nozzle(), Slic3r::IPrinterAgent::command_start_camera(), Slic3r::IPrinterAgent::command_xyz_abs(), Slic3r::PrintParams::comments, Slic3r::PrintParams::config_filename, connect_printer(), Slic3r::detectResult::connect_type, Slic3r::PrintParams::connection_type, Slic3r::AgentInfo::description, Slic3r::detectResult::dev_id, Slic3r::PrinterConnectionParams::dev_id, Slic3r::PrintParams::dev_id, Slic3r::PrintParams::dev_ip, Slic3r::detectResult::dev_name, Slic3r::PrintParams::dev_name, Slic3r::IPrinterAgent::disconnect_printer(), Slic3r::PrintParams::dst_file, Slic3r::PrintParams::extra_options, Slic3r::IPrinterAgent::fetch_filament_info(), Slic3r::PrintParams::filename, Slic3r::PrintParams::ftp_file, Slic3r::PrintParams::ftp_file_md5, Slic3r::PrintParams::ftp_folder, get_agent_info(), Slic3r::IPrinterAgent::get_camera_stream_mode(), Slic3r::IPrinterAgent::get_camera_url(), Slic3r::IPrinterAgent::get_filament_sync_mode(), get_type(), get_user_selected_machine(), Slic3r::PrinterConnectionParams::host, Slic3r::http, Slic3r::http_snapshot, Slic3r::https, Slic3r::AgentInfo::id, Slic3r::IPrinterAgent::install_device_cert(), Slic3r::detectResult::model_id, Slic3r::module(), Slic3r::AgentInfo::name, Slic3r::PluginCapabilityInterface::name(), Slic3r::none, Slic3r::PrintParams::nozzle_mapping, Slic3r::PrintParams::nozzles_info, Slic3r::PrintParams::origin_model_id, Slic3r::PrintParams::origin_profile_id, Slic3r::PrinterConnectionParams::password, Slic3r::PrintParams::password, Slic3r::IPrinterAgent::ping_bind(), Slic3r::PrintParams::plate_index, Slic3r::PrinterConnectionParams::port, Slic3r::PrintParams::preset_name, Slic3r::PrintParams::print_type, Slic3r::PrintParams::project_name, Slic3r::pull, Slic3r::detectResult::result_msg, Slic3r::rtsp, send_message(), send_message_to_printer(), set_user_selected_machine(), start_discovery(), start_local_print(), start_local_print_with_record(), start_print(), start_sdcard_print(), start_send_gcode_to_sdcard(), Slic3r::PrintParams::stl_design_id, Slic3r::subscription, Slic3r::PrintParams::task_bed_leveling, Slic3r::PrintParams::task_bed_type, Slic3r::PrintParams::task_ext_change_assist, Slic3r::PrintParams::task_flow_cali, Slic3r::PrintParams::task_layer_inspect, Slic3r::PrintParams::task_name, Slic3r::PrintParams::task_record_timelapse, Slic3r::PrintParams::task_use_ams, Slic3r::PrintParams::task_vibration_cali, Slic3r::PrintParams::try_emmc_print, Slic3r::IPrinterAgent::unbind(), Slic3r::PrinterConnectionParams::use_ssl, Slic3r::PrintParams::use_ssl_for_ftp, Slic3r::PrintParams::use_ssl_for_mqtt, Slic3r::PrinterConnectionParams::username, Slic3r::PrintParams::username, Slic3r::AgentInfo::version, and Slic3r::detectResult::version.

Referenced by Slic3r::bind_python_api().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ request_bind_ticket()

virtual int Slic3r::IPrinterAgent::request_bind_ticket ( std::string * ticket)
inlinevirtualinherited

Request a one-time bind ticket from the server.

Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

300 {
301 if (ticket)
302 *ticket = {};
304 }

References BAMBU_NETWORK_SUCCESS.

◆ send_message()

int Slic3r::PrinterAgentPluginCapability::send_message ( std::string dev_id,
std::string json_str,
int qos,
int flag )
overridepure virtual

Publish a JSON command to a printer through cloud relay.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

Referenced by RegisterBindings().

Here is the caller graph for this function:

◆ send_message_to_printer()

int Slic3r::PrinterAgentPluginCapability::send_message_to_printer ( std::string dev_id,
std::string json_str,
int qos,
int flag )
overridepure virtual

Send a JSON command to a LAN printer (bypassing cloud).

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

Referenced by RegisterBindings().

Here is the caller graph for this function:

◆ set_audit_plugin_key()

void Slic3r::PluginCapabilityInterface::set_audit_plugin_key ( std::string key)
inlineinherited
210{ m_audit_plugin_key = std::move(key); }

References m_audit_plugin_key.

◆ set_cloud_agent()

void Slic3r::PrinterAgentPluginCapability::set_cloud_agent ( std::shared_ptr< ICloudServiceAgent > cloud)
inlinefinaloverridevirtual

Set the cloud agent used for token access. Must be called before any cloud-relay operations.

Implements Slic3r::IPrinterAgent.

30{ (void) cloud; }

◆ set_config_ui_available()

void Slic3r::PluginCapabilityInterface::set_config_ui_available ( bool available)
inlineinherited
206{ m_config_ui_available = available; }

References m_config_ui_available.

◆ set_enabled()

void Slic3r::PluginCapabilityInterface::set_enabled ( bool enabled)
inlineinherited
200{ m_enabled.store(enabled, std::memory_order_release); }

References m_enabled.

◆ set_on_local_connect_fn()

int Slic3r::PrinterAgentPluginCapability::set_on_local_connect_fn ( OnLocalConnectedFn fn)
overridepure virtual

Register LAN connection status callback.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

◆ set_on_local_message_fn()

int Slic3r::PrinterAgentPluginCapability::set_on_local_message_fn ( OnMessageFn fn)
overridepure virtual

Register LAN message callback.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

◆ set_on_message_fn()

int Slic3r::PrinterAgentPluginCapability::set_on_message_fn ( OnMessageFn fn)
overridepure virtual

Register cloud device message callback.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

◆ set_on_printer_connected_fn()

int Slic3r::PrinterAgentPluginCapability::set_on_printer_connected_fn ( OnPrinterConnectedFn fn)
overridepure virtual

Register printer MQTT connection callback.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

◆ set_on_ssdp_msg_fn()

int Slic3r::PrinterAgentPluginCapability::set_on_ssdp_msg_fn ( OnMsgArrivedFn fn)
overridepure virtual

Register SSDP discovery callback.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

◆ set_on_subscribe_failure_fn()

int Slic3r::PrinterAgentPluginCapability::set_on_subscribe_failure_fn ( GetSubscribeFailureFn fn)
overridepure virtual

Register subscription failure callback.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

◆ set_on_user_message_fn()

int Slic3r::PrinterAgentPluginCapability::set_on_user_message_fn ( OnMessageFn fn)
overridepure virtual

Register user-scoped message callback.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

◆ set_queue_on_main_fn()

int Slic3r::PrinterAgentPluginCapability::set_queue_on_main_fn ( QueueOnMainFn fn)
overridepure virtual

Provide main thread queue callback.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

◆ set_resolved_identity()

void Slic3r::PluginCapabilityInterface::set_resolved_identity ( std::string name,
PluginCapabilityType type )
inlineinherited
191 {
192 m_name = std::move(name);
193 m_type = type;
194 }
PluginCapabilityType type() const
Definition PythonPluginInterface.hpp:188

References m_name, m_type, name(), and type().

Here is the call graph for this function:

◆ set_server_callback()

int Slic3r::PrinterAgentPluginCapability::set_server_callback ( OnServerErrFn fn)
overridepure virtual

Register callback for fatal HTTP errors.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

◆ set_user_selected_machine()

int Slic3r::PrinterAgentPluginCapability::set_user_selected_machine ( std::string dev_id)
overridepure virtual

Update the selected cloud machine preference.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

Referenced by RegisterBindings().

Here is the caller graph for this function:

◆ start_discovery()

bool Slic3r::PrinterAgentPluginCapability::start_discovery ( bool start,
bool sending )
overridepure virtual

Start or stop SSDP discovery.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

Referenced by RegisterBindings().

Here is the caller graph for this function:

◆ start_local_print()

int Slic3r::PrinterAgentPluginCapability::start_local_print ( PrintParams params,
OnUpdateStatusFn update_fn,
WasCancelledFn cancel_fn )
overridepure virtual

Start a LAN-only print.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

Referenced by RegisterBindings().

Here is the caller graph for this function:

◆ start_local_print_with_record()

int Slic3r::PrinterAgentPluginCapability::start_local_print_with_record ( PrintParams params,
OnUpdateStatusFn update_fn,
WasCancelledFn cancel_fn,
OnWaitFn wait_fn )
overridepure virtual

Start a local print with cloud record.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

Referenced by RegisterBindings().

Here is the caller graph for this function:

◆ start_print()

int Slic3r::PrinterAgentPluginCapability::start_print ( PrintParams params,
OnUpdateStatusFn update_fn,
WasCancelledFn cancel_fn,
OnWaitFn wait_fn )
overridepure virtual

Start a fully managed cloud print.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

Referenced by RegisterBindings().

Here is the caller graph for this function:

◆ start_sdcard_print()

int Slic3r::PrinterAgentPluginCapability::start_sdcard_print ( PrintParams params,
OnUpdateStatusFn update_fn,
WasCancelledFn cancel_fn )
overridepure virtual

Start a print from printer's SD card.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

Referenced by RegisterBindings().

Here is the caller graph for this function:

◆ start_send_gcode_to_sdcard()

int Slic3r::PrinterAgentPluginCapability::start_send_gcode_to_sdcard ( PrintParams params,
OnUpdateStatusFn update_fn,
WasCancelledFn cancel_fn,
OnWaitFn wait_fn )
overridepure virtual

Upload gcode to printer's SD card without starting.

Implements Slic3r::IPrinterAgent.

Implemented in Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

Referenced by RegisterBindings().

Here is the caller graph for this function:

◆ start_subscribe()

virtual int Slic3r::IPrinterAgent::start_subscribe ( std::string module)
inlinevirtualinherited

Subscribe to a logical module (for example app- or tunnel-scoped streams).

Reimplemented in Slic3r::BBLPrinterAgent.

343{ (void) module; return BAMBU_NETWORK_SUCCESS; }
FileTransferModule & module()
Definition FileTransferUtils.hpp:248

References BAMBU_NETWORK_SUCCESS, and Slic3r::module().

Here is the call graph for this function:

◆ stop_subscribe()

virtual int Slic3r::IPrinterAgent::stop_subscribe ( std::string module)
inlinevirtualinherited

Stop listening to a formerly subscribed module.

Reimplemented in Slic3r::BBLPrinterAgent.

348{ (void) module; return BAMBU_NETWORK_SUCCESS; }

References BAMBU_NETWORK_SUCCESS, and Slic3r::module().

Here is the call graph for this function:

◆ to_orca_filament_id()

virtual std::string Slic3r::IPrinterAgent::to_orca_filament_id ( const std::string & printer_filament_id) const
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.

471{ return printer_filament_id; }

◆ type()

PluginCapabilityType Slic3r::PluginCapabilityInterface::type ( ) const
inlineinherited
188{ return m_type; }

References m_type.

Referenced by set_resolved_identity().

Here is the caller graph for this function:

◆ unbind()

virtual int Slic3r::IPrinterAgent::unbind ( std::string dev_id)
inlinevirtualinherited

Remove the association between account and printer.

Reimplemented in Slic3r::BBLPrinterAgent, and Slic3r::PyPrinterAgentPluginCapabilityTrampoline.

291 {
292 (void) dev_id;
294 }

References BAMBU_NETWORK_SUCCESS.

Referenced by Slic3r::PrinterAgentPluginCapability::RegisterBindings().

Here is the caller graph for this function:

Member Data Documentation

◆ m_audit_plugin_key

std::string Slic3r::PluginCapabilityInterface::m_audit_plugin_key
privateinherited

◆ m_config_ui_available

bool Slic3r::PluginCapabilityInterface::m_config_ui_available = false
privateinherited

◆ m_enabled

std::atomic<bool> Slic3r::PluginCapabilityInterface::m_enabled {true}
privateinherited
220{true};

Referenced by is_enabled(), and set_enabled().

◆ m_name

std::string Slic3r::PluginCapabilityInterface::m_name
privateinherited

◆ m_refs

std::atomic<int> Slic3r::PluginCapabilityInterface::m_refs {0}
mutableprivateinherited
224{0};

Referenced by decrement(), increment(), and ref_count().

◆ m_type

PluginCapabilityType Slic3r::PluginCapabilityInterface::m_type = PluginCapabilityType::Unknown
privateinherited

The documentation for this class was generated from the following files: