prusa3d / PrusaSlicer

G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)
https://www.prusa3d.com/prusaslicer/
GNU Affero General Public License v3.0
7.53k stars 1.9k forks source link

Add additional Placeholder variables? #3685

Open felixekman opened 4 years ago

felixekman commented 4 years ago

Version

PrusaSlicer 2.2.0-alpha4

I'd like to suggest the addition of a few Placeholder variables, most (all?) of which are already exposed in the code/processor, but not addressable in the "Start G-code" window.

Some basic information about the print [filament_stats] [print_time] [normal_print_time] [used_filament] [total_used_filament] [total_weight] [extruded_volume] [total_weight]

For a thumbnail preview on other machines/boards/LCDs than the with Prusa Mini Index for jpeg/png(base64) and X/Y size [thumnail_png_100x100]

Values in mm for estimating work area movements of the machine [max_x] [max_y] [max_z]

Min should reasonably be able to take negative values (for outside of bed moves) [min_x] [min_y] [min_z]

Current Ref https://github.com/prusa3d/PrusaSlicer/blob/master/src/libslic3r/Print.cpp https://github.com/prusa3d/PrusaSlicer/wiki/Slic3r-Prusa-Edition-Macro-Language

bubnikv commented 4 years ago

please note that some variables are not yet known when processing the custom G-code sections. For example the print time cannot be known.

bepstein111 commented 3 years ago

I would also like to see this. In order to get the TFT** displays to show extra info at the end of a print, one needs to embed it via a M118 P0 filament_data followed by W:[total_weight], and L:[total_used_filament]. Would be nice to embed this in my start/end gcode.

bepstein111 commented 3 years ago

The Github for the TFT wants: M118 P0 filament_data L:{filament_amount}m M118 P0 filament_data W:{filament_weight}g M118 P0 filament_data C:{filament_cost}

But entering {extruded_volume} for the first variable returns an Invalid Data error, even though it's listed on the placeholders page.

bubnikv commented 2 years ago

"print_bed_min", "print_bed_max", "print_bed_size", "first_layer_print_convex_hull", "first_layer_print_min", "first_layer_print_max", "first_layer_print_size" are available for some time already.

"thumbnails" is available at the parameter layer, but due to https://github.com/prusa3d/PrusaSlicer/issues/990 not accessible from the custom G-code blocks.

Various print statistics are not known yet at the time the custom G-code blocks are processed.