mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 07:34:03 -06:00
FIX: seprate filament_type and display_filament_type
special case for "Support G" and "Support W" Change-Id: I26f873083d6afb58fb10ebc9beef54fbf5e18320 Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
parent
b4c7d5b65b
commit
ea7aaf7a8d
13 changed files with 73 additions and 34 deletions
|
@ -637,9 +637,9 @@ void Preset::set_visible_from_appconfig(const AppConfig &app_config)
|
|||
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": name %1%, is_visible set to %2%")%name % is_visible;
|
||||
}
|
||||
|
||||
std::string Preset::get_filament_type()
|
||||
std::string Preset::get_filament_type(std::string &display_filament_type)
|
||||
{
|
||||
return config.get_filament_type();
|
||||
return config.get_filament_type(display_filament_type);
|
||||
}
|
||||
|
||||
static std::vector<std::string> s_Preset_print_options {
|
||||
|
|
|
@ -295,7 +295,7 @@ public:
|
|||
bool operator<(const Preset &other) const { return this->name < other.name; }
|
||||
|
||||
// special for upport G and Support W
|
||||
std::string get_filament_type();
|
||||
std::string get_filament_type(std::string &display_filament_type);
|
||||
|
||||
static const std::vector<std::string>& print_options();
|
||||
static const std::vector<std::string>& filament_options();
|
||||
|
|
|
@ -3587,7 +3587,7 @@ std::string DynamicPrintConfig::validate()
|
|||
}
|
||||
}
|
||||
|
||||
std::string DynamicPrintConfig::get_filament_type(int id)
|
||||
std::string DynamicPrintConfig::get_filament_type(std::string &displayed_filament_type, int id)
|
||||
{
|
||||
auto* filament_id = dynamic_cast<const ConfigOptionStrings*>(this->option("filament_id"));
|
||||
auto* filament_type = dynamic_cast<const ConfigOptionStrings*>(this->option("filament_type"));
|
||||
|
@ -3598,9 +3598,11 @@ std::string DynamicPrintConfig::get_filament_type(int id)
|
|||
|
||||
if (!filament_is_support) {
|
||||
if (filament_type) {
|
||||
displayed_filament_type = filament_type->get_at(id);
|
||||
return filament_type->get_at(id);
|
||||
}
|
||||
else {
|
||||
displayed_filament_type = "";
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
@ -3609,25 +3611,33 @@ std::string DynamicPrintConfig::get_filament_type(int id)
|
|||
if (is_support) {
|
||||
if (filament_id) {
|
||||
if (filament_id->get_at(id) == "GFS00") {
|
||||
return "Support W";
|
||||
displayed_filament_type = "Support W";
|
||||
return "PLA-S";
|
||||
}
|
||||
else if (filament_id->get_at(id) == "GFS01") {
|
||||
return "Support G";
|
||||
displayed_filament_type = "Support G";
|
||||
return "PA-S";
|
||||
}
|
||||
else {
|
||||
displayed_filament_type = filament_type->get_at(id);
|
||||
return filament_type->get_at(id);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (filament_type->get_at(id) == "PLA")
|
||||
return "Support W";
|
||||
else if (filament_type->get_at(id) == "PA")
|
||||
return "Support G";
|
||||
else
|
||||
if (filament_type->get_at(id) == "PLA") {
|
||||
displayed_filament_type = "Support W";
|
||||
return "PLA-S";
|
||||
} else if (filament_type->get_at(id) == "PA") {
|
||||
displayed_filament_type = "Support G";
|
||||
return "PA-S";
|
||||
} else {
|
||||
displayed_filament_type = filament_type->get_at(id);
|
||||
return filament_type->get_at(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
displayed_filament_type = filament_type->get_at(id);
|
||||
return filament_type->get_at(id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -325,7 +325,7 @@ public:
|
|||
{ PrintConfigDef::handle_legacy(opt_key, value); }
|
||||
|
||||
//BBS special case Support G/ Support W
|
||||
std::string get_filament_type(int id = 0);
|
||||
std::string get_filament_type(std::string &displayed_filament_type, int id = 0);
|
||||
};
|
||||
|
||||
void handle_legacy_sla(DynamicPrintConfig &config);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue