mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
ENH: calib support multi_extruder(UI part)
jira: none Change-Id: I3009c2f8b601dc078cfed787dc3531fc1d4848d6 (cherry picked from commit 11f61abefaca6f0810e76266e50729432a3aa15e)
This commit is contained in:
@@ -25,58 +25,6 @@ namespace Slic3r { namespace GUI {
|
||||
// BBS: new layout
|
||||
constexpr int titleWidth = 20;
|
||||
|
||||
// get the param index of cur_exturder
|
||||
int get_extruder_idx(const DynamicPrintConfig& config, const std::string &opt_key, int cur_extruder_id)
|
||||
{
|
||||
if (printer_extruder_options.find(opt_key) != printer_extruder_options.end()) {
|
||||
return cur_extruder_id;
|
||||
}
|
||||
|
||||
int extruder_count = wxGetApp().preset_bundle->get_printer_extruder_count();
|
||||
if (extruder_count == 1 || cur_extruder_id == -1)
|
||||
return 0;
|
||||
|
||||
assert(cur_extruder_id < extruder_count);
|
||||
const DynamicPrintConfig& cur_printer_config = wxGetApp().preset_bundle->printers.get_selected_preset().config;
|
||||
auto opt_extruder_type = dynamic_cast<const ConfigOptionEnumsGeneric *>(cur_printer_config.option("extruder_type"));
|
||||
auto opt_nozzle_volume_type = dynamic_cast<const ConfigOptionEnumsGeneric *>(cur_printer_config.option("nozzle_volume_type"));
|
||||
|
||||
if (!opt_extruder_type || !opt_nozzle_volume_type)
|
||||
return 0;
|
||||
|
||||
ExtruderType extruder_type = (ExtruderType) (opt_extruder_type->get_at(cur_extruder_id));
|
||||
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";
|
||||
variant_name = "filament_extruder_variant";
|
||||
} else if (print_options_with_variant.count(opt_key) > 0) {
|
||||
id_name = "print_extruder_id";
|
||||
variant_name = "print_extruder_variant";
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// variant index
|
||||
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;
|
||||
}
|
||||
|
||||
return variant_index;
|
||||
}
|
||||
|
||||
const t_field& OptionsGroup::build_field(const Option& opt) {
|
||||
return build_field(opt.opt_id, opt.opt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user