![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Base/VitalsDataComponent.h>
DataComponent for a collection of time dependent vital signs like ECG, heart rate or pulse oximeter measurements. More...
DataComponent for a collection of time dependent vital signs like ECG, heart rate or pulse oximeter measurements.
Classes | |
struct | Sample |
A single temporal sample. More... | |
class | TimeSeries |
A scalar time series. More... | |
Public Types | |
enum class | Kind : int { ECG , PulseOximeter , HeartRate , Other } |
Type of vital signs represented. | |
using | TimePoint = std::chrono::system_clock::time_point |
using | Duration = TimePoint::duration |
Public Member Functions | |
void | add (TimePoint timestamp, double signalSample, Kind kind, int which=0) |
Add a sample with corresponding timestamp. | |
void | trim (const TimePoint &earliestTimeToKeep) |
Remove all samples older than a set threshold. | |
void | addTimeSeries (std::vector< std::pair< TimePoint, double > > signal, Kind kind) |
Add a time series from the given timestamps and signal values. signal needs to be sorted w.r.t. time! | |
std::vector< Sample > | closest (TimePoint queryTimestamp, Kind kind, Duration maxDifference=std::chrono::milliseconds{100}) const |
Find the samples closest in time to the given timestamp. | |
std::vector< Sample > | closest (double queryTimestampSinceEpochInSeconds, Kind kind, double maxDifferenceInSeconds=0.1) const |
Find the samples closest in time to the given timestamp. | |
std::vector< std::pair< TimePoint, TimePoint > > | timestampRanges (Kind kind) const |
Range (min, max) of the contained timestamps. | |
std::vector< std::pair< double, double > > | signalRanges (Kind kind) const |
Range (min, max) of the contained vitals signal. | |
int | size () const |
Number of time series in this instance. | |
std::vector< std::reference_wrapper< const TimeSeries > > | timeSeries (Kind kind) const |
Get all time series of the given kind. | |
void | clear () |
Removes all time series. | |
bool | hasTimeSeries (Kind kind) const |
Whether there is a time series of the given kind. | |
std::vector< Kind > | kinds () const |
list of all kinds of time series in this instance | |
bool | operator== (const VitalsDataComponent &other) const |
bool | operator!= (const VitalsDataComponent &other) const |
std::string | id () const override |
Returns a unique string identifier for this type of data component. | |
![]() | |
std::unique_ptr< DataComponentBase > | clone () const override |
Creates a clone of this data component. | |
std::unique_ptr< Subclass > | cloneDerived () const |
bool | assign (const DataComponentBase &other) override |
Assigns the content of other to this data component. | |
bool | equals (const DataComponentBase &other) const override |
Compares this data component to other for equality. | |
![]() | |
virtual void | configureDefaults () |
Retrieve the properties of this object, replaces values with their defaults and sets it again. | |
void | registerParameter (ParameterBase *param) |
Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration(). | |
void | unregisterParameter (const ParameterBase *param) |
Remove the given Parameter or SubProperty from the list of registered parameters. | |
Configurable (const Configurable &rhs) | |
Configurable (Configurable &&rhs) noexcept | |
Configurable & | operator= (const Configurable &) |
Configurable & | operator= (Configurable &&) noexcept |
Configurable interface | |
void | configure (const Properties *p) override |
Configure this object instance by de-serializing the given Properties. | |
void | configuration (Properties *p) const override |
Serialize the current object configuration into the given Properties object. | |
Additional Inherited Members | |
![]() | |
Signal | signalParametersChanged |
Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted. | |
![]() | |
DataComponentBase (const DataComponentBase &)=default | |
DataComponentBase & | operator= (const DataComponentBase &other)=default |
![]() | |
std::vector< Param > | m_params |
List of all registered Parameter and SubProperty instances. | |
|
overridevirtual |
Returns a unique string identifier for this type of data component.
Implements DataComponentBase.
|
overridevirtual |
Configure this object instance by de-serializing the given Properties.
The default implementation will do so automatically for all registered Parameter and SubProperty instances.
Reimplemented from Configurable.
|
overridevirtual |
Serialize the current object configuration into the given Properties object.
The default implementation will do so automatically for all registered Parameter and SubProperty instances.
Reimplemented from Configurable.