FIX: the bed_type is incorrect for flowrate cali

jira: STUDIO-14901
Change-Id: I8a1fcdf5eb051a81f0fcd0c5d9a590bce2646994
(cherry picked from commit 49edbe52572137ff79f1b17dab261d5b800b2499)
This commit is contained in:
zhimin.zeng
2025-09-26 17:41:21 +08:00
committed by Noisyfox
parent d4e1d7dfb2
commit 0964a9a85c
4 changed files with 10 additions and 5 deletions

View File

@@ -375,7 +375,7 @@ bool CalibrationWizard::save_preset_with_index(const std::string &old_preset_nam
return true;
}
void CalibrationWizard::cache_preset_info(MachineObject* obj, float nozzle_dia)
void CalibrationWizard::cache_preset_info(MachineObject *obj, float nozzle_dia, BedType bed_type)
{
if (!obj) return;
@@ -388,6 +388,7 @@ void CalibrationWizard::cache_preset_info(MachineObject* obj, float nozzle_dia)
CaliPresetInfo result;
result.tray_id = item.first;
result.nozzle_diameter = nozzle_dia;
result.bed_type = bed_type;
result.filament_id = item.second->filament_id;
result.setting_id = item.second->setting_id;
result.name = item.second->name;
@@ -696,7 +697,7 @@ void PressureAdvanceWizard::on_cali_start()
float nozzle_dia = -1;
preset_page->get_preset_info(nozzle_dia, plate_type);
CalibrationWizard::cache_preset_info(curr_obj, nozzle_dia);
CalibrationWizard::cache_preset_info(curr_obj, nozzle_dia, plate_type);
if (/*nozzle_dia < 0 || */ plate_type == BedType::btDefault) {
BOOST_LOG_TRIVIAL(error) << "CaliPreset: get preset info, nozzle and plate type error";
return;
@@ -1207,7 +1208,7 @@ void FlowRateWizard::on_cali_start(CaliPresetStage stage, float cali_value, Flow
msg_dlg.ShowModal();
return;
}
CalibrationWizard::cache_preset_info(curr_obj, nozzle_dia);
CalibrationWizard::cache_preset_info(curr_obj, nozzle_dia, plate_type);
}
else if (from_page == FlowRatioCaliSource::FROM_COARSE_PAGE) {
selected_filaments = get_cached_selected_filament(curr_obj);
@@ -1278,6 +1279,7 @@ void FlowRateWizard::on_cali_start(CaliPresetStage stage, float cali_value, Flow
int selected_tray_id = curr_obj->selected_cali_preset.front().tray_id;
PresetCollection *filament_presets = &wxGetApp().preset_bundle->filaments;
Preset* preset = filament_presets->find_preset(curr_obj->selected_cali_preset.front().name);
plate_type = curr_obj->selected_cali_preset.front().bed_type;
if (preset) {
selected_filaments.insert(std::make_pair(selected_tray_id, preset));
}
@@ -1673,7 +1675,7 @@ void MaxVolumetricSpeedWizard::on_cali_start()
preset_page->get_preset_info(nozzle_dia, plate_type);
CalibrationWizard::cache_preset_info(curr_obj, nozzle_dia);
CalibrationWizard::cache_preset_info(curr_obj, nozzle_dia, plate_type);
wxArrayString values = preset_page->get_custom_range_values();
Calib_Params params;