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@2:a13cde5c679c, 2016-05-28 (annotated)
- Committer:
- ketjow
- Date:
- Sat May 28 19:25:39 2016 +0000
- Revision:
- 2:a13cde5c679c
- Parent:
- 1:446154224f92
Added Sync signal.; Added libraries.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ketjow | 1:446154224f92 | 1 | /*! |
ketjow | 1:446154224f92 | 2 | @file slider.cpp |
ketjow | 1:446154224f92 | 3 | |
ketjow | 1:446154224f92 | 4 | The implementation of the slider sensor signal class. |
ketjow | 1:446154224f92 | 5 | |
ketjow | 1:446154224f92 | 6 | @par Full Description |
ketjow | 1:446154224f92 | 7 | The implementation of the slider sensor signal class. |
ketjow | 1:446154224f92 | 8 | |
ketjow | 1:446154224f92 | 9 | @if REVISION_HISTORY_INCLUDED |
ketjow | 1:446154224f92 | 10 | @par Edit History |
ketjow | 1:446154224f92 | 11 | @li [0] wojciech.rynczuk@wp.pl 20-JAN-2015 Initial file revision. |
ketjow | 1:446154224f92 | 12 | @endif |
ketjow | 1:446154224f92 | 13 | |
ketjow | 1:446154224f92 | 14 | @ingroup Signal |
ketjow | 1:446154224f92 | 15 | |
ketjow | 2:a13cde5c679c | 16 | The MIT License (MIT) |
ketjow | 2:a13cde5c679c | 17 | Copyright (c) 2016 Wojciech Rynczuk |
ketjow | 1:446154224f92 | 18 | |
ketjow | 1:446154224f92 | 19 | */ |
ketjow | 1:446154224f92 | 20 | |
ketjow | 0:9a59cffaafad | 21 | #include "slider.hpp" |
ketjow | 0:9a59cffaafad | 22 | |
ketjow | 0:9a59cffaafad | 23 | Slider::Slider(const string& name, Logger& logger) : Signal(name, 7, logger) |
ketjow | 0:9a59cffaafad | 24 | { |
ketjow | 0:9a59cffaafad | 25 | m_SliderPrev = 0; |
ketjow | 0:9a59cffaafad | 26 | m_SliderCurr = 0; |
ketjow | 0:9a59cffaafad | 27 | } |
ketjow | 0:9a59cffaafad | 28 | |
ketjow | 0:9a59cffaafad | 29 | void Slider::PrintState() |
ketjow | 0:9a59cffaafad | 30 | { |
ketjow | 0:9a59cffaafad | 31 | string suffix(""); |
ketjow | 0:9a59cffaafad | 32 | string msg(""); |
ketjow | 0:9a59cffaafad | 33 | int32_t time_ref = 0; |
ketjow | 0:9a59cffaafad | 34 | |
ketjow | 0:9a59cffaafad | 35 | m_SliderCurr = m_Slider.readPercentage() * 100; |
ketjow | 0:9a59cffaafad | 36 | if ( (CheckFilter()) || \ |
ketjow | 0:9a59cffaafad | 37 | (fabs((float)(m_SliderCurr - m_SliderPrev)) > 0)) |
ketjow | 0:9a59cffaafad | 38 | { |
ketjow | 0:9a59cffaafad | 39 | PrintVector(m_SliderCurr, suffix, msg, time_ref); |
ketjow | 0:9a59cffaafad | 40 | m_SliderPrev = m_SliderCurr; |
ketjow | 0:9a59cffaafad | 41 | } |
ketjow | 0:9a59cffaafad | 42 | } |