ENH: add setting of extruder type

Signed-off-by: salt.wei <salt.wei@bambulab.com>
Change-Id: Ic126466f6b579dd6a55a1ba16a63c015d538c750
This commit is contained in:
salt.wei 2023-06-25 16:19:22 +08:00 committed by Lane.Wei
parent 66bb5bc4b6
commit c5d70a846e
16 changed files with 64 additions and 3 deletions

View file

@ -837,7 +837,7 @@ static std::vector<std::string> s_Preset_printer_options {
"print_host_webui",
"printhost_cafile","printhost_port","printhost_authorization_type",
"printhost_user", "printhost_password", "printhost_ssl_ignore_revoke",
"use_relative_e_distances"
"use_relative_e_distances", "extruder_type"
};
static std::vector<std::string> s_Preset_sla_print_options {

View file

@ -305,6 +305,12 @@ static const t_config_enum_values s_keys_map_ZHopType = {
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(ZHopType)
static const t_config_enum_values s_keys_map_ExtruderType = {
{ "DirectDrive", etDirectDrive },
{ "Bowden", etBowden }
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(ExtruderType)
static void assign_printer_technology_to_unknown(t_optiondef_map &options, PrinterTechnology printer_technology)
{
for (std::pair<const t_config_option_key, ConfigOptionDef> &kvp : options)
@ -2426,6 +2432,17 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionEnumsGeneric{ ZHopType::zhtSpiral });
def = this->add("extruder_type", coEnums);
def->label = L("Type");
def->tooltip = ("This setting is only used for initial value of manual calibration of presure advance. Bowden extruder usually has larger pa value. This setting doesn't influence normal slicing");
def->enum_keys_map = &ConfigOptionEnum<ExtruderType>::get_enum_values();
def->enum_values.push_back("DirectDrive");
def->enum_values.push_back("Bowden");
def->enum_labels.push_back(L("Direct drive"));
def->enum_labels.push_back(L("Bowden"));
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionEnumsGeneric{ ExtruderType::etDirectDrive });
def = this->add("retract_restart_extra", coFloats);
//def->label = L("Extra length on restart");
def->label = "Extra length on restart";

View file

@ -212,6 +212,12 @@ enum ZHopType {
zhtCount
};
// BBS
enum ExtruderType {
etDirectDrive = 0,
etBowden
};
static std::string bed_type_to_gcode_string(const BedType type)
{
std::string type_str;
@ -864,6 +870,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionBool, auxiliary_fan))
((ConfigOptionBool, accel_to_decel_enable))
((ConfigOptionPercent, accel_to_decel_factor))
((ConfigOptionEnumsGeneric, extruder_type))
)
// This object is mapped to Perl as Slic3r::Config::Print.