FIX: backend get the extruder id based on filament_map

Change-Id: Ib7679c0fc67336e462467dab9f5b4d4684d6eb19
(cherry picked from commit dcd9fd501354da33baea2adc0f645fabe8880cf1)
This commit is contained in:
zhimin.zeng
2024-07-02 19:26:52 +08:00
committed by Noisyfox
parent f5d2a1bc0c
commit 8db3e3cd54
20 changed files with 193 additions and 131 deletions

View File

@@ -48,12 +48,14 @@ int get_extruder_idx(const DynamicPrintConfig& config, const std::string &opt_ke
NozzleVolumeType nozzle_volume_type = (NozzleVolumeType) (opt_nozzle_volume_type->get_at(cur_extruder_id));
std::string id_name, variant_name;
unsigned int stride = 1;
if (printer_options_with_variant_1.count(opt_key) > 0) { // printer parameter
id_name = "printer_extruder_id";
variant_name = "printer_extruder_variant";
} else if (printer_options_with_variant_2.count(opt_key) > 0) {
id_name = "printer_extruder_id";
variant_name = "printer_extruder_variant";
stride = 2;
} else if (filament_options_with_variant.count(opt_key) > 0) {
//filament don't use id anymore
//id_name = "filament_extruder_id";
@@ -66,7 +68,7 @@ int get_extruder_idx(const DynamicPrintConfig& config, const std::string &opt_ke
}
// variant index
int variant_index = config.get_index_for_extruder(cur_extruder_id + 1, id_name, extruder_type, nozzle_volume_type, variant_name);
int variant_index = config.get_index_for_extruder(cur_extruder_id + 1, id_name, extruder_type, nozzle_volume_type, variant_name, stride);
if (variant_index < 0) {
assert(false);
return 0;