From 3119a84eb2af58b89113f03c4393d1062423f930 Mon Sep 17 00:00:00 2001 From: tao wang Date: Wed, 21 Aug 2024 21:16:00 +0800 Subject: [PATCH] FIX:fixed unable to reset ams filament setting jira:[for reset ams] Change-Id: I9f2f8be4a6e16b05191e4076db4e3f53d7601db4 --- src/slic3r/GUI/AMSMaterialsSetting.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/AMSMaterialsSetting.cpp b/src/slic3r/GUI/AMSMaterialsSetting.cpp index bb2bf9d98..bb1278232 100644 --- a/src/slic3r/GUI/AMSMaterialsSetting.cpp +++ b/src/slic3r/GUI/AMSMaterialsSetting.cpp @@ -462,10 +462,23 @@ void AMSMaterialsSetting::on_select_reset(wxCommandEvent& event) { if (obj) { // set filament if (is_virtual_tray()) { - obj->command_ams_filament_settings(255, VIRTUAL_TRAY_MAIN_ID, ams_filament_id, ams_setting_id, std::string(col_buf), m_filament_type, nozzle_temp_min_int, nozzle_temp_max_int); + auto tar_tray = VIRTUAL_TRAY_DEPUTY_ID; + + if (!obj->is_enable_np) { + tar_tray = VIRTUAL_TRAY_DEPUTY_ID; + } + else { + tar_tray = 0; + } + obj->command_ams_filament_settings(ams_id, tar_tray, ams_filament_id, ams_setting_id, std::string(col_buf), m_filament_type, nozzle_temp_min_int, nozzle_temp_max_int); } else if(m_is_third){ - obj->command_ams_filament_settings(ams_id, tray_id, ams_filament_id, ams_setting_id, std::string(col_buf), m_filament_type, nozzle_temp_min_int, nozzle_temp_max_int); + if (obj->is_enable_np) { + obj->command_ams_filament_settings(ams_id, slot_id, ams_filament_id, ams_setting_id, std::string(col_buf), m_filament_type, nozzle_temp_min_int, nozzle_temp_max_int); + } + else { + obj->command_ams_filament_settings(ams_id, ams_id * 4 + slot_id, ams_filament_id, ams_setting_id, std::string(col_buf), m_filament_type, nozzle_temp_min_int, nozzle_temp_max_int); + } } // set k / n value