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
(cherry picked from commit 7224ccd2a114d553b6234a7d8616d253bef0ced4)
This commit is contained in:
hu.wang 2023-08-15 19:24:37 +08:00 committed by Lane.Wei
parent 09b6f4d8fd
commit 2cf9ee1dc5
5 changed files with 51 additions and 12 deletions

View file

@ -2107,7 +2107,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
@ -2120,7 +2120,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());
@ -2738,6 +2739,9 @@ bool MachineObject::is_function_supported(PrinterFunction func)
case FUNC_FILAMENT_BACKUP:
func_name = "FUNC_FILAMENT_BACKUP";
break;
case FUNC_MOTOR_NOISE_CALI:
func_name = "FUNC_MOTOR_NOISE_CALI";
break;
default:
return true;
}