66 lines
1.1 KiB
C++
66 lines
1.1 KiB
C++
/*
|
||
* SignalSync.hh
|
||
*
|
||
* Created on: 12 апр. 2022 г.
|
||
* 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_ */
|