mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
ENH: filament: delete filament_extruder_id related logic
jira: no jira Change-Id: Ie0d8e31a6a3eef0400b3ba6238f817bad4daca24 (cherry picked from commit e9081ba8d4013874c972f401b3633942028621b8)
This commit is contained in:
@@ -876,7 +876,7 @@ static std::vector<std::string> s_Preset_filament_options {
|
||||
//BBS
|
||||
"filament_wipe_distance", "additional_cooling_fan_speed",
|
||||
"nozzle_temperature_range_low", "nozzle_temperature_range_high",
|
||||
"filament_extruder_id", "filament_extruder_variant",
|
||||
"filament_extruder_variant",
|
||||
//SoftFever
|
||||
"enable_pressure_advance", "pressure_advance","adaptive_pressure_advance","adaptive_pressure_advance_model","adaptive_pressure_advance_overhangs", "adaptive_pressure_advance_bridges","chamber_temperature", "filament_shrink","filament_shrinkage_compensation_z", "support_material_interface_fan_speed","internal_bridge_fan_speed", "filament_notes" /*,"filament_seam_gap"*/,
|
||||
"ironing_fan_speed",
|
||||
|
||||
@@ -2208,7 +2208,7 @@ DynamicPrintConfig PresetBundle::full_fff_config(bool apply_extruder, std::vecto
|
||||
//BBS: update filament config related with variants
|
||||
DynamicPrintConfig filament_config = this->filaments.get_edited_preset().config;
|
||||
if (apply_extruder)
|
||||
filament_config.update_values_to_printer_extruders(out, filament_options_with_variant, "filament_extruder_id", "filament_extruder_variant", 1, filament_maps[0]);
|
||||
filament_config.update_values_to_printer_extruders(out, filament_options_with_variant, "", "filament_extruder_variant", 1, filament_maps[0]);
|
||||
out.apply(filament_config);
|
||||
compatible_printers_condition.emplace_back(this->filaments.get_edited_preset().compatible_printers_condition());
|
||||
compatible_prints_condition .emplace_back(this->filaments.get_edited_preset().compatible_prints_condition());
|
||||
@@ -2298,7 +2298,7 @@ DynamicPrintConfig PresetBundle::full_fff_config(bool apply_extruder, std::vecto
|
||||
for (size_t i = 0; i < num_filaments; ++i) {
|
||||
filament_temp_configs[i] = *(filament_configs[i]);
|
||||
if (apply_extruder)
|
||||
filament_temp_configs[i].update_values_to_printer_extruders(out, filament_options_with_variant, "filament_extruder_id", "filament_extruder_variant", 1, filament_maps[i]);
|
||||
filament_temp_configs[i].update_values_to_printer_extruders(out, filament_options_with_variant, "", "filament_extruder_variant", 1, filament_maps[i]);
|
||||
}
|
||||
|
||||
// loop through options and apply them to the resulting config.
|
||||
@@ -2564,11 +2564,11 @@ void PresetBundle::load_config_file_config(const std::string &name_or_path, bool
|
||||
if (config.option("extruder_variant_list")) {
|
||||
//3mf support multiple extruder logic
|
||||
size_t extruder_count = config.option<ConfigOptionFloats>("nozzle_diameter")->values.size();
|
||||
extruder_variant_count = config.option<ConfigOptionInts>("filament_extruder_id", true)->size();
|
||||
extruder_variant_count = config.option<ConfigOptionStrings>("filament_extruder_variant", true)->size();
|
||||
if ((extruder_variant_count != filament_self_indice.size())
|
||||
|| (extruder_variant_count < num_filaments)) {
|
||||
assert(false);
|
||||
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(": invalid config file %1%, can not find suitable filament_extruder_id or filament_self_index") % name_or_path;
|
||||
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(": invalid config file %1%, can not find suitable filament_extruder_variant or filament_self_index") % name_or_path;
|
||||
throw Slic3r::RuntimeError(std::string("invalid configuration file: ") + name_or_path);
|
||||
}
|
||||
if (extruder_count != extruder_variant_count) {
|
||||
|
||||
@@ -4435,11 +4435,11 @@ void PrintConfigDef::init_fff_params()
|
||||
def->set_default_value(new ConfigOptionStrings { "Direct Drive Normal" });
|
||||
def->cli = ConfigOptionDef::nocli;
|
||||
|
||||
def = this->add("filament_extruder_id", coInts);
|
||||
/*def = this->add("filament_extruder_id", coInts);
|
||||
def->label = "Filament extruder id";
|
||||
def->tooltip = "Filament extruder id";
|
||||
def->set_default_value(new ConfigOptionInts { 1 });
|
||||
def->cli = ConfigOptionDef::nocli;
|
||||
def->cli = ConfigOptionDef::nocli;*/
|
||||
|
||||
def = this->add("filament_extruder_variant", coStrings);
|
||||
def->label = "Filament's extruder variant";
|
||||
@@ -7150,7 +7150,7 @@ std::set<std::string> print_options_with_variant = {
|
||||
|
||||
std::set<std::string> filament_options_with_variant = {
|
||||
"filament_max_volumetric_speed",
|
||||
"filament_extruder_id",
|
||||
//"filament_extruder_id",
|
||||
"filament_extruder_variant"
|
||||
};
|
||||
|
||||
@@ -7610,18 +7610,27 @@ int DynamicPrintConfig::get_index_for_extruder(int extruder_id, std::string id_n
|
||||
int ret = -1;
|
||||
|
||||
auto variant_opt = dynamic_cast<const ConfigOptionStrings*>(this->option(variant_name));
|
||||
auto id_opt = dynamic_cast<const ConfigOptionInts*>(this->option(id_name));
|
||||
if ((variant_opt != nullptr)&&(id_opt != nullptr)) {
|
||||
const ConfigOptionInts* id_opt = id_name.empty()?nullptr: dynamic_cast<const ConfigOptionInts*>(this->option(id_name));
|
||||
if (variant_opt != nullptr) {
|
||||
int v_size = variant_opt->values.size();
|
||||
int i_size = id_opt->values.size();
|
||||
//int i_size = id_opt->values.size();
|
||||
std::string extruder_variant = get_extruder_variant_string(extruder_type, nozzle_volume_type);
|
||||
for (int index = 0; index < v_size; index++)
|
||||
{
|
||||
const std::string variant = variant_opt->get_at(index);
|
||||
const int id = id_opt->get_at(index);
|
||||
if ((extruder_variant == variant)&&(id == extruder_id)) {
|
||||
ret = index;
|
||||
break;
|
||||
if (extruder_variant == variant) {
|
||||
if (id_opt) {
|
||||
const int id = id_opt->get_at(index);
|
||||
if (id == extruder_id) {
|
||||
ret = index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
ret = index;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1202,7 +1202,7 @@ PRINT_CONFIG_CLASS_DEFINE(
|
||||
((ConfigOptionFloats, filament_max_volumetric_speed))
|
||||
((ConfigOptionInts, required_nozzle_HRC))
|
||||
((ConfigOptionInts, filament_map))
|
||||
((ConfigOptionInts, filament_extruder_id))
|
||||
//((ConfigOptionInts, filament_extruder_id))
|
||||
((ConfigOptionStrings, filament_extruder_variant))
|
||||
// BBS
|
||||
((ConfigOptionBool, scan_first_layer))
|
||||
|
||||
@@ -48,7 +48,8 @@ int get_extruder_idx(const DynamicPrintConfig& config, const std::string &opt_ke
|
||||
id_name = "printer_extruder_id";
|
||||
variant_name = "printer_extruder_variant";
|
||||
} else if (filament_options_with_variant.count(opt_key) > 0) {
|
||||
id_name = "filament_extruder_id";
|
||||
//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";
|
||||
@@ -1346,8 +1347,8 @@ void ogStaticText::SetPathEnd(const std::string& link)
|
||||
} );
|
||||
Bind(wxEVT_ENTER_WINDOW, [this, link](wxMouseEvent& event) {
|
||||
SetToolTip(OptionsGroup::get_url(std::string()));
|
||||
FocusText(true);
|
||||
event.Skip();
|
||||
FocusText(true);
|
||||
event.Skip();
|
||||
});
|
||||
Bind(wxEVT_LEAVE_WINDOW, [this](wxMouseEvent& event) { FocusText(false); event.Skip(); });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user