Skip to main content

RtSensorStreamManager

Namespace: DISP3DLIB  ·  Library: 3D Display Library

#include <disp3D/rtsensorstreammanager.h>

class DISP3DLIB::RtSensorStreamManager

Manages real-time sensor data streaming via RtSensorDataController.

BrainView delegates all sensor streaming operations to this component, keeping its own code free of the RtSensorDataController lifecycle.

Real-time sensor streaming lifecycle manager.

Inheritance​


Public Methods​

RtSensorStreamManager(parent)​

Constructor.

Parameters:

  • parent : *QObject ** Parent QObject.

~RtSensorStreamManager()​

Destructor.


startStreaming(modality, fieldMapper, surfaces)​

Start real-time sensor streaming for the given modality.

Reads mapping matrices, pick vectors, evoked data, and colourmap from the provided fieldMapper. Validates that the target surface key exists in surfaces.

Parameters:

  • modality : const QString & "MEG" or "EEG".

  • fieldMapper : const SensorFieldMapper & Sensor-field mapper with built mapping data.

  • surfaces : const QMap< QString, std::shared_ptr< BrainSurface > > & FsSurface map for target-surface validation.

Returns:

  • bool — true if streaming was started successfully.

stopStreaming()​

Stop real-time sensor streaming.


isStreaming()​

Returns:

  • bool — true while real-time sensor streaming is active.

modality()​

Returns:

  • QString — the active modality ("MEG" or "EEG"), or empty.

pushData(data)​

Push a single measurement vector into the streaming queue.

Parameters:

  • data : const Eigen::VectorXf & One sample of sensor values; ignored if no controller exists.

setInterval(msec)​

Set the streaming playback interval in milliseconds.

Parameters:

  • msec : int Interval between streamed samples in milliseconds.

setLooping(enabled)​

Enable or disable looping of the streaming queue.

Parameters:

  • enabled : bool True to replay the queue from the start when it ends.

setAverages(numAvr)​

Set the number of averages for smoothing.

Parameters:

  • numAvr : int Number of consecutive samples averaged per frame.

setColormap(name)​

Set the colormap used for colour mapping.

Parameters:

  • name : const QString & Colormap name (e.g. "MNE", "Jet").

Example​

No example of its own: Real-time sensor streaming state owned privately by BrainView; exercised through BrainView's streaming API (test_disp3d_brainview, test_sensor_streaming).

It is exercised by:

src/examples/ex_disp3d_scene/main.cpp
BrainView view; // QRhi widget; nothing is rendered until it is shown
view.setViewCount(2);
const bool twoPanes = view.viewCount() == 2 && view.viewMode() == BrainView::MultiView;
LiveMarker trackerTip;
trackerTip.position = QVector3D(0.0f, 0.08f, 0.04f);
trackerTip.color = Qt::yellow;
view.setLiveMarkers({trackerTip}); // transient, does not move the camera
view.clearLiveMarkers();
view.setViewCount(1);

From ex_disp3d_scene.

Authors of this file​