mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-24 01:01:15 -06:00
PhysicalPrinter improvements:
* implemented PresetForPrinter class
This commit is contained in:
parent
6d4a0d91fc
commit
0b88e86634
4 changed files with 175 additions and 40 deletions
|
|
@ -1375,6 +1375,15 @@ const std::string& PhysicalPrinter::get_printer_model() const
|
|||
return config.opt_string("printer_model");
|
||||
}
|
||||
|
||||
bool PhysicalPrinter::has_empty_config() const
|
||||
{
|
||||
return config.opt_string("print_host" ).empty() &&
|
||||
config.opt_string("printhost_apikey").empty() &&
|
||||
config.opt_string("printhost_cafile").empty() &&
|
||||
config.opt_string("login" ).empty() &&
|
||||
config.opt_string("password" ).empty();
|
||||
}
|
||||
|
||||
void PhysicalPrinter::update_from_preset(const Preset& preset)
|
||||
{
|
||||
config.apply_only(preset.config, printer_options(), false);
|
||||
|
|
|
|||
|
|
@ -556,6 +556,7 @@ public:
|
|||
static const std::vector<std::string>& printer_options();
|
||||
const std::string& get_preset_name() const;
|
||||
const std::string& get_printer_model() const;
|
||||
bool has_empty_config() const;
|
||||
|
||||
void save() { this->config.save(this->file); }
|
||||
void save_to(const std::string& file_name) const { this->config.save(file_name); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue