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

Public Member Functions

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

Public Attributes

qint16 stressLevelValue
 The StressLevelMessage FIT message's stressLevelValue field.
 
DateTime stressLevelTime
 The StressLevelMessage FIT message's stressLevelTime 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 StressLevelMessagePrivate class provides private implementation for the StressLevelMessage.

See also
StressLevelMessage

Definition at line 38 of file stresslevelmessage_p.h.

Constructor & Destructor Documentation

◆ StressLevelMessagePrivate()

StressLevelMessagePrivate::StressLevelMessagePrivate ( StressLevelMessage *const  q)
explicit

Constructs a StressLevelMessagePrivate object with public implementation q.

Parameters
qPointer to public implementaton.

Definition at line 133 of file stresslevelmessage.cpp.

135  , stressLevelValue(0x7FFF)
136  , stressLevelTime(static_cast<DateTime>(-1))
137 {
138  globalMessageNumber = MesgNum::StressLevel;
139 }
MesgNum globalMessageNumber
FIT Globla Message Number for this FIT Data Message.
qint16 stressLevelValue
The StressLevelMessage FIT message's stressLevelValue field.
DateTime stressLevelTime
The StressLevelMessage FIT message's stressLevelTime field.
DateTime
Seconds since UTC 00:00 Dec 31 1989.
Definition: types.h:237

References AbstractDataMessagePrivate::globalMessageNumber.

◆ ~StressLevelMessagePrivate()

StressLevelMessagePrivate::~StressLevelMessagePrivate ( )
virtual

Destroys the StressLevelMessagePrivate object.

Definition at line 146 of file stresslevelmessage.cpp.

147 {
148 
149 }

Member Function Documentation

◆ setField()

bool StressLevelMessagePrivate::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 151 of file stresslevelmessage.cpp.

153 {
154  switch (fieldId) {
155  case 0: // See Profile.xlsx::Messages:stress_level.stressLevelValue
156  if (!verify(data, baseType, 2, FitBaseType::Sint16, "stress_level.stressLevelValue")) return false;
157  this->stressLevelValue = static_cast<qint16>(bigEndian ? qFromBigEndian< qint16>(data) : qFromLittleEndian< qint16>(data));
158  break;
159  case 1: // See Profile.xlsx::Messages:stress_level.stressLevelTime
160  if (!verify(data, baseType, 4, FitBaseType::Uint32, "stress_level.stressLevelTime")) return false;
161  this->stressLevelTime = static_cast<DateTime>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
162  break;
163  default:
164  qWarning() << "ignoring unknown stress_level message field number" << fieldId << bigEndian;
165  // Fall through to return true, as its still 'safe' to continue parsing data messages.
166  }
167  return true;
168 }
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

◆ stressLevelTime

DateTime StressLevelMessagePrivate::stressLevelTime

The StressLevelMessage FIT message's stressLevelTime field.

Time stress score was calculated

Definition at line 51 of file stresslevelmessage_p.h.


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