This is the vcdMaker demo project. See http://vcdmaker.org for details. vcdMaker is supposed to help engineers to debug their applications and systems. It transforms text log files into the VCD format which can be easily displayed as a waveform.

Dependencies:   mbed vcdLogger vcdSignal

Signals/slider.cpp

Committer:
ketjow
Date:
2016-05-28
Revision:
2:a13cde5c679c
Parent:
1:446154224f92

File content as of revision 2:a13cde5c679c:

/*!
  @file slider.cpp

  The implementation of the slider sensor signal class.

  @par Full Description
  The implementation of the slider sensor signal class.

  @if REVISION_HISTORY_INCLUDED
  @par Edit History
  @li [0]    wojciech.rynczuk@wp.pl    20-JAN-2015    Initial file revision.
  @endif

  @ingroup Signal

  The MIT License (MIT)
  Copyright (c) 2016 Wojciech Rynczuk

*/

#include "slider.hpp"

Slider::Slider(const string& name, Logger& logger) : Signal(name, 7, logger)
{
    m_SliderPrev = 0;
    m_SliderCurr = 0;
}
  
void Slider::PrintState()
{
    string  suffix("");
    string  msg("");
    int32_t time_ref = 0;
    
    m_SliderCurr = m_Slider.readPercentage() * 100;
    if ( (CheckFilter()) || \
         (fabs((float)(m_SliderCurr - m_SliderPrev)) > 0))
    {
        PrintVector(m_SliderCurr, suffix, msg, time_ref);
        m_SliderPrev = m_SliderCurr;
    }
}