NEW:write log when pausing or stopping printing tasks

Change-Id: I397fe6f5490d2599ce4bb81e32c64ae0f57eb3c0
This commit is contained in:
tao wang 2023-07-06 19:59:06 +08:00 committed by Lane.Wei
parent 0c8245a76c
commit f6049a2295
1 changed files with 10 additions and 3 deletions

View File

@ -1567,19 +1567,26 @@ void StatusPanel::on_market_scoring(wxCommandEvent &event) {
void StatusPanel::on_subtask_pause_resume(wxCommandEvent &event) void StatusPanel::on_subtask_pause_resume(wxCommandEvent &event)
{ {
if (obj) { if (obj) {
if (obj->can_resume()) if (obj->can_resume()) {
BOOST_LOG_TRIVIAL(info) << "monitor: resume current print task dev_id =" << obj->dev_id;
obj->command_task_resume(); obj->command_task_resume();
else }
else {
BOOST_LOG_TRIVIAL(info) << "monitor: pause current print task dev_id =" << obj->dev_id;
obj->command_task_pause(); obj->command_task_pause();
} }
} }
}
void StatusPanel::on_subtask_abort(wxCommandEvent &event) void StatusPanel::on_subtask_abort(wxCommandEvent &event)
{ {
if (abort_dlg == nullptr) { if (abort_dlg == nullptr) {
abort_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Cancel print")); abort_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Cancel print"));
abort_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this](wxCommandEvent &e) { abort_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this](wxCommandEvent &e) {
if (obj) obj->command_task_abort(); if (obj) {
BOOST_LOG_TRIVIAL(info) << "monitor: stop current print task dev_id =" << obj->dev_id;
obj->command_task_abort();
}
}); });
} }
abort_dlg->update_text(_L("Are you sure you want to cancel this print?")); abort_dlg->update_text(_L("Are you sure you want to cancel this print?"));