Skip to content

Commit

Permalink
Search last 20kB of G-code file for print info
Browse files Browse the repository at this point in the history
Solves issues with the larger comments in G-code files produced by PrusaSlicer 2.4alpha+
not providing filament type, consumption and other information.
  • Loading branch information
D.R.racer authored and DRracer committed Nov 15, 2021
1 parent 41a9d52 commit 7a3822b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/screen_print_preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ GCodeInfo::GCodeInfo() {
filament_used_mm = 0;
filament_used_g = 0;
valid_printer_settings = true;
const unsigned search_last_x_bytes = 10000;
const unsigned search_last_x_bytes = 20000;
FSIZE_t filesize = f_size(&file);
f_lseek(&file, filesize > search_last_x_bytes ? filesize - search_last_x_bytes : 0);
char name_buffer[64];
Expand Down

0 comments on commit 7a3822b

Please sign in to comment.