mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-04 08:42:10 +00:00
Show the print-failure snapshot in the device error dialog
When a print fails, DeviceErrorDialog now fetches the printer's captured camera frame of the failure and shows it in place of the generic HMS illustration, falling back to the local image and a drawn placeholder on older plugins or errors. - Agent: add get_hms_snapshot through NetworkAgent / IPrinterAgent (BBL calls the bound plugin symbol; other agents no-op, so old plugins degrade gracefully). - DeviceManager: parse and clear m_print_error_img_id from the print-error message. - Dialog: tiered cloud/local/placeholder image reusing the single image widget, with a liveness-guarded async callback decoded on the UI thread.
This commit is contained in:
@@ -171,6 +171,19 @@ int BBLPrinterAgent::request_bind_ticket(std::string* ticket)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int BBLPrinterAgent::get_hms_snapshot(std::string dev_id, std::string file_name, std::function<void(std::string, int)> callback)
|
||||
{
|
||||
auto& plugin = BBLNetworkPlugin::instance();
|
||||
auto agent = plugin.get_agent();
|
||||
auto func = plugin.get_get_hms_snapshot();
|
||||
// dev_id/file_name are passed as lvalues to bind the plugin's std::string& params.
|
||||
// A null func (older plugin without this symbol) falls through to -1 so callers degrade gracefully.
|
||||
if (func && agent) {
|
||||
return func(agent, dev_id, file_name, callback);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int BBLPrinterAgent::set_server_callback(OnServerErrFn fn)
|
||||
{
|
||||
auto& plugin = BBLNetworkPlugin::instance();
|
||||
|
||||
Reference in New Issue
Block a user