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

Public Member Functions

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

Public Attributes

MessageIndex messageIndex
 The SegmentPointMessage FIT message's messageIndex field.
 
qint32 positionLat
 The SegmentPointMessage FIT message's positionLat field.
 
qint32 positionLong
 The SegmentPointMessage FIT message's positionLong field.
 
quint32 distance
 The SegmentPointMessage FIT message's distance field. More...
 
quint16 altitude
 The SegmentPointMessage FIT message's altitude field. More...
 
quint32 leaderTime
 The SegmentPointMessage FIT message's leaderTime 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 SegmentPointMessagePrivate class provides private implementation for the SegmentPointMessage.

See also
SegmentPointMessage

Definition at line 38 of file segmentpointmessage_p.h.

Constructor & Destructor Documentation

◆ SegmentPointMessagePrivate()

SegmentPointMessagePrivate::SegmentPointMessagePrivate ( SegmentPointMessage *const  q)
explicit

Constructs a SegmentPointMessagePrivate object with public implementation q.

Parameters
qPointer to public implementaton.

Definition at line 222 of file segmentpointmessage.cpp.

224  , messageIndex(static_cast<MessageIndex>(-1))
225  , positionLat(0x7FFFFFFF)
226  , positionLong(0x7FFFFFFF)
227  , distance(0xFFFFFFFF)
228  , altitude(0xFFFF)
229  , leaderTime(0xFFFFFFFF)
230 {
231  globalMessageNumber = MesgNum::SegmentPoint;
232 }
MesgNum globalMessageNumber
FIT Globla Message Number for this FIT Data Message.
quint32 distance
The SegmentPointMessage FIT message's distance field.
quint32 leaderTime
The SegmentPointMessage FIT message's leaderTime field.
qint32 positionLat
The SegmentPointMessage FIT message's positionLat field.
quint16 altitude
The SegmentPointMessage FIT message's altitude field.
qint32 positionLong
The SegmentPointMessage FIT message's positionLong field.
MessageIndex messageIndex
The SegmentPointMessage FIT message's messageIndex field.
MessageIndex
Garmin FIT MessageIndex type.
Definition: types.h:263

References AbstractDataMessagePrivate::globalMessageNumber.

◆ ~SegmentPointMessagePrivate()

SegmentPointMessagePrivate::~SegmentPointMessagePrivate ( )
virtual

Destroys the SegmentPointMessagePrivate object.

Definition at line 239 of file segmentpointmessage.cpp.

240 {
241 
242 }

Member Function Documentation

◆ setField()

bool SegmentPointMessagePrivate::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 244 of file segmentpointmessage.cpp.

246 {
247  switch (fieldId) {
248  case 254: // See Profile.xlsx::Messages:segment_point.messageIndex
249  if (!verify(data, baseType, 2, FitBaseType::Uint16, "segment_point.messageIndex")) return false;
250  this->messageIndex = static_cast<MessageIndex>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
251  break;
252  case 1: // See Profile.xlsx::Messages:segment_point.positionLat
253  if (!verify(data, baseType, 4, FitBaseType::Sint32, "segment_point.positionLat")) return false;
254  this->positionLat = static_cast<qint32>(bigEndian ? qFromBigEndian< qint32>(data) : qFromLittleEndian< qint32>(data));
255  break;
256  case 2: // See Profile.xlsx::Messages:segment_point.positionLong
257  if (!verify(data, baseType, 4, FitBaseType::Sint32, "segment_point.positionLong")) return false;
258  this->positionLong = static_cast<qint32>(bigEndian ? qFromBigEndian< qint32>(data) : qFromLittleEndian< qint32>(data));
259  break;
260  case 3: // See Profile.xlsx::Messages:segment_point.distance
261  if (!verify(data, baseType, 4, FitBaseType::Uint32, "segment_point.distance")) return false;
262  this->distance = static_cast<quint32>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
263  break;
264  case 4: // See Profile.xlsx::Messages:segment_point.altitude
265  if (!verify(data, baseType, 2, FitBaseType::Uint16, "segment_point.altitude")) return false;
266  this->altitude = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
267  break;
268  case 5: // See Profile.xlsx::Messages:segment_point.leaderTime
269  if (!verify(data, baseType, 4, FitBaseType::Uint32, "segment_point.leaderTime")) return false;
270  this->leaderTime = static_cast<quint32>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
271  break;
272  default:
273  qWarning() << "ignoring unknown segment_point message field number" << fieldId << bigEndian;
274  // Fall through to return true, as its still 'safe' to continue parsing data messages.
275  }
276  return true;
277 }
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

◆ altitude

quint16 SegmentPointMessagePrivate::altitude

The SegmentPointMessage FIT message's altitude field.

Accumulated altitude along the segment at the described point

Definition at line 68 of file segmentpointmessage_p.h.

◆ distance

quint32 SegmentPointMessagePrivate::distance

The SegmentPointMessage FIT message's distance field.

Accumulated distance along the segment at the described point

Definition at line 61 of file segmentpointmessage_p.h.

◆ leaderTime

quint32 SegmentPointMessagePrivate::leaderTime

The SegmentPointMessage FIT message's leaderTime field.

Accumualted time each leader board member required to reach the described point. This value is zero for all leader board members at the starting point of the segment.

Definition at line 76 of file segmentpointmessage_p.h.


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