diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 508d0110d9f..4ef9182de19 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -1463,6 +1463,9 @@ void GCodeProcessor::finalize(bool post_process) #if ENABLE_GCODE_VIEWER_STATISTICS m_result.time = std::chrono::duration_cast(std::chrono::high_resolution_clock::now() - m_start_time).count(); #endif // ENABLE_GCODE_VIEWER_STATISTICS + + //result is now updated + m_result.computed_timestamp = std::time(0); } float GCodeProcessor::get_time(PrintEstimatedStatistics::ETimeMode mode) const diff --git a/src/slic3r/GUI/BackgroundSlicingProcess.cpp b/src/slic3r/GUI/BackgroundSlicingProcess.cpp index 088febf0aff..92b792798df 100644 --- a/src/slic3r/GUI/BackgroundSlicingProcess.cpp +++ b/src/slic3r/GUI/BackgroundSlicingProcess.cpp @@ -164,6 +164,8 @@ void BackgroundSlicingProcess::process_fff() } this->set_step_done(bspsGCodeFinalize); } + evt.SetInt((int)(m_fff_print->step_state_with_timestamp(PrintStep::psGCodeExport).timestamp)); + wxQueueEvent(GUI::wxGetApp().mainframe->m_plater, evt.Clone()); } static void write_thumbnail(Zipper& zipper, const ThumbnailData& data) @@ -181,6 +183,9 @@ void BackgroundSlicingProcess::process_sla() { assert(m_print == m_sla_print); m_print->process(); + wxCommandEvent evt(m_event_slicing_completed_id); + evt.SetInt((int)(m_sla_print->step_state_with_timestamp(SLAPrintStep::slapsRasterize).timestamp)); + wxQueueEvent(GUI::wxGetApp().mainframe->m_plater, evt.Clone()); if (this->set_step_started(bspsGCodeFinalize)) { if (! m_export_path.empty()) { wxQueueEvent(GUI::wxGetApp().mainframe->m_plater, new wxCommandEvent(m_event_export_began_id)); diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index aeb4254fe2f..e2cdec46aca 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -713,6 +713,10 @@ void GCodeViewer::init() m_gl_data_initialized = true; } +bool GCodeViewer::is_loaded(const GCodeProcessorResult& gcode_result) { + return (m_last_result_id == gcode_result.id); +} + void GCodeViewer::load(const GCodeProcessorResult& gcode_result, const Print& print, bool initialized) { // avoid processing if called with the same gcode_result diff --git a/src/slic3r/GUI/GCodeViewer.hpp b/src/slic3r/GUI/GCodeViewer.hpp index 46db0e7d0cb..790f7869624 100644 --- a/src/slic3r/GUI/GCodeViewer.hpp +++ b/src/slic3r/GUI/GCodeViewer.hpp @@ -744,6 +744,7 @@ class GCodeViewer // extract rendering data from the given parameters void load(const GCodeProcessorResult& gcode_result, const Print& print, bool initialized); + bool is_loaded(const GCodeProcessorResult& gcode_result); // recalculate ranges in dependence of what is visible and sets tool/print colors void refresh(const GCodeProcessorResult& gcode_result, const std::vector& str_tool_colors); void refresh_render_paths(); diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index a197ef1351b..a5adc0a9e21 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2182,7 +2182,8 @@ bool GLCanvas3D::is_gcode_preview_dirty(const GCodeProcessorResult& gcode_result void GLCanvas3D::load_gcode_preview(const GCodeProcessorResult& gcode_result, const std::vector& str_tool_colors) { - if (last_showned_gcode != gcode_result.computed_timestamp) { + if (last_showned_gcode != gcode_result.computed_timestamp + || !m_gcode_viewer.is_loaded(gcode_result)) { last_showned_gcode = gcode_result.computed_timestamp; m_gcode_viewer.load(gcode_result, *this->fff_print(), m_initialized); diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index 815860ba797..f603824fd0a 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -695,7 +695,7 @@ void Preview::update_layers_slider(const std::vector& layers_z, bool kee // Save the initial slider span. double z_low = m_layers_slider->GetLowerValueD(); double z_high = m_layers_slider->GetHigherValueD(); - bool was_empty = m_layers_slider->GetMaxValue() == 0; + bool was_empty = m_layers_slider->GetMaxValue() == 0 || z_high == 0; bool force_sliders_full_range = was_empty; if (!keep_z_range)