NEW:use new homing command

jira:[none]

Change-Id: I9d60d0b5c2d0e2cf7ac5c5e4b0dbcf2daf6edbb1
This commit is contained in:
tao wang 2025-01-10 20:50:51 +08:00 committed by lane.wei
parent 9744d9a6b1
commit 9dce95d401
3 changed files with 17 additions and 2 deletions

View File

@ -1911,6 +1911,15 @@ int MachineObject::command_go_home()
}
}
int MachineObject::command_go_home2()
{
BOOST_LOG_TRIVIAL(info) << "New protocol of command_go_home2";
json j;
j["print"]["command"] = "back_to_center";
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
return this->publish_json(j.dump());
}
// Old protocol
int MachineObject::command_control_fan(int fan_type, int val)
{

View File

@ -1069,7 +1069,8 @@ public:
int command_xyz_abs();
int command_auto_leveling();
int command_go_home();
int command_control_fan(int fan_type, int val); // Old protocol
int command_go_home2();
int command_control_fan(int fan_type, int val); // Old protocol
int command_control_fan_new(int fan_id, int val, const CommandCallBack &cb); // New protocol
int command_control_air_duct(int mode_id, const CommandCallBack& cb);
int command_task_abort();

View File

@ -3846,7 +3846,12 @@ void StatusPanel::on_axis_ctrl_xy(wxCommandEvent &event)
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();
if (obj->is_enable_np) {
obj->command_go_home2();
} else {
obj->command_go_home();
}
}
});
}