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

Public Member Functions

 CameraEventMessagePrivate (CameraEventMessage *const q)
 
virtual ~CameraEventMessagePrivate ()
 
- 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 CameraEventMessage FIT message's timestamp field. More...
 
quint16 timestampMs
 The CameraEventMessage FIT message's timestampMs field. More...
 
CameraEventType cameraEventType
 The CameraEventMessage FIT message's cameraEventType field.
 
QString cameraFileUuid
 The CameraEventMessage FIT message's cameraFileUuid field.
 
CameraOrientationType cameraOrientation
 The CameraEventMessage FIT message's cameraOrientation field.
 
- 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 CameraEventMessagePrivate class provides private implementation for the CameraEventMessage.

See also
CameraEventMessage

Definition at line 38 of file cameraeventmessage_p.h.

Constructor & Destructor Documentation

◆ CameraEventMessagePrivate()

CameraEventMessagePrivate::CameraEventMessagePrivate ( CameraEventMessage *const  q)
explicit

Constructs a CameraEventMessagePrivate object with public implementation q.

Parameters
qPointer to public implementaton.

Definition at line 198 of file cameraeventmessage.cpp.

200  , timestamp(static_cast<DateTime>(-1))
201  , timestampMs(0xFFFF)
202  , cameraEventType(static_cast<CameraEventType>(-1))
203  , cameraOrientation(static_cast<CameraOrientationType>(-1))
204 {
205  globalMessageNumber = MesgNum::CameraEvent;
206 }
MesgNum globalMessageNumber
FIT Globla Message Number for this FIT Data Message.
DateTime timestamp
The CameraEventMessage FIT message's timestamp field.
CameraEventType cameraEventType
The CameraEventMessage FIT message's cameraEventType field.
CameraOrientationType cameraOrientation
The CameraEventMessage FIT message's cameraOrientation field.
quint16 timestampMs
The CameraEventMessage FIT message's timestampMs field.
CameraEventType
Garmin FIT CameraEventType type.
Definition: types.h:2931
CameraOrientationType
Garmin FIT CameraOrientationType type.
Definition: types.h:3004
DateTime
Seconds since UTC 00:00 Dec 31 1989.
Definition: types.h:237

References AbstractDataMessagePrivate::globalMessageNumber.

◆ ~CameraEventMessagePrivate()

CameraEventMessagePrivate::~CameraEventMessagePrivate ( )
virtual

Destroys the CameraEventMessagePrivate object.

Definition at line 213 of file cameraeventmessage.cpp.

214 {
215 
216 }

Member Function Documentation

◆ setField()

bool CameraEventMessagePrivate::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 218 of file cameraeventmessage.cpp.

220 {
221  switch (fieldId) {
222  case 253: // See Profile.xlsx::Messages:camera_event.timestamp
223  if (!verify(data, baseType, 4, FitBaseType::Uint32, "camera_event.timestamp")) return false;
224  this->timestamp = static_cast<DateTime>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
225  break;
226  case 0: // See Profile.xlsx::Messages:camera_event.timestampMs
227  if (!verify(data, baseType, 2, FitBaseType::Uint16, "camera_event.timestampMs")) return false;
228  this->timestampMs = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
229  break;
230  case 1: // See Profile.xlsx::Messages:camera_event.cameraEventType
231  if (!verify(data, baseType, 1, FitBaseType::Enum, "camera_event.cameraEventType")) return false;
232  this->cameraEventType = static_cast<CameraEventType>(data.at(0));
233  break;
234  case 2: // See Profile.xlsx::Messages:camera_event.cameraFileUuid
235  if (!verify(data, baseType, 1, FitBaseType::String, "camera_event.cameraFileUuid")) return false;
236  this->cameraFileUuid = QString::fromUtf8(data);
237  break;
238  case 3: // See Profile.xlsx::Messages:camera_event.cameraOrientation
239  if (!verify(data, baseType, 1, FitBaseType::Enum, "camera_event.cameraOrientation")) return false;
240  this->cameraOrientation = static_cast<CameraOrientationType>(data.at(0));
241  break;
242  default:
243  qWarning() << "ignoring unknown camera_event message field number" << fieldId << bigEndian;
244  // Fall through to return true, as its still 'safe' to continue parsing data messages.
245  }
246  return true;
247 }
bool verify(const QByteArray &data, const FitBaseType actualType, const int expectedSize, const FitBaseType expectedType, const char *messageFieldName)
QString cameraFileUuid
The CameraEventMessage FIT message's cameraFileUuid field.

References AbstractDataMessagePrivate::verify().

Here is the call graph for this function:

Member Data Documentation

◆ timestamp

DateTime CameraEventMessagePrivate::timestamp

The CameraEventMessage FIT message's timestamp field.

Whole second part of the timestamp.

Definition at line 46 of file cameraeventmessage_p.h.

◆ timestampMs

quint16 CameraEventMessagePrivate::timestampMs

The CameraEventMessage FIT message's timestampMs field.

Millisecond part of the timestamp.

Definition at line 53 of file cameraeventmessage_p.h.


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