private bool CheckDelay(IMeasurement measurement, bool raiseCondition)
{
Ticks dist;
if (!raiseCondition)
{
// Keep track of the last time
// the signal failed the raise test
m_lastNegative = measurement.Timestamp;
}
else
{
// Get the amount of time since the last
// time the signal failed the raise test
dist = measurement.Timestamp - m_lastNegative;
// If the amount of time is larger than
// the delay threshold, raise the alarm
if (dist >= Ticks.FromSeconds(m_delay.GetValueOrDefault()))
return true;
}
return false;
}