SmartSwitch/sswTimerThread.cpp
//******************************************************************************
//******************************************************************************
//******************************************************************************
// Update the simulated input value.
Update the simulated input value.
Update the simulated input value .
void TimerThread::doUpdateValue()
{
   if (mNoiseRequestFlag)
   {
      mNoiseRequestFlag = false;
      mGaussNoise.initialize(mNoiseSigma);
   }
   mValueA += mDeltaA;
   mValueB += mDeltaB;
   mNoise = (float)mGaussNoise.getNoise();
   mValueAPN = mValueA + mNoise;
   mNoise = (float)mGaussNoise.getNoise();
   mValueBPN = mValueB + mNoise;
}
void TimerThread :: doUpdateValue ( ) { if ( mNoiseRequestFlag ) { mNoiseRequestFlag = false ; mGaussNoise . initialize ( mNoiseSigma ) ; } mValueA += mDeltaA ; mValueB += mDeltaB ; mNoise = ( float ) mGaussNoise . getNoise ( ) ; mValueAPN = mValueA + mNoise ; mNoise = ( float ) mGaussNoise . getNoise ( ) ; mValueBPN = mValueB + mNoise ; }
Update the simulated input value.
Update the simulated input value .
// If there is a request for gaussian noise then initialize the gaussian // noise generator. // Get from the noise generator. // Update the input value. // Add some noise.