NEW: Add SecondaryCheckDialog for home

jira: none

Change-Id: I5cabae467c62391156e7af1fb99afc0b18400fb6
(cherry picked from commit b33715dcc59c07872f7d1b23eb30a2adea13f481)
This commit is contained in:
hang.xu 2024-08-22 15:44:39 +08:00 committed by Lane.Wei
parent dbeed95448
commit fd9767eb4f
2 changed files with 15 additions and 1 deletions

View File

@ -3266,7 +3266,20 @@ void StatusPanel::on_axis_ctrl_xy(wxCommandEvent &event)
if (event.GetInt() == 5) { obj->command_axis_control("X", 1.0, -1.0f, 3000); }
if (event.GetInt() == 6) { obj->command_axis_control("Y", 1.0, -1.0f, 3000); }
if (event.GetInt() == 7) { obj->command_axis_control("X", 1.0, 1.0f, 3000); }
if (event.GetInt() == 8) { obj->command_go_home(); }
if (event.GetInt() == 8) {
if (axis_go_home_dlg == nullptr) {
axis_go_home_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Axis go home"));
axis_go_home_dlg->update_text(_L("Are you sure you want to home now?"));
axis_go_home_dlg->m_button_ok->SetLabel(_L("Home"));
axis_go_home_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this](wxCommandEvent& e) {
if (obj) {
BOOST_LOG_TRIVIAL(info) << "Axis have go home";
obj->command_go_home();
}
});
}
axis_go_home_dlg->on_show();
}
//check is at home
if (event.GetInt() == 1

View File

@ -470,6 +470,7 @@ protected:
SecondaryCheckDialog* con_load_dlg = nullptr;
SecondaryCheckDialog* ctrl_e_hint_dlg = nullptr;
SecondaryCheckDialog* sdcard_hint_dlg = nullptr;
SecondaryCheckDialog* axis_go_home_dlg = nullptr;
FanControlPopup* m_fan_control_popup{nullptr};