From 8491872fb78d6d2ae1d335ca0dcbfb3e3a06c063 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Thu, 5 Nov 2020 14:02:43 +0100 Subject: [PATCH] #5079 - Fixed GCode Viewer changing files modified date on Windows --- src/libslic3r/GCode.cpp | 2 +- src/libslic3r/GCode/GCodeProcessor.cpp | 5 +++-- src/libslic3r/GCode/GCodeProcessor.hpp | 2 +- src/slic3r/GUI/Plater.cpp | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 7f3843646a..b017e2f527 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -761,7 +761,7 @@ void GCode::do_export(Print* print, const char* path, GCodePreviewData* preview_ #if ENABLE_GCODE_VIEWER BOOST_LOG_TRIVIAL(debug) << "Start processing gcode, " << log_memory_info(); - m_processor.process_file(path_tmp, [print]() { print->throw_if_canceled(); }); + m_processor.process_file(path_tmp, true, [print]() { print->throw_if_canceled(); }); DoExport::update_print_estimated_times_stats(m_processor, print->m_print_statistics); if (result != nullptr) *result = std::move(m_processor.extract_result()); diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index a1c9c688d3..a5a186f926 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -750,7 +750,7 @@ void GCodeProcessor::reset() #endif // ENABLE_GCODE_VIEWER_DATA_CHECKING } -void GCodeProcessor::process_file(const std::string& filename, std::function cancel_callback) +void GCodeProcessor::process_file(const std::string& filename, bool apply_postprocess, std::function cancel_callback) { auto last_cancel_callback_time = std::chrono::high_resolution_clock::now(); @@ -808,7 +808,8 @@ void GCodeProcessor::process_file(const std::string& filename, std::functionthrow_if_canceled() (sent by the caller as callback). - void process_file(const std::string& filename, std::function cancel_callback = nullptr); + void process_file(const std::string& filename, bool apply_postprocess, std::function cancel_callback = nullptr); float get_time(PrintEstimatedTimeStatistics::ETimeMode mode) const; std::string get_time_dhm(PrintEstimatedTimeStatistics::ETimeMode mode) const; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 4063b22e74..7ddeba6c68 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -4740,7 +4740,7 @@ void Plater::load_gcode(const wxString& filename) GCodeProcessor processor; processor.enable_producers(true); processor.enable_machine_envelope_processing(true); - processor.process_file(filename.ToUTF8().data()); + processor.process_file(filename.ToUTF8().data(), false); p->gcode_result = std::move(processor.extract_result()); // show results