MotorControlModuleSDFM_TMS3.../Projects/EFC_Application/UMLibrary/processing/SignalSync.hh

66 lines
1.1 KiB
C++
Raw Normal View History

/*
* SignalSync.hh
*
* Created on: 12 <EFBFBD><EFBFBD><EFBFBD>. 2022 <EFBFBD>.
* Author: titov
*/
#ifndef UMLIBRARY_PROCESSING_SIGNALSYNC_HH_
#define UMLIBRARY_PROCESSING_SIGNALSYNC_HH_
#include "../systemic/ISignal.hh"
#include "../systemic/IProcess.hh"
#include "../peripheral/NanoTimer.hh"
#include "../common/DoubleBuffer.hpp"
namespace processing {
class SignalSynchroSource : public systemic::IProcess {
systemic::ISignal & raw;
public:
SignalSynchroSource( systemic::ISignal & raw );
struct Point {
float value;
peripheral::nanotimer::stamp timestamp;
bool operator!=( const Point & right ) const;
} current;
const Point & point() const;
void process();
};
class SignalSynchroSync : public systemic::IProcess {
public:
typedef SignalSynchroSource::Point Point;
const Point & point;
Point prev_point;
float sync_value;
float dvalue;
peripheral::nanotimer::time_ns dtime;
public:
SignalSynchroSync( const Point & );
const float & value() const;
void process();
};
}
#endif /* UMLIBRARY_PROCESSING_SIGNALSYNC_HH_ */