From 9bf251c54cf9d3fd6dc9e7625008a9980b0a7226 Mon Sep 17 00:00:00 2001 From: "xun.zhang" Date: Tue, 22 Aug 2023 19:39:45 +0800 Subject: [PATCH] ENH: add printer structure in code Signed-off-by: xun.zhang Change-Id: I57c24a0ea977b510932970817d67570ab3fe7bc4 (cherry picked from commit 409f03de471f65b9edf5c733b691e280c18c19cc) --- src/libslic3r/Preset.cpp | 2 +- src/libslic3r/PrintConfig.cpp | 26 ++++++++++++++++++++++++++ src/libslic3r/PrintConfig.hpp | 10 ++++++++++ src/slic3r/GUI/Tab.cpp | 2 ++ 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index d88177995..85e36d24a 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -852,7 +852,7 @@ static std::vector s_Preset_printer_options { "silent_mode", // BBS "scan_first_layer", "machine_load_filament_time", "machine_unload_filament_time", "machine_pause_gcode", "template_custom_gcode", - "nozzle_type","auxiliary_fan", "nozzle_volume","upward_compatible_machine", "z_hop_types","support_chamber_temp_control","support_air_filtration", + "nozzle_type","auxiliary_fan", "nozzle_volume","upward_compatible_machine", "z_hop_types","support_chamber_temp_control","support_air_filtration","printer_structure", //OrcaSlicer "host_type", "print_host", "printhost_apikey", "print_host_webui", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 8ddc2c388..64dbe25d7 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -299,6 +299,15 @@ static t_config_enum_values s_keys_map_NozzleType { }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(NozzleType) +static t_config_enum_values s_keys_map_PrinterStructure { + {"undefine", int(PrinterStructure::psUndefine)}, + {"corexy", int(PrinterStructure::psCoreXY)}, + {"i3", int(PrinterStructure::psI3)}, + {"hbot", int(PrinterStructure::psHbot)}, + {"delta", int(PrinterStructure::psDelta)} +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(PrinterStructure) + static t_config_enum_values s_keys_map_PerimeterGeneratorType{ { "classic", int(PerimeterGeneratorType::Classic) }, { "arachne", int(PerimeterGeneratorType::Arachne) } @@ -1739,6 +1748,23 @@ void PrintConfigDef::init_fff_params() def->mode = comDevelop; def->set_default_value(new ConfigOptionEnum(ntUndefine)); + def = this->add("printer_structure", coEnum); + def->label = L("Printer structure"); + def->tooltip = L("The physical arrangement and components of a printing device"); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values.push_back("undefine"); + def->enum_values.push_back("corexy"); + def->enum_values.push_back("i3"); + def->enum_values.push_back("hbot"); + def->enum_values.push_back("delta"); + def->enum_labels.push_back(L("Undefine")); + def->enum_labels.push_back(L("CoreXY")); + def->enum_labels.push_back(L("I3")); + def->enum_labels.push_back(L("Hbot")); + def->enum_labels.push_back(L("Delta")); + def->mode = comDevelop; + def->set_default_value(new ConfigOptionEnum(psUndefine)); + def = this->add("auxiliary_fan", coBool); def->label = L("Auxiliary part cooling fan"); def->tooltip = L("Enable this option if machine has auxiliary part cooling fan"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index cb8dc0699..3b42cf24c 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -210,6 +210,15 @@ enum NozzleType { ntCount }; +// BBS +enum PrinterStructure { + psUndefine=0, + psCoreXY, + psI3, + psHbot, + psDelta +}; + // BBS enum ZHopType { zhtAuto = 0, @@ -878,6 +887,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionString, template_custom_gcode)) //BBS ((ConfigOptionEnum, nozzle_type)) + ((ConfigOptionEnum,printer_structure)) ((ConfigOptionBool, auxiliary_fan)) ((ConfigOptionBool, support_chamber_temp_control)) ((ConfigOptionBool, support_air_filtration)) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index f7a5b85e7..3eec357de 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -3091,6 +3091,7 @@ void TabPrinter::build_fff() #endif optgroup = page->new_optgroup(L("Advanced"), L"param_advanced"); + optgroup->append_single_option_line("printer_structure"); optgroup->append_single_option_line("gcode_flavor"); optgroup->append_single_option_line("scan_first_layer"); optgroup->append_single_option_line("use_relative_e_distances"); @@ -3672,6 +3673,7 @@ void TabPrinter::toggle_options() toggle_option("single_extruder_multi_material", have_multiple_extruders); //BBS: gcode_flavore of BBL printer can't be edited and changed toggle_option("gcode_flavor", !is_BBL_printer); + toggle_option("printer_structure", !is_BBL_printer); toggle_option("use_relative_e_distances", !is_BBL_printer); toggle_option("support_chamber_temp_control",!is_BBL_printer);