Change how 'default_output_extension' placeholder is integrated

This commit is contained in:
tamasmeszaros 2023-05-10 18:08:49 +02:00
parent e1d1be872a
commit 36cddc3a02
2 changed files with 5 additions and 3 deletions

View File

@ -1541,6 +1541,7 @@ std::string Print::output_filename(const std::string &filename_base) const
// These values will be just propagated into the output file name. // These values will be just propagated into the output file name.
DynamicConfig config = this->finished() ? this->print_statistics().config() : this->print_statistics().placeholders(); DynamicConfig config = this->finished() ? this->print_statistics().config() : this->print_statistics().placeholders();
config.set_key_value("num_extruders", new ConfigOptionInt((int)m_config.nozzle_diameter.size())); config.set_key_value("num_extruders", new ConfigOptionInt((int)m_config.nozzle_diameter.size()));
config.set_key_value("default_output_extension", new ConfigOptionString(".gcode"));
return this->PrintBase::output_filename(m_config.output_filename_format.value, ".gcode", filename_base, &config); return this->PrintBase::output_filename(m_config.output_filename_format.value, ".gcode", filename_base, &config);
} }

View File

@ -525,9 +525,6 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, DynamicPrintConfig con
m_full_print_config = std::move(config); m_full_print_config = std::move(config);
const char *default_ext = get_default_extension(m_printer_config.sla_archive_format.value.c_str());
m_placeholder_parser.set("default_output_extension", default_ext);
return static_cast<ApplyStatus>(apply_status); return static_cast<ApplyStatus>(apply_status);
} }
@ -542,6 +539,10 @@ std::string SLAPrint::output_filename(const std::string &filename_base) const
default_ext = "sl1"; default_ext = "sl1";
default_ext.insert(default_ext.begin(), '.'); default_ext.insert(default_ext.begin(), '.');
config.set_key_value("default_output_extension",
new ConfigOptionString(default_ext));
return this->PrintBase::output_filename(m_print_config.output_filename_format.value, default_ext, filename_base, &config); return this->PrintBase::output_filename(m_print_config.output_filename_format.value, default_ext, filename_base, &config);
} }