ENH: add filament map and filament list in GCode head

jira: NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Id214bcf5f76e6c59d4b8bcb55583f96b347630bf
(cherry picked from commit d1e6680f4c19ae19e8328813528f21e63084e577)
This commit is contained in:
xun.zhang 2025-04-23 17:11:24 +08:00 committed by Noisyfox
parent cd9fd28c4e
commit 01673d1fef

View file

@ -2255,6 +2255,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");
}