ENH: support recommended filament map when print by object

1. support recommended filament map when print by object
2. placeholder_parser support function filament_change
3. extruder_id of filament_map is start from 1

Change-Id: Ide8019cd4a165a25972f22706ff685c3005aa031
(cherry picked from commit b42d94e1d05236b8b7b2e65b4a24810eecf040cb)
This commit is contained in:
zhimin.zeng
2024-07-02 20:26:13 +08:00
committed by Noisyfox
parent 8db3e3cd54
commit e2c3926c76
7 changed files with 182 additions and 17 deletions

View File

@@ -2746,12 +2746,8 @@ void GCode::check_placeholder_parser_failed()
size_t GCode::get_extruder_id(unsigned int filament_id) const
{
if (m_print) {
std::vector<int> filament_maps = m_print->get_filament_maps();
if (filament_id < filament_maps.size()) {
return filament_maps[filament_id];
}
return m_print->get_extruder_id(filament_id);
}
return 0;
}