I am trying to read printing information for automatic processing from the gcode files.
I am interested in printing time and used filament weight for further calculations.
I found the printing time in the HEADER_BLOCK_START (see sample below) but I didn’t find anything about the used filament weight.
It would be really helpful to add the weight in g and possible the filament length in m to the header information
If you loop through every line of the GCODE and process all of the G0,G1,G2 and G3 commands, adding up (or subtracting) the E field values you can get the total length (or length per colour if you also take into account the tool change Tx commands).
Weight should then be fairly easily derivable from length, diameter and density.
More detailed printing time can also be derived too if you take into account the speed change commands and tool change times.