v2.0.0
Loading...
Searching...
No Matches
UTILSLIB::FastrakParser Class Reference

Streaming parser for Fastrak / FastSCAN ASCII records. More...

#include <fastrak_parser.h>

Public Types

enum class  Units { Inches , Centimetres }

Public Member Functions

 FastrakParser ()=default
void setUnits (Units units)
Units units () const
void append (const QByteArray &chunk)
bool nextSample (FastrakSample &out)
void reset ()

Static Public Member Functions

static bool parseRecord (const QByteArray &record, Units units, FastrakSample &out)

Detailed Description

Streaming parser for Fastrak / FastSCAN ASCII records.

Thread-affine: the caller is responsible for serialising calls. No heap allocations on the hot path other than the internal buffer.

Definition at line 71 of file fastrak_parser.h.

Member Enumeration Documentation

◆ Units

enum class UTILSLIB::FastrakParser::Units
strong
Enumerator
Inches 

Fastrak factory default.

Centimetres 

FastSCAN / G4 default.

Definition at line 74 of file fastrak_parser.h.

Constructor & Destructor Documentation

◆ FastrakParser()

UTILSLIB::FastrakParser::FastrakParser ( )
default

Member Function Documentation

◆ append()

void UTILSLIB::FastrakParser::append ( const QByteArray & chunk)
inline

Append raw bytes received from the serial port.

Definition at line 87 of file fastrak_parser.h.

◆ nextSample()

bool FastrakParser::nextSample ( FastrakSample & out)

Pop the next fully-decoded sample, if any.

Returns
true when out was populated; false when the buffer does not yet contain a complete record.

Definition at line 120 of file fastrak_parser.cpp.

◆ parseRecord()

bool FastrakParser::parseRecord ( const QByteArray & record,
Units units,
FastrakSample & out )
static

Parse one record line (without trailing CR/LF) — exposed for unit tests and for callers that pre-frame their data.

Returns
true on success; false on malformed input.

Definition at line 42 of file fastrak_parser.cpp.

◆ reset()

void UTILSLIB::FastrakParser::reset ( )
inline

Reset accumulated buffer state.

Definition at line 98 of file fastrak_parser.h.

◆ setUnits()

void UTILSLIB::FastrakParser::setUnits ( Units units)
inline

Configure the linear unit reported by the device.

Definition at line 82 of file fastrak_parser.h.

◆ units()

Units UTILSLIB::FastrakParser::units ( ) const
inline

Definition at line 84 of file fastrak_parser.h.


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