mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-08-18 22:25:53 +08:00
FIX: crash when select filament in device
jira: STUDIO-7972 Change-Id: Ice9e7360fbfe0c07bd49bbd696bb3cfb662e94e4
This commit is contained in:
parent
56ed912c3e
commit
4c644d4715
@ -1191,21 +1191,24 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_comboBox_cali_result->Set(items);
|
m_comboBox_cali_result->Set(items);
|
||||||
if (ams_id == VIRTUAL_TRAY_MAIN_ID) {
|
if (ams_id == VIRTUAL_TRAY_MAIN_ID || ams_id == VIRTUAL_TRAY_DEPUTY_ID) {
|
||||||
cali_select_idx = CalibUtils::get_selected_calib_idx(m_pa_profile_items,this->obj->vt_slot[0].cali_idx);
|
for (auto slot : obj->vt_slot) {
|
||||||
if (cali_select_idx >= 0) {
|
if (slot.id == std::to_string(ams_id))
|
||||||
m_comboBox_cali_result->SetSelection(cali_select_idx);
|
cali_select_idx = CalibUtils::get_selected_calib_idx(m_pa_profile_items, slot.cali_idx);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
|
if (cali_select_idx >= 0)
|
||||||
|
m_comboBox_cali_result->SetSelection(cali_select_idx);
|
||||||
|
else
|
||||||
m_comboBox_cali_result->SetSelection(0);
|
m_comboBox_cali_result->SetSelection(0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
|
if (this->obj->amsList.find(std::to_string(ams_id)) != this->obj->amsList.end()) {
|
||||||
Ams* selected_ams = this->obj->amsList[std::to_string(ams_id)];
|
Ams* selected_ams = this->obj->amsList[std::to_string(ams_id)];
|
||||||
if(!selected_ams)
|
if (!selected_ams)
|
||||||
return;
|
return;
|
||||||
AmsTray* selected_tray = selected_ams->trayList[std::to_string(slot_id)];
|
AmsTray* selected_tray = selected_ams->trayList[std::to_string(slot_id)];
|
||||||
if(!selected_tray)
|
if (!selected_tray)
|
||||||
return;
|
return;
|
||||||
cali_select_idx = CalibUtils::get_selected_calib_idx(m_pa_profile_items, selected_tray->cali_idx);
|
cali_select_idx = CalibUtils::get_selected_calib_idx(m_pa_profile_items, selected_tray->cali_idx);
|
||||||
if (cali_select_idx < 0) {
|
if (cali_select_idx < 0) {
|
||||||
@ -1215,6 +1218,7 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
|
|||||||
}
|
}
|
||||||
m_comboBox_cali_result->SetSelection(cali_select_idx);
|
m_comboBox_cali_result->SetSelection(cali_select_idx);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (cali_select_idx >= 0) {
|
if (cali_select_idx >= 0) {
|
||||||
m_input_k_val->GetTextCtrl()->SetValue(float_to_string_with_precision(m_pa_profile_items[cali_select_idx].k_value));
|
m_input_k_val->GetTextCtrl()->SetValue(float_to_string_with_precision(m_pa_profile_items[cali_select_idx].k_value));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user