MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/processing/SignalSync.hh
2024-06-07 11:12:56 +03:00

66 lines
1.1 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* 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_ */