mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 02:07:54 -06:00
PrintHost: Fix host type configuration, refactor, fix #1687
This commit is contained in:
parent
bd725a47f4
commit
857b68a82a
10 changed files with 80 additions and 55 deletions
|
@ -25,16 +25,28 @@ namespace Slic3r {
|
|||
|
||||
PrintHost::~PrintHost() {}
|
||||
|
||||
PrintHost* PrintHost::get_print_host(DynamicPrintConfig *config, Slic3r::PrinterTechnology pt_fallback)
|
||||
PrintHost* PrintHost::get_print_host(DynamicPrintConfig *config)
|
||||
{
|
||||
const auto opt = config->option<ConfigOptionEnum<PrintHostType>>("host_type");
|
||||
const auto host_type = opt != nullptr ? opt->value : (pt_fallback == ptFFF ? htOctoPrint : htSL1);
|
||||
PrinterTechnology tech = ptFFF;
|
||||
|
||||
switch (host_type) {
|
||||
case htOctoPrint: return new OctoPrint(config);
|
||||
case htDuet: return new Duet(config);
|
||||
case htSL1: return new SLAHost(config);
|
||||
default: return nullptr;
|
||||
{
|
||||
const auto opt = config->option<ConfigOptionEnum<PrinterTechnology>>("printer_technology");
|
||||
if (opt != nullptr) {
|
||||
tech = opt->value;
|
||||
}
|
||||
}
|
||||
|
||||
if (tech == ptFFF) {
|
||||
const auto opt = config->option<ConfigOptionEnum<PrintHostType>>("host_type");
|
||||
const auto host_type = opt != nullptr ? opt->value : htOctoPrint;
|
||||
|
||||
switch (host_type) {
|
||||
case htOctoPrint: return new OctoPrint(config);
|
||||
case htDuet: return new Duet(config);
|
||||
default: return nullptr;
|
||||
}
|
||||
} else {
|
||||
return new SL1Host(config);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue