OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::Preset Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Preset.hpp>

Collaboration diagram for Slic3r::Preset:

Public Types

enum  Type {
  TYPE_INVALID , TYPE_PRINT , TYPE_SLA_PRINT , TYPE_FILAMENT ,
  TYPE_SLA_MATERIAL , TYPE_PRINTER , TYPE_COUNT , TYPE_PHYSICAL_PRINTER ,
  TYPE_PLATE , TYPE_MODEL
}

Public Member Functions

bool is_user () const
bool can_overwrite () const
bool is_from_bundle () const
void load_info (const std::string &file)
void save_info (std::string file="")
void remove_files (bool cloud_already_deleted=false)
bool save (DynamicPrintConfig *parent_config)
void reload (Preset const &parent)
std::string label (bool no_alias) const
void set_dirty (const DynamicPrintConfig &config)
void set_dirty (bool dirty=true)
void reset_dirty ()
std::string & inherits ()
const std::string & inherits () const
std::string & compatible_prints_condition ()
const std::string & compatible_prints_condition () const
std::string & compatible_printers_condition ()
const std::string & compatible_printers_condition () const
PrinterTechnology printer_technology () const
PrinterTechnology & printer_technology_ref ()
void set_visible_from_appconfig (const AppConfig &app_config)
void set_num_extruders (unsigned int n)
bool operator< (const Preset &other) const
std::string get_filament_type (std::string &display_filament_type)
std::string get_printer_type (PresetBundle *preset_bundle)
std::string get_current_printer_type (PresetBundle *preset_bundle)
std::string get_printer_id () const
bool has_lidar (PresetBundle *preset_bundle)
bool is_custom_defined ()
BedType get_default_bed_type (PresetBundle *preset_bundle)
bool has_cali_lines (PresetBundle *preset_bundle)
 Preset (Type type, const std::string &name, bool is_default=false)

Static Public Member Functions

static std::string get_type_string (Preset::Type type)
static std::string get_iot_type_string (Preset::Type type)
static Preset::Type get_type_from_string (std::string type_str)
static std::string & inherits (DynamicPrintConfig &cfg)
static void normalize_inherits (DynamicPrintConfig &cfg, const Preset *resolved_parent)
static std::string & compatible_prints_condition (DynamicPrintConfig &cfg)
static std::string & compatible_printers_condition (DynamicPrintConfig &cfg)
static PrinterTechnology printer_technology (const DynamicPrintConfig &cfg)
static void get_extruder_names_and_keysets (Type type, std::string &extruder_id_name, std::string &extruder_variant_name, std::set< std::string > **p_key_set1, std::set< std::string > **p_key_set2)
static DynamicPrintConfig load_external_config (Type type, const DynamicPrintConfig &default_config, const DynamicPrintConfig &project_config, const std::set< std::string > &different_settings_list, const std::function< DynamicPrintConfig *(const std::string &inherits)> &find_base, t_config_option_keys *keys=nullptr)
static double convert_pellet_flow_to_filament_diameter (double pellet_flow_coefficient)
static double convert_filament_diameter_to_pellet_flow (double filament_diameter)
static const std::vector< std::string > & print_options ()
static const std::vector< std::string > & filament_options ()
static const std::vector< std::string > & printer_options ()
static const std::vector< std::string > & nozzle_options ()
static const std::vector< std::string > & machine_limits_options ()
static const char * plugin_overrides_key (Type type)
static const std::vector< std::string > & sla_printer_options ()
static const std::vector< std::string > & sla_material_options ()
static const std::vector< std::string > & sla_print_options ()
static void update_suffix_modified (const std::string &new_suffix_modified)
static const std::string & suffix_modified ()
static std::string remove_suffix_modified (const std::string &name)
static void normalize (DynamicPrintConfig &config)
static std::string remove_invalid_keys (DynamicPrintConfig &config, const DynamicPrintConfig &default_config, const DynamicPrintConfig *added=nullptr)

Public Attributes

Type type = TYPE_INVALID
bool is_default = false
bool is_external = false
bool is_system = false
bool is_visible = true
bool is_dirty = false
bool is_compatible = true
bool is_project_embedded = false
ConfigSubstitutions * loading_substitutions {nullptr}
std::string name
std::string file
const VendorProfile * vendor = nullptr
bool loaded = false
DynamicPrintConfig config
std::string alias
std::vector< std::string > renamed_from
std::set< std::string > m_excluded_from
bool m_from_orca_filament_lib = false
std::string bundle_id
Semver version
std::string ini_str
std::string setting_id
std::string filament_id
std::string user_id
std::string base_id
std::string sync_info
std::string description
long long updated_time {0}
std::map< std::string, std::string > key_values

Protected Member Functions

 Preset ()=default

Friends

class PresetCollection
class PresetBundle

Detailed Description

Member Enumeration Documentation

◆ Type

Enumerator
TYPE_INVALID 
TYPE_PRINT 
TYPE_SLA_PRINT 
TYPE_FILAMENT 
TYPE_SLA_MATERIAL 
TYPE_PRINTER 
TYPE_COUNT 
TYPE_PHYSICAL_PRINTER 
TYPE_PLATE 
TYPE_MODEL 
244 {
252 // This type is here to support PresetConfigSubstitutions for physical printers, however it does not belong to the Preset class,
253 // PhysicalPrinter class is used instead.
255 // BBS: plate config
257 // BBS: model config
259 };
@ TYPE_SLA_PRINT
Definition Preset.hpp:247
@ TYPE_PRINTER
Definition Preset.hpp:250
@ TYPE_MODEL
Definition Preset.hpp:258
@ TYPE_PHYSICAL_PRINTER
Definition Preset.hpp:254
@ TYPE_INVALID
Definition Preset.hpp:245
@ TYPE_PRINT
Definition Preset.hpp:246
@ TYPE_PLATE
Definition Preset.hpp:256
@ TYPE_SLA_MATERIAL
Definition Preset.hpp:249
@ TYPE_COUNT
Definition Preset.hpp:251
@ TYPE_FILAMENT
Definition Preset.hpp:248

Constructor & Destructor Documentation

◆ Preset() [1/2]

Slic3r::Preset::Preset ( Type type,
const std::string & name,
bool is_default = false )
inline
std::string name
Definition Preset.hpp:288
bool is_default
Definition Preset.hpp:265
Type type
Definition Preset.hpp:261

References is_default, name, and type.

Referenced by compatible_printers_condition(), compatible_prints_condition(), inherits(), normalize_inherits(), operator<(), and reload().

Here is the caller graph for this function:

◆ Preset() [2/2]

Slic3r::Preset::Preset ( )
protecteddefault

Member Function Documentation

◆ can_overwrite()

bool Slic3r::Preset::can_overwrite ( ) const
inline
284{ return ! this->is_default && ! this->is_system && ! this->is_from_bundle(); }
bool is_system
Definition Preset.hpp:270
bool is_from_bundle() const
Definition Preset.hpp:320

References is_from_bundle().

Referenced by Slic3r::PresetCollection::delete_current_preset(), Slic3r::GUI::UnsavedChangesDialog::save(), Slic3r::GUI::SavePresetDialog::Item::update(), and Slic3r::GUI::Tab::update_btns_enabling().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compatible_printers_condition() [1/3]

std::string & Slic3r::Preset::compatible_printers_condition ( )
inline
385 {
386 assert(this->type == TYPE_PRINT || this->type == TYPE_SLA_PRINT || this->type == TYPE_FILAMENT || this->type == TYPE_SLA_MATERIAL);
388 }
DynamicPrintConfig config
Definition Preset.hpp:300
std::string & compatible_printers_condition()
Definition Preset.hpp:385

References compatible_printers_condition(), TYPE_FILAMENT, TYPE_PRINT, TYPE_SLA_MATERIAL, and TYPE_SLA_PRINT.

Referenced by compatible_printers_condition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compatible_printers_condition() [2/3]

const std::string & Slic3r::Preset::compatible_printers_condition ( ) const
inline
389{ return const_cast<Preset*>(this)->compatible_printers_condition(); }
Preset(Type type, const std::string &name, bool is_default=false)
Definition Preset.hpp:475

References Preset(), and compatible_printers_condition().

Referenced by compatible_printers_condition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compatible_printers_condition() [3/3]

std::string & Slic3r::Preset::compatible_printers_condition ( DynamicPrintConfig & cfg)
inlinestatic
384{ return cfg.option<ConfigOptionString>("compatible_printers_condition", true)->value; }
zaa_minimize_perimeter_height ConfigOptionString
Definition PrintConfig.hpp:1702

References Slic3r::ConfigBase::option().

Referenced by Slic3r::PresetBundle::construct_full_config(), Slic3r::PresetBundle::full_fff_config(), Slic3r::is_compatible_with_printer(), and Slic3r::PresetBundle::load_config_file_config().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compatible_prints_condition() [1/3]

std::string & Slic3r::Preset::compatible_prints_condition ( )
inline
377 {
378 assert(this->type == TYPE_FILAMENT || this->type == TYPE_SLA_MATERIAL);
380 }
std::string & compatible_prints_condition()
Definition Preset.hpp:377

References compatible_prints_condition(), TYPE_FILAMENT, and TYPE_SLA_MATERIAL.

Referenced by compatible_prints_condition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compatible_prints_condition() [2/3]

const std::string & Slic3r::Preset::compatible_prints_condition ( ) const
inline
381{ return const_cast<Preset*>(this)->compatible_prints_condition(); }

References Preset(), and compatible_prints_condition().

Referenced by compatible_prints_condition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compatible_prints_condition() [3/3]

std::string & Slic3r::Preset::compatible_prints_condition ( DynamicPrintConfig & cfg)
inlinestatic
376{ return cfg.option<ConfigOptionString>("compatible_prints_condition", true)->value; }

References Slic3r::ConfigBase::option().

Referenced by Slic3r::PresetBundle::full_fff_config(), Slic3r::is_compatible_with_print(), and Slic3r::PresetBundle::load_config_file_config().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ convert_filament_diameter_to_pellet_flow()

double Slic3r::Preset::convert_filament_diameter_to_pellet_flow ( double filament_diameter)
inlinestatic
442 {
443 return 4 / (pow(filament_diameter, 2) * PI);
444 }
static constexpr double PI
Definition libslic3r.h:81

References PI.

Referenced by Slic3r::GUI::Tab::on_value_change().

Here is the caller graph for this function:

◆ convert_pellet_flow_to_filament_diameter()

double Slic3r::Preset::convert_pellet_flow_to_filament_diameter ( double pellet_flow_coefficient)
inlinestatic
437 {
438 return sqrt(4 / (PI * pellet_flow_coefficient));
439 }

References PI.

Referenced by Slic3r::GUI::Tab::on_value_change().

Here is the caller graph for this function:

◆ filament_options()

const std::vector< std::string > & Slic3r::Preset::filament_options ( )
static
1706{ return s_Preset_filament_options; }
static std::vector< std::string > s_Preset_filament_options
Definition Preset.cpp:1493

References Slic3r::s_Preset_filament_options.

Referenced by Slic3r::active_capability_config(), Slic3r::GUI::EditGCodeDialog::add_presets_placeholders(), Slic3r::GUI::PublishSettingsDialog::full_keys_for_slot(), normalize(), Slic3r::GUI::preset_type_options(), and Slic3r::CLI::run().

Here is the caller graph for this function:

◆ get_current_printer_type()

std::string Slic3r::Preset::get_current_printer_type ( PresetBundle * preset_bundle)
1020{
1021 if (preset_bundle) {
1022 auto config = &(this->config);
1023 const auto& printer_model = config->opt_string("printer_model");
1024 for (const auto& vendor_profile : preset_bundle->vendors) {
1025 for (const auto& vendor_model : vendor_profile.second.models)
1026 if (vendor_model.name == printer_model) {
1027 return vendor_model.model_id;
1028 }
1029 }
1030 }
1031 return "";
1032}

References config, PresetBundle, and Slic3r::PresetBundle::vendors.

Referenced by Slic3r::GUI::Sidebar::update_printer_thumbnail().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_default_bed_type()

BedType Slic3r::Preset::get_default_bed_type ( PresetBundle * preset_bundle)
1110{
1111 if (config.has("default_bed_type") && !config.opt_string("default_bed_type").empty()) {
1112 try {
1113 std::string str_bed_type = config.opt_string("default_bed_type");
1114 BedType bed_type;
1115 if (ConfigOptionEnum<BedType>::from_string(str_bed_type, bed_type) &&
1116 bed_type > btDefault && bed_type < btCount) {
1117 return bed_type;
1118 }
1119
1120 // Try parsing as integer (legacy format)
1121 int bed_type_value = atoi(str_bed_type.c_str());
1122 if (bed_type_value > 0 && bed_type_value < BedType::btCount) {
1123 return BedType(bed_type_value);
1124 }
1125
1126 BOOST_LOG_TRIVIAL(error) << "default_bed_type: invalid bed type: " << str_bed_type;
1127 return BedType::btPEI;
1128
1129 } catch(...) {
1130 ;
1131 }
1132 }
1133
1134 std::string model_id = this->get_printer_type(preset_bundle);
1135 if (model_id == "BL-P001" || model_id == "BL-P002" || model_id == "C13") {
1136 return BedType::btPC;
1137 } else if (model_id == "C11") {
1138 return BedType::btPEI;
1139 }
1140 return BedType::btPEI;
1141}
static bool from_string(const std::string &str, T &value)
Definition Config.hpp:2132
std::string get_printer_type(PresetBundle *preset_bundle)
Definition Preset.cpp:1003
BedType
Definition PrintConfig.hpp:507
@ btPEI
Definition PrintConfig.hpp:511
@ btPC
Definition PrintConfig.hpp:509
@ btDefault
Definition PrintConfig.hpp:508
@ btCount
Definition PrintConfig.hpp:515

References Slic3r::btCount, Slic3r::btDefault, Slic3r::btPC, Slic3r::btPEI, config, Slic3r::ConfigOptionEnum< T >::from_string(), get_printer_type(), and PresetBundle.

Referenced by Slic3r::GUI::Sidebar::update_all_preset_comboboxes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_extruder_names_and_keysets()

void Slic3r::Preset::get_extruder_names_and_keysets ( Type type,
std::string & extruder_id_name,
std::string & extruder_variant_name,
std::set< std::string > ** p_key_set1,
std::set< std::string > ** p_key_set2 )
static
1035{
1036 if (type == Preset::TYPE_PRINT) {
1037 extruder_id_name = "print_extruder_id";
1038 extruder_variant_name = "print_extruder_variant";
1039 *p_key_set1 = &print_options_with_variant;
1040 *p_key_set2 = &empty_options;
1041 }
1042 else if (type == Preset::TYPE_PRINTER) {
1043 extruder_id_name = "printer_extruder_id";
1044 extruder_variant_name = "printer_extruder_variant";
1045 *p_key_set1 = &printer_options_with_variant_1;
1046 *p_key_set2 = &printer_options_with_variant_2;
1047 }
1048 else if (type == Preset::TYPE_FILAMENT) {
1049 extruder_variant_name = "filament_extruder_variant";
1050 *p_key_set1 = &filament_options_with_variant;
1051 *p_key_set2 = &empty_options;
1052 }
1053 else {
1054 *p_key_set1 = &empty_options;
1055 *p_key_set2 = &empty_options;
1056 }
1057}
std::set< std::string > printer_options_with_variant_1
Definition PrintConfig.cpp:10236
std::set< std::string > printer_options_with_variant_2
Definition PrintConfig.cpp:10270
std::set< std::string > empty_options
Definition PrintConfig.cpp:10289
std::set< std::string > filament_options_with_variant
Definition PrintConfig.cpp:10150
std::set< std::string > print_options_with_variant
Definition PrintConfig.cpp:10102

References Slic3r::empty_options, Slic3r::filament_options_with_variant, Slic3r::print_options_with_variant, Slic3r::printer_options_with_variant_1, Slic3r::printer_options_with_variant_2, type, TYPE_FILAMENT, TYPE_PRINT, and TYPE_PRINTER.

Referenced by Slic3r::PresetCollection::get_differed_values_to_update(), Slic3r::PresetCollection::get_preset_differed_for_save(), load_external_config(), Slic3r::PresetCollection::load_presets(), Slic3r::PresetCollection::load_project_embedded_presets(), Slic3r::PresetCollection::load_user_preset(), and save().

Here is the caller graph for this function:

◆ get_filament_type()

std::string Slic3r::Preset::get_filament_type ( std::string & display_filament_type)
999{
1000 return config.get_filament_type(display_filament_type);
1001}

References config.

Referenced by Slic3r::GUI::collect_imex_warnings(), Slic3r::GUI::CalibrationPresetPage::is_filament_in_blacklist(), and Slic3r::GUI::sCheckFilamentInfo().

Here is the caller graph for this function:

◆ get_iot_type_string()

std::string Slic3r::Preset::get_iot_type_string ( Preset::Type type)
static
642{
643 switch (type) {
650
651 default:
652 return "invalid";
653 }
654}
#define PRESET_IOT_FILAMENT_TYPE
Definition Preset.hpp:50
#define PRESET_IOT_PRINT_TYPE
Definition Preset.hpp:51
#define PRESET_IOT_PRINTER_TYPE
Definition Preset.hpp:49

References PRESET_IOT_FILAMENT_TYPE, PRESET_IOT_PRINT_TYPE, PRESET_IOT_PRINTER_TYPE, type, TYPE_FILAMENT, TYPE_PRINT, and TYPE_PRINTER.

Referenced by Slic3r::PresetCollection::get_differed_values_to_update(), and Slic3r::GUI::UnsavedChangesDialog::update_tree().

Here is the caller graph for this function:

◆ get_printer_id()

std::string Slic3r::Preset::get_printer_id ( ) const
inline
427{ return vendor ? vendor->id : ""; }
const VendorProfile * vendor
Definition Preset.hpp:294

References vendor.

◆ get_printer_type()

std::string Slic3r::Preset::get_printer_type ( PresetBundle * preset_bundle)
1004{
1005 if (preset_bundle) {
1006 auto config = &preset_bundle->printers.get_edited_preset().config;
1007 const auto& printer_model = config->opt_string("printer_model");
1008 for (const auto& vendor_profile : preset_bundle->vendors) {
1009 for (const auto& vendor_model : vendor_profile.second.models)
1010 if (vendor_model.name == printer_model)
1011 {
1012 return vendor_model.model_id;
1013 }
1014 }
1015 }
1016 return "";
1017}

References config, Slic3r::PresetCollection::get_edited_preset(), PresetBundle, Slic3r::PresetBundle::printers, and Slic3r::PresetBundle::vendors.

Referenced by Slic3r::GUI::_collect_sorted_machines(), Slic3r::GUI::Plater::priv::check_ams_status_impl(), Slic3r::GUI::Plater::export_3mf(), Slic3r::GUI::Plater::export_gcode(), get_default_bed_type(), Slic3r::GUI::Plater::priv::get_machine_sync_status(), has_cali_lines(), Slic3r::GUI::Plater::is_same_printer_for_connected_and_selected(), Slic3r::GUI::SelectMachineDialog::is_same_printer_model(), Slic3r::GUI::SyncAmsInfoDialog::is_same_printer_model(), Slic3r::GUI::Sidebar::need_auto_sync_extruder_list_after_connect_priner(), Slic3r::GUI::Plater::priv::on_select_preset(), Slic3r::GUI::SelectMachineDialog::show_status(), Slic3r::GUI::SyncAmsInfoDialog::show_status(), Slic3r::GUI::Sidebar::priv::sync_extruder_list(), Slic3r::GUI::TabPrinter::toggle_options(), Slic3r::GUI::Sidebar::update_presets(), Slic3r::GUI::SelectMachineDialog::update_show_status(), and Slic3r::GUI::Sidebar::priv::update_sync_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_type_from_string()

Preset::Type Slic3r::Preset::get_type_from_string ( std::string type_str)
static
658{
659 if (type_str.compare(PRESET_PRINT_NAME) == 0 || type_str.compare(PRESET_IOT_PRINT_TYPE) == 0)
661 else if (type_str.compare(PRESET_FILAMENT_NAME) == 0 || type_str.compare(PRESET_IOT_FILAMENT_TYPE) == 0)
663 else if (type_str.compare(PRESET_PRINTER_NAME) == 0 || type_str.compare(PRESET_IOT_PRINTER_TYPE) == 0)
665 else
667}
#define PRESET_PRINTER_NAME
Definition Preset.hpp:35
#define PRESET_PRINT_NAME
Definition Preset.hpp:34
#define PRESET_FILAMENT_NAME
Definition Preset.hpp:33

References PRESET_FILAMENT_NAME, PRESET_IOT_FILAMENT_TYPE, PRESET_IOT_PRINT_TYPE, PRESET_IOT_PRINTER_TYPE, PRESET_PRINT_NAME, PRESET_PRINTER_NAME, TYPE_FILAMENT, TYPE_INVALID, TYPE_PRINT, and TYPE_PRINTER.

Referenced by Slic3r::PresetCollection::load_project_embedded_presets().

Here is the caller graph for this function:

◆ get_type_string()

std::string Slic3r::Preset::get_type_string ( Preset::Type type)
static
591{
592 switch (type) {
596 return PRESET_PRINT_NAME;
598 return PRESET_PRINTER_NAME;
600 return "physical_printer";
602 return "invalid";
603 default:
604 return "invalid";
605 }
606}

References PRESET_FILAMENT_NAME, PRESET_PRINT_NAME, PRESET_PRINTER_NAME, type, TYPE_FILAMENT, TYPE_INVALID, TYPE_PHYSICAL_PRINTER, TYPE_PRINT, and TYPE_PRINTER.

Referenced by Slic3r::GUI::SavePresetDialog::Item::Item(), Slic3r::_BBS_3MF_Importer::_extract_project_embedded_presets_from_archive(), Slic3r::PresetCollection::commit_user_preset(), Slic3r::PresetBundle::commit_vendor_preset(), Slic3r::GUI::Tab::delete_preset(), Slic3r::PresetCollection::get_project_embedded_presets(), Slic3r::GUI::Tab::load_current_preset(), Slic3r::PresetCollection::load_external_preset(), Slic3r::PresetCollection::load_preset(), Slic3r::PresetCollection::load_presets(), Slic3r::PresetCollection::load_project_embedded_presets(), Slic3r::PresetCollection::load_user_preset(), Slic3r::PresetBundle::remove_users_preset(), Slic3r::PresetCollection::reset_project_embedded_presets(), Slic3r::CLI::run(), Slic3r::PresetCollection::select_preset(), Slic3r::PresetCollection::select_preset_by_name(), Slic3r::PresetCollection::select_preset_by_name_strict(), and Slic3r::PresetCollection::update_compatible_internal().

Here is the caller graph for this function:

◆ has_cali_lines()

bool Slic3r::Preset::has_cali_lines ( PresetBundle * preset_bundle)
1144{
1145 std::string model_id = this->get_printer_type(preset_bundle);
1146 if (model_id == "BL-P001" || model_id == "BL-P002" || model_id == "C13") {
1147 return true;
1148 }
1149 return false;
1150}

References get_printer_type(), and PresetBundle.

Here is the call graph for this function:

◆ has_lidar()

bool Slic3r::Preset::has_lidar ( PresetBundle * preset_bundle)
1091{
1092 bool has_lidar = false;
1093 if (preset_bundle) {
1094 auto config = &preset_bundle->printers.get_edited_preset().config;
1095 std::string vendor_name;
1096 for (auto vendor_profile : preset_bundle->vendors) {
1097 for (auto vendor_model : vendor_profile.second.models)
1098 if (vendor_model.name == config->opt_string("printer_model")) {
1099 vendor_name = vendor_profile.first;
1100 break;
1101 }
1102 }
1103 if (!vendor_name.empty())
1104 has_lidar = vendor_name.compare("BBL") == 0 ? true : false;
1105 }
1106 return has_lidar;
1107}
bool has_lidar(PresetBundle *preset_bundle)
Definition Preset.cpp:1090

References config, Slic3r::PresetCollection::get_edited_preset(), has_lidar(), PresetBundle, Slic3r::PresetBundle::printers, and Slic3r::PresetBundle::vendors.

Referenced by has_lidar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ inherits() [1/3]

std::string & Slic3r::Preset::inherits ( )
inline
358{ return Preset::inherits(this->config); }
std::string & inherits()
Definition Preset.hpp:358

References inherits().

Referenced by Slic3r::PresetCollection::check_and_fix_syncinfo(), inherits(), inherits(), Slic3r::PresetCollection::load_external_preset(), normalize_inherits(), and Slic3r::PresetCollection::save_user_presets().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ inherits() [2/3]

const std::string & Slic3r::Preset::inherits ( ) const
inline
359{ return Preset::inherits(const_cast<Preset*>(this)->config); }

References Preset(), config, and inherits().

Here is the call graph for this function:

◆ inherits() [3/3]

std::string & Slic3r::Preset::inherits ( DynamicPrintConfig & cfg)
inlinestatic

◆ is_custom_defined()

bool Slic3r::Preset::is_custom_defined ( )

References PresetBundle.

Here is the call graph for this function:

◆ is_from_bundle()

bool Slic3r::Preset::is_from_bundle ( ) const
inline
320{ return ! bundle_id.empty(); }
std::string bundle_id
Definition Preset.hpp:319

References bundle_id.

Referenced by Slic3r::GUI::SavePresetDialog::Item::Item(), can_overwrite(), Slic3r::GUI::TabPresetComboBox::get_preset_name(), is_user(), save(), save_info(), Slic3r::GUI::Tab::select_preset(), Slic3r::GUI::PlaterPresetComboBox::update(), Slic3r::GUI::TabPresetComboBox::update(), and Slic3r::PresetBundle::update_subscribed_presets().

Here is the caller graph for this function:

◆ is_user()

bool Slic3r::Preset::is_user ( ) const
inline
283{ return ! this->is_default && ! this->is_system && ! this->is_project_embedded && ! this->is_from_bundle(); }
bool is_project_embedded
Definition Preset.hpp:281

References is_from_bundle().

Referenced by Slic3r::PresetBundle::check_and_fix_user_presets_syncinfo(), Slic3r::PresetBundle::check_filament_temp_equation_by_printer_type_and_nozzle_for_mas_tray(), save(), and Slic3r::GUI::GUI_App::sync_preset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ label()

std::string Slic3r::Preset::label ( bool no_alias) const
866{
867 return (this->is_dirty ? g_suffix_modified : "")
868 + ((no_alias || this->alias.empty()) ? this->name : this->alias);
869}
std::string alias
Definition Preset.hpp:303
bool is_dirty
Definition Preset.hpp:276
static std::string g_suffix_modified
Definition Preset.cpp:504

References alias, Slic3r::g_suffix_modified, is_dirty, and name.

Referenced by Slic3r::GUI::PlaterPresetComboBox::get_preset_name(), Slic3r::GUI::TabPresetComboBox::get_preset_name(), and Slic3r::GUI::TabPresetComboBox::update_dirty().

Here is the caller graph for this function:

◆ load_external_config()

DynamicPrintConfig Slic3r::Preset::load_external_config ( Type type,
const DynamicPrintConfig & default_config,
const DynamicPrintConfig & project_config,
const std::set< std::string > & different_settings_list,
const std::function< DynamicPrintConfig *(const std::string &inherits)> & find_base,
t_config_option_keys * keys = nullptr )
static
1063{
1064 // Load the preset over a default preset, so that the missing fields are filled in from the default preset.
1065 DynamicPrintConfig cfg(default_config);
1066 // SoftFever: ignore print connection info from project
1067 auto cfg_keys = cfg.keys();
1068 cfg_keys.erase(std::remove_if(cfg_keys.begin(), cfg_keys.end(),
1069 [](std::string &val) {
1070 return val == "print_host" || val == "print_host_webui" || val == "printhost_apikey" ||
1071 val == "printhost_cafile" || val == "printhost_user" || val == "printhost_password" || val == "printhost_port";
1072 }),
1073 cfg_keys.end());
1074 cfg.apply_only(project_config, cfg_keys, true);
1075
1076 //add different settings check logic, replace the old system preset's default value with new system preset's default values
1077 if (!different_settings_list.empty()) {
1078 if (DynamicPrintConfig *base_config = find_base(Preset::inherits(cfg))) {
1079 std::string extruder_id_name, extruder_variant_name;
1080 std::set<std::string> *key_set1 = nullptr, *key_set2 = nullptr;
1081 Preset::get_extruder_names_and_keysets(type, extruder_id_name, extruder_variant_name, &key_set1, &key_set2);
1082 cfg.update_non_diff_values_to_base_config(*base_config, cfg_keys, different_settings_list, extruder_id_name, extruder_variant_name, *key_set1, *key_set2);
1083 }
1084 }
1085 if (keys)
1086 *keys = std::move(cfg_keys);
1087 return cfg;
1088}
static void get_extruder_names_and_keysets(Type type, std::string &extruder_id_name, std::string &extruder_variant_name, std::set< std::string > **p_key_set1, std::set< std::string > **p_key_set2)
Definition Preset.cpp:1034

References Slic3r::ConfigBase::apply_only(), get_extruder_names_and_keysets(), inherits(), Slic3r::DynamicConfig::keys(), type, and Slic3r::DynamicPrintConfig::update_non_diff_values_to_base_config().

Referenced by Slic3r::PresetCollection::load_external_preset(), and Slic3r::CLI::run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_info()

void Slic3r::Preset::load_info ( const std::string & file)
671{
672 try {
673 boost::property_tree::ptree tree;
674 boost::nowide::ifstream ifs(file);
675 boost::property_tree::read_ini(ifs, tree);
676 if (tree.empty()) return;
677 for (const boost::property_tree::ptree::value_type &v : tree) {
678 if (v.first.compare("sync_info") == 0)
679 this->sync_info = v.second.get_value<std::string>();
680 else if (v.first.compare("user_id") == 0)
681 this->user_id = v.second.get_value<std::string>();
682 else if (v.first.compare("setting_id") == 0) {
683 this->setting_id = v.second.get_value<std::string>();
684 if (this->setting_id.compare("null") == 0)
685 this->setting_id.clear();
686 }
687 else if (v.first.compare("base_id") == 0) {
688 this->base_id = v.second.get_value<std::string>();
689 if (this->base_id.compare("null") == 0)
690 this->base_id.clear();
691 }
692 else if (v.first.compare("updated_time") == 0) {
693 std::string time = v.second.get_value<std::string>();
694 this->updated_time = std::atoll(time.c_str());
695 }
696 }
697 }
698 catch (...) {
699 return;
700 }
701}
long long updated_time
Definition Preset.hpp:331
std::string setting_id
Definition Preset.hpp:325
std::string base_id
Definition Preset.hpp:328
std::string sync_info
Definition Preset.hpp:329
std::string file
Definition Preset.hpp:292
std::string user_id
Definition Preset.hpp:327

References base_id, file, setting_id, sync_info, updated_time, and user_id.

◆ machine_limits_options()

const std::vector< std::string > & Slic3r::Preset::machine_limits_options ( )
static
static std::vector< std::string > s_Preset_machine_limits_options
Definition Preset.cpp:1558

References Slic3r::s_Preset_machine_limits_options.

◆ normalize()

void Slic3r::Preset::normalize ( DynamicPrintConfig & config)
static
525{
526 size_t n = 1;
527 if (config.option("single_extruder_multi_material") == nullptr || config.opt_bool("single_extruder_multi_material")) {
528 // BBS
529 auto* filament_diameter = dynamic_cast<const ConfigOptionFloats*>(config.option("filament_diameter"));
530 if (filament_diameter != nullptr) {
531 n = filament_diameter->values.size();
532 // Loaded the FFF Printer settings. Verify, that all extruder dependent values have enough values.
533 config.set_num_filaments((unsigned int) n);
534 }
535 } else {
536 auto* nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(config.option("nozzle_diameter"));
537 if (nozzle_diameter != nullptr) {
538 n = nozzle_diameter->values.size();
539 // Loaded the FFF Printer settings. Verify, that all extruder dependent values have enough values.
540 config.set_num_extruders((unsigned int) n);
541 }
542 }
543
544 if (config.option("filament_diameter") != nullptr) {
545 // This config contains single or multiple filament presets.
546 // Ensure that the filament preset vector options contain the correct number of values.
547 const auto &defaults = FullPrintConfig::defaults();
548 for (const std::string &key : Preset::filament_options()) {
549 if (key == "compatible_prints" || key == "compatible_printers")
550 continue;
552 continue;
553 if (filament_dev_options.find(key) != filament_dev_options.end())
554 continue;
555 auto *opt = config.option(key, false);
556 /*assert(opt != nullptr);
557 assert(opt->is_vector());*/
558 if (opt != nullptr && opt->is_vector())
559 static_cast<ConfigOptionVectorBase*>(opt)->resize(n, defaults.option(key));
560 }
561 // The following keys are mandatory for the UI, but they are not part of FullPrintConfig, therefore they are handled separately.
562 for (const std::string &key : { "filament_settings_id" }) {
563 auto *opt = config.option(key, false);
564 assert(opt == nullptr || opt->type() == coStrings);
565 if (opt != nullptr && opt->type() == coStrings)
566 static_cast<ConfigOptionStrings*>(opt)->values.resize(n, std::string());
567 }
568 }
569
571}
static const std::vector< std::string > & filament_options()
Definition Preset.cpp:1706
void handle_legacy_sla(DynamicPrintConfig &config)
Definition PrintConfig.cpp:10576
zaa_minimize_perimeter_height nozzle_diameter((ConfigOptionBool, reduce_infill_retraction))((ConfigOptionBool
std::set< std::string > filament_dev_options
Definition PrintConfig.cpp:10291
@ coStrings
Definition Config.hpp:194
ConfigOptionFloatsTempl< false > ConfigOptionFloats
Definition Config.hpp:1015

References config, Slic3r::coStrings, Slic3r::filament_dev_options, filament_options(), Slic3r::filament_options_with_variant, Slic3r::handle_legacy_sla(), Slic3r::nozzle_diameter(), and Slic3r::ConfigOptionVector< T >::resize().

Referenced by Slic3r::PresetBundle::config_from_gcode(), Slic3r::PresetBundle::import_json_presets(), Slic3r::GUI::Plater::priv::load_files(), Slic3r::PresetCollection::load_project_embedded_presets(), Slic3r::PresetCollection::load_user_preset(), Slic3r::PresetCollection::resolve_user_preset(), and Slic3r::PresetBundle::resolve_vendor_preset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalize_inherits()

void Slic3r::Preset::normalize_inherits ( DynamicPrintConfig & cfg,
const Preset * resolved_parent )
inlinestatic
367 {
368 if (resolved_parent == nullptr)
369 return;
370 std::string &inherits = Preset::inherits(cfg);
371 if (inherits != resolved_parent->name)
372 inherits = resolved_parent->name;
373 }
static std::string & inherits(DynamicPrintConfig &cfg)
Definition Preset.hpp:357

References Preset(), inherits(), inherits(), and name.

Referenced by Slic3r::PresetBundle::import_json_presets(), Slic3r::PresetCollection::load_project_embedded_presets(), Slic3r::PresetCollection::load_user_preset(), Slic3r::PresetCollection::resolve_user_preset(), Slic3r::PresetCollection::save_current_preset(), and Slic3r::PresetBundle::save_preset_to_bundle_dir().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nozzle_options()

const std::vector< std::string > & Slic3r::Preset::nozzle_options ( )
static
const std::vector< std::string > & extruder_option_keys() const
Definition PrintConfig.hpp:851
const PrintConfigDef print_config_def
Definition PrintConfig.cpp:10099

References Slic3r::print_config_def.

Referenced by printer_options().

Here is the caller graph for this function:

◆ operator<()

bool Slic3r::Preset::operator< ( const Preset & other) const
inline
410{ return this->name < other.name; }

References Preset(), and name.

Here is the call graph for this function:

◆ plugin_overrides_key()

const char * Slic3r::Preset::plugin_overrides_key ( Type type)
static
1727{
1728 switch (type) {
1729 case TYPE_PRINTER: return "printer_plugin_config_overrides";
1730 case TYPE_FILAMENT: return "filament_plugin_config_overrides";
1731 default: return "print_plugin_config_overrides";
1732 }
1733}

References type, TYPE_FILAMENT, and TYPE_PRINTER.

Referenced by Slic3r::active_capability_config(), and Slic3r::GUI::Tab::on_value_change().

Here is the caller graph for this function:

◆ print_options()

const std::vector< std::string > & Slic3r::Preset::print_options ( )
static
1705{ return s_Preset_print_options; }
static std::vector< std::string > s_Preset_print_options
Definition Preset.cpp:1152

References Slic3r::s_Preset_print_options.

Referenced by Slic3r::active_capability_config(), Slic3r::GUI::EditGCodeDialog::add_presets_placeholders(), Slic3r::GUI::preset_type_options(), and Slic3r::CLI::run().

Here is the caller graph for this function:

◆ printer_options()

const std::vector< std::string > & Slic3r::Preset::printer_options ( )
static
1716{
1717 static std::vector<std::string> s_opts = [](){
1718 std::vector<std::string> opts = s_Preset_printer_options;
1721 return opts;
1722 }();
1723 return s_opts;
1724}
static const std::vector< std::string > & nozzle_options()
Definition Preset.cpp:1710
static std::vector< std::string > s_Preset_printer_options
Definition Preset.cpp:1573
void append(std::vector< T, Alloc > &dest, const std::vector< T, Alloc2 > &src)
Definition libslic3r.h:157

References Slic3r::append(), nozzle_options(), Slic3r::s_Preset_machine_limits_options, and Slic3r::s_Preset_printer_options.

Referenced by Slic3r::active_capability_config(), Slic3r::GUI::EditGCodeDialog::add_presets_placeholders(), Slic3r::PresetBundle::load_config_file_config(), Slic3r::GUI::preset_type_options(), and Slic3r::CLI::run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printer_technology() [1/2]

PrinterTechnology Slic3r::Preset::printer_technology ( ) const
inline
399{ return Preset::printer_technology(this->config); }
PrinterTechnology printer_technology() const
Definition Preset.hpp:399

References printer_technology().

Referenced by Slic3r::GUI::Plater::priv::load_files(), printer_technology(), Slic3r::GUI::PhysicalPrinterDialog::update(), Slic3r::GUI::PhysicalPrinterDialog::update_ports(), and Slic3r::GUI::PhysicalPrinterDialog::update_webui().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printer_technology() [2/2]

PrinterTechnology Slic3r::Preset::printer_technology ( const DynamicPrintConfig & cfg)
inlinestatic
392 {
393 auto *opt = cfg.option<ConfigOptionEnum<PrinterTechnology>>("printer_technology");
394 // The following assert may trigger when importing some legacy profile,
395 // but it is safer to keep it here to capture the cases where the "printer_technology" key is queried, where it should not.
396// assert(opt != nullptr);
397 return (opt == nullptr) ? ptFFF : opt->value;
398 }
@ ptFFF
Definition Config.hpp:231
ConfigOptionEnum< PrinterTechnology >
Definition PrintConfig.hpp:2358

References Slic3r::ConfigBase::option(), and Slic3r::ptFFF.

Referenced by Slic3r::GUI::UnsavedChangesDialog::build(), Slic3r::GUI::PhysicalPrinterDialog::build_printhost_settings(), Slic3r::GUI::TabPrinter::cache_extruder_cnt(), Slic3r::GUI::Tab::compatible_widget_create(), Slic3r::GUI::GUI_App::extruders_cnt(), Slic3r::GUI::GUI_App::extruders_edited_cnt(), Slic3r::PresetCollection::get_selected_preset_parent(), Slic3r::PresetBundle::load_config_file_config(), Slic3r::GUI::Tab::load_current_preset(), Slic3r::PresetBundle::reload_local_bundle(), Slic3r::anonymous_namespace{PluginHostPresets.cpp}::require_tab(), Slic3r::PresetCollection::resolve_user_preset(), Slic3r::GUI::Tab::select_preset(), Slic3r::GUI::PresetComboBox::update(), Slic3r::GUI::Sidebar::update_all_preset_comboboxes(), Slic3r::GUI::DiffPresetDialog::update_compatibility(), Slic3r::PresetBundle::update_compatible(), Slic3r::GUI::Tab::update_preset_description_line(), Slic3r::GUI::Sidebar::update_presets(), and Slic3r::GUI::DiffPresetDialog::update_tree().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printer_technology_ref()

PrinterTechnology & Slic3r::Preset::printer_technology_ref ( )
inline
401{ return this->config.option<ConfigOptionEnum<PrinterTechnology>>("printer_technology", true)->value; }

References Slic3r::ConfigBase::option().

Here is the call graph for this function:

◆ reload()

void Slic3r::Preset::reload ( Preset const & parent)
847{
848 DynamicPrintConfig config;
849 // BBS: change to json format
850 // ConfigSubstitutions config_substitutions = config.load_from_ini(preset.file, substitution_rule);
851 std::map<std::string, std::string> key_values;
852 std::string reason;
854 try {
855 InstanceLock instance_lock(user_presets_lock_path());
856 ConfigSubstitutions config_substitutions = config.load_from_json(file, substitution_rule, key_values, reason);
857 this->config = parent.config;
858 this->config.apply(std::move(config));
859 } catch (const std::exception &err) {
860 BOOST_LOG_TRIVIAL(error) << boost::format("Failed loading the user-config file: %1%. Reason: %2%") % file % err.what();
861 }
862}
std::map< std::string, std::string > key_values
Definition Preset.hpp:332
ForwardCompatibilitySubstitutionRule
Definition Config.hpp:241
@ Disable
Definition Config.hpp:243
std::string user_presets_lock_path(bool read_only)
Definition Preset.cpp:146
std::vector< ConfigSubstitution > ConfigSubstitutions
Definition Config.hpp:269

References Preset(), Slic3r::ConfigBase::apply(), config, Slic3r::Disable, file, key_values, and Slic3r::user_presets_lock_path().

Here is the call graph for this function:

◆ remove_files()

void Slic3r::Preset::remove_files ( bool cloud_already_deleted = false)
731{
732 //BBS: add project embedded preset logic
733 if (this->is_project_embedded) {
734 return;
735 }
736 InstanceLock instance_lock(user_presets_lock_path());
737 // Erase the preset file.
738 boost::nowide::remove(this->file.c_str());
739 fs::path idx_path(this->file);
740 idx_path.replace_extension(".info");
741 if (fs::exists(idx_path)) {
742 if (!this->setting_id.empty() && !cloud_already_deleted) {
743 // Cloud-synced preset - mark for deletion and keep .info file until sync confirms
744 this->sync_info = "delete";
745 this->save_info(idx_path.string());
746 } else {
747 // Local-only preset or cloud already confirmed deletion - safe to delete .info immediately
748 boost::nowide::remove(idx_path.string().c_str());
749 }
750 }
751}
void save_info(std::string file="")
Definition Preset.cpp:703

References file, is_project_embedded, save_info(), setting_id, sync_info, and Slic3r::user_presets_lock_path().

Referenced by Slic3r::PresetCollection::delete_current_preset(), and Slic3r::PresetBundle::remove_users_preset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove_invalid_keys()

std::string Slic3r::Preset::remove_invalid_keys ( DynamicPrintConfig & config,
const DynamicPrintConfig & default_config,
const DynamicPrintConfig * added = nullptr )
static
575{
576 std::string incorrect_keys;
577 for (const std::string &key : (added != nullptr ? *added : config).keys())
578 if (! default_config.has(key)) {
579 if (incorrect_keys.empty())
580 incorrect_keys = key;
581 else {
582 incorrect_keys += ", ";
583 incorrect_keys += key;
584 }
585 config.erase(key);
586 }
587 return incorrect_keys;
588}

References config, and Slic3r::ConfigOptionResolver::has().

Referenced by Slic3r::PresetBundle::import_json_presets(), Slic3r::PresetCollection::load_project_embedded_presets(), Slic3r::PresetCollection::load_user_preset(), Slic3r::PresetCollection::resolve_user_preset(), and Slic3r::PresetBundle::resolve_vendor_preset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove_suffix_modified()

◆ reset_dirty()

void Slic3r::Preset::reset_dirty ( )
inline
354{ this->is_dirty = false; }

◆ save()

bool Slic3r::Preset::save ( DynamicPrintConfig * parent_config)
755{
756 //BBS: add project embedded preset logic
757 if (this->is_project_embedded)
758 return true;
759 //BBS: change to json format
760 //this->config.save(this->file);
761 std::string from_str;
762 if (this->is_user())
763 from_str = std::string("User");
764 else if (this->is_project_embedded)
765 from_str = std::string("Project");
766 else if (this->is_from_bundle())
767 from_str = std::string("Bundle");
768 else if (this->is_system)
769 from_str = std::string("System");
770 else
771 from_str = std::string("Default");
772
773 const std::string bare_name = get_preset_bare_name(this->name);
774
775 // What gets written: the diff against the parent, the config plus its
776 // filament id, or the config as is. Built before the lock is taken so the
777 // exclusive window covers only the file writes.
778 DynamicPrintConfig temp_config;
779 const DynamicPrintConfig *to_save = &this->config;
780
781 //BBS: only save difference if it has parent
782 if (parent_config) {
783 std::vector<std::string> dirty_options = config.diff(*parent_config);
784
785 std::string extruder_id_name, extruder_variant_name;
786 std::set<std::string> *key_set1 = nullptr, *key_set2 = nullptr;
787 Preset::get_extruder_names_and_keysets(type, extruder_id_name, extruder_variant_name, &key_set1, &key_set2);
788
789 if (!extruder_id_name.empty()) {
790 dirty_options.emplace_back(extruder_id_name);
791 }
792 if (!extruder_variant_name.empty()) {
793 dirty_options.emplace_back(extruder_variant_name);
794 }
795
796 for (auto option: dirty_options)
797 {
798 ConfigOption *opt_src = config.option(option);
799 ConfigOption *opt_dst = temp_config.option(option, true);
800 if (opt_dst->is_scalar() || !(opt_dst->nullable()) || is_filament_extruder_override_key(option))
801 opt_dst->set(opt_src);
802 else {
803 ConfigOptionVectorBase* opt_vec_src = static_cast<ConfigOptionVectorBase*>(opt_src);
804 ConfigOptionVectorBase* opt_vec_dst = static_cast<ConfigOptionVectorBase*>(opt_dst);
805 ConfigOptionVectorBase* opt_vec_inherit = static_cast<ConfigOptionVectorBase*>(parent_config->option(option));
806 if (opt_vec_src->size() == 1)
807 opt_dst->set(opt_src);
808 else if (key_set1->find(option) != key_set1->end()) {
809 opt_vec_dst->set_with_nil(opt_vec_src, opt_vec_inherit, 1);
810 }
811 else if (key_set2->find(option) != key_set2->end()) {
812 opt_vec_dst->set_with_nil(opt_vec_src, opt_vec_inherit, 2);
813 }
814 else
815 opt_dst->set(opt_src);
816 }
817 }
818 to_save = &temp_config;
819 } else if (!filament_id.empty() && inherits().empty()) {
820 temp_config = config;
821 temp_config.set_key_value(BBL_JSON_KEY_FILAMENT_ID, new ConfigOptionString(filament_id));
822 to_save = &temp_config;
823 }
824
825 std::ostringstream json;
826 to_save->save_to_json(json, bare_name, from_str, this->version.to_string());
827
828 InstanceLock instance_lock(user_presets_lock_path());
829 boost::filesystem::create_directories(fs::path(this->file).parent_path());
830 if (const std::error_code ec = write_file_atomically(this->file, json.str())) {
831 // No .info either: one without its preset reads as a cloud deletion request.
832 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": failed to save " << this->file << ": " << ec.message();
833 return false;
834 }
835 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " save config for: " << this->name << " and filament_id: " << filament_id << " and base_id: " << this->base_id;
836
837 // Bundle presets are synced via bundle_id and don't need individual .info files.
838 if (! this->is_from_bundle()) {
839 fs::path idx_file(this->file);
840 idx_file.replace_extension(".info");
841 this->save_info(idx_file.string());
842 }
843 return true;
844}
#define BBL_JSON_KEY_FILAMENT_ID
Definition Preset.hpp:71
Semver version
Definition Preset.hpp:323
std::string filament_id
Definition Preset.hpp:326
bool is_user() const
Definition Preset.hpp:283
std::error_code write_file_atomically(const std::string &path, std::initializer_list< std::string_view > chunks, bool binary)
Definition utils.cpp:796
bool is_filament_extruder_override_key(const std::string &opt_key)
Definition PrintConfig.cpp:130
nlohmann::json json
Definition AssembleList.cpp:42
std::string get_preset_bare_name(const std::string &canonical_name)
Definition Preset.cpp:172
bool empty(const BoundingBoxBase< PointType, PointsType > &bb)
Definition BoundingBox.hpp:273

References base_id, BBL_JSON_KEY_FILAMENT_ID, config, Slic3r::ConfigOptionString, Slic3r::empty(), filament_id, file, get_extruder_names_and_keysets(), Slic3r::get_preset_bare_name(), inherits(), Slic3r::is_filament_extruder_override_key(), is_from_bundle(), is_project_embedded, Slic3r::ConfigOption::is_scalar(), is_system, is_user(), name, Slic3r::ConfigOption::nullable(), Slic3r::ConfigBase::option(), save_info(), Slic3r::ConfigBase::save_to_json(), Slic3r::ConfigOption::set(), Slic3r::DynamicConfig::set_key_value(), Slic3r::ConfigOptionVectorBase::set_with_nil(), Slic3r::ConfigOptionVectorBase::size(), type, Slic3r::user_presets_lock_path(), version, and Slic3r::write_file_atomically().

Referenced by Slic3r::PresetCollection::clone_presets(), Slic3r::GUI::ExportConfigsDialog::earse_preset_fields_for_safe(), Slic3r::PresetBundle::import_json_presets(), Slic3r::GUI::ExportPresetBundleDialog::InitExportData(), Slic3r::PresetBundle::load_config_file_config(), Slic3r::PresetCollection::save_current_preset(), and Slic3r::PresetBundle::save_preset_to_bundle_dir().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ save_info()

void Slic3r::Preset::save_info ( std::string file = "")
704{
705 //BBS: add project embedded preset logic
706 if (this->is_project_embedded || this->is_from_bundle())
707 return;
708 if (file.empty()) {
709 fs::path idx_file(this->file);
710 idx_file.replace_extension(".info");
711 file = idx_file.string();
712 }
713
714 std::string sync_info_to_save;
715 //BBS: hold is used for stop requesting to server this time
716 if (this->sync_info.compare("hold") != 0)
717 sync_info_to_save = this->sync_info;
718 std::ostringstream c;
719 c << "sync_info" << " = " << sync_info_to_save << std::endl;
720 c << "user_id" << " = " << this->user_id << std::endl;
721 c << "setting_id" << " = " << this->setting_id << std::endl;
722 c << "base_id" << " = " << this->base_id << std::endl;
723 c << "updated_time" << " = " << std::to_string(this->updated_time) << std::endl;
724
725 InstanceLock instance_lock(user_presets_lock_path());
726 if (const std::error_code ec = write_file_atomically(file, c.str()))
727 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": failed to save " << file << ": " << ec.message();
728}

References base_id, file, is_from_bundle(), is_project_embedded, setting_id, sync_info, updated_time, user_id, Slic3r::user_presets_lock_path(), and Slic3r::write_file_atomically().

Referenced by remove_files(), save(), Slic3r::GUI::CalibrationWizard::save_preset(), Slic3r::GUI::Tab::save_preset(), and Slic3r::GUI::CalibrationWizard::save_preset_with_index().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_dirty() [1/2]

void Slic3r::Preset::set_dirty ( bool dirty = true)
inline
353{ this->is_dirty = dirty; }

◆ set_dirty() [2/2]

void Slic3r::Preset::set_dirty ( const DynamicPrintConfig & config)
inline
352{ this->is_dirty = ! this->config.diff(config).empty(); }

References config, and Slic3r::DynamicConfig::diff().

Here is the call graph for this function:

◆ set_num_extruders()

void Slic3r::Preset::set_num_extruders ( unsigned int n)
inline
407{ this->config.set_num_extruders(n); }

References Slic3r::DynamicPrintConfig::set_num_extruders().

Here is the call graph for this function:

◆ set_visible_from_appconfig()

void Slic3r::Preset::set_visible_from_appconfig ( const AppConfig & app_config)
968{
969 //BBS: add config related log
970 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": name %1%, is_visible %2%")%name % is_visible;
971 if (vendor == nullptr) { return; }
972
973 if (type == TYPE_PRINTER) {
974 const std::string &model = config.opt_string("printer_model");
975 const std::string &variant = config.opt_string("printer_variant");
976 if (model.empty() || variant.empty())
977 return;
978 is_visible = app_config.get_variant(vendor->id, model, variant);
979 } else if (type == TYPE_FILAMENT || type == TYPE_SLA_MATERIAL) {
980 const std::string &section_name = (type == TYPE_FILAMENT) ? AppConfig::SECTION_FILAMENTS : AppConfig::SECTION_MATERIALS;
981 if (app_config.has_section(section_name)) {
982 // Check whether this profile is marked as "installed" in PrusaSlicer.ini,
983 // or whether a profile is marked as "installed", which this profile may have been renamed from.
984 const std::map<std::string, std::string> &installed = app_config.get_section(section_name);
985 auto has = [&installed](const std::string &name) {
986 auto it = installed.find(name);
987 return it != installed.end() && ! it->second.empty();
988 };
989 is_visible = has(this->name);
990 for (auto it = this->renamed_from.begin(); ! is_visible && it != this->renamed_from.end(); ++ it)
991 is_visible = has(*it);
992 }
993 }
994 //BBS: add config related log
995 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": name %1%, is_visible set to %2%")%name % is_visible;
996}
static const std::string SECTION_FILAMENTS
Definition AppConfig.hpp:408
std::vector< std::string > renamed_from
Definition Preset.hpp:307
bool is_visible
Definition Preset.hpp:274
const char * section_name(ShortcutSection section)
Definition Shortcuts.cpp:248

References config, Slic3r::AppConfig::get_section(), Slic3r::AppConfig::get_variant(), Slic3r::AppConfig::has_section(), is_visible, name, renamed_from, Slic3r::AppConfig::SECTION_FILAMENTS, Slic3r::AppConfig::SECTION_MATERIALS, type, TYPE_FILAMENT, TYPE_PRINTER, TYPE_SLA_MATERIAL, and vendor.

Referenced by Slic3r::PresetBundle::load_installed_filaments(), Slic3r::PresetBundle::load_installed_printers(), and Slic3r::PresetBundle::load_installed_sla_materials().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sla_material_options()

const std::vector< std::string > & Slic3r::Preset::sla_material_options ( )
static
static std::vector< std::string > s_Preset_sla_material_options
Definition Preset.cpp:1664

References Slic3r::s_Preset_sla_material_options.

Referenced by Slic3r::GUI::EditGCodeDialog::add_presets_placeholders().

Here is the caller graph for this function:

◆ sla_print_options()

const std::vector< std::string > & Slic3r::Preset::sla_print_options ( )
static
static std::vector< std::string > s_Preset_sla_print_options
Definition Preset.cpp:1617

References Slic3r::s_Preset_sla_print_options.

Referenced by Slic3r::GUI::EditGCodeDialog::add_presets_placeholders().

Here is the caller graph for this function:

◆ sla_printer_options()

const std::vector< std::string > & Slic3r::Preset::sla_printer_options ( )
static
static std::vector< std::string > s_Preset_sla_printer_options
Definition Preset.cpp:1685

References Slic3r::s_Preset_sla_printer_options.

Referenced by Slic3r::GUI::EditGCodeDialog::add_presets_placeholders().

Here is the caller graph for this function:

◆ suffix_modified()

const std::string & Slic3r::Preset::suffix_modified ( )
static
506{
507 return g_suffix_modified;
508}

References Slic3r::g_suffix_modified.

Referenced by Slic3r::GUI::GLGizmoEmboss::draw_style_list(), Slic3r::GUI::PlaterPresetComboBox::switch_to_tab(), and Slic3r::GUI::PlaterPresetComboBox::update().

Here is the caller graph for this function:

◆ update_suffix_modified()

void Slic3r::Preset::update_suffix_modified ( const std::string & new_suffix_modified)
static
511{
512 g_suffix_modified = new_suffix_modified;
513}

References Slic3r::g_suffix_modified.

Referenced by Slic3r::GUI::GUI_App::load_language().

Here is the caller graph for this function:

◆ PresetBundle

◆ PresetCollection

friend class PresetCollection
friend

References PresetCollection.

Referenced by PresetCollection.

Member Data Documentation

◆ alias

◆ base_id

◆ bundle_id

◆ config

DynamicPrintConfig Slic3r::Preset::config

Referenced by Slic3r::_BBS_3MF_Exporter::_add_project_embedded_presets_to_archive(), Slic3r::GUI::_collect_filament_info(), Slic3r::_BBS_3MF_Importer::_extract_project_embedded_presets_from_archive(), Slic3r::active_capability_config(), Slic3r::GUI::PresetComboBox::add_connected_printers(), Slic3r::PresetCollection::add_detached_preset(), Slic3r::GUI::ExportConfigsDialog::archive_preset_bundle_to_file(), Slic3r::GUI::SelectMachineDialog::build_nozzles_info(), Slic3r::GUI::SyncAmsInfoDialog::build_nozzles_info(), Slic3r::GUI::PartPlate::calc_imex_zones(), Slic3r::GUI::CalibUtils::calib_flowrate(), Slic3r::GUI::CalibUtils::calib_generic_auto_pa_cali(), Slic3r::GUI::CalibUtils::calib_generic_PA(), Slic3r::GUI::CalibUtils::calib_max_vol_speed(), Slic3r::GUI::CalibUtils::calib_pa_pattern(), Slic3r::GUI::CalibUtils::calib_retraction(), Slic3r::GUI::CalibUtils::calib_temptue(), Slic3r::GUI::CalibUtils::calib_VFA(), Slic3r::GUI::Plater::priv::check_ams_status_impl(), Slic3r::PresetBundle::check_filament_temp_equation_by_printer_type_and_nozzle_for_mas_tray(), Slic3r::check_filaments_printable(), Slic3r::PresetBundle::check_preset_references(), Slic3r::GUI::collect_imex_warnings(), Slic3r::GUI::Sidebar::collect_physical_filament_info(), Slic3r::GUI::construct_extruder_unprintable_error(), Slic3r::PresetBundle::construct_full_config(), Slic3r::GUI::CreateFilamentPresetDialog::create_filament_preset_item(), Slic3r::GUI::Bed3D::detect_type(), Slic3r::PresetCollection::dirty_options(), Slic3r::PresetCollection::dirty_options_without_option_list(), Slic3r::GUI::ExportConfigsDialog::earse_preset_fields_for_safe(), Slic3r::effective_physical_extruder_map(), Slic3r::PresetBundle::export_current_configs(), Slic3r::GUI::extruder_supports_tpu_high_flow(), Slic3r::GUI::GUI_App::extruders_cnt(), Slic3r::GUI::GUI_App::extruders_edited_cnt(), Slic3r::GUI::filament_type_for_color_decompose(), Slic3r::anonymous_namespace{SnapmakerPrinterAgent.cpp}::find_closest_color_preset_by_vendor_and_type(), Slic3r::anonymous_namespace{PluginResolver.cpp}::find_option_for_capability(), Slic3r::GUI::Plater::force_filament_colors_update(), Slic3r::PresetBundle::full_fff_config(), Slic3r::GUI::FlowRateWizard::generate_index_key_value(), Slic3r::GUI::SyncAmsInfoDialog::generate_override_fix_ams_list(), Slic3r::GUI::CreatePrinterPresetDialog::generate_process_presets_data(), Slic3r::GUI::NewCalibrationHistoryDialog::get_all_filaments(), Slic3r::GUI::PresetComboBox::get_bmp(), Slic3r::GUI::get_config_json(), get_current_printer_type(), Slic3r::PresetBundle::get_custom_vendor_models(), get_default_bed_type(), Slic3r::PresetCollection::get_differed_values_to_update(), Slic3r::GUI::Tab::get_extruder_sync_enable_state(), Slic3r::PresetBundle::get_filament_by_filament_id(), Slic3r::GUI::get_filament_compatible_printer(), Slic3r::GUI::CreateFilamentPresetDialog::get_filament_preset_choices(), Slic3r::GUI::CreateFilamentPresetDialog::get_filament_presets_by_machine(), Slic3r::PresetBundle::get_filament_presets_for_machine(), Slic3r::GUI::Materials::get_filament_type(), get_filament_type(), Slic3r::GUI::AMSMaterialsSetting::get_filament_variant_index(), Slic3r::GUI::Materials::get_filament_vendor(), Slic3r::GUI::Materials::get_material_type(), Slic3r::GUI::Materials::get_material_vendor(), Slic3r::PresetCollection::get_preset_differed_for_save(), Slic3r::GUI::CalibrationPresetPage::get_print_preset(), Slic3r::PresetBundle::get_printer_extruder_count(), get_printer_type(), Slic3r::GUI::Plater::get_selected_printer_name_in_combox(), Slic3r::PresetBundle::get_similar_printer_preset(), Slic3r::GUI::PresetComboBox::get_tooltip(), Slic3r::PresetBundle::get_used_tpu_filaments(), Slic3r::GUI::CreatePresetForPrinterDialog::get_visible_printer_and_compatible_filament_presets(), Slic3r::GUI::getExtruderNozzleCount(), Slic3r::GUI::getExtruderNozzleCountTotal(), Slic3r::DevUtilBackend::GetFilamentDryingPreset(), Slic3r::PresetBundle::has_errors(), has_lidar(), Slic3r::GUI::PartPlate::imex_wipe_tower_hull(), Slic3r::PresetBundle::import_json_presets(), inherits(), Slic3r::GUI::GCodeViewer::init(), Slic3r::GUI::ExportPresetBundleDialog::InitExportData(), Slic3r::is_compatible_with_parent_printer(), Slic3r::is_compatible_with_print(), Slic3r::is_compatible_with_printer(), Slic3r::is_compatible_with_printer(), Slic3r::is_compatible_with_printer(), Slic3r::PresetCollection::is_dirty(), Slic3r::GUI::CalibrationPresetPage::is_filament_in_blacklist(), Slic3r::GUI::is_soluble_filament(), Slic3r::GUI::is_support_filament(), Slic3r::GUI::Sidebar::priv::layout_printer(), Slic3r::PresetBundle::load_config_file_config(), Slic3r::GUI::Tab::load_current_preset(), Slic3r::PresetCollection::load_external_preset(), Slic3r::GUI::MainFrame::load_printer_url(), Slic3r::PhysicalPrinterCollection::load_printers_from_presets(), Slic3r::PresetCollection::load_project_embedded_presets(), Slic3r::PresetBundle::load_selections(), Slic3r::PresetCollection::load_user_preset(), Slic3r::GUI::manuallySetNozzleCount(), Slic3r::GUI::Tab::may_discard_current_dirty_preset(), Slic3r::GUI::GLCanvas3D::CenterOfMass::model_markers(), normalize(), Slic3r::normalize_compatible_field(), Slic3r::GUI::FlowRateWizard::on_cali_start(), Slic3r::GUI::PressureAdvanceWizard::on_cali_start(), Slic3r::GUI::Plater::on_filament_change(), Slic3r::GUI::TabPrinter::on_preset_loaded(), Slic3r::GUI::CalibrationPresetPage::on_recommend_input_value(), Slic3r::GUI::AMSMaterialsSetting::on_select_filament(), Slic3r::GUI::Plater::priv::on_select_preset(), Slic3r::GUI::Tab::on_value_change(), Slic3r::GUI::AMSMaterialsSetting::Popup(), Slic3r::anonymous_namespace{PresetBundle.cpp}::printer_kept_bed_paths(), Slic3r::GUI::anonymous_namespace{PublishSettingsDialog.cpp}::project_used_filament_slots(), Slic3r::referenced_capabilities(), Slic3r::GUI::PartPlate::refresh_imex_icon(), Slic3r::refresh_missing_plugins(), Slic3r::GUI::PartPlate::register_raycasters_for_picking(), reload(), Slic3r::PresetBundle::reload_local_bundle(), Slic3r::GUI::GUI_App::reload_settings(), remove_invalid_keys(), Slic3r::GUI::PartPlate::render_icons(), Slic3r::GUI::GCodeViewer::render_markers(), Slic3r::GUI::SelectMachineDialog::reset_and_sync_ams_list(), Slic3r::GUI::SyncAmsInfoDialog::reset_and_sync_ams_list(), Slic3r::PresetBundle::reset_default_nozzle_volume_type(), Slic3r::PresetBundle::reset_project_embedded_presets(), Slic3r::PresetBundle::resolve_preset_config(), Slic3r::PresetBundle::resolve_system_preset(), Slic3r::PresetCollection::resolve_user_preset(), Slic3r::PresetBundle::resolve_vendor_preset(), Slic3r::PresetBundle::restore_selection(), Slic3r::CLI::run(), Slic3r::GUI::s_get_slicing_extuder_nozzles(), save(), Slic3r::PresetBundle::save_changes_for_preset(), Slic3r::PresetCollection::save_current_preset(), Slic3r::GUI::CalibrationWizard::save_preset(), Slic3r::PresetBundle::save_preset_to_bundle_dir(), Slic3r::GUI::CalibrationWizard::save_preset_with_index(), Slic3r::GUI::CreatePrinterPresetDialog::save_printable_area_config(), Slic3r::PresetCollection::save_user_presets(), Slic3r::GUI::sCheckFilamentInfo(), Slic3r::GUI::seedExtruderNozzleStats(), Slic3r::GUI::Tab::select_preset(), anonymous_namespace{OrcaSlicer_profile_validator.cpp}::select_printer_default_presets(), Slic3r::PresetBundle::selection(), Slic3r::GUI::Plater::set_bed_shape(), Slic3r::PresetBundle::set_calibrate_printer(), set_dirty(), Slic3r::GUI::PartPlate::set_shape(), set_visible_from_appconfig(), Slic3r::GUI::setExtruderNozzleCount(), Slic3r::GUI::Sidebar::should_show_SEMM_buttons(), anonymous_namespace{OrcaSlicer_profile_validator.cpp}::slice_all_printers(), anonymous_namespace{OrcaSlicer_profile_validator.cpp}::slice_config(), Slic3r::PresetBundle::support_different_extruders(), Slic3r::GUI::support_nozzle_volume(), Slic3r::GUI::Sidebar::priv::switch_diameter_to(), Slic3r::GUI::Tab::switch_excluder(), Slic3r::GUI::SendMultiMachinePage::sync_ams_list(), Slic3r::GUI::Tab::sync_excluder(), Slic3r::GUI::Sidebar::priv::sync_extruder_list(), Slic3r::PresetUtils::system_printer_model(), Slic3r::GUI::anonymous_namespace{HintNotification.cpp}::tag_check_material(), Slic3r::GUI::TabSLAMaterial::toggle_options(), Slic3r::GUI::ConfigManipulation::toggle_print_fff_options(), Slic3r::GUI::Tab::transfer_options(), Slic3r::GUI::PlaterPresetComboBox::update(), Slic3r::GUI::Sidebar::update_all_preset_comboboxes(), Slic3r::GUI::CalibrationPresetPage::update_combobox_filaments(), Slic3r::PresetBundle::update_compatible(), Slic3r::PresetCollection::update_compatible_internal(), Slic3r::GUI::update_custom_filaments(), Slic3r::PhysicalPrinter::update_from_preset(), Slic3r::GUI::Tab::update_preset_description_line(), Slic3r::GUI::Sidebar::update_presets(), Slic3r::GUI::Sidebar::update_printer_thumbnail(), Slic3r::GUI::DiffPresetDialog::update_tree(), Slic3r::GUI::updateNozzleCountDisplay(), and Slic3r::GUI::Tab::validate_filament_temperature_pairs().

◆ description

◆ filament_id

std::string Slic3r::Preset::filament_id

Referenced by Slic3r::GUI::PlaterPresetComboBox::PlaterPresetComboBox(), Slic3r::PresetCollection::add_detached_preset(), Slic3r::GUI::CalibUtils::calib_flowrate(), Slic3r::GUI::CalibUtils::calib_generic_PA(), Slic3r::PresetBundle::check_duplicate_filament_subtypes(), Slic3r::PresetBundle::commit_vendor_preset(), Slic3r::PresetCollection::filament_id_by_type(), Slic3r::PresetBundle::full_fff_config(), Slic3r::GUI::SyncAmsInfoDialog::generate_override_fix_ams_list(), Slic3r::PresetBundle::get_filament_by_filament_id(), Slic3r::GUI::get_filament_id(), Slic3r::GUI::CreateFilamentPresetDialog::get_filament_preset_choices(), Slic3r::DevUtilBackend::GetFilamentDryingPreset(), Slic3r::anonymous_namespace{CrealityPrintAgent.cpp}::has_visible_base_preset(), Slic3r::anonymous_namespace{QidiPrinterAgent.cpp}::has_visible_base_preset(), Slic3r::PresetBundle::import_json_presets(), Slic3r::GUI::CalibrationPresetPage::is_filament_in_blacklist(), Slic3r::PresetBundle::load_config_file_config(), Slic3r::PresetCollection::load_external_preset(), Slic3r::PresetCollection::load_project_embedded_presets(), Slic3r::PresetCollection::load_user_preset(), Slic3r::MoonrakerPrinterAgent::map_filament_type_to_generic_id(), Slic3r::GUI::FlowRateWizard::on_cali_start(), Slic3r::GUI::PressureAdvanceWizard::on_cali_start(), Slic3r::GUI::SelectMachineDialog::reset_and_sync_ams_list(), Slic3r::GUI::SyncAmsInfoDialog::reset_and_sync_ams_list(), Slic3r::PresetCollection::resolve_user_preset(), save(), Slic3r::PresetBundle::save_preset_to_bundle_dir(), Slic3r::GUI::sCheckFilamentInfo(), Slic3r::GUI::SendMultiMachinePage::sync_ams_list(), Slic3r::GUI::Sidebar::sync_ams_list(), Slic3r::GUI::wgtDeviceNozzleRackHotendUpdate::UpdateInfo(), and Slic3r::warn_ambiguous_filament_id_match().

◆ file

◆ ini_str

std::string Slic3r::Preset::ini_str

◆ is_compatible

◆ is_default

◆ is_dirty

◆ is_external

◆ is_project_embedded

◆ is_system

bool Slic3r::Preset::is_system = false

Referenced by Slic3r::GUI::SavePresetDialog::Item::Item(), Slic3r::GUI::PhysicalPrinterDialog::PhysicalPrinterDialog(), Slic3r::PresetBundle::check_duplicate_filament_subtypes(), Slic3r::PresetBundle::check_preset_references(), Slic3r::PresetBundle::check_printer_default_materials(), Slic3r::PresetBundle::commit_vendor_preset(), Slic3r::PresetCollection::delete_current_preset(), Slic3r::GUI::Bed3D::detect_type(), Slic3r::PresetBundle::export_current_configs(), Slic3r::PresetBundle::full_fff_config(), Slic3r::PresetBundle::get_custom_vendor_models(), Slic3r::PresetBundle::get_filament_by_filament_id(), Slic3r::PresetBundle::get_filament_presets_for_machine(), Slic3r::PresetCollection::get_preset_base(), Slic3r::PresetBundle::get_similar_printer_preset(), Slic3r::PresetBundle::has_errors(), Slic3r::GUI::GCodeViewer::init(), Slic3r::is_compatible_with_printer(), Slic3r::PresetCollection::legacy_user_filament_presets(), Slic3r::PresetBundle::load_installed_filaments(), Slic3r::MoonrakerPrinterAgent::map_filament_type_to_generic_id(), Slic3r::GUI::Plater::priv::on_select_preset(), Slic3r::GUI::ExportPresetBundleDialog::OnRequestPresets(), save(), Slic3r::GUI::CalibrationWizard::save_preset(), Slic3r::GUI::Tab::save_preset(), Slic3r::GUI::CalibrationWizard::save_preset_with_index(), Slic3r::GUI::ExportConfigsDialog::select_curr_radiobox(), Slic3r::GUI::Tab::select_preset(), Slic3r::GUI::Plater::set_bed_shape(), Slic3r::GUI::CalibrateFilamentComboBox::update(), Slic3r::GUI::PlaterPresetComboBox::update(), Slic3r::GUI::PresetComboBox::update(), Slic3r::GUI::TabPresetComboBox::update(), Slic3r::GUI::TabPrint::update(), Slic3r::GUI::update_custom_filaments(), Slic3r::GUI::Tab::update_preset_description_line(), and Slic3r::GUI::PhysicalPrinterDialog::update_preset_input().

◆ is_visible

◆ key_values

std::map<std::string, std::string> Slic3r::Preset::key_values

Referenced by reload().

◆ loaded

bool Slic3r::Preset::loaded = false

◆ loading_substitutions

ConfigSubstitutions* Slic3r::Preset::loading_substitutions {nullptr}

◆ m_excluded_from

std::set<std::string> Slic3r::Preset::m_excluded_from

◆ m_from_orca_filament_lib

bool Slic3r::Preset::m_from_orca_filament_lib = false

◆ name

std::string Slic3r::Preset::name

Referenced by Slic3r::GUI::SavePresetDialog::Item::Item(), Slic3r::GUI::PhysicalPrinterDialog::PhysicalPrinterDialog(), Preset(), Slic3r::_BBS_3MF_Exporter::_add_project_embedded_presets_to_archive(), Slic3r::GUI::SavePresetDialog::Item::accept(), Slic3r::active_capability_config(), Slic3r::GUI::ExportConfigsDialog::archive_filament_bundle_to_file(), Slic3r::GUI::ExportConfigsDialog::archive_filament_preset_to_file(), Slic3r::GUI::ExportConfigsDialog::archive_preset_bundle_to_file(), Slic3r::GUI::ExportConfigsDialog::archive_printer_preset_to_file(), Slic3r::GUI::ExportConfigsDialog::archive_process_preset_to_file(), Slic3r::anonymous_namespace{PluginHostPresets.cpp}::bind_filament_target(), Slic3r::anonymous_namespace{PluginHostPresets.cpp}::bind_preset_target(), Slic3r::GUI::UnsavedChangesDialog::build(), Slic3r::PresetBundle::check_duplicate_filament_subtypes(), Slic3r::PresetBundle::check_filament_temp_equation_by_printer_type_and_nozzle_for_mas_tray(), Slic3r::check_filaments_printable(), Slic3r::PresetBundle::check_preset_references(), Slic3r::PresetCollection::clone_presets(), Slic3r::anonymous_namespace{PluginHostPresets.cpp}::PresetTransaction::commit(), Slic3r::PresetBundle::commit_vendor_preset(), Slic3r::GUI::Tab::compatible_widget_create(), Slic3r::PresetBundle::construct_full_config(), Slic3r::GUI::DiffPresetDialog::create_buttons(), Slic3r::GUI::CreateFilamentPresetDialog::create_dialog_buttons(), Slic3r::GUI::EditFilamentPresetDialog::create_dialog_buttons(), Slic3r::GUI::CreateFilamentPresetDialog::create_filament_preset_item(), Slic3r::GUI::DiffPresetDialog::create_presets_sizer(), Slic3r::GUI::ExportConfigsDialog::data_init(), Slic3r::PresetCollection::delete_current_preset(), Slic3r::GUI::delete_filament_preset_by_name(), Slic3r::GUI::EditFilamentPresetDialog::delete_preset(), Slic3r::PresetCollection::delete_preset(), Slic3r::GUI::ExportConfigsDialog::earse_preset_fields_for_safe(), Slic3r::PresetBundle::export_current_configs(), Slic3r::PresetCollection::filament_preset_less(), Slic3r::GUI::filament_type_for_color_decompose(), Slic3r::PresetBundle::full_fff_config(), Slic3r::GUI::SyncAmsInfoDialog::generate_override_fix_ams_list(), Slic3r::GUI::CreateFilamentPresetDialog::get_all_filament_presets(), Slic3r::GUI::get_config_json(), Slic3r::GUI::get_filament_id(), Slic3r::GUI::CreateFilamentPresetDialog::get_filament_preset_choices(), Slic3r::GUI::CreateFilamentPresetDialog::get_filament_presets_by_machine(), Slic3r::PresetBundle::get_filament_presets_for_machine(), Slic3r::GUI::PresetComboBox::get_preset_item_name(), Slic3r::GUI::PresetComboBox::get_preset_name(), Slic3r::GUI::CalibrationPresetPage::get_print_preset(), Slic3r::GUI::CalibrationPresetPage::get_print_preset_name(), Slic3r::PresetCollection::get_selected_preset_name(), Slic3r::PresetBundle::get_similar_printer_preset(), Slic3r::GUI::PresetComboBox::get_tooltip(), Slic3r::PresetBundle::get_used_tpu_filaments(), Slic3r::PresetBundle::import_json_presets(), Slic3r::GUI::ExportPresetBundleDialog::InitExportData(), Slic3r::PresetBundle::install_vendor_entries(), Slic3r::is_compatible_with_print(), Slic3r::is_compatible_with_printer(), Slic3r::is_compatible_with_printer(), Slic3r::PresetBundle::is_the_only_edited_filament(), label(), Slic3r::PresetCollection::legacy_user_filament_presets(), Slic3r::PresetBundle::load_config_file_config(), Slic3r::PresetCollection::load_external_preset(), Slic3r::PhysicalPrinterCollection::load_printers_from_presets(), Slic3r::PresetBundle::load_selections(), Slic3r::GUI::ConfigWizard::priv::load_vendors(), Slic3r::GUI::anonymous_namespace{PublishSettingsDialog.cpp}::material_title(), Slic3r::normalize_compatible_field(), normalize_inherits(), Slic3r::GUI::FlowRateWizard::on_cali_start(), Slic3r::GUI::PressureAdvanceWizard::on_cali_start(), Slic3r::GUI::PageMaterials::on_material_highlighted(), Slic3r::GUI::TabPrinter::on_preset_loaded(), Slic3r::GUI::ExportPresetBundleDialog::OnRequestPresets(), operator<(), Slic3r::GUI::AMSMaterialsSetting::Popup(), Slic3r::PresetBundle::reload_local_bundle(), Slic3r::GUI::PageMaterials::reload_presets(), Slic3r::GUI::GUI_App::reload_settings(), remove_suffix_modified(), Slic3r::PresetBundle::remove_users_preset(), Slic3r::GUI::SelectMachineDialog::reset_and_sync_ams_list(), Slic3r::GUI::SyncAmsInfoDialog::reset_and_sync_ams_list(), Slic3r::anonymous_namespace{PluginHostPresets.cpp}::resolved_slot_preset(), Slic3r::CLI::run(), Slic3r::GUI::UnsavedChangesDialog::save(), save(), Slic3r::GUI::CalibrationWizard::save_preset(), Slic3r::GUI::Tab::save_preset(), Slic3r::PresetBundle::save_preset_to_bundle_dir(), Slic3r::GUI::CalibrationWizard::save_preset_with_index(), Slic3r::GUI::sCheckFilamentInfo(), Slic3r::GUI::Tab::select_preset(), Slic3r::GUI::PluginsConfigDialog::send_capabilities(), Slic3r::GUI::CalibUtils::send_to_print(), Slic3r::PresetBundle::set_calibrate_printer(), set_visible_from_appconfig(), Slic3r::GUI::SendMultiMachinePage::sync_ams_list(), Slic3r::GUI::Sidebar::priv::sync_extruder_list(), Slic3r::GUI::GUI_App::sync_preset(), Slic3r::GUI::Tab::transfer_options(), Slic3r::GUI::CalibrateFilamentComboBox::update(), Slic3r::GUI::PlaterPresetComboBox::update(), Slic3r::GUI::PresetComboBox::update(), Slic3r::GUI::TabPresetComboBox::update(), Slic3r::GUI::UnsavedChangesDialog::update(), Slic3r::GUI::CalibrationPresetPage::update_combobox_filaments(), Slic3r::PresetBundle::update_compatible(), Slic3r::PresetCollection::update_compatible_internal(), Slic3r::GUI::update_custom_filaments(), Slic3r::PhysicalPrinter::update_from_preset(), Slic3r::GUI::PageMaterials::update_lists(), Slic3r::PresetBundle::update_num_filaments(), Slic3r::GUI::Tab::update_preset_description_line(), Slic3r::GUI::CreatePrinterPresetDialog::update_presets_list(), Slic3r::PresetBundle::update_subscribed_presets(), Slic3r::PresetBundle::update_system_preset_setting_ids(), Slic3r::GUI::DiffPresetDialog::update_tree(), and Slic3r::GUI::Tab::validate_filament_temperature_pairs().

◆ renamed_from

◆ setting_id

◆ sync_info

◆ type

◆ updated_time

long long Slic3r::Preset::updated_time {0}
331{0}; //last updated time

Referenced by load_info(), and save_info().

◆ user_id

◆ vendor

◆ version


The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Preset.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Preset.cpp