Exemple #1
0
        public void AddNewPoint(MeasurementModel left, MeasurementModel right)
        {
            MotorLeftValues.Add(left);
            MotorRightValues.Add(right);

            if (MotorLeftValues.Count > 120)
            {
                MotorLeftValues.RemoveAt(0);
            }
            if (MotorRightValues.Count > 120)
            {
                MotorRightValues.RemoveAt(0);
            }

            SetAxisLimits(DateTime.Now);
        }
Exemple #2
0
        public void AddNewPoints(IList <MeasurementModel> left, IList <MeasurementModel> right)
        {
            const int historicalSamples = 130;

            historyLeft.AddRange(left);
            historyRight.AddRange(right);

            if (historyLeft.Count > historicalSamples)
            {
                historyLeft.RemoveRange(0, historyLeft.Count - historicalSamples);
            }
            if (historyRight.Count > historicalSamples)
            {
                historyRight.RemoveRange(0, historyRight.Count - historicalSamples);
            }

            MotorLeftValues.Clear();
            MotorRightValues.Clear();

            MotorLeftValues.AddRange(historyLeft);
            MotorRightValues.AddRange(historyRight);

            SetAxisLimits(DateTime.Now);
        }
 public float GetAverageRightSpeed()
 {
     return(MotorRightValues.Average());
 }
 public void AddMotorSpeed(float left, float right)
 {
     MotorLeftValues.Add(left);
     MotorRightValues.Add(right);
 }