#pragma once #include "IPrinterAgent.hpp" #include "MoonrakerPrinterAgent.hpp" #include #include #include #include namespace Slic3r { class SnapmakerPrinterAgent final : public MoonrakerPrinterAgent { public: explicit SnapmakerPrinterAgent(std::string log_dir); ~SnapmakerPrinterAgent() override = default; static AgentInfo get_agent_info_static(); AgentInfo get_agent_info() override { return get_agent_info_static(); } bool fetch_filament_info(std::string dev_id, FilamentSyncMode sync_mode = FilamentSyncMode::pull) override; FilamentSyncMode get_filament_sync_mode() const override; int command_start_camera(std::string dev_id) override; CameraStreamMode get_camera_stream_mode() const override { return CameraStreamMode::http_snapshot; } std::string get_camera_url() const override { return device_info.base_url + "/server/files/camera/monitor.jpg"; } private: // Combine filament_type + filament_sub_type into a unified type string static std::string combine_filament_type(const std::string& type, const std::string& sub_type); // Resolve tray_info_idx for the collected trays. Reads the GUI preset // bundle, so it is invoked on the main thread from within the shared // build_ams_payload_for_device() (never on the fetch worker). static void resolve_snapmaker_tray_info(std::vector& trays, const std::vector& vendors); void start_camera_monitor(); void on_status_loop_tick(const std::string& dev_id) override; std::atomic m_camera_last_fire_ms{0}; }; } // namespace Slic3r