NEW:[STUDIO-4016] Support motor noise cali for N1

Calibrated motor noise option, N1 supported.
And when none of the calibration options are selected, the start calibration button turns gray

Change-Id: I991034a13001f840016475171c33218ddc812d35
This commit is contained in:
hu.wang 2023-08-15 19:24:37 +08:00 committed by Lane.Wei
parent eb7f53d6c1
commit b281285a2d
10 changed files with 55 additions and 13 deletions

View file

@ -1990,7 +1990,7 @@ bool MachineObject::is_support_command_calibration()
return true;
}
int MachineObject::command_start_calibration(bool vibration, bool bed_leveling, bool xcam_cali)
int MachineObject::command_start_calibration(bool vibration, bool bed_leveling, bool xcam_cali, bool motor_noise)
{
if (!is_support_command_calibration()) {
// fixed gcode file
@ -2003,7 +2003,8 @@ int MachineObject::command_start_calibration(bool vibration, bool bed_leveling,
json j;
j["print"]["command"] = "calibration";
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
j["print"]["option"] = (vibration ? 1 << 2 : 0)
j["print"]["option"]= (motor_noise ? 1 << 3 : 0)
+ (vibration ? 1 << 2 : 0)
+ (bed_leveling ? 1 << 1 : 0)
+ (xcam_cali ? 1 << 0 : 0);
return this->publish_json(j.dump());
@ -2857,6 +2858,12 @@ int MachineObject::parse_json(std::string payload)
}
}
if (jj.contains("support_motor_noise_cali")) {
if (jj["support_motor_noise_cali"].is_boolean()) {
is_support_motor_noise_cali = jj["support_motor_noise_cali"].get<bool>();
}
}
if (jj.contains("support_timelapse")) {
if (jj["support_timelapse"].is_boolean()) {
is_support_timelapse = jj["support_timelapse"].get<bool>();