From bc0fe0c8bc6e34d9cd6832b0309656880f9fa03f Mon Sep 17 00:00:00 2001 From: Stone Li Date: Wed, 12 Apr 2023 11:01:30 +0800 Subject: [PATCH] ENH: compatible with filament unload of new firmware Change-Id: I0b01a549929e716f0ac05176ba5dc05c360c081b Signed-off-by: Stone Li --- src/slic3r/GUI/DeviceManager.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 4ac30cdbc..bc74be42f 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -1892,8 +1892,8 @@ int MachineObject::command_start_calibration(bool vibration, bool bed_leveling, int MachineObject::command_unload_filament() { - if (printer_type == "BL-P001" - || printer_type == "BL-P002") { + if ((printer_type == "BL-P001" || printer_type == "BL-P002") + && !this->is_function_supported(PrinterFunction::FUNC_VIRTUAL_TYAY)) { // fixed gcode file json j; j["print"]["command"] = "gcode_file"; @@ -1901,7 +1901,10 @@ 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") { + else if (printer_type == "C11" + || ((printer_type == "BL-P001" || printer_type == "BL-P002") + && this->is_function_supported(PrinterFunction::FUNC_VIRTUAL_TYAY)) + ) { std::string gcode = DeviceManager::load_gcode(printer_type, "ams_unload.gcode"); if (gcode.empty()) { return -1;