Esempio n. 1
0
 private void ResetData()
 {
     StopTimers();
     oktimer.Reset();
     delaytimer.Reset();
     OKsBeforeRSSampleData.Clear();
     TimeBeforeRSSampleData.Clear();
     currentPhase = ConnectionMeter.Phase.FindingSteadyState;
 }
Esempio n. 2
0
        private void UpdatePhase()
        {
            if (currentPhase == ConnectionMeter.Phase.FindingSteadyState && RSDelayStandardDeviation < 0.2)
            {
                currentPhase = ConnectionMeter.Phase.Metering;
            }
            else
            {
                if (currentPhase != ConnectionMeter.Phase.Metering)
                {
                    return;
                }

                if (RSDelayStandardDeviation >= 0.2)
                {
                    currentPhase  = ConnectionMeter.Phase.FindingSteadyState;
                    current_delay = 0L;
                }
                else
                {
                    if (current_delay != 0L)
                    {
                        return;
                    }

                    if (DelayMode == ConnectionMeter.Mode.DelayEveryCommand)
                    {
                        current_delay = (long)(AvgRSDelay * 500.0);
                    }
                    else if (DelayMode == ConnectionMeter.Mode.DelayWhenBufferIsFull)
                    {
                        current_delay = (long)(AvgRSDelay * 500.0);
                    }

                    delaytimer.Restart();
                }
            }
        }