Fix to show correct filament usage in DWC for slic3r gcode
-
After switching to slic3r-PE I DWC stopped showing filament usage.
I was pretty bummed about that as i find the estimate based on filament usage fairly accurate.
After I reformatted the SD-card, I started playing with the gcode itself and was able to fix it manually.this is the relevant gcode generated by slic3r:
; filament used [mm] = 4235.9 ; filament used [cm3] = 10.2 ; filament used [g] = 13.1 ; filament cost = 0.4 ; total filament used [g] = 13.1 ; total filament cost = 0.4 ; estimated printing time (normal mode) = 46m 49s
DWC seems to look for:
; filament used = 4235.9
So, after modifying the file accordingly DWC recognizes the filament usage correctly.
I'd be much appreciated, if this could be fixed in an upcoming release.In the meantime, is it possible for me to edit the parser, so it'll do that automatically for me?
So changing the parser code to look for; filament used [mm] = xxxx.x
instead of
; filament used = xxxx.x
I have no idea where these instructions are stored, so any help would be appreciated.
Also, I'd like request maybe allowing us to change which columns are displayed in the gcode browser.
I don't really need the info to which slicer was used generate the code visible, I'd much prefer something like cost.Thanks for your help
-
Looks like this is the code you'd need to modify - https://github.com/dc42/RepRapFirmware/blob/d9f051b6c658fa278b22535a8bd03d124bcf8fad/src/Storage/FileInfoParser.cpp#L651
Details on building the firmware here - https://github.com/dc42/RepRapFirmware/blob/dev/BuildInstructions.md
-
Looks like you'd need to add
[
,m
, and]
to thestrchr
maybe? -
@jv43 I use a perl script, windows 10, you need to adjust the paths to match your structure.
This is replacing the string correctly, but I haven't tried if this will really fix it for dwc.The newest prusa slicer hasn't the perl bundled anymore..I use the perl5.24.0.exe from previous version
Slic3rPE-1.41.3+win64-full-201902111723
PrusaSlicer - print settings - output :
D:\3Dprint\filause.bat;
The content of the filause.bat file:
D:\ProgrammePortable\Slic3rPE-1.41.3+win64-full-201902111723\perl5.24.0.exe d:\3dprint\filause.pl %*
The content of the filause.pl file:
use strict; use warnings; $^I = '.bak'; # create a copy of the file # read stdin and any/all files passed as parameters, one line at a time while (<>) { # shorten string to display creation time of file on dwc # s/PrusaSlicer/PS/; # filament used [mm] = s/; filament used \[mm\](.*)/; filament used$1/; print; }
-
I always thought it just counted the extrusions it made. It's always worked fine for me.
-
Please make this GCode file available to me via Dropbox or another file sharing site. I can put a fix for this in the next 2.03RC. Unfortunately, some slicer developers often change the metadata format, so it's a moving target.
-
@dc42 : why not make it configurable? that way the user can adapt if the slicer decides to change it format...
-
@dc42
I've sliced a marvin using Slic3rPE 1.41.3 and PrusaSlicer 2.0.0
The 2 GCodes can be downloaded from https://www.dropbox.com/s/3o7nibahbyuaixn/Marvin_GCode.zip?dl=0 -
sample gcode prenerated by PrusaSlicer 2.0.0
filament usage parameter is located at the beginning of the metadata at the end of the file, starting at line 5685 of the file linked above
-
@jv43 said in Fix to show correct filament usage in DWC for slic3r gcode:
sample gcode prenerated by PrusaSlicer 2.0.0
filament usage parameter is located at the beginning of the metadata at the end of the file, starting at line 5685 of the file linked above
Thanks. I've implemented a change in my latest 2.03 source code and I will test it using that file.
-
@dc42
Awesome!
I'll test it once you release 2.03RC3 -