ENH: add filament map and filament list in GCode head

jira: NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Id214bcf5f76e6c59d4b8bcb55583f96b347630bf
This commit is contained in:
xun.zhang 2025-04-23 17:11:24 +08:00 committed by lane.wei
parent 3eac767b14
commit d1e6680f4c

View File

@ -1991,6 +1991,18 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
file.writeln(max_height_z_tip.str());
}
{
auto used_filaments = print.get_slice_used_filaments(false);
std::ostringstream out;
out << "; filament: ";
for (size_t idx = 0; idx < used_filaments.size(); ++idx) {
if (idx != 0)
out << ',';
out << used_filaments[idx] + 1;
}
file.writeln(out.str());
}
file.write_format("; HEADER_BLOCK_END\n\n");
//BBS: write global config at the beginning of gcode file because printer need these config information