FastrakSample
Namespace: UTILSLIB · Library: Utilities Library
#include <utils/fastrak_parser.h>
struct UTILSLIB::FastrakSample
One decoded sample from a Fastrak ASCII stream.
src/examples/ex_utils/main.cpp
FastrakParser parser;
parser.setUnits(FastrakParser::Units::Centimetres);
parser.append("01 12.50 -3.25 8.00\r\n02 1.0"); // the second record is still incomplete
FastrakSample sample;
const bool complete = parser.nextSample(sample);
const bool pending = parser.nextSample(sample);
Example
- Full source:
src/examples/ex_utils/main.cpp - Build target:
ex_utils(runs under CTest)
Used in examples
ex_utils
Utilities library: buffers, observers, logging, file formats, montages, layouts and reports.
src/examples/ex_utils/main.cpp, line 254
FastrakParser parser;
parser.setUnits(FastrakParser::Units::Centimetres);
parser.append("01 12.50 -3.25 8.00\r\n02 1.0"); // the second record is still incomplete
FastrakSample sample;
const bool complete = parser.nextSample(sample);
const bool pending = parser.nextSample(sample);
ok &= expect(complete && !pending && sample.station == 1 && std::fabs(sample.position.x() - 0.125f) < 1e-6f && std::fabs(sample.position.y() + 0.0325f) < 1e-6f,
"FastrakParser converts centimetres to metres and waits for the partial record");
Authors of this file
- Christoph Dinh <christoph.dinh@mne-cpp.org>