EduArt Sensor Ring Library 4.0.0
Loading...
Searching...
No Matches
eduart::sensorring::manager::MeasurementManager Class Reference

Meta class that handles the timing, triggering and processing of sensor measurements. Internally it runs a looping state machine. More...

#include <MeasurementManager.hpp>

Public Member Functions

 MeasurementManager (ManagerParams params, SensorRingFactory &factory)
 Construct the manager from a configured factory. Builds the SensorRing internally.
 MeasurementManager (ManagerParams params, std::unique_ptr< SensorRing > sensor_ring)
 Construct the manager from a pre-built SensorRing (expert-user constructor).
 ~MeasurementManager () noexcept
 Destructor.
bool measureSome () noexcept
 Run one processing cycle of the state machine worker.
bool startMeasuring () noexcept
 Start the state machine worker loop in a dedicated thread.
bool stopMeasuring () noexcept
 Stop the state machine worker loop and join the thread.
bool isMeasuring () noexcept
 Report whether the measurement worker thread is running.
subscription::Subscription subscribeToStateChanges (std::function< void(ManagerState state)> callback)
 Subscribe to state changes; callback is invoked when the state changes.
ManagerState getManagerState () const noexcept
 Return the current health state of the state machine worker.
ManagerParams getParams () const noexcept
 Return the parameters used to initialize the manager.
device::Group< device::DepthSensor > depthSensors () const noexcept
 Return all depth sensors.
device::Group< device::ThermalSensor > thermalSensors () const noexcept
 Return all thermal sensors.
device::Group< device::Light > lights () const noexcept
 Return all lights.
SensorRing * getRing () const noexcept
 Access the underlying sensor ring.

Detailed Description

Meta class that handles the timing, triggering and processing of sensor measurements. Internally it runs a looping state machine.

Constructor & Destructor Documentation

◆ MeasurementManager() [1/2]

eduart::sensorring::manager::MeasurementManager::MeasurementManager ( ManagerParams params,
SensorRingFactory & factory )

Construct the manager from a configured factory. Builds the SensorRing internally.

Parameters
[in]paramsManager configuration.
[in]factoryConfigured SensorRingFactory (interfaces and expectations already set).

◆ MeasurementManager() [2/2]

eduart::sensorring::manager::MeasurementManager::MeasurementManager ( ManagerParams params,
std::unique_ptr< SensorRing > sensor_ring )

Construct the manager from a pre-built SensorRing (expert-user constructor).

Parameters
[in]paramsManager configuration.
[in]sensor_ringFully configured SensorRing. Ownership is transferred.

Member Function Documentation

◆ depthSensors()

device::Group< device::DepthSensor > eduart::sensorring::manager::MeasurementManager::depthSensors ( ) const
noexcept

Return all depth sensors.

Returns
Group of depth sensors.

◆ getManagerState()

ManagerState eduart::sensorring::manager::MeasurementManager::getManagerState ( ) const
noexcept

Return the current health state of the state machine worker.

Returns
Current manager state.

◆ getParams()

ManagerParams eduart::sensorring::manager::MeasurementManager::getParams ( ) const
noexcept

Return the parameters used to initialize the manager.

Returns
Initial parameter struct.

◆ isMeasuring()

bool eduart::sensorring::manager::MeasurementManager::isMeasuring ( )
noexcept

Report whether the measurement worker thread is running.

Returns
true if the measurement thread is running.

◆ lights()

device::Group< device::Light > eduart::sensorring::manager::MeasurementManager::lights ( ) const
noexcept

Return all lights.

Returns
Group of lights.

◆ measureSome()

bool eduart::sensorring::manager::MeasurementManager::measureSome ( )
noexcept

Run one processing cycle of the state machine worker.

Returns
true on success.

◆ startMeasuring()

bool eduart::sensorring::manager::MeasurementManager::startMeasuring ( )
noexcept

Start the state machine worker loop in a dedicated thread.

Returns
true on success.

◆ stopMeasuring()

bool eduart::sensorring::manager::MeasurementManager::stopMeasuring ( )
noexcept

Stop the state machine worker loop and join the thread.

Returns
true on success.

◆ subscribeToStateChanges()

subscription::Subscription eduart::sensorring::manager::MeasurementManager::subscribeToStateChanges ( std::function< void(ManagerState state)> callback)

Subscribe to state changes; callback is invoked when the state changes.

Parameters
[in]callbackInvoked with the updated ManagerState.
Returns
RAII Subscription that auto-cancels on destruction.

◆ thermalSensors()

device::Group< device::ThermalSensor > eduart::sensorring::manager::MeasurementManager::thermalSensors ( ) const
noexcept

Return all thermal sensors.

Returns
Group of thermal sensors.

The documentation for this class was generated from the following file: