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

jira: [none]
Change-Id: I8a1f015a92ac965972f6de46a143a6b0f02340a0
(cherry picked from commit 403a3b42e7c5b4c8aa8a5f680b7d2b6413431ef6)
This commit is contained in:
xin.zhang
2025-01-20 16:45:07 +08:00
committed by Noisyfox
parent aa58b9b7ad
commit 872c979b0b

View File

@@ -1882,6 +1882,11 @@ void AmsReplaceMaterialDialog::update_to_nozzle(int nozzle_id)
return; 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 // traverse the amd list
std::unordered_map<int, AmsTray*> id2tray;// tray id to tray std::unordered_map<int, AmsTray*> id2tray;// tray id to tray
try try
@@ -1906,9 +1911,6 @@ void AmsReplaceMaterialDialog::update_to_nozzle(int nozzle_id)
} }
catch (...) {} catch (...) {}
//update group
int group_index = 0;
m_groups_sizer->Clear(true);
const Extder& extder = m_obj->m_extder_data.extders[nozzle_id]; const Extder& extder = m_obj->m_extder_data.extders[nozzle_id];
for (int filam : extder.filam_bak) for (int filam : extder.filam_bak)
{ {
@@ -1949,6 +1951,7 @@ void AmsReplaceMaterialDialog::update_to_nozzle(int nozzle_id)
group_index++; group_index++;
} }
} }
}
if (group_index > 0) if (group_index > 0)
{ {