ENH: filament map params switch to global param

1.Add more filament map modes
2.Filament map and mode are set as project config
3.Plate filament map is only valid when plate filament mode is
manual

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I33b2f853e0b77b9d605be1f2f1172b44df43da15
(cherry picked from commit e45f8c6dc2146e1e31a1c21e8aaada540af112d0)
This commit is contained in:
xun.zhang
2024-12-19 14:53:42 +08:00
committed by Noisyfox
parent 66814d687e
commit 05bf5c114b
20 changed files with 218 additions and 115 deletions

View File

@@ -1126,8 +1126,9 @@ bool SelectMachineDialog::do_ams_mapping(MachineObject *obj_)
// try color and type mapping
const auto& full_config = wxGetApp().preset_bundle->full_config();
const auto& project_config = wxGetApp().preset_bundle->project_config;
size_t nozzle_nums = full_config.option<ConfigOptionFloats>("nozzle_diameter")->values.size();
m_filaments_map = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_filament_maps();
m_filaments_map = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_real_filament_maps(project_config);
int filament_result = 0;
std::vector<bool> map_opt; //four values: use_left_ams, use_right_ams, use_left_ext, use_right_ext
@@ -1443,9 +1444,10 @@ bool SelectMachineDialog::is_nozzle_type_match(ExtderData data) {
if (data.total_extder_count <= 1 || data.extders.size() <= 1 || !wxGetApp().preset_bundle)
return false;
const auto& project_config = wxGetApp().preset_bundle->project_config;
//check nozzle used
auto used_filaments = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_used_extruders(); // 1 based
auto filament_maps = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_filament_maps(); // 1 based
auto filament_maps = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_real_filament_maps(project_config); // 1 based
std::map<int, std::string> used_extruders_flow;
std::vector<int> used_extruders; // 0 based
for (auto f : used_filaments) {
@@ -3544,7 +3546,8 @@ void SelectMachineDialog::reset_and_sync_ams_list()
bool use_double_extruder = nozzle_nums > 1 ? true : false;
if (use_double_extruder)
{
m_filaments_map = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_filament_maps();
const auto& project_config = preset_bundle->project_config;
m_filaments_map = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_real_filament_maps(project_config);
}
for (auto i = 0; i < extruders.size(); i++) {