Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorenricoturri1966 <enricoturri@seznam.cz>2020-09-01 11:15:00 +0300
committerenricoturri1966 <enricoturri@seznam.cz>2020-09-01 11:15:00 +0300
commit5f27b0f851a3463fd70d3aea076007273dea9ac0 (patch)
tree75465c9c6634e8882706dc94ee0d0b1d655a802c /src/slic3r/GUI/BackgroundSlicingProcess.cpp
parent143e3a6a3588fe467e3cb3940cf78df30af56f96 (diff)
parente32930aa6c5008a86323a6d2c9a7d6a4a67be930 (diff)
Merge remote-tracking branch 'origin/et_gcode_viewer'
Diffstat (limited to 'src/slic3r/GUI/BackgroundSlicingProcess.cpp')
-rw-r--r--src/slic3r/GUI/BackgroundSlicingProcess.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/slic3r/GUI/BackgroundSlicingProcess.cpp b/src/slic3r/GUI/BackgroundSlicingProcess.cpp
index 7309654a8..9675db10e 100644
--- a/src/slic3r/GUI/BackgroundSlicingProcess.cpp
+++ b/src/slic3r/GUI/BackgroundSlicingProcess.cpp
@@ -19,7 +19,9 @@
#include "libslic3r/SLAPrint.hpp"
#include "libslic3r/Utils.hpp"
#include "libslic3r/GCode/PostProcessor.hpp"
+#if !ENABLE_GCODE_VIEWER
#include "libslic3r/GCode/PreviewData.hpp"
+#endif // !ENABLE_GCODE_VIEWER
#include "libslic3r/Format/SL1.hpp"
#include "libslic3r/libslic3r.h"
@@ -92,7 +94,11 @@ void BackgroundSlicingProcess::process_fff()
wxCommandEvent evt(m_event_slicing_completed_id);
evt.SetInt((int)(m_fff_print->step_state_with_timestamp(PrintStep::psBrim).timestamp));
wxQueueEvent(GUI::wxGetApp().mainframe->m_plater, evt.Clone());
- m_fff_print->export_gcode(m_temp_output_path, m_gcode_preview_data, m_thumbnail_cb);
+#if ENABLE_GCODE_VIEWER
+ m_fff_print->export_gcode(m_temp_output_path, m_gcode_result, m_thumbnail_cb);
+#else
+ m_fff_print->export_gcode(m_temp_output_path, m_gcode_preview_data, m_thumbnail_cb);
+#endif // ENABLE_GCODE_VIEWER
if (this->set_step_started(bspsGCodeFinalize)) {
if (! m_export_path.empty()) {
wxQueueEvent(GUI::wxGetApp().mainframe->m_plater, new wxCommandEvent(m_event_export_began_id));
@@ -382,6 +388,17 @@ Print::ApplyStatus BackgroundSlicingProcess::apply(const Model &model, const Dyn
assert(m_print != nullptr);
assert(config.opt_enum<PrinterTechnology>("printer_technology") == m_print->technology());
Print::ApplyStatus invalidated = m_print->apply(model, config);
+#if ENABLE_GCODE_VIEWER
+ if ((invalidated & PrintBase::APPLY_STATUS_INVALIDATED) != 0 && m_print->technology() == ptFFF &&
+ !this->m_fff_print->is_step_done(psGCodeExport))
+ {
+ // Some FFF status was invalidated, and the G-code was not exported yet.
+ // Let the G-code preview UI know that the final G-code preview is not valid.
+ // In addition, this early memory deallocation reduces memory footprint.
+ if (m_gcode_result != nullptr)
+ m_gcode_result->reset();
+ }
+#else
if ((invalidated & PrintBase::APPLY_STATUS_INVALIDATED) != 0 && m_print->technology() == ptFFF &&
m_gcode_preview_data != nullptr && ! this->m_fff_print->is_step_done(psGCodeExport)) {
// Some FFF status was invalidated, and the G-code was not exported yet.
@@ -389,6 +406,7 @@ Print::ApplyStatus BackgroundSlicingProcess::apply(const Model &model, const Dyn
// In addition, this early memory deallocation reduces memory footprint.
m_gcode_preview_data->reset();
}
+#endif // ENABLE_GCODE_VIEWER
return invalidated;
}