update slic3r

This commit is contained in:
QIDI TECH
2024-11-28 15:19:12 +08:00
parent a26696f35e
commit 7eb6543991
196 changed files with 18701 additions and 3803 deletions

View File

@@ -82,7 +82,7 @@ const std::string& shortkey_ctrl_prefix()
{
static const std::string str =
#ifdef __APPLE__
"⌘+"
"command+" //"⌘+"
#else
_u8L("Ctrl+")
#endif
@@ -94,7 +94,7 @@ const std::string& shortkey_alt_prefix()
{
static const std::string str =
#ifdef __APPLE__
"⌥+"
"option+"//"⌥+"
#else
"Alt+"
#endif
@@ -108,8 +108,8 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt
try{
if (config.def()->get(opt_key)->type == coBools && config.def()->get(opt_key)->nullable) {
ConfigOptionBoolsNullable* vec_new = new ConfigOptionBoolsNullable{ boost::any_cast<unsigned char>(value) };
config.option<ConfigOptionBoolsNullable>(opt_key)->set_at(vec_new, opt_index, 0);
auto vec_new = std::make_unique<ConfigOptionBoolsNullable>(std::vector<unsigned char>{boost::any_cast<unsigned char>(value)});
config.option<ConfigOptionBoolsNullable>(opt_key)->set_at(vec_new.get(), opt_index, 0);
return;
}
@@ -125,6 +125,17 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt
double val = std::stod(str); // locale-dependent (on purpose - the input is the actual content of the field)
config.set_key_value(opt_key, new ConfigOptionFloatOrPercent(val, percent));
break;}
case coFloatsOrPercents:{
std::string str = boost::any_cast<std::string>(value);
bool percent = false;
if (str.back() == '%') {
str.pop_back();
percent = true;
}
double val = std::stod(str); // locale-dependent (on purpose - the input is the actual content of the field)
auto vec_new = std::make_unique<ConfigOptionFloatOrPercent>(val, percent);
config.option<ConfigOptionFloatsOrPercents>(opt_key)->set_at(vec_new.get(), opt_index, opt_index);
break;}
case coPercent:
config.set_key_value(opt_key, new ConfigOptionPercent(boost::any_cast<double>(value)));
break;
@@ -134,13 +145,13 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt
break;
}
case coPercents:{
ConfigOptionPercents* vec_new = new ConfigOptionPercents{ boost::any_cast<double>(value) };
config.option<ConfigOptionPercents>(opt_key)->set_at(vec_new, opt_index, opt_index);
auto vec_new = std::make_unique <ConfigOptionPercent>(boost::any_cast<double>(value));
config.option<ConfigOptionPercents>(opt_key)->set_at(vec_new.get(), opt_index, opt_index);
break;
}
case coFloats:{
ConfigOptionFloats* vec_new = new ConfigOptionFloats{ boost::any_cast<double>(value) };
config.option<ConfigOptionFloats>(opt_key)->set_at(vec_new, opt_index, opt_index);
auto vec_new = std::make_unique<ConfigOptionFloat>(boost::any_cast<double>(value));
config.option<ConfigOptionFloats>(opt_key)->set_at(vec_new.get(), opt_index, opt_index);
break;
}
case coString:
@@ -165,8 +176,8 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt
config.option<ConfigOptionStrings>(opt_key)->values = values;
}
else{
ConfigOptionStrings* vec_new = new ConfigOptionStrings{ boost::any_cast<std::string>(value) };
config.option<ConfigOptionStrings>(opt_key)->set_at(vec_new, opt_index, 0);
auto vec_new = std::make_unique<ConfigOptionString>(boost::any_cast<std::string>(value));
config.option<ConfigOptionStrings>(opt_key)->set_at(vec_new.get(), opt_index, 0);
}
}
break;
@@ -174,15 +185,15 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt
config.set_key_value(opt_key, new ConfigOptionBool(boost::any_cast<bool>(value)));
break;
case coBools:{
ConfigOptionBools* vec_new = new ConfigOptionBools{ boost::any_cast<unsigned char>(value) != 0 };
config.option<ConfigOptionBools>(opt_key)->set_at(vec_new, opt_index, 0);
auto vec_new = std::make_unique<ConfigOptionBool>(boost::any_cast<unsigned char>(value) != 0);
config.option<ConfigOptionBools>(opt_key)->set_at(vec_new.get(), opt_index, 0);
break;}
case coInt:
config.set_key_value(opt_key, new ConfigOptionInt(boost::any_cast<int>(value)));
break;
case coInts:{
ConfigOptionInts* vec_new = new ConfigOptionInts{ boost::any_cast<int>(value) };
config.option<ConfigOptionInts>(opt_key)->set_at(vec_new, opt_index, 0);
auto vec_new = std::make_unique<ConfigOptionInt>(boost::any_cast<int>(value));
config.option<ConfigOptionInts>(opt_key)->set_at(vec_new.get(), opt_index, 0);
}
break;
case coEnum:{
@@ -193,9 +204,9 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt
break;
// QDS
case coEnums:{
ConfigOptionEnumsGeneric* vec_new = new ConfigOptionEnumsGeneric{ boost::any_cast<int>(value) };
auto vec_new = std::make_unique<ConfigOptionEnumsGeneric>(std::vector<int>{boost::any_cast<int>(value)});
if (config.has(opt_key))
config.option<ConfigOptionEnumsGeneric>(opt_key)->set_at(vec_new, opt_index, 0);
config.option<ConfigOptionEnumsGeneric>(opt_key)->set_at(vec_new.get(), opt_index, 0);
}
break;
case coPoint:{
@@ -207,8 +218,8 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt
config.option<ConfigOptionPoints>(opt_key)->values = boost::any_cast<std::vector<Vec2d>>(value);
break;
}
ConfigOptionPoints* vec_new = new ConfigOptionPoints{ boost::any_cast<Vec2d>(value) };
config.option<ConfigOptionPoints>(opt_key)->set_at(vec_new, opt_index, 0);
auto vec_new = std::make_unique<ConfigOptionPoint>(boost::any_cast<Vec2d>(value));
config.option<ConfigOptionPoints>(opt_key)->set_at(vec_new.get(), opt_index, 0);
}
break;
case coNone: