FIX: calibration flow rate sending progressbar

fix sending progressbar display problem in flow rate preset page

jira: STUDIO-4869、STUDIO-4783、STUDIO-4786

Change-Id: I91bfb473d603bb50435da5b23389f38cee8bca6c
This commit is contained in:
liz.li 2023-10-30 17:27:39 +08:00 committed by Lane.Wei
parent 295c40709f
commit 9b26013298
3 changed files with 43 additions and 2 deletions

View File

@ -90,6 +90,26 @@ CalibrationWizard::CalibrationWizard(wxWindow* parent, CalibMode mode, wxWindowI
main_sizer->Fit(this);
Bind(EVT_CALIBRATION_JOB_FINISHED, &CalibrationWizard::on_cali_job_finished, this);
this->Bind(wxEVT_CHAR_HOOK, [this](auto& evt) {
const int keyCode = evt.GetKeyCode();
switch (keyCode)
{
case WXK_F1:
{
show_step(m_curr_step->prev);
break;
}
case WXK_F2:
{
show_step(m_curr_step->next);
break;
}
default:
evt.Skip();
break;
}
});
}
CalibrationWizard::~CalibrationWizard()
@ -990,8 +1010,13 @@ void FlowRateWizard::on_cali_start(CaliPresetStage stage, float cali_value, Flow
}
else if (stage == CaliPresetStage::CALI_MANUAL_STAGE_2) {
cali_stage = 2;
calib_info.process_bar = coarse_page->get_sending_progress_bar();
temp_filament_preset->config.set_key_value("filament_flow_ratio", new ConfigOptionFloats{ cali_value });
if (from_page == FlowRatioCaliSource::FROM_PRESET_PAGE) {
calib_info.process_bar = preset_page->get_sending_progress_bar();
}
else if (from_page == FlowRatioCaliSource::FROM_COARSE_PAGE) {
calib_info.process_bar = coarse_page->get_sending_progress_bar();
}
}
calib_info.filament_prest = temp_filament_preset;
@ -1021,7 +1046,12 @@ void FlowRateWizard::on_cali_start(CaliPresetStage stage, float cali_value, Flow
else if (cali_stage == 2) {
CalibrationCaliPage *cali_fine_page = (static_cast<CalibrationCaliPage *>(cali_fine_step->page));
cali_fine_page->clear_last_job_status();
coarse_page->on_cali_start_job();
if (from_page == FlowRatioCaliSource::FROM_PRESET_PAGE) {
preset_page->on_cali_start_job();
}
else if (from_page == FlowRatioCaliSource::FROM_COARSE_PAGE) {
coarse_page->on_cali_start_job();
}
}
} else {
assert(false);
@ -1208,6 +1238,7 @@ void FlowRateWizard::on_cali_job_finished(wxString evt_data)
show_step(cali_fine_step);
}
// change ui, hide
static_cast<CalibrationPresetPage*>(preset_step->page)->on_cali_finished_job();
static_cast<CalibrationFlowCoarseSavePage*>(coarse_save_step->page)->on_cali_finished_job();
}
else

View File

@ -1199,6 +1199,9 @@ bool CalibrationPresetPage::need_check_sdcard(MachineObject* obj)
void CalibrationPresetPage::show_status(CaliPresetPageStatus status)
{
if (m_stop_update_page_status)
return;
if (m_page_status != status)
//BOOST_LOG_TRIVIAL(info) << "CalibrationPresetPage: show_status = " << status << "(" << get_print_status_info(status) << ")";
m_page_status = status;
@ -1407,6 +1410,8 @@ void CalibrationPresetPage::on_cali_start_job()
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_CALI, false);
Layout();
Fit();
m_stop_update_page_status = true;
}
void CalibrationPresetPage::on_cali_finished_job()
@ -1418,6 +1423,8 @@ void CalibrationPresetPage::on_cali_finished_job()
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_CALI, true);
Layout();
Fit();
m_stop_update_page_status = false;
}
void CalibrationPresetPage::on_cali_cancel_job()
@ -1438,6 +1445,8 @@ void CalibrationPresetPage::on_cali_cancel_job()
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_CALI, true);
Layout();
Fit();
m_stop_update_page_status = false;
}
void CalibrationPresetPage::init_with_machine(MachineObject* obj)

View File

@ -281,6 +281,7 @@ protected:
std::map<int, DynamicPrintConfig> filament_ams_list;
CaliPresetPageStatus m_page_status { CaliPresetPageStatus::CaliPresetStatusInit };
bool m_stop_update_page_status{ false };
bool m_show_custom_range { false };
bool m_has_filament_incompatible { false };