#5079 - Fixed GCode Viewer changing files modified date on Windows

This commit is contained in:
enricoturri1966 2020-11-05 14:02:43 +01:00
parent 6d56e60091
commit 8491872fb7
4 changed files with 6 additions and 5 deletions

View file

@ -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());

View file

@ -750,7 +750,7 @@ void GCodeProcessor::reset()
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
}
void GCodeProcessor::process_file(const std::string& filename, std::function<void()> cancel_callback)
void GCodeProcessor::process_file(const std::string& filename, bool apply_postprocess, std::function<void()> 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::function<voi
update_estimated_times_stats();
// post-process to add M73 lines into the gcode
m_time_processor.post_process(filename);
if (apply_postprocess)
m_time_processor.post_process(filename);
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
std::cout << "\n";

View file

@ -433,7 +433,7 @@ namespace Slic3r {
// Process the gcode contained in the file with the given filename
// throws CanceledException through print->throw_if_canceled() (sent by the caller as callback).
void process_file(const std::string& filename, std::function<void()> cancel_callback = nullptr);
void process_file(const std::string& filename, bool apply_postprocess, std::function<void()> cancel_callback = nullptr);
float get_time(PrintEstimatedTimeStatistics::ETimeMode mode) const;
std::string get_time_dhm(PrintEstimatedTimeStatistics::ETimeMode mode) const;

View file

@ -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