From 4d8eefb1ea23e70cdc7520817a0d9ffed825aa03 Mon Sep 17 00:00:00 2001 From: "qing.zhang" Date: Mon, 24 Oct 2022 14:58:35 +0800 Subject: [PATCH] ENH: open the filament_color preset Signed-off-by: qing.zhang Change-Id: Idca08be5401aad1672adc46f9604338e3456f519 --- .../profiles/BBL/filament/fdm_filament_common.json | 3 +++ src/libslic3r/Preset.cpp | 2 +- src/libslic3r/PrintConfig.cpp | 12 ++++++------ src/slic3r/GUI/Tab.cpp | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/resources/profiles/BBL/filament/fdm_filament_common.json b/resources/profiles/BBL/filament/fdm_filament_common.json index 208d6ac17..8fc207cdd 100644 --- a/resources/profiles/BBL/filament/fdm_filament_common.json +++ b/resources/profiles/BBL/filament/fdm_filament_common.json @@ -3,6 +3,9 @@ "name": "fdm_filament_common", "from": "system", "instantiation": "false", + "filament_colour":[ + "#00AE42" + ], "cool_plate_temp" : [ "60" ], diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 8e2202cc4..c24aa3e96 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -734,7 +734,7 @@ static std::vector s_Preset_print_options { }; static std::vector s_Preset_filament_options { - /*"filament_colour", */"filament_diameter", "filament_type", "filament_soluble", "filament_is_support", "filament_max_volumetric_speed", + "filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_is_support", "filament_max_volumetric_speed", "filament_flow_ratio", "filament_density", "filament_cost", "filament_minimal_purge_on_wipe_tower", "nozzle_temperature", "nozzle_temperature_initial_layer", // BBS diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 9fe8e9f03..e4d490a27 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1064,12 +1064,12 @@ void PrintConfigDef::init_fff_params() def->mode = comSimple; def->set_default_value(new ConfigOptionInts { 60 }); - def = this->add("filament_colour", coStrings); - def->label = L("Color"); - def->tooltip = L("Only used as a visual help on UI"); + def = this->add("filament_colour", coStrings); + def->label = L("Defualt color"); + def->tooltip = L("Only used as a visual help on UI"); def->gui_type = ConfigOptionDef::GUIType::color; - def->mode = comDevelop; - def->set_default_value(new ConfigOptionStrings{ "#00AE42" }); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionStrings{"#00AE42"}); def = this->add("filament_max_volumetric_speed", coFloats); def->label = L("Max volumetric speed"); @@ -2926,7 +2926,7 @@ void PrintConfigDef::init_filament_option_keys() "filament_diameter", "min_layer_height", "max_layer_height", "retraction_length", "z_hop", "retraction_speed", "deretraction_speed", "retract_before_wipe", "retract_restart_extra", "retraction_minimum_travel", "wipe", "wipe_distance", - "retract_when_changing_layer", "retract_length_toolchange", "retract_restart_extra_toolchange", /*"filament_colour",*/ + "retract_when_changing_layer", "retract_length_toolchange", "retract_restart_extra_toolchange", "filament_colour", "default_filament_profile" }; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index ec107ae8a..ba9c94d13 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2421,7 +2421,7 @@ void TabFilament::build() optgroup->append_single_option_line("filament_soluble"); // BBS optgroup->append_single_option_line("filament_is_support"); - //optgroup->append_single_option_line("filament_colour"); + optgroup->append_single_option_line("filament_colour"); optgroup->append_single_option_line("filament_diameter"); optgroup->append_single_option_line("filament_flow_ratio"); optgroup->append_single_option_line("filament_density");