OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Preset.hpp File Reference
#include <cstddef>
#include <cassert>
#include <cmath>
#include <algorithm>
#include <deque>
#include <map>
#include <limits>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <functional>
#include <mutex>
#include <optional>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/property_tree/ptree_fwd.hpp>
#include <vector>
#include <utility>
#include "Config.hpp"
#include "PrintConfig.hpp"
#include "Semver.hpp"
#include "ProjectTask.hpp"
#include "libslic3r.h"
Include dependency graph for Preset.hpp:

Go to the source code of this file.

Classes

class  Slic3r::VendorProfile
struct  Slic3r::VendorProfile::PrinterVariant
struct  Slic3r::VendorProfile::PrinterModel
struct  Slic3r::PresetWithVendorProfile
class  Slic3r::Preset
struct  Slic3r::PresetOrigin
struct  Slic3r::PresetConfigSubstitutions
struct  Slic3r::LegacyUserFilamentPreset
class  Slic3r::PresetCollection
struct  Slic3r::PresetCollection::PresetFilesOnDisk
struct  Slic3r::PresetCollection::UserPresetLoad
class  Slic3r::PrinterPresetCollection
class  Slic3r::PhysicalPrinter
class  Slic3r::PhysicalPrinterCollection

Namespaces

namespace  Slic3r
 |/ Copyright (c) Prusa Research 2020 - 2023 Enrico Turri @enricoturri1966 |/ |/ PrusaSlicer is released under the terms of the AGPLv3 or higher |/
namespace  Slic3r::PresetUtils

Macros

#define PRESET_SYSTEM_DIR   "system"
#define PRESET_USER_DIR   "user"
#define PRESET_FILAMENT_NAME   "filament"
#define PRESET_PRINT_NAME   "process"
#define PRESET_PRINTER_NAME   "machine"
#define PRESET_SLA_PRINT_NAME   "sla_print"
#define PRESET_SLA_MATERIALS_NAME   "sla_materials"
#define PRESET_PROFILES_DIR   "profiles"
#define PRESET_PROFILES_TEMOLATE_DIR   "profiles_template"
#define PRESET_TEMPLATE_DIR   "Template"
#define PRESET_CUSTOM_VENDOR   "Custom"
#define PRESET_LOCAL_DIR   "_local"
#define PRESET_SUBSCRIBED_DIR   "_subscribed"
#define PRESET_BUNDLE_METADATA   "bundle_metadata.json"
#define PRESET_IOT_PRINTER_TYPE   "printer"
#define PRESET_IOT_FILAMENT_TYPE   "filament"
#define PRESET_IOT_PRINT_TYPE   "print"
#define BBL_JSON_KEY_VERSION   "version"
#define BBL_JSON_KEY_IS_CUSTOM   "is_custom_defined"
#define BBL_JSON_KEY_URL   "url"
#define BBL_JSON_KEY_NAME   "name"
#define BBL_JSON_KEY_DESCRIPTION   "description"
#define BBL_JSON_KEY_FORCE_UPDATE   "force_update"
#define BBL_JSON_KEY_MACHINE_MODEL_LIST   "machine_model_list"
#define BBL_JSON_KEY_PROCESS_LIST   "process_list"
#define BBL_JSON_KEY_SUB_PATH   "sub_path"
#define BBL_JSON_KEY_FILAMENT_LIST   "filament_list"
#define BBL_JSON_KEY_MACHINE_LIST   "machine_list"
#define BBL_JSON_KEY_TYPE   "type"
#define BBL_JSON_KEY_FROM   "from"
#define BBL_JSON_KEY_SETTING_ID   "setting_id"
#define BBL_JSON_KEY_BASE_ID   "base_id"
#define BBL_JSON_KEY_USER_ID   "user_id"
#define BBL_JSON_KEY_FILAMENT_ID   "filament_id"
#define UNKNOWN_FILAMENT_ID   "__unknown__"
#define ORCA_JSON_KEY_UPDATE_TIME   "updated_time"
#define ORCA_JSON_KEY_CREATED_TIME   "created_time"
#define BBL_JSON_KEY_INHERITS   "inherits"
#define BBL_JSON_KEY_INCLUDES   "include"
#define BBL_JSON_KEY_INSTANTIATION   "instantiation"
#define BBL_JSON_KEY_NOZZLE_DIAMETER   "nozzle_diameter"
#define BBL_JSON_KEY_PRINTER_TECH   "machine_tech"
#define BBL_JSON_KEY_FAMILY   "family"
#define BBL_JSON_KEY_BED_MODEL   "bed_model"
#define BBL_JSON_KEY_BED_TEXTURE   "bed_texture"
#define BBL_JSON_KEY_IMAGE_BED_TYPE   "image_bed_type"
#define BBL_JSON_KEY_BOTTOM_TEXTURE_END_NAME   "bottom_texture_end_name"
#define BBL_JSON_KEY_USE_DOUBLE_EXTRUDER_DEFAULT_TEXTURE   "use_double_extruder_default_texture"
#define BBL_JSON_KEY_BOTTOM_TEXTURE_RECT   "bottom_texture_rect"
#define BBL_JSON_KEY_BOTTOM_TEXTURE_RECT_LONGER   "bottom_texture_rect_longer"
#define BBL_JSON_KEY_MIDDLE_TEXTURE_RECT   "middle_texture_rect"
#define BBL_JSON_KEY_HOTEND_MODEL   "hotend_model"
#define BBL_JSON_KEY_DEFAULT_MATERIALS   "default_materials"
#define BBL_JSON_KEY_NOT_SUPPORT_BED_TYPE   "not_support_bed_type"
#define BBL_JSON_KEY_MODEL_ID   "model_id"
#define ORCA_JSON_KEY_RENAMED_FROM   "renamed_from"

Typedefs

typedef std::map< std::string, VendorProfile > Slic3r::VendorMap
using Slic3r::PresetsConfigSubstitutions = std::vector<PresetConfigSubstitutions>

Enumerations

enum  Slic3r::ConfigFileType { Slic3r::CONFIG_FILE_TYPE_UNKNOWN , Slic3r::CONFIG_FILE_TYPE_APP_CONFIG , Slic3r::CONFIG_FILE_TYPE_CONFIG , Slic3r::CONFIG_FILE_TYPE_CONFIG_BUNDLE }
enum class  Slic3r::PresetSelectCompatibleType { Slic3r::Never , Slic3r::OnlyIfWasCompatible , Slic3r::Always }

Functions

std::string Slic3r::generate_preset_setting_id (const std::string &vendor, const std::string &type, const std::string &name)
Semver Slic3r::get_version_from_json (std::string file_path)
int Slic3r::get_values_from_json (std::string file_path, std::vector< std::string > &keys, std::map< std::string, std::string > &key_values)
ConfigFileType Slic3r::guess_config_file_type (const boost::property_tree::ptree &tree)
void Slic3r::extend_default_config_length (DynamicPrintConfig &config, const bool set_nil_to_default, const DynamicPrintConfig &defaults)
bool Slic3r::is_compatible_with_print (const PresetWithVendorProfile &preset, const PresetWithVendorProfile &active_print, const PresetWithVendorProfile &active_printer)
bool Slic3r::is_compatible_with_printer (const PresetWithVendorProfile &preset, const PresetWithVendorProfile &active_printer, const DynamicPrintConfig *extra_config)
bool Slic3r::is_compatible_with_printer (const PresetWithVendorProfile &preset, const PresetWithVendorProfile &active_printer)
bool Slic3r::is_compatible_with_printer (const DynamicPrintConfig &preset_config, Preset::Type preset_type, const DynamicPrintConfig &printer_config, const std::string &printer_name)
std::string Slic3r::get_preset_canonical_name (const std::string &preset_bare_name, const PresetOrigin &origin)
std::string Slic3r::get_preset_bare_name (const std::string &canonical_name)
std::string Slic3r::user_presets_lock_path (bool read_only)
PresetOrigin Slic3r::detect_origin_from_path (const boost::filesystem::path &path, const PresetOrigin &explicit_origin)
const VendorProfile::PrinterModel * Slic3r::PresetUtils::system_printer_model (const Preset &preset)
std::string Slic3r::PresetUtils::system_printer_bed_model (const Preset &preset)
std::string Slic3r::PresetUtils::system_printer_bed_texture (const Preset &preset)
std::string Slic3r::PresetUtils::system_printer_hotend_model (const Preset &preset)

Variables

static constexpr const char * GENERIC_PREFIX = "Generic "

Class Documentation

◆ Slic3r::LegacyUserFilamentPreset

struct Slic3r::LegacyUserFilamentPreset
Collaboration diagram for Slic3r::LegacyUserFilamentPreset:
Class Members
vector< string > compatible_printers
string file
string inherits
string parent
string preset
vector< string > printers

◆ Slic3r::PresetCollection::UserPresetLoad

struct Slic3r::PresetCollection::UserPresetLoad
Collaboration diagram for Slic3r::PresetCollection::UserPresetLoad:
Class Members
bool complete { false }
bool discard_file { false }
vector< string > errors
string info_file
bool install { false }
PresetFilesOnDisk on_disk
Preset preset
bool save_compatible_printers { false }
PresetsConfigSubstitutions substitutions

Macro Definition Documentation

◆ BBL_JSON_KEY_BASE_ID

◆ BBL_JSON_KEY_BED_MODEL

#define BBL_JSON_KEY_BED_MODEL   "bed_model"

◆ BBL_JSON_KEY_BED_TEXTURE

#define BBL_JSON_KEY_BED_TEXTURE   "bed_texture"

◆ BBL_JSON_KEY_BOTTOM_TEXTURE_END_NAME

#define BBL_JSON_KEY_BOTTOM_TEXTURE_END_NAME   "bottom_texture_end_name"

◆ BBL_JSON_KEY_BOTTOM_TEXTURE_RECT

#define BBL_JSON_KEY_BOTTOM_TEXTURE_RECT   "bottom_texture_rect"

◆ BBL_JSON_KEY_BOTTOM_TEXTURE_RECT_LONGER

#define BBL_JSON_KEY_BOTTOM_TEXTURE_RECT_LONGER   "bottom_texture_rect_longer"

◆ BBL_JSON_KEY_DEFAULT_MATERIALS

#define BBL_JSON_KEY_DEFAULT_MATERIALS   "default_materials"

◆ BBL_JSON_KEY_DESCRIPTION

◆ BBL_JSON_KEY_FAMILY

#define BBL_JSON_KEY_FAMILY   "family"

◆ BBL_JSON_KEY_FILAMENT_ID

◆ BBL_JSON_KEY_FILAMENT_LIST

#define BBL_JSON_KEY_FILAMENT_LIST   "filament_list"

◆ BBL_JSON_KEY_FORCE_UPDATE

#define BBL_JSON_KEY_FORCE_UPDATE   "force_update"

◆ BBL_JSON_KEY_FROM

◆ BBL_JSON_KEY_HOTEND_MODEL

#define BBL_JSON_KEY_HOTEND_MODEL   "hotend_model"

◆ BBL_JSON_KEY_IMAGE_BED_TYPE

#define BBL_JSON_KEY_IMAGE_BED_TYPE   "image_bed_type"

◆ BBL_JSON_KEY_INCLUDES

#define BBL_JSON_KEY_INCLUDES   "include"

◆ BBL_JSON_KEY_INHERITS

◆ BBL_JSON_KEY_INSTANTIATION

◆ BBL_JSON_KEY_IS_CUSTOM

#define BBL_JSON_KEY_IS_CUSTOM   "is_custom_defined"

◆ BBL_JSON_KEY_MACHINE_LIST

#define BBL_JSON_KEY_MACHINE_LIST   "machine_list"

◆ BBL_JSON_KEY_MACHINE_MODEL_LIST

#define BBL_JSON_KEY_MACHINE_MODEL_LIST   "machine_model_list"

◆ BBL_JSON_KEY_MIDDLE_TEXTURE_RECT

#define BBL_JSON_KEY_MIDDLE_TEXTURE_RECT   "middle_texture_rect"

◆ BBL_JSON_KEY_MODEL_ID

#define BBL_JSON_KEY_MODEL_ID   "model_id"

◆ BBL_JSON_KEY_NAME

◆ BBL_JSON_KEY_NOT_SUPPORT_BED_TYPE

#define BBL_JSON_KEY_NOT_SUPPORT_BED_TYPE   "not_support_bed_type"

◆ BBL_JSON_KEY_NOZZLE_DIAMETER

#define BBL_JSON_KEY_NOZZLE_DIAMETER   "nozzle_diameter"

◆ BBL_JSON_KEY_PRINTER_TECH

#define BBL_JSON_KEY_PRINTER_TECH   "machine_tech"

◆ BBL_JSON_KEY_PROCESS_LIST

#define BBL_JSON_KEY_PROCESS_LIST   "process_list"

◆ BBL_JSON_KEY_SETTING_ID

◆ BBL_JSON_KEY_SUB_PATH

#define BBL_JSON_KEY_SUB_PATH   "sub_path"

◆ BBL_JSON_KEY_TYPE

◆ BBL_JSON_KEY_URL

#define BBL_JSON_KEY_URL   "url"

◆ BBL_JSON_KEY_USE_DOUBLE_EXTRUDER_DEFAULT_TEXTURE

#define BBL_JSON_KEY_USE_DOUBLE_EXTRUDER_DEFAULT_TEXTURE   "use_double_extruder_default_texture"

◆ BBL_JSON_KEY_USER_ID

◆ BBL_JSON_KEY_VERSION

◆ ORCA_JSON_KEY_CREATED_TIME

#define ORCA_JSON_KEY_CREATED_TIME   "created_time"

◆ ORCA_JSON_KEY_RENAMED_FROM

#define ORCA_JSON_KEY_RENAMED_FROM   "renamed_from"

◆ ORCA_JSON_KEY_UPDATE_TIME

◆ PRESET_BUNDLE_METADATA

◆ PRESET_CUSTOM_VENDOR

◆ PRESET_FILAMENT_NAME

◆ PRESET_IOT_FILAMENT_TYPE

◆ PRESET_IOT_PRINT_TYPE

◆ PRESET_IOT_PRINTER_TYPE

◆ PRESET_LOCAL_DIR

◆ PRESET_PRINT_NAME

◆ PRESET_PRINTER_NAME

◆ PRESET_PROFILES_DIR

◆ PRESET_PROFILES_TEMOLATE_DIR

#define PRESET_PROFILES_TEMOLATE_DIR   "profiles_template"

◆ PRESET_SLA_MATERIALS_NAME

#define PRESET_SLA_MATERIALS_NAME   "sla_materials"

◆ PRESET_SLA_PRINT_NAME

#define PRESET_SLA_PRINT_NAME   "sla_print"

◆ PRESET_SUBSCRIBED_DIR

◆ PRESET_SYSTEM_DIR

◆ PRESET_TEMPLATE_DIR

#define PRESET_TEMPLATE_DIR   "Template"

◆ PRESET_USER_DIR

◆ UNKNOWN_FILAMENT_ID

#define UNKNOWN_FILAMENT_ID   "__unknown__"

Variable Documentation

◆ GENERIC_PREFIX

const char* GENERIC_PREFIX = "Generic "
staticconstexpr