Optimal calibration

This commit is contained in:
QIDI TECH
2023-10-13 13:45:48 +08:00
parent 2fa4dd2459
commit 25096e7aad
4 changed files with 12 additions and 3 deletions

View File

@@ -1593,7 +1593,8 @@ void MainFrame::init_menubar_as_editor()
append_menu_item(flowrateMenu, wxID_ANY, _L("Fine"), _L("Flow Rate Fine"),
[this](wxCommandEvent &) {
m_frf_calib_dlg = new FRF_Calibration_Dlg((wxWindow *) this, wxID_ANY, m_plater);
if (!m_frf_calib_dlg)
m_frf_calib_dlg = new FRF_Calibration_Dlg((wxWindow *) this, wxID_ANY, m_plater);
m_frf_calib_dlg->ShowModal();
},
"", nullptr, [this]() { return m_plater->is_view3D_shown(); }, this);
@@ -1603,7 +1604,8 @@ void MainFrame::init_menubar_as_editor()
append_menu_item(calibrationMenu, wxID_ANY, _L("Pressure Advance"), _L("Pressure Advance"),
[this](wxCommandEvent &) {
m_pa_calib_dlg = new PA_Calibration_Dlg((wxWindow *) this, wxID_ANY, m_plater);
if (!m_pa_calib_dlg)
m_pa_calib_dlg = new PA_Calibration_Dlg((wxWindow *) this, wxID_ANY, m_plater);
m_pa_calib_dlg->ShowModal();
},
"", nullptr, [this]() { return m_plater->is_view3D_shown(); }, this);

View File

@@ -160,7 +160,7 @@ void PA_Calibration_Dlg::on_start(wxCommandEvent& event) {
read_double = m_tcStartPA->GetValue().ToDouble(&start_pa);
read_double = read_double && m_tcEndPA->GetValue().ToDouble(&end_pa);
read_double = read_double && m_tcPAStep->GetValue().ToDouble(&pa_step);
if (!read_double || start_pa < 0 || pa_step < EPSILON || end_pa < start_pa + pa_step) {
if (!read_double || start_pa < 0 || pa_step < 0.001 || end_pa < start_pa + pa_step) {
MessageDialog msg_dlg(nullptr, _L("Please input valid values:\nStart PA: >= 0.0\nEnd PA: > Start PA + PA step\nPA step: >= 0.001)"), wxEmptyString, wxICON_WARNING | wxOK);
msg_dlg.ShowModal();
return;