fix: stop Qidi slot parse throwing on null

This commit is contained in:
Andrew
2026-08-04 18:12:42 +08:00
committed by Ian Chua
parent 8153e26b6d
commit 6515062a3a
4 changed files with 166 additions and 13 deletions
+6
View File
@@ -2,6 +2,7 @@
#define __QIDI_PRINTER_AGENT_HPP__
#include "MoonrakerPrinterAgent.hpp"
#include "nlohmann/json_fwd.hpp"
#include <map>
#include <string>
@@ -21,6 +22,11 @@ public:
// Override filament sync (Qidi-specific implementation)
bool fetch_filament_info(std::string dev_id) override;
static bool parse_slot_response(const std::string& response_body,
nlohmann::json& status,
nlohmann::json& variables,
std::string& error);
// Print operations — emit QiDi multi-color box config, then delegate to base.
int start_print(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;