FIX:Fixed error in displaying the name of Bambu filaments

Change-Id: Ib42194c07b6eefe793eec81a588debc9d622d951
This commit is contained in:
tao wang 2024-05-09 11:41:03 +08:00 committed by Lane.Wei
parent dab3f24553
commit 3fe8d450d9
1 changed files with 10 additions and 2 deletions

View File

@ -800,7 +800,7 @@ void AMSMaterialsSetting::Popup(wxString filament, wxString sn, wxString temp_mi
int selection_idx = -1, idx = 0;
wxArrayString filament_items;
wxString bambu_filament_name;
std::set<std::string> filament_id_set;
PresetBundle * preset_bundle = wxGetApp().preset_bundle;
@ -854,6 +854,8 @@ void AMSMaterialsSetting::Popup(wxString filament, wxString sn, wxString temp_mi
if (filament_it->filament_id == ams_filament_id) {
selection_idx = idx;
bambu_filament_name = filament_it->alias;
// update if nozzle_temperature_range is found
ConfigOption *opt_min = filament_it->config.option("nozzle_temperature_range_low");
@ -893,7 +895,13 @@ void AMSMaterialsSetting::Popup(wxString filament, wxString sn, wxString temp_mi
if (!m_is_third) {
m_comboBox_filament->Hide();
m_readonly_filament->Show();
m_readonly_filament->SetLabel("Bambu " + filament);
if (bambu_filament_name.empty()) {
m_readonly_filament->SetLabel("Bambu " + filament);
}
else {
m_readonly_filament->SetLabel(bambu_filament_name);
}
m_input_nozzle_min->GetTextCtrl()->SetValue(temp_min);
m_input_nozzle_max->GetTextCtrl()->SetValue(temp_max);
}