FIX: show the refill graph only if it's enabled

jira: [none]
Change-Id: I8a1f015a92ac965972f6de46a143a6b0f02340a0
This commit is contained in:
xin.zhang 2025-01-20 16:45:07 +08:00 committed by lane.wei
parent 32597b43f9
commit 403a3b42e7
1 changed files with 53 additions and 50 deletions

View File

@ -1886,6 +1886,11 @@ void AmsReplaceMaterialDialog::update_to_nozzle(int nozzle_id)
return;
}
//update group
int group_index = 0;
m_groups_sizer->Clear(true);
if (m_obj->is_support_filament_backup && m_obj->ams_auto_switch_filament_flag)
{
// traverse the amd list
std::unordered_map<int, AmsTray*> id2tray;// tray id to tray
try
@ -1910,9 +1915,6 @@ void AmsReplaceMaterialDialog::update_to_nozzle(int nozzle_id)
}
catch (...) {}
//update group
int group_index = 0;
m_groups_sizer->Clear(true);
const Extder& extder = m_obj->m_extder_data.extders[nozzle_id];
for (int filam : extder.filam_bak)
{
@ -1953,6 +1955,7 @@ void AmsReplaceMaterialDialog::update_to_nozzle(int nozzle_id)
group_index++;
}
}
}
if (group_index > 0)
{