FIX:when ams cali_idx is unknown, use default item

2. use transparent color when reset filament
jira: 7946

Change-Id: I129dc0e6b7244cad3b5e61e1bc423938f4b92d7e
This commit is contained in:
zhimin.zeng 2024-08-27 20:18:31 +08:00 committed by lane.wei
parent aba72bb04f
commit 7f473c2027
1 changed files with 6 additions and 6 deletions

View File

@ -483,7 +483,7 @@ void AMSMaterialsSetting::on_select_reset(wxCommandEvent& event) {
long nozzle_temp_max_int = 0;
wxColour color = *wxWHITE;
char col_buf[10];
sprintf(col_buf, "%02X%02X%02XFF", (int)color.Red(), (int)color.Green(), (int)color.Blue());
sprintf(col_buf, "%02X%02X%02X00", (int)color.Red(), (int)color.Green(), (int)color.Blue());
std::string selected_ams_id;
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
@ -1208,12 +1208,12 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
if(!selected_tray)
return;
cali_select_idx = CalibUtils::get_selected_calib_idx(m_pa_profile_items, selected_tray->cali_idx);
if (cali_select_idx >= 0) {
m_comboBox_cali_result->SetSelection(cali_select_idx);
}
else {
m_comboBox_cali_result->SetSelection(0);
if (cali_select_idx < 0) {
BOOST_LOG_TRIVIAL(info) << "extrusion_cali_status_error: cannot find pa profile, ams_id = " << ams_id
<< ", slot_id = " << slot_id << ", cali_idx = " << selected_tray->cali_idx;
cali_select_idx = 0;
}
m_comboBox_cali_result->SetSelection(cali_select_idx);
}
if (cali_select_idx >= 0) {