mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-30 17:41:59 +08:00
followup on 5f4b4da91e0c062153ca24ce4fbc829e5c1e6044
fix of value reading
This commit is contained in:
parent
a54aa25f1b
commit
8edc0b796d
@ -3976,8 +3976,12 @@ bool GUI_App::select_filament_preset(const Preset* preset, size_t extruder_index
|
||||
void GUI_App::search_and_select_filaments(const std::string& material, bool avoid_abrasive, size_t extruder_index, std::string& out_message)
|
||||
{
|
||||
const Preset* preset = preset_bundle->extruders_filaments[extruder_index].get_selected_preset();
|
||||
bool b = preset->config.option<ConfigOptionBools>("filament_abrasive")->get_at(0);
|
||||
// selected is ok
|
||||
if (!preset->is_default && preset->config.has("filament_type") && preset->config.option("filament_type")->serialize() == material) {
|
||||
if (!preset->is_default && preset->config.has("filament_type")
|
||||
&& (!avoid_abrasive || preset->config.option<ConfigOptionBools>("filament_abrasive")->get_at(0) == false)
|
||||
&& preset->config.option("filament_type")->serialize() == material)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// find installed compatible filament that is Prusa with suitable type and select it
|
||||
@ -3987,7 +3991,7 @@ void GUI_App::search_and_select_filaments(const std::string& material, bool avoi
|
||||
&& filament.preset->is_visible
|
||||
&& (!filament.preset->vendor || !filament.preset->vendor->templates_profile)
|
||||
&& filament.preset->config.has("filament_type")
|
||||
&& (!avoid_abrasive || filament.preset->config.opt_bool("filament_abrasive") == false)
|
||||
&& (!avoid_abrasive || filament.preset->config.option<ConfigOptionBools>("filament_abrasive")->get_at(0) == false)
|
||||
&& filament.preset->config.option("filament_type")->serialize() == material
|
||||
&& filament.preset->name.compare(0, 9, "Prusament") == 0
|
||||
&& select_filament_preset(filament.preset, extruder_index)
|
||||
@ -4006,7 +4010,7 @@ void GUI_App::search_and_select_filaments(const std::string& material, bool avoi
|
||||
&& filament.preset->is_visible
|
||||
&& (!filament.preset->vendor || !filament.preset->vendor->templates_profile)
|
||||
&& filament.preset->config.has("filament_type")
|
||||
&& (!avoid_abrasive || filament.preset->config.opt_bool("filament_abrasive") == false)
|
||||
&& (!avoid_abrasive || filament.preset->config.option<ConfigOptionBools>("filament_abrasive")->get_at(0) == false)
|
||||
&& filament.preset->config.option("filament_type")->serialize() == material
|
||||
&& select_filament_preset(filament.preset, extruder_index)
|
||||
)
|
||||
@ -4024,7 +4028,7 @@ void GUI_App::search_and_select_filaments(const std::string& material, bool avoi
|
||||
&& !filament.preset->is_default
|
||||
&& (!filament.preset->vendor || !filament.preset->vendor->templates_profile)
|
||||
&& filament.preset->config.has("filament_type")
|
||||
&& (!avoid_abrasive || filament.preset->config.opt_bool("filament_abrasive") == false)
|
||||
&& (!avoid_abrasive || filament.preset->config.option<ConfigOptionBools>("filament_abrasive")->get_at(0) == false)
|
||||
&& filament.preset->config.option("filament_type")->serialize() == material
|
||||
&& filament.preset->name.compare(0, 9, "Prusament") == 0
|
||||
&& select_filament_preset(filament.preset, extruder_index))
|
||||
|
@ -288,7 +288,7 @@ void fill_material_from_json(const std::string& json, std::vector<std::string>&
|
||||
}
|
||||
if (result_map.find("hardened") != result_map.end()) {
|
||||
for (const std::string& val : result_map["hardened"]) {
|
||||
avoid_abrasive_result.emplace_back(val == "false" ? 1 : 0);
|
||||
avoid_abrasive_result.emplace_back(val == "0" ? 1 : 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user