Fix ignoring of changed sla printer params

This commit is contained in:
tamasmeszaros 2022-01-07 13:12:40 +01:00
parent 7f153a55b3
commit 00764ceade
3 changed files with 7 additions and 7 deletions

View File

@ -244,11 +244,11 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, DynamicPrintConfig con
// Handle changes to object config defaults
m_default_object_config.apply_only(config, object_diff, true);
if (!m_printer || std::find(printer_diff.begin(), printer_diff.end(), "sla_archive_format") != printer_diff.end()) {
if (!m_archiver || !printer_diff.empty()) {
if (m_printer_config.sla_archive_format.value == "SL1")
m_printer = std::make_unique<SL1Archive>(m_printer_config);
m_archiver = std::make_unique<SL1Archive>(m_printer_config);
else if (m_printer_config.sla_archive_format.value == "SL2")
m_printer = std::make_unique<SL1_SVGArchive>(m_printer_config);
m_archiver = std::make_unique<SL1_SVGArchive>(m_printer_config);
}
struct ModelObjectStatus {

View File

@ -536,7 +536,7 @@ public:
void export_print(Zipper &zipper, const std::string &projectname = "")
{
m_printer->export_print(zipper, *this, projectname);
m_archiver->export_print(zipper, *this, projectname);
}
void export_print(const std::string &fname, const std::string &projectname = "")
@ -565,7 +565,7 @@ private:
std::vector<PrintLayer> m_printer_input;
// The archive object which collects the raster images after slicing
std::unique_ptr<SLAArchive> m_printer;
std::unique_ptr<SLAArchive> m_archiver;
// Estimated print time, material consumed.
SLAPrintStatistics m_print_statistics;

View File

@ -1044,7 +1044,7 @@ void SLAPrint::Steps::merge_slices_and_eval_stats() {
// Rasterizing the model objects, and their supports
void SLAPrint::Steps::rasterize()
{
if(canceled() || !m_print->m_printer) return;
if(canceled() || !m_print->m_archiver) return;
// coefficient to map the rasterization state (0-99) to the allocated
// portion (slot) of the process state
@ -1089,7 +1089,7 @@ void SLAPrint::Steps::rasterize()
if(canceled()) return;
// Print all the layers in parallel
m_print->m_printer->draw_layers(m_print->m_printer_input.size(), lvlfn,
m_print->m_archiver->draw_layers(m_print->m_printer_input.size(), lvlfn,
[this]() { return canceled(); }, ex_tbb);
}