mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	#5079 - Fixed GCode Viewer changing files modified date on Windows
This commit is contained in:
		
							parent
							
								
									6d56e60091
								
							
						
					
					
						commit
						8491872fb7
					
				
					 4 changed files with 6 additions and 5 deletions
				
			
		|  | @ -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()); | ||||
|  |  | |||
|  | @ -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"; | ||||
|  |  | |||
|  | @ -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; | ||||
|  |  | |||
|  | @ -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
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 enricoturri1966
						enricoturri1966