Fix of SLADisplayOrientation updates

This commit is contained in:
bubnikv 2018-12-14 17:19:17 +01:00
parent 506cbcb4a7
commit d6471e7b07
4 changed files with 10 additions and 4 deletions

View File

@ -2394,8 +2394,10 @@ void PrintConfigDef::init_sla_params()
def->tooltip = L("Display orientation");
def->cli = "display-orientation=s";
def->enum_keys_map = &ConfigOptionEnum<SLADisplayOrientation>::get_enum_values();
def->enum_values.push_back("Landscape");
def->enum_values.push_back("Portrait");
def->enum_values.push_back("landscape");
def->enum_values.push_back("portrait");
def->enum_labels.push_back(L("Landscape"));
def->enum_labels.push_back(L("Portrait"));
def->default_value = new ConfigOptionEnum<SLADisplayOrientation>(sladoPortrait);
def = this->add("printer_correction", coFloats);

View File

@ -155,8 +155,8 @@ template<> inline const t_config_enum_values& ConfigOptionEnum<FilamentType>::ge
template<> inline const t_config_enum_values& ConfigOptionEnum<SLADisplayOrientation>::get_enum_values() {
static const t_config_enum_values keys_map = {
{ "Landscape", sladoLandscape},
{ "Portrait", sladoPortrait}
{ "landscape", sladoLandscape},
{ "portrait", sladoPortrait}
};
return keys_map;

View File

@ -638,6 +638,8 @@ boost::any& Choice::get_value()
m_value = static_cast<SeamPosition>(ret_enum);
else if (m_opt_id.compare("host_type") == 0)
m_value = static_cast<PrintHostType>(ret_enum);
else if (m_opt_id.compare("display_orientation") == 0)
m_value = static_cast<SLADisplayOrientation>(ret_enum);
}
return m_value;

View File

@ -195,6 +195,8 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt
config.set_key_value(opt_key, new ConfigOptionEnum<SeamPosition>(boost::any_cast<SeamPosition>(value)));
else if (opt_key.compare("host_type") == 0)
config.set_key_value(opt_key, new ConfigOptionEnum<PrintHostType>(boost::any_cast<PrintHostType>(value)));
else if (opt_key.compare("display_orientation") == 0)
config.set_key_value(opt_key, new ConfigOptionEnum<SLADisplayOrientation>(boost::any_cast<SLADisplayOrientation>(value)));
}
break;
case coPoints:{