mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-28 03:01:17 -06:00
Merge of pull request Add support for RepetierServer #4384 by @docbobo
with the following refactorings: 1) Removed the "printhost_slug" config from the Printer config and from all the Printer config related spots. 2) "printhost_slug" renamed to "printhost_port". Slug sounds nasty. 3) Improved error reporting of RepetierHost class. 4) Refactored for the new "Physical Printers" Following refactorings were done independently of the Repetier pull request: 1) Removed PrintHost static print config. 2) Clean-up after conversion of print host configuration from Printer config to Physical Printer config. 3) Fixed some issues, where the Printer config was still queried for host configuration. Vojtech believes that this should not happen after the host configuration is converted to physical printers. Vojtech still feels that more refactoring is needed in regard to porting the host configuration from Printer profile to the new Physical Printer profile.
This commit is contained in:
parent
0798fa8185
commit
7c571c1d9d
24 changed files with 556 additions and 200 deletions
|
|
@ -19,6 +19,7 @@ SLIC3R_DERIVE_EXCEPTION(InvalidArgument, LogicError);
|
|||
SLIC3R_DERIVE_EXCEPTION(OutOfRange, LogicError);
|
||||
SLIC3R_DERIVE_EXCEPTION(IOError, CriticalException);
|
||||
SLIC3R_DERIVE_EXCEPTION(FileIOError, IOError);
|
||||
SLIC3R_DERIVE_EXCEPTION(HostNetworkError, IOError);
|
||||
// Runtime exception produced by Slicer. Such exception cancels the slicing process and it shall be shown in notifications.
|
||||
SLIC3R_DERIVE_EXCEPTION(SlicingError, Exception);
|
||||
#undef SLIC3R_DERIVE_EXCEPTION
|
||||
|
|
|
|||
|
|
@ -383,6 +383,7 @@ void fill_slicerconf(ConfMap &m, const SLAPrint &print)
|
|||
static constexpr auto banned_keys = {
|
||||
"compatible_printers"sv,
|
||||
"compatible_prints"sv,
|
||||
//FIXME The print host keys should not be exported to full_print_config anymore. The following keys may likely be removed.
|
||||
"print_host"sv,
|
||||
"printhost_apikey"sv,
|
||||
"printhost_cafile"sv
|
||||
|
|
|
|||
|
|
@ -1619,7 +1619,7 @@ void GCode::_do_export(Print& print, FILE* file, ThumbnailsGeneratorCallback thu
|
|||
// Append full config.
|
||||
_write(file, "\n");
|
||||
{
|
||||
std::string full_config = "";
|
||||
std::string full_config;
|
||||
append_full_config(print, full_config);
|
||||
if (!full_config.empty())
|
||||
_write(file, full_config);
|
||||
|
|
@ -2475,6 +2475,7 @@ void GCode::append_full_config(const Print &print, std::string &str)
|
|||
static constexpr auto banned_keys = {
|
||||
"compatible_printers"sv,
|
||||
"compatible_prints"sv,
|
||||
//FIXME The print host keys should not be exported to full_print_config anymore. The following keys may likely be removed.
|
||||
"print_host"sv,
|
||||
"printhost_apikey"sv,
|
||||
"printhost_cafile"sv
|
||||
|
|
|
|||
|
|
@ -475,8 +475,9 @@ const std::vector<std::string>& Preset::printer_options()
|
|||
if (s_opts.empty()) {
|
||||
s_opts = {
|
||||
"printer_technology",
|
||||
"bed_shape", "bed_custom_texture", "bed_custom_model", "z_offset", "gcode_flavor", "use_relative_e_distances", "serial_port", "serial_speed",
|
||||
"bed_shape", "bed_custom_texture", "bed_custom_model", "z_offset", "gcode_flavor", "use_relative_e_distances",
|
||||
"use_firmware_retraction", "use_volumetric_e", "variable_layer_height",
|
||||
//FIXME the print host keys are left here just for conversion from the Printer preset to Physical Printer preset.
|
||||
"host_type", "print_host", "printhost_apikey", "printhost_cafile",
|
||||
"single_extruder_multi_material", "start_gcode", "end_gcode", "before_layer_gcode", "layer_gcode", "toolchange_gcode",
|
||||
"color_change_gcode", "pause_print_gcode", "template_custom_gcode",
|
||||
|
|
@ -595,6 +596,7 @@ const std::vector<std::string>& Preset::sla_printer_options()
|
|||
"gamma_correction",
|
||||
"min_exposure_time", "max_exposure_time",
|
||||
"min_initial_exposure_time", "max_initial_exposure_time",
|
||||
//FIXME the print host keys are left here just for conversion from the Printer preset to Physical Printer preset.
|
||||
"print_host", "printhost_apikey", "printhost_cafile",
|
||||
"printer_notes",
|
||||
"inherits"
|
||||
|
|
@ -711,38 +713,6 @@ Preset& PresetCollection::load_preset(const std::string &path, const std::string
|
|||
return this->load_preset(path, name, std::move(cfg), select);
|
||||
}
|
||||
|
||||
enum class ProfileHostParams
|
||||
{
|
||||
Same,
|
||||
Different,
|
||||
Anonymized,
|
||||
};
|
||||
|
||||
static ProfileHostParams profile_host_params_same_or_anonymized(const DynamicPrintConfig &cfg_old, const DynamicPrintConfig &cfg_new)
|
||||
{
|
||||
auto opt_print_host_old = cfg_old.option<ConfigOptionString>("print_host");
|
||||
auto opt_printhost_apikey_old = cfg_old.option<ConfigOptionString>("printhost_apikey");
|
||||
auto opt_printhost_cafile_old = cfg_old.option<ConfigOptionString>("printhost_cafile");
|
||||
|
||||
auto opt_print_host_new = cfg_new.option<ConfigOptionString>("print_host");
|
||||
auto opt_printhost_apikey_new = cfg_new.option<ConfigOptionString>("printhost_apikey");
|
||||
auto opt_printhost_cafile_new = cfg_new.option<ConfigOptionString>("printhost_cafile");
|
||||
|
||||
// If the new print host data is undefined, use the old data.
|
||||
bool new_print_host_undefined = (opt_print_host_new == nullptr || opt_print_host_new ->empty()) &&
|
||||
(opt_printhost_apikey_new == nullptr || opt_printhost_apikey_new ->empty()) &&
|
||||
(opt_printhost_cafile_new == nullptr || opt_printhost_cafile_new ->empty());
|
||||
if (new_print_host_undefined)
|
||||
return ProfileHostParams::Anonymized;
|
||||
|
||||
auto opt_same = [](const ConfigOptionString *l, const ConfigOptionString *r) {
|
||||
return ((l == nullptr || l->empty()) && (r == nullptr || r->empty())) ||
|
||||
(l != nullptr && r != nullptr && l->value == r->value);
|
||||
};
|
||||
return (opt_same(opt_print_host_old, opt_print_host_new) && opt_same(opt_printhost_apikey_old, opt_printhost_apikey_new) &&
|
||||
opt_same(opt_printhost_cafile_old, opt_printhost_cafile_new)) ? ProfileHostParams::Same : ProfileHostParams::Different;
|
||||
}
|
||||
|
||||
static bool profile_print_params_same(const DynamicPrintConfig &cfg_old, const DynamicPrintConfig &cfg_new)
|
||||
{
|
||||
t_config_option_keys diff = cfg_old.diff(cfg_new);
|
||||
|
|
@ -752,10 +722,11 @@ static bool profile_print_params_same(const DynamicPrintConfig &cfg_old, const D
|
|||
"compatible_printers", "compatible_printers_condition", "inherits",
|
||||
"print_settings_id", "filament_settings_id", "sla_print_settings_id", "sla_material_settings_id", "printer_settings_id",
|
||||
"printer_model", "printer_variant", "default_print_profile", "default_filament_profile", "default_sla_print_profile", "default_sla_material_profile",
|
||||
//FIXME remove the print host keys?
|
||||
"print_host", "printhost_apikey", "printhost_cafile" })
|
||||
diff.erase(std::remove(diff.begin(), diff.end(), key), diff.end());
|
||||
// Preset with the same name as stored inside the config exists.
|
||||
return diff.empty() && profile_host_params_same_or_anonymized(cfg_old, cfg_new) != ProfileHostParams::Different;
|
||||
return diff.empty();
|
||||
}
|
||||
|
||||
// Load a preset from an already parsed config file, insert it into the sorted sequence of presets
|
||||
|
|
@ -784,25 +755,11 @@ Preset& PresetCollection::load_external_preset(
|
|||
it = this->find_preset_renamed(original_name);
|
||||
found = it != m_presets.end();
|
||||
}
|
||||
if (found) {
|
||||
if (profile_print_params_same(it->config, cfg)) {
|
||||
// The preset exists and it matches the values stored inside config.
|
||||
if (select)
|
||||
this->select_preset(it - m_presets.begin());
|
||||
return *it;
|
||||
}
|
||||
if (profile_host_params_same_or_anonymized(it->config, cfg) == ProfileHostParams::Anonymized) {
|
||||
// The project being loaded is anonymized. Replace the empty host keys of the loaded profile with the data from the original profile.
|
||||
// See "Octoprint Settings when Opening a .3MF file" GH issue #3244
|
||||
auto opt_update = [it, &cfg](const std::string &opt_key) {
|
||||
auto opt = it->config.option<ConfigOptionString>(opt_key);
|
||||
if (opt != nullptr)
|
||||
cfg.set_key_value(opt_key, opt->clone());
|
||||
};
|
||||
opt_update("print_host");
|
||||
opt_update("printhost_apikey");
|
||||
opt_update("printhost_cafile");
|
||||
}
|
||||
if (found && profile_print_params_same(it->config, cfg)) {
|
||||
// The preset exists and it matches the values stored inside config.
|
||||
if (select)
|
||||
this->select_preset(it - m_presets.begin());
|
||||
return *it;
|
||||
}
|
||||
// Update the "inherits" field.
|
||||
std::string &inherits = Preset::inherits(cfg);
|
||||
|
|
@ -1374,31 +1331,25 @@ const std::vector<std::string>& PhysicalPrinter::printer_options()
|
|||
"preset_name",
|
||||
"printer_technology",
|
||||
// "printer_model",
|
||||
"host_type",
|
||||
"print_host",
|
||||
"printhost_apikey",
|
||||
"host_type",
|
||||
"print_host",
|
||||
"printhost_apikey",
|
||||
"printhost_cafile",
|
||||
"printhost_port",
|
||||
"printhost_authorization_type",
|
||||
// HTTP digest authentization (RFC 2617)
|
||||
"printhost_user",
|
||||
"printhost_user",
|
||||
"printhost_password"
|
||||
};
|
||||
}
|
||||
return s_opts;
|
||||
}
|
||||
|
||||
const std::vector<std::string>& PhysicalPrinter::print_host_options()
|
||||
{
|
||||
static std::vector<std::string> s_opts;
|
||||
if (s_opts.empty()) {
|
||||
s_opts = {
|
||||
"print_host",
|
||||
"printhost_apikey",
|
||||
"printhost_cafile"
|
||||
};
|
||||
}
|
||||
return s_opts;
|
||||
}
|
||||
static constexpr auto legacy_print_host_options = {
|
||||
"print_host",
|
||||
"printhost_apikey",
|
||||
"printhost_cafile",
|
||||
};
|
||||
|
||||
std::vector<std::string> PhysicalPrinter::presets_with_print_host_information(const PrinterPresetCollection& printer_presets)
|
||||
{
|
||||
|
|
@ -1412,7 +1363,7 @@ std::vector<std::string> PhysicalPrinter::presets_with_print_host_information(co
|
|||
|
||||
bool PhysicalPrinter::has_print_host_information(const DynamicPrintConfig& config)
|
||||
{
|
||||
for (const std::string& opt : print_host_options())
|
||||
for (const char *opt : legacy_print_host_options)
|
||||
if (!config.opt_string(opt).empty())
|
||||
return true;
|
||||
|
||||
|
|
@ -1429,6 +1380,7 @@ 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("printhost_port" ).empty() &&
|
||||
config.opt_string("printhost_user" ).empty() &&
|
||||
config.opt_string("printhost_password").empty();
|
||||
}
|
||||
|
|
@ -1614,9 +1566,7 @@ void PhysicalPrinterCollection::load_printers_from_presets(PrinterPresetCollecti
|
|||
int cnt=0;
|
||||
for (Preset& preset: printer_presets) {
|
||||
DynamicPrintConfig& config = preset.config;
|
||||
const std::vector<std::string>& options = PhysicalPrinter::print_host_options();
|
||||
|
||||
for(const std::string& option : options) {
|
||||
for(const char* option : legacy_print_host_options) {
|
||||
if (!config.opt_string(option).empty()) {
|
||||
// check if printer with those "Print Host upload" options already exist
|
||||
PhysicalPrinter* existed_printer = find_printer_with_same_config(config);
|
||||
|
|
@ -1635,7 +1585,7 @@ void PhysicalPrinterCollection::load_printers_from_presets(PrinterPresetCollecti
|
|||
}
|
||||
|
||||
// erase "Print Host upload" information from the preset
|
||||
for (const std::string& opt : options)
|
||||
for (const char *opt : legacy_print_host_options)
|
||||
config.opt_string(opt).clear();
|
||||
// save changes for preset
|
||||
preset.save();
|
||||
|
|
@ -1643,7 +1593,7 @@ void PhysicalPrinterCollection::load_printers_from_presets(PrinterPresetCollecti
|
|||
// update those changes for edited preset if it's equal to the preset
|
||||
Preset& edited = printer_presets.get_edited_preset();
|
||||
if (preset.name == edited.name) {
|
||||
for (const std::string& opt : options)
|
||||
for (const char *opt : legacy_print_host_options)
|
||||
edited.config.opt_string(opt).clear();
|
||||
}
|
||||
|
||||
|
|
@ -1692,7 +1642,7 @@ PhysicalPrinter* PhysicalPrinterCollection::find_printer_with_same_config(const
|
|||
{
|
||||
for (const PhysicalPrinter& printer :*this) {
|
||||
bool is_equal = true;
|
||||
for (const std::string& opt : PhysicalPrinter::print_host_options())
|
||||
for (const char *opt : legacy_print_host_options)
|
||||
if (is_equal && printer.config.opt_string(opt) != config.opt_string(opt))
|
||||
is_equal = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -37,11 +37,11 @@ static std::vector<std::string> s_project_options {
|
|||
const char *PresetBundle::PRUSA_BUNDLE = "PrusaResearch";
|
||||
|
||||
PresetBundle::PresetBundle() :
|
||||
prints(Preset::TYPE_PRINT, Preset::print_options(), static_cast<const HostConfig&>(FullPrintConfig::defaults())),
|
||||
filaments(Preset::TYPE_FILAMENT, Preset::filament_options(), static_cast<const HostConfig&>(FullPrintConfig::defaults())),
|
||||
prints(Preset::TYPE_PRINT, Preset::print_options(), static_cast<const PrintRegionConfig&>(FullPrintConfig::defaults())),
|
||||
filaments(Preset::TYPE_FILAMENT, Preset::filament_options(), static_cast<const PrintRegionConfig&>(FullPrintConfig::defaults())),
|
||||
sla_materials(Preset::TYPE_SLA_MATERIAL, Preset::sla_material_options(), static_cast<const SLAMaterialConfig&>(SLAFullPrintConfig::defaults())),
|
||||
sla_prints(Preset::TYPE_SLA_PRINT, Preset::sla_print_options(), static_cast<const SLAPrintObjectConfig&>(SLAFullPrintConfig::defaults())),
|
||||
printers(Preset::TYPE_PRINTER, Preset::printer_options(), static_cast<const HostConfig&>(FullPrintConfig::defaults()), "- default FFF -"),
|
||||
printers(Preset::TYPE_PRINTER, Preset::printer_options(), static_cast<const PrintRegionConfig&>(FullPrintConfig::defaults()), "- default FFF -"),
|
||||
physical_printers(PhysicalPrinter::printer_options())
|
||||
{
|
||||
// The following keys are handled by the UI, they do not have a counterpart in any StaticPrintConfig derived classes,
|
||||
|
|
@ -77,11 +77,12 @@ PresetBundle::PresetBundle() :
|
|||
for (size_t i = 0; i < 2; ++ i) {
|
||||
// The following ugly switch is to avoid printers.preset(0) to return the edited instance, as the 0th default is the current one.
|
||||
Preset &preset = this->printers.default_preset(i);
|
||||
preset.config.optptr("printer_settings_id", true);
|
||||
preset.config.optptr("printer_vendor", true);
|
||||
preset.config.optptr("printer_model", true);
|
||||
preset.config.optptr("printer_variant", true);
|
||||
preset.config.optptr("thumbnails", true);
|
||||
for (const char *key : {
|
||||
"printer_settings_id", "printer_vendor", "printer_model", "printer_variant", "thumbnails",
|
||||
//FIXME the following keys are only created here for compatibility to be able to parse legacy Printer profiles.
|
||||
// These keys are converted to Physical Printer profile. After the conversion, they shall be removed.
|
||||
"host_type", "print_host", "printhost_apikey", "printhost_cafile"})
|
||||
preset.config.optptr(key, true);
|
||||
if (i == 0) {
|
||||
preset.config.optptr("default_print_profile", true);
|
||||
preset.config.option<ConfigOptionStrings>("default_filament_profile", true)->values = { "" };
|
||||
|
|
@ -495,6 +496,7 @@ DynamicPrintConfig PresetBundle::full_config() const
|
|||
DynamicPrintConfig PresetBundle::full_config_secure() const
|
||||
{
|
||||
DynamicPrintConfig config = this->full_config();
|
||||
//FIXME legacy, the keys should not be there after conversion to a Physical Printer profile.
|
||||
config.erase("print_host");
|
||||
config.erase("printhost_apikey");
|
||||
config.erase("printhost_cafile");
|
||||
|
|
|
|||
|
|
@ -108,7 +108,14 @@ void PrintConfigDef::init_common_params()
|
|||
"the API Key or the password required for authentication.");
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionString(""));
|
||||
|
||||
|
||||
def = this->add("printhost_port", coString);
|
||||
def->label = L("Printer");
|
||||
def->tooltip = L("Name of the printer");
|
||||
def->gui_type = "select_open";
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionString(""));
|
||||
|
||||
def = this->add("printhost_cafile", coString);
|
||||
def->label = L("HTTPS CA File");
|
||||
def->tooltip = L("Custom CA certificate file can be specified for HTTPS OctoPrint connections, in crt/pem format. "
|
||||
|
|
@ -1447,10 +1454,12 @@ void PrintConfigDef::init_fff_params()
|
|||
def->enum_values.push_back("duet");
|
||||
def->enum_values.push_back("flashair");
|
||||
def->enum_values.push_back("astrobox");
|
||||
def->enum_values.push_back("repetier");
|
||||
def->enum_labels.push_back("OctoPrint");
|
||||
def->enum_labels.push_back("Duet");
|
||||
def->enum_labels.push_back("FlashAir");
|
||||
def->enum_labels.push_back("AstroBox");
|
||||
def->enum_labels.push_back("Repetier");
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionEnum<PrintHostType>(htOctoPrint));
|
||||
|
||||
|
|
@ -1765,26 +1774,6 @@ void PrintConfigDef::init_fff_params()
|
|||
def->set_default_value(new ConfigOptionFloat(30));
|
||||
#endif
|
||||
|
||||
def = this->add("serial_port", coString);
|
||||
def->gui_type = "select_open";
|
||||
def->label = "";
|
||||
def->full_label = L("Serial port");
|
||||
def->tooltip = L("USB/serial port for printer connection.");
|
||||
def->width = 20;
|
||||
def->set_default_value(new ConfigOptionString(""));
|
||||
|
||||
def = this->add("serial_speed", coInt);
|
||||
def->gui_type = "i_enum_open";
|
||||
def->label = L("Speed");
|
||||
def->full_label = L("Serial port speed");
|
||||
def->tooltip = L("Speed (baud) of USB/serial port for printer connection.");
|
||||
def->min = 1;
|
||||
def->max = 300000;
|
||||
def->enum_values.push_back("115200");
|
||||
def->enum_values.push_back("250000");
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionInt(250000));
|
||||
|
||||
def = this->add("skirt_distance", coFloat);
|
||||
def->label = L("Distance from object");
|
||||
def->tooltip = L("Distance between skirt and object(s). Set this to zero to attach the skirt "
|
||||
|
|
@ -3176,8 +3165,9 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
|
|||
"seal_position", "vibration_limit", "bed_size",
|
||||
"print_center", "g0", "threads", "pressure_advance", "wipe_tower_per_color_wipe"
|
||||
#ifndef HAS_PRESSURE_EQUALIZER
|
||||
, "max_volumetric_extrusion_rate_slope_positive", "max_volumetric_extrusion_rate_slope_negative"
|
||||
, "max_volumetric_extrusion_rate_slope_positive", "max_volumetric_extrusion_rate_slope_negative",
|
||||
#endif /* HAS_PRESSURE_EQUALIZER */
|
||||
"serial_port", "serial_speed"
|
||||
};
|
||||
|
||||
// In PrusaSlicer 2.3.0-alpha0 the "monotonous" infill was introduced, which was later renamed to "monotonic".
|
||||
|
|
@ -3498,7 +3488,6 @@ StaticPrintConfig::StaticCache<class Slic3r::PrintRegionConfig> PrintRegionConfi
|
|||
StaticPrintConfig::StaticCache<class Slic3r::MachineEnvelopeConfig> MachineEnvelopeConfig::s_cache_MachineEnvelopeConfig;
|
||||
StaticPrintConfig::StaticCache<class Slic3r::GCodeConfig> GCodeConfig::s_cache_GCodeConfig;
|
||||
StaticPrintConfig::StaticCache<class Slic3r::PrintConfig> PrintConfig::s_cache_PrintConfig;
|
||||
StaticPrintConfig::StaticCache<class Slic3r::HostConfig> HostConfig::s_cache_HostConfig;
|
||||
StaticPrintConfig::StaticCache<class Slic3r::FullPrintConfig> FullPrintConfig::s_cache_FullPrintConfig;
|
||||
|
||||
StaticPrintConfig::StaticCache<class Slic3r::SLAMaterialConfig> SLAMaterialConfig::s_cache_SLAMaterialConfig;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
// PrintRegionConfig
|
||||
// PrintConfig
|
||||
// GCodeConfig
|
||||
// HostConfig
|
||||
//
|
||||
|
||||
#ifndef slic3r_PrintConfig_hpp_
|
||||
|
|
@ -37,7 +36,7 @@ enum class MachineLimitsUsage {
|
|||
};
|
||||
|
||||
enum PrintHostType {
|
||||
htOctoPrint, htDuet, htFlashAir, htAstroBox
|
||||
htOctoPrint, htDuet, htFlashAir, htAstroBox, htRepetier
|
||||
};
|
||||
|
||||
enum AuthorizationType {
|
||||
|
|
@ -127,6 +126,7 @@ template<> inline const t_config_enum_values& ConfigOptionEnum<PrintHostType>::g
|
|||
keys_map["duet"] = htDuet;
|
||||
keys_map["flashair"] = htFlashAir;
|
||||
keys_map["astrobox"] = htAstroBox;
|
||||
keys_map["repetier"] = htRepetier;
|
||||
}
|
||||
return keys_map;
|
||||
}
|
||||
|
|
@ -962,38 +962,14 @@ protected:
|
|||
}
|
||||
};
|
||||
|
||||
class HostConfig : public StaticPrintConfig
|
||||
{
|
||||
STATIC_PRINT_CONFIG_CACHE(HostConfig)
|
||||
public:
|
||||
ConfigOptionEnum<PrintHostType> host_type;
|
||||
ConfigOptionString print_host;
|
||||
ConfigOptionString printhost_apikey;
|
||||
ConfigOptionString printhost_cafile;
|
||||
ConfigOptionString serial_port;
|
||||
ConfigOptionInt serial_speed;
|
||||
|
||||
protected:
|
||||
void initialize(StaticCacheBase &cache, const char *base_ptr)
|
||||
{
|
||||
OPT_PTR(host_type);
|
||||
OPT_PTR(print_host);
|
||||
OPT_PTR(printhost_apikey);
|
||||
OPT_PTR(printhost_cafile);
|
||||
OPT_PTR(serial_port);
|
||||
OPT_PTR(serial_speed);
|
||||
}
|
||||
};
|
||||
|
||||
// This object is mapped to Perl as Slic3r::Config::Full.
|
||||
class FullPrintConfig :
|
||||
public PrintObjectConfig,
|
||||
public PrintRegionConfig,
|
||||
public PrintConfig,
|
||||
public HostConfig
|
||||
public PrintConfig
|
||||
{
|
||||
STATIC_PRINT_CONFIG_CACHE_DERIVED(FullPrintConfig)
|
||||
FullPrintConfig() : PrintObjectConfig(0), PrintRegionConfig(0), PrintConfig(0), HostConfig(0) { initialize_cache(); *this = s_cache_FullPrintConfig.defaults(); }
|
||||
FullPrintConfig() : PrintObjectConfig(0), PrintRegionConfig(0), PrintConfig(0) { initialize_cache(); *this = s_cache_FullPrintConfig.defaults(); }
|
||||
|
||||
public:
|
||||
// Validate the FullPrintConfig. Returns an empty string on success, otherwise an error message is returned.
|
||||
|
|
@ -1001,13 +977,12 @@ public:
|
|||
|
||||
protected:
|
||||
// Protected constructor to be called to initialize ConfigCache::m_default.
|
||||
FullPrintConfig(int) : PrintObjectConfig(0), PrintRegionConfig(0), PrintConfig(0), HostConfig(0) {}
|
||||
FullPrintConfig(int) : PrintObjectConfig(0), PrintRegionConfig(0), PrintConfig(0) {}
|
||||
void initialize(StaticCacheBase &cache, const char *base_ptr)
|
||||
{
|
||||
this->PrintObjectConfig::initialize(cache, base_ptr);
|
||||
this->PrintRegionConfig::initialize(cache, base_ptr);
|
||||
this->PrintConfig ::initialize(cache, base_ptr);
|
||||
this->HostConfig ::initialize(cache, base_ptr);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue