Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::GUI::Bundle Struct Reference

#include <src/slic3r/GUI/ConfigWizard_private.hpp>

+ Collaboration diagram for Slic3r::GUI::Bundle:

Public Member Functions

 Bundle ()=default
 
 Bundle (Bundle &&other)
 
bool load (fs::path source_path, BundleLocation location, bool is_prusa_bundle=false)
 
const std::string & vendor_id () const
 

Public Attributes

std::unique_ptr< PresetBundlepreset_bundle
 
VendorProfilevendor_profile { nullptr }
 
BundleLocation location
 
bool is_prusa_bundle { false }
 

Detailed Description

Constructor & Destructor Documentation

◆ Bundle() [1/2]

Slic3r::GUI::Bundle::Bundle ( )
default

◆ Bundle() [2/2]

Slic3r::GUI::Bundle::Bundle ( Bundle &&  other)
108 : preset_bundle(std::move(other.preset_bundle))
109 , vendor_profile(other.vendor_profile)
110 , location(other.location)
111 , is_prusa_bundle(other.is_prusa_bundle)
112{
113 other.vendor_profile = nullptr;
114}
BundleLocation location
Definition ConfigWizard_private.hpp:72
bool is_prusa_bundle
Definition ConfigWizard_private.hpp:73
std::unique_ptr< PresetBundle > preset_bundle
Definition ConfigWizard_private.hpp:69
VendorProfile * vendor_profile
Definition ConfigWizard_private.hpp:70

Member Function Documentation

◆ load()

bool Slic3r::GUI::Bundle::load ( fs::path  source_path,
BundleLocation  location,
bool  is_prusa_bundle = false 
)
80{
81 this->preset_bundle = std::make_unique<PresetBundle>();
82 this->location = location;
83 this->is_prusa_bundle = ais_prusa_bundle;
84
85 std::string path_string = source_path.string();
86 // Throw when parsing invalid configuration. Only valid configuration is supposed to be provided over the air.
87 auto [config_substitutions, presets_loaded] = preset_bundle->load_configbundle(
89 UNUSED(config_substitutions);
90 // No substitutions shall be reported when loading a system config bundle, no substitutions are allowed.
91 assert(config_substitutions.empty());
92 auto first_vendor = preset_bundle->vendors.begin();
93 if (first_vendor == preset_bundle->vendors.end()) {
94 BOOST_LOG_TRIVIAL(error) << boost::format("Vendor bundle: `%1%`: No vendor information defined, cannot install.") % path_string;
95 return false;
96 }
97 if (presets_loaded == 0) {
98 BOOST_LOG_TRIVIAL(error) << boost::format("Vendor bundle: `%1%`: No profile loaded.") % path_string;
99 return false;
100 }
101
102 BOOST_LOG_TRIVIAL(trace) << boost::format("Vendor bundle: `%1%`: %2% profiles loaded.") % path_string % presets_loaded;
103 this->vendor_profile = &first_vendor->second;
104 return true;
105}
@ LoadSystem
Definition PresetBundle.hpp:115
#define UNUSED(x)
Definition libslic3r.h:74
@ Disable
Definition Config.hpp:219
static char error[256]
Definition tga.cpp:50

References Slic3r::Disable, error, is_prusa_bundle, Slic3r::PresetBundle::LoadSystem, location, preset_bundle, UNUSED, and vendor_profile.

Referenced by Slic3r::GUI::BundleMap::load().

+ Here is the caller graph for this function:

◆ vendor_id()

const std::string & Slic3r::GUI::Bundle::vendor_id ( ) const
inline
81{ return vendor_profile->id; }
std::string id
Definition Preset.hpp:33

References Slic3r::VendorProfile::id, and vendor_profile.

Member Data Documentation

◆ is_prusa_bundle

bool Slic3r::GUI::Bundle::is_prusa_bundle { false }

Referenced by load().

◆ location

BundleLocation Slic3r::GUI::Bundle::location

Referenced by load().

◆ preset_bundle

std::unique_ptr<PresetBundle> Slic3r::GUI::Bundle::preset_bundle

Referenced by load().

◆ vendor_profile

VendorProfile* Slic3r::GUI::Bundle::vendor_profile { nullptr }

Referenced by load(), and vendor_id().


The documentation for this struct was generated from the following files: