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

Public Member Functions

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

Public Attributes

Manufacturer manufacturer
 The ScheduleMessage FIT message's manufacturer field. More...
 
quint16 product
 The ScheduleMessage FIT message's product field. More...
 
quint32z serialNumber
 The ScheduleMessage FIT message's serialNumber field. More...
 
DateTime timeCreated
 The ScheduleMessage FIT message's timeCreated field. More...
 
bool completed
 The ScheduleMessage FIT message's completed field. More...
 
Schedule type
 The ScheduleMessage FIT message's type field.
 
LocalDateTime scheduledTime
 The ScheduleMessage FIT message's scheduledTime 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 ScheduleMessagePrivate class provides private implementation for the ScheduleMessage.

See also
ScheduleMessage

Definition at line 38 of file schedulemessage_p.h.

Constructor & Destructor Documentation

◆ ScheduleMessagePrivate()

ScheduleMessagePrivate::ScheduleMessagePrivate ( ScheduleMessage *const  q)
explicit

Constructs a ScheduleMessagePrivate object with public implementation q.

Parameters
qPointer to public implementaton.

Definition at line 246 of file schedulemessage.cpp.

248  , manufacturer(static_cast<Manufacturer>(-1))
249  , product(0xFFFF)
250  , serialNumber(0)
251  , timeCreated(static_cast<DateTime>(-1))
252  , completed(static_cast<bool>(-1))
253  , type(static_cast<Schedule>(-1))
254  , scheduledTime(static_cast<LocalDateTime>(-1))
255 {
256  globalMessageNumber = MesgNum::Schedule;
257 }
MesgNum globalMessageNumber
FIT Globla Message Number for this FIT Data Message.
quint32z serialNumber
The ScheduleMessage FIT message's serialNumber field.
quint16 product
The ScheduleMessage FIT message's product field.
bool completed
The ScheduleMessage FIT message's completed field.
Schedule type
The ScheduleMessage FIT message's type field.
DateTime timeCreated
The ScheduleMessage FIT message's timeCreated field.
LocalDateTime scheduledTime
The ScheduleMessage FIT message's scheduledTime field.
Manufacturer manufacturer
The ScheduleMessage FIT message's manufacturer field.
LocalDateTime
Seconds since 00:00 Dec 31 1989 in local time zone.
Definition: types.h:250
Schedule
Garmin FIT Schedule type.
Definition: types.h:1432
Manufacturer
Garmin FIT Manufacturer type.
Definition: types.h:1484
DateTime
Seconds since UTC 00:00 Dec 31 1989.
Definition: types.h:237

References AbstractDataMessagePrivate::globalMessageNumber.

◆ ~ScheduleMessagePrivate()

ScheduleMessagePrivate::~ScheduleMessagePrivate ( )
virtual

Destroys the ScheduleMessagePrivate object.

Definition at line 264 of file schedulemessage.cpp.

265 {
266 
267 }

Member Function Documentation

◆ setField()

bool ScheduleMessagePrivate::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 269 of file schedulemessage.cpp.

271 {
272  switch (fieldId) {
273  case 0: // See Profile.xlsx::Messages:schedule.manufacturer
274  if (!verify(data, baseType, 2, FitBaseType::Uint16, "schedule.manufacturer")) return false;
275  this->manufacturer = static_cast<Manufacturer>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
276  break;
277  case 1: // See Profile.xlsx::Messages:schedule.product
278  if (!verify(data, baseType, 2, FitBaseType::Uint16, "schedule.product")) return false;
279  this->product = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
280  break;
281  case 2: // See Profile.xlsx::Messages:schedule.serialNumber
282  if (!verify(data, baseType, 4, FitBaseType::Uint32z, "schedule.serialNumber")) return false;
283  this->serialNumber = static_cast<quint32z>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
284  break;
285  case 3: // See Profile.xlsx::Messages:schedule.timeCreated
286  if (!verify(data, baseType, 4, FitBaseType::Uint32, "schedule.timeCreated")) return false;
287  this->timeCreated = static_cast<DateTime>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
288  break;
289  case 4: // See Profile.xlsx::Messages:schedule.completed
290  if (!verify(data, baseType, 0, FitBaseType::Byte, "schedule.completed")) return false;
291  this->completed = static_cast<bool>(data.at(0));
292  break;
293  case 5: // See Profile.xlsx::Messages:schedule.type
294  if (!verify(data, baseType, 1, FitBaseType::Enum, "schedule.type")) return false;
295  this->type = static_cast<Schedule>(data.at(0));
296  break;
297  case 6: // See Profile.xlsx::Messages:schedule.scheduledTime
298  if (!verify(data, baseType, 4, FitBaseType::Uint32, "schedule.scheduledTime")) return false;
299  this->scheduledTime = static_cast<LocalDateTime>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
300  break;
301  default:
302  qWarning() << "ignoring unknown schedule message field number" << fieldId << bigEndian;
303  // Fall through to return true, as its still 'safe' to continue parsing data messages.
304  }
305  return true;
306 }
bool verify(const QByteArray &data, const FitBaseType actualType, const int expectedSize, const FitBaseType expectedType, const char *messageFieldName)
quint32 quint32z
32-bit unsigned integer, with 0-is-invalid semantics.
Definition: types.h:47

References AbstractDataMessagePrivate::verify().

Here is the call graph for this function:

Member Data Documentation

◆ completed

bool ScheduleMessagePrivate::completed

The ScheduleMessage FIT message's completed field.

TRUE if this activity has been started

Definition at line 74 of file schedulemessage_p.h.

◆ manufacturer

Manufacturer ScheduleMessagePrivate::manufacturer

The ScheduleMessage FIT message's manufacturer field.

Corresponds to file_id of scheduled workout / course.

Definition at line 46 of file schedulemessage_p.h.

◆ product

quint16 ScheduleMessagePrivate::product

The ScheduleMessage FIT message's product field.

Corresponds to file_id of scheduled workout / course.

Definition at line 53 of file schedulemessage_p.h.

◆ serialNumber

quint32z ScheduleMessagePrivate::serialNumber

The ScheduleMessage FIT message's serialNumber field.

Corresponds to file_id of scheduled workout / course.

Definition at line 60 of file schedulemessage_p.h.

◆ timeCreated

DateTime ScheduleMessagePrivate::timeCreated

The ScheduleMessage FIT message's timeCreated field.

Corresponds to file_id of scheduled workout / course.

Definition at line 67 of file schedulemessage_p.h.


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