QtFit  0.1
Internal library development documentation
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
BarometerDataMessagePrivate Class Reference
Inheritance diagram for BarometerDataMessagePrivate:
[legend]
Collaboration diagram for BarometerDataMessagePrivate:
[legend]

Public Member Functions

 BarometerDataMessagePrivate (BarometerDataMessage *const q)
 
virtual ~BarometerDataMessagePrivate ()
 
- Public Member Functions inherited from AbstractDataMessagePrivate
 AbstractDataMessagePrivate (AbstractDataMessage *const q)
 
virtual ~AbstractDataMessagePrivate ()
 
bool setFields (const DataDefinition *const defn, const QByteArray &record)
 

Public Attributes

DateTime timestamp
 The BarometerDataMessage FIT message's timestamp field. More...
 
quint16 timestampMs
 The BarometerDataMessage FIT message's timestampMs field. More...
 
quint16 sampleTimeOffset
 The BarometerDataMessage FIT message's sampleTimeOffset field. More...
 
quint32 baroPres
 The BarometerDataMessage FIT message's baroPres field. More...
 
- Public Attributes inherited from AbstractDataMessagePrivate
MesgNum globalMessageNumber
 FIT Globla Message Number for this FIT Data Message.
 

Protected Member Functions

bool setField (const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian) override
 
- Protected Member Functions inherited from AbstractDataMessagePrivate
bool verify (const QByteArray &data, const FitBaseType actualType, const int expectedSize, const FitBaseType expectedType, const char *messageFieldName)
 

Additional Inherited Members

- Protected Attributes inherited from AbstractDataMessagePrivate
AbstractDataMessage *const q_ptr
 Internal q-pointer.
 

Detailed Description

The BarometerDataMessagePrivate class provides private implementation for the BarometerDataMessage.

See also
BarometerDataMessage

Definition at line 38 of file barometerdatamessage_p.h.

Constructor & Destructor Documentation

◆ BarometerDataMessagePrivate()

BarometerDataMessagePrivate::BarometerDataMessagePrivate ( BarometerDataMessage *const  q)
explicit

Constructs a BarometerDataMessagePrivate object with public implementation q.

Parameters
qPointer to public implementaton.

Definition at line 184 of file barometerdatamessage.cpp.

186  , timestamp(static_cast<DateTime>(-1))
187  , timestampMs(0xFFFF)
188  , sampleTimeOffset(0xFFFF)
189  , baroPres(0xFFFFFFFF)
190 {
191  globalMessageNumber = MesgNum::BarometerData;
192 }
MesgNum globalMessageNumber
FIT Globla Message Number for this FIT Data Message.
DateTime timestamp
The BarometerDataMessage FIT message's timestamp field.
quint16 sampleTimeOffset
The BarometerDataMessage FIT message's sampleTimeOffset field.
quint16 timestampMs
The BarometerDataMessage FIT message's timestampMs field.
quint32 baroPres
The BarometerDataMessage FIT message's baroPres field.
DateTime
Seconds since UTC 00:00 Dec 31 1989.
Definition: types.h:237

References AbstractDataMessagePrivate::globalMessageNumber.

◆ ~BarometerDataMessagePrivate()

BarometerDataMessagePrivate::~BarometerDataMessagePrivate ( )
virtual

Destroys the BarometerDataMessagePrivate object.

Definition at line 199 of file barometerdatamessage.cpp.

200 {
201 
202 }

Member Function Documentation

◆ setField()

bool BarometerDataMessagePrivate::setField ( const int  fieldId,
const QByteArray &  data,
const FitBaseType  baseType,
const bool  bigEndian 
)
overrideprotectedvirtual

Sets the value of the fieldId field.

Derived classes must implement this method to extract the baseType value from data, and assign the extracted value the fieldId field.

Parameters
fieldIdThe field number within the given FIT data message.
dataThe raw data to extract the field value from.
baseTypeThe FIT base type for the field.
bigEndianWhether or not multibyte values in record are big-endian.
Returns
true if the field was set, or safely ignored; false otherwise.

Implements AbstractDataMessagePrivate.

Definition at line 204 of file barometerdatamessage.cpp.

206 {
207  switch (fieldId) {
208  case 253: // See Profile.xlsx::Messages:barometer_data.timestamp
209  if (!verify(data, baseType, 4, FitBaseType::Uint32, "barometer_data.timestamp")) return false;
210  this->timestamp = static_cast<DateTime>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
211  break;
212  case 0: // See Profile.xlsx::Messages:barometer_data.timestampMs
213  if (!verify(data, baseType, 2, FitBaseType::Uint16, "barometer_data.timestampMs")) return false;
214  this->timestampMs = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
215  break;
216  case 1: // See Profile.xlsx::Messages:barometer_data.sampleTimeOffset
217  if (!verify(data, baseType, 2, FitBaseType::Uint16, "barometer_data.sampleTimeOffset")) return false;
218  this->sampleTimeOffset = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
219  break;
220  case 2: // See Profile.xlsx::Messages:barometer_data.baroPres
221  if (!verify(data, baseType, 4, FitBaseType::Uint32, "barometer_data.baroPres")) return false;
222  this->baroPres = static_cast<quint32>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
223  break;
224  default:
225  qWarning() << "ignoring unknown barometer_data message field number" << fieldId << bigEndian;
226  // Fall through to return true, as its still 'safe' to continue parsing data messages.
227  }
228  return true;
229 }
bool verify(const QByteArray &data, const FitBaseType actualType, const int expectedSize, const FitBaseType expectedType, const char *messageFieldName)

References AbstractDataMessagePrivate::verify().

Here is the call graph for this function:

Member Data Documentation

◆ baroPres

quint32 BarometerDataMessagePrivate::baroPres

The BarometerDataMessage FIT message's baroPres field.

These are the raw ADC reading. The samples may span across seconds. A conversion will need to be done on this data once read.

Definition at line 70 of file barometerdatamessage_p.h.

◆ sampleTimeOffset

quint16 BarometerDataMessagePrivate::sampleTimeOffset

The BarometerDataMessage FIT message's sampleTimeOffset field.

Each time in the array describes the time at which the barometer sample with the corrosponding index was taken. The samples may span across seconds. Array size must match the number of samples in baro_cal

Definition at line 62 of file barometerdatamessage_p.h.

◆ timestamp

DateTime BarometerDataMessagePrivate::timestamp

The BarometerDataMessage FIT message's timestamp field.

Whole second part of the timestamp

Definition at line 46 of file barometerdatamessage_p.h.

◆ timestampMs

quint16 BarometerDataMessagePrivate::timestampMs

The BarometerDataMessage FIT message's timestampMs field.

Millisecond part of the timestamp.

Definition at line 53 of file barometerdatamessage_p.h.


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