FIX: fix bugs of calibration

Change-Id: I2d0f57105bdda2abc3fc7b218122d4df5a3161da
This commit is contained in:
Stone Li 2023-07-04 10:50:02 +08:00 committed by Lane.Wei
parent 32892514ff
commit 28b56c2efb
8 changed files with 116 additions and 57 deletions

View file

@ -480,13 +480,16 @@ void PrintJob::process()
BOOST_LOG_TRIVIAL(error) << "print_job: send ok.";
wxCommandEvent* evt = new wxCommandEvent(m_print_job_completed_id);
if (!m_completed_evt_data.empty())
evt->SetString(m_completed_evt_data);
else
evt->SetString(m_dev_id);
if (m_print_job_completed_id == wxGetApp().plater()->get_send_calibration_finished_event()) {
int sel = wxGetApp().mainframe->get_calibration_curr_tab();
if (sel >= 0) {
evt->SetInt(sel);
}
}
evt->SetString(m_dev_id);
wxQueueEvent(m_plater, evt);
m_job_finished = true;
}

View file

@ -38,6 +38,7 @@ class PrintJob : public PlaterJob
std::string m_dev_id;
bool m_job_finished{ false };
int m_print_job_completed_id = 0;
wxString m_completed_evt_data;
std::function<void()> m_enter_ip_address_fun_fail{ nullptr };
std::function<void()> m_enter_ip_address_fun_success{ nullptr };
@ -90,7 +91,10 @@ public:
}
bool is_finished() { return m_job_finished; }
void set_print_job_finished_event(int event_id) { m_print_job_completed_id = event_id; }
void set_print_job_finished_event(int event_id, wxString evt_data = wxEmptyString) {
m_print_job_completed_id = event_id;
m_completed_evt_data = evt_data;
}
void on_success(std::function<void()> success);
void process() override;
void finalize() override;