From d54461413f7d4d955b51c3371cebfe59e95d8bb6 Mon Sep 17 00:00:00 2001 From: Stone Li Date: Mon, 1 Aug 2022 15:26:59 +0800 Subject: [PATCH] ENH: add calibration and unload filament define new command for calibration and unload filament Change-Id: I834680740b4052d5719193a40945ca2704a3d858 Signed-off-by: Stone Li (cherry picked from commit c742fb5feb26938152858c44056d809fe18ce742) Signed-off-by: Stone Li --- src/slic3r/GUI/DeviceManager.cpp | 41 ++++++++++++++++++++++---------- src/slic3r/GUI/Monitor.cpp | 12 ---------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 353b46eaa7..5f19d39c06 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -1412,22 +1412,39 @@ int MachineObject::command_axis_control(std::string axis, double unit, double va int MachineObject::command_start_calibration() { - // fixed gcode file - json j; - j["print"]["command"] = "gcode_file"; - j["print"]["param"] = "/usr/etc/print/auto_cali_for_user.gcode"; - j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++); - return this->publish_json(j.dump()); + if (printer_type == "BL-P001" + || printer_type == "BL-P002") { + // fixed gcode file + json j; + j["print"]["command"] = "gcode_file"; + j["print"]["param"] = "/usr/etc/print/auto_cali_for_user.gcode"; + j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++); + return this->publish_json(j.dump()); + } else { + json j; + j["print"]["command"] = "calibration"; + j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++); + return this->publish_json(j.dump()); + } } int MachineObject::command_unload_filament() { - // fixed gcode file - json j; - j["print"]["command"] = "gcode_file"; - j["print"]["param"] = "/usr/etc/print/filament_unload.gcode"; - j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++); - return this->publish_json(j.dump()); + if (printer_type == "BL-P001" + || printer_type == "BL-P002") { + // fixed gcode file + json j; + j["print"]["command"] = "gcode_file"; + j["print"]["param"] = "/usr/etc/print/filament_unload.gcode"; + j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++); + return this->publish_json(j.dump()); + } + else { + json j; + j["print"]["command"] = "unload_filament"; + j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++); + return this->publish_json(j.dump()); + } } diff --git a/src/slic3r/GUI/Monitor.cpp b/src/slic3r/GUI/Monitor.cpp index c3c37af09e..ee12eea6bc 100644 --- a/src/slic3r/GUI/Monitor.cpp +++ b/src/slic3r/GUI/Monitor.cpp @@ -210,12 +210,6 @@ MonitorPanel::~MonitorPanel() m_hms_panel = new HMSPanel(m_tabpanel); m_tabpanel->AddPage(m_hms_panel, _L("HMS"),"", false); - -#if !BBL_RELEASE_TO_PUBLIC - m_debug_panel = new DebugPanel(m_tabpanel); - m_tabpanel->AddPage(m_debug_panel, _L("Debug"), "", false); -#endif - m_initialized = true; show_status((int)MonitorStatus::MONITOR_NO_PRINTER); } @@ -436,12 +430,6 @@ void MonitorPanel::update_all() if (m_upgrade_panel->IsShown()) { m_upgrade_panel->update(obj); } - -#if !BBL_RELEASE_TO_PUBLIC - if (m_debug_panel->IsShown()) { - m_debug_panel->update(obj); - } -#endif } bool MonitorPanel::Show(bool show)