mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
ConfigWizard refactoring
This commit is contained in:
parent
f0cee79170
commit
b0f54e5709
9 changed files with 1065 additions and 818 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <Windows.h>
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
#include <stdexcept>
|
||||
#include <boost/format.hpp>
|
||||
|
@ -128,11 +129,14 @@ VendorProfile VendorProfile::from_ini(const ptree &tree, const boost::filesystem
|
|||
VendorProfile::PrinterModel model;
|
||||
model.id = section.first.substr(printer_model_key.size());
|
||||
model.name = section.second.get<std::string>("name", model.id);
|
||||
|
||||
auto technology_field = section.second.get<std::string>("technology", "FFF");
|
||||
if (! ConfigOptionEnum<PrinterTechnology>::from_string(technology_field, model.technology)) {
|
||||
BOOST_LOG_TRIVIAL(error) << boost::format("Vendor bundle: `%1%`: Invalid printer technology field: `%2%`") % id % technology_field;
|
||||
model.technology = ptFFF;
|
||||
}
|
||||
|
||||
model.family = section.second.get<std::string>("family", model.id);
|
||||
#if 0
|
||||
// Remove SLA printers from the initial alpha.
|
||||
if (model.technology == ptSLA)
|
||||
|
@ -157,6 +161,20 @@ VendorProfile VendorProfile::from_ini(const ptree &tree, const boost::filesystem
|
|||
return res;
|
||||
}
|
||||
|
||||
std::vector<std::string> VendorProfile::families() const
|
||||
{
|
||||
std::vector<std::string> res;
|
||||
unsigned num_familiies = 0;
|
||||
|
||||
for (auto &model : models) {
|
||||
if (!model.family.empty() && std::find(res.begin(), res.end(), model.family) == res.end()) {
|
||||
res.push_back(model.family);
|
||||
num_familiies++;
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
// Suffix to be added to a modified preset name in the combo box.
|
||||
static std::string g_suffix_modified = " (modified)";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue