Add material print speed parameter for sla printers except sl1

This commit is contained in:
tamasmeszaros 2021-11-10 13:44:47 +01:00
parent 67373ca722
commit a7260e7257
6 changed files with 35 additions and 1 deletions

View File

@ -382,6 +382,7 @@ void fill_iniconf(ConfMap &m, const SLAPrint &print)
m["layerHeight"] = get_cfg_value(cfg, "layer_height");
m["expTime"] = get_cfg_value(cfg, "exposure_time");
m["expTimeFirst"] = get_cfg_value(cfg, "initial_exposure_time");
m["expUserProfile"] = get_cfg_value(cfg, "material_print_speed") == "slow" ? "1" : "0";
m["materialName"] = get_cfg_value(cfg, "sla_material_settings_id");
m["printerModel"] = get_cfg_value(cfg, "printer_model");
m["printerVariant"] = get_cfg_value(cfg, "printer_variant");

View File

@ -551,6 +551,7 @@ static std::vector<std::string> s_Preset_sla_material_options {
"material_correction_z",
"material_notes",
"material_vendor",
"material_print_speed",
"default_sla_material_profile",
"compatible_prints", "compatible_prints_condition",
"compatible_printers", "compatible_printers_condition", "inherits"

View File

@ -165,6 +165,12 @@ static const t_config_enum_values s_keys_map_SLAPillarConnectionMode = {
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SLAPillarConnectionMode)
static const t_config_enum_values s_keys_map_SLAMaterialSpeed = {
{"slow", slamsSlow},
{"fast", slamsFast}
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SLAMaterialSpeed);
static const t_config_enum_values s_keys_map_BrimType = {
{"no_brim", btNoBrim},
{"outer_only", btOuterOnly},
@ -3730,6 +3736,17 @@ void PrintConfigDef::init_sla_params()
def->max = 10;
def->mode = comExpert;
def->set_default_value(new ConfigOptionFloat(2.0));
def = this->add("material_print_speed", coEnum);
def->label = L("Print speed");
def->tooltip = L("lorem ipsum");
def->enum_keys_map = &ConfigOptionEnum<SLAMaterialSpeed>::get_enum_values();
def->enum_values.push_back("slow");
def->enum_values.push_back("fast");
def->enum_labels.push_back(L("Slow"));
def->enum_labels.push_back(L("Fast"));
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionEnum<SLAMaterialSpeed>(slamsSlow));
}
void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &value)

View File

@ -915,6 +915,8 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, hollowing_closing_distance))
)
enum SLAMaterialSpeed { slamsSlow, slamsFast };
PRINT_CONFIG_CLASS_DEFINE(
SLAMaterialConfig,
@ -929,6 +931,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, material_correction_x))
((ConfigOptionFloat, material_correction_y))
((ConfigOptionFloat, material_correction_z))
((ConfigOptionEnum<SLAMaterialSpeed>, material_print_speed))
)
PRINT_CONFIG_CLASS_DEFINE(

View File

@ -4239,6 +4239,11 @@ void TabSLAMaterial::build()
optgroup->append_single_option_line(option);
build_preset_description_line(optgroup.get());
page = add_options_page(L("Material printing profile"), "note.png");
optgroup = page->new_optgroup(L("Material printing profile"));
option = optgroup->get_option("material_print_speed");
optgroup->append_single_option_line(option);
}
// Reload current config (aka presets->edited_preset->config) into the UI fields.
@ -4249,6 +4254,13 @@ void TabSLAMaterial::reload_config()
Tab::reload_config();
}
void TabSLAMaterial::toggle_options()
{
const Preset &current_printer = wxGetApp().preset_bundle->printers.get_edited_preset();
std::string model = current_printer.config.opt_string("printer_model");
m_config_manipulation.toggle_field("material_print_speed", model != "SL1");
}
void TabSLAMaterial::update()
{
if (m_preset_bundle->printers.get_selected_preset().printer_technology() == ptFFF)

View File

@ -480,7 +480,7 @@ public:
void build() override;
void reload_config() override;
void toggle_options() override {};
void toggle_options() override;
void update() override;
void init_options_list() override;
bool supports_printer_technology(const PrinterTechnology tech) const override { return tech == ptSLA; }