From 33c22bef62c81147c34d3b68e5be0b7abf270db7 Mon Sep 17 00:00:00 2001 From: tao wang Date: Wed, 8 Feb 2023 14:53:10 +0800 Subject: [PATCH] FIX:use the gcode line command to unload the C11 printer Change-Id: I33eec56b8c02fd605d3c0acb4e1f9d07811cea69 --- src/slic3r/GUI/DeviceManager.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 41249bd0e..59ec1b2f9 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -1816,6 +1816,22 @@ int MachineObject::command_unload_filament() j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++); return this->publish_json(j.dump()); } + else if (printer_type == "C11") { + std::string gcode = DeviceManager::load_gcode(printer_type, "ams_unload.gcode"); + if (gcode.empty()) { + return -1; + } + + json j; + j["print"]["command"] = "gcode_line"; + j["print"]["param"] = gcode; + j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++); + + if (m_agent) + j["print"]["user_id"] = m_agent->get_user_id(); + + return this->publish_json(j.dump()); + } else { json j; j["print"]["command"] = "unload_filament";