fix(calibration): correctly set intiial notch configuration

This commit is contained in:
Naxdy 2024-04-02 19:18:45 +02:00
parent 6c7ad81b80
commit 755e49180c
Signed by untrusted user: Naxdy
GPG key ID: CC15075846BCE91B

View file

@ -574,19 +574,19 @@ impl<'a> StickCalibrationProcess<'a> {
// TODO: phob does something related to undo here
if self.calibration_step == NO_OF_CALIBRATION_POINTS as u8 {
stick_config.angles = *legalize_notches(
self.calibration_step as usize,
&self.applied_calibration.measured_notch_angles,
&self.applied_calibration.notch_angles,
)
.to_packed_float_array();
self.applied_calibration = AppliedCalibration::from_points(
&self.cal_points.map(|e| e.x),
&self.cal_points.map(|e| e.y),
&stick_config,
self.which_stick,
);
stick_config.angles = *legalize_notches(
self.calibration_step as usize,
&self.applied_calibration.measured_notch_angles,
&DEFAULT_ANGLES,
)
.to_packed_float_array();
}
if self.calibration_step >= NO_OF_CALIBRATION_POINTS as u8 {
@ -626,6 +626,10 @@ impl<'a> StickCalibrationProcess<'a> {
return true;
}
if self.calibration_step == NO_OF_CALIBRATION_POINTS as u8 {
SIGNAL_CONFIG_CHANGE.signal(self.gcc_config.clone());
}
return false;
}