public ControllerDataSeries(AngleController angleController) { controllerDataString = $"{angleController.MotorType}ControllerData"; this.angleController = angleController; angleController.PropertyChanged += OnAngleControllerPropertyChanged; ControllerData = angleController.ControllerData; MotorType = angleController.MotorType; MotorDriver = angleController.MotorDriver; foreach (var profile in angleController.PidProfiles.Values) { if (profile.DirectionProfile == DirectionProfile.CW) { CWProportionalGain = profile.ProportionalGain; CWIntegralGain = profile.IntegralGain; CWDerivativeGain = profile.DerivativeGain; } else { CCWProportionalGain = profile.ProportionalGain; CCWIntegralGain = profile.IntegralGain; CCWDerivativeGain = profile.DerivativeGain; } } IWindupThreshold = angleController.IntegralWindupThreshold; OutputRateLimit = angleController.OutputRateLimit; }
public void Dispose() { angleController.PropertyChanged -= OnAngleControllerPropertyChanged; angleController = null; }