77 return d->messageIndex;
132 return d->totalElapsedTime;
143 return d->totalTimerTime;
154 return d->totalStrokes;
176 return d->swimStroke;
187 return d->avgSwimmingCadence;
198 return d->eventGroup;
209 return d->totalCalories;
220 return d->lengthType;
231 return d->playerScore;
242 return d->opponentScore;
255 return d->strokeCount;
474 , timestamp(static_cast<
DateTime>(-1))
475 , event(static_cast<
Event>(-1))
477 , startTime(static_cast<
DateTime>(-1))
478 , totalElapsedTime(0xFFFFFFFF)
479 , totalTimerTime(0xFFFFFFFF)
480 , totalStrokes(0xFFFF)
483 , avgSwimmingCadence(0xFF)
485 , totalCalories(0xFFFF)
487 , playerScore(0xFFFF)
488 , opponentScore(0xFFFF)
489 , strokeCount(0xFFFF)
506 const int fieldId,
const QByteArray &data,
const FitBaseType baseType,
const bool bigEndian)
510 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"length.messageIndex"))
return false;
511 this->
messageIndex =
static_cast<MessageIndex>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
514 if (!
verify(data, baseType, 4, FitBaseType::Uint32,
"length.timestamp"))
return false;
515 this->
timestamp =
static_cast<DateTime>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
518 if (!
verify(data, baseType, 1, FitBaseType::Enum,
"length.event"))
return false;
519 this->
event =
static_cast<Event>(data.at(0));
522 if (!
verify(data, baseType, 1, FitBaseType::Enum,
"length.eventType"))
return false;
526 if (!
verify(data, baseType, 4, FitBaseType::Uint32,
"length.startTime"))
return false;
527 this->
startTime =
static_cast<DateTime>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
530 if (!
verify(data, baseType, 4, FitBaseType::Uint32,
"length.totalElapsedTime"))
return false;
531 this->
totalElapsedTime =
static_cast<quint32
>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
534 if (!
verify(data, baseType, 4, FitBaseType::Uint32,
"length.totalTimerTime"))
return false;
535 this->
totalTimerTime =
static_cast<quint32
>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
538 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"length.totalStrokes"))
return false;
539 this->
totalStrokes =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
542 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"length.avgSpeed"))
return false;
543 this->
avgSpeed =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
546 if (!
verify(data, baseType, 1, FitBaseType::Enum,
"length.swimStroke"))
return false;
550 if (!
verify(data, baseType, 1, FitBaseType::Uint8,
"length.avgSwimmingCadence"))
return false;
554 if (!
verify(data, baseType, 1, FitBaseType::Uint8,
"length.eventGroup"))
return false;
555 this->
eventGroup =
static_cast<quint8
>(data.at(0));
558 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"length.totalCalories"))
return false;
559 this->
totalCalories =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
562 if (!
verify(data, baseType, 1, FitBaseType::Enum,
"length.lengthType"))
return false;
566 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"length.playerScore"))
return false;
567 this->
playerScore =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
570 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"length.opponentScore"))
return false;
571 this->
opponentScore =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
574 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"length.strokeCount"))
return false;
575 this->
strokeCount =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
578 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"length.zoneCount"))
return false;
579 this->
zoneCount =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
582 qWarning() <<
"ignoring unknown length message field number" << fieldId << bigEndian;
#define QTFIT_END_NAMESPACE
Macro for ending the QtFit library's top-most namespace (if one is defined).
#define QTFIT_BEGIN_NAMESPACE
Macro for starting the QtFit library's top-most namespace (if one is defined).
MesgNum globalMessageNumber
FIT Globla Message Number for this FIT Data Message.
bool verify(const QByteArray &data, const FitBaseType actualType, const int expectedSize, const FitBaseType expectedType, const char *messageFieldName)
The AbstractDataMessage class is the polymorphic base class for all FIT Data Message classes.
bool setField(const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian) override
quint16 totalStrokes
The LengthMessage FIT message's totalStrokes field.
EventType eventType
The LengthMessage FIT message's eventType field.
quint8 avgSwimmingCadence
The LengthMessage FIT message's avgSwimmingCadence field.
quint16 totalCalories
The LengthMessage FIT message's totalCalories field.
quint16 opponentScore
The LengthMessage FIT message's opponentScore field.
SwimStroke swimStroke
The LengthMessage FIT message's swimStroke field.
quint16 avgSpeed
The LengthMessage FIT message's avgSpeed field.
DateTime timestamp
The LengthMessage FIT message's timestamp field.
LengthType lengthType
The LengthMessage FIT message's lengthType field.
DateTime startTime
The LengthMessage FIT message's startTime field.
quint16 playerScore
The LengthMessage FIT message's playerScore field.
quint16 zoneCount
The LengthMessage FIT message's zoneCount field.
quint32 totalElapsedTime
The LengthMessage FIT message's totalElapsedTime field.
quint16 strokeCount
The LengthMessage FIT message's strokeCount field.
quint8 eventGroup
The LengthMessage FIT message's eventGroup field.
virtual ~LengthMessagePrivate()
MessageIndex messageIndex
The LengthMessage FIT message's messageIndex field.
quint32 totalTimerTime
The LengthMessage FIT message's totalTimerTime field.
The LengthMessage class represents a FIT LengthMessage data message.
void setOpponentScore(const quint16 opponentScore)
Sets the opponentScore field to opponentScore.
quint16 opponentScore() const
Returns the LengthMessage data message's opponentScore field's current value.
quint16 avgSpeed() const
Returns the LengthMessage data message's avgSpeed field's current value.
Event event() const
Returns the LengthMessage data message's event field's current value.
EventType eventType() const
Returns the LengthMessage data message's eventType field's current value.
LengthType lengthType() const
Returns the LengthMessage data message's lengthType field's current value.
void setEventType(const EventType eventType)
Sets the eventType field to eventType.
void setTotalTimerTime(const quint32 totalTimerTime)
Sets the totalTimerTime field to totalTimerTime.
quint16 playerScore() const
Returns the LengthMessage data message's playerScore field's current value.
void setAvgSpeed(const quint16 avgSpeed)
Sets the avgSpeed field to avgSpeed.
void setTotalStrokes(const quint16 totalStrokes)
Sets the totalStrokes field to totalStrokes.
void setEvent(const Event event)
Sets the event field to event.
void setAvgSwimmingCadence(const quint8 avgSwimmingCadence)
Sets the avgSwimmingCadence field to avgSwimmingCadence.
DateTime timestamp() const
Returns the LengthMessage data message's timestamp field's current value.
DateTime startTime() const
Returns the LengthMessage data message's startTime field's current value.
quint8 eventGroup() const
Returns the LengthMessage data message's eventGroup field's current value.
void setMessageIndex(const MessageIndex messageIndex)
Sets the messageIndex field to messageIndex.
void setSwimStroke(const SwimStroke swimStroke)
Sets the swimStroke field to swimStroke.
void setTotalCalories(const quint16 totalCalories)
Sets the totalCalories field to totalCalories.
quint16 totalStrokes() const
Returns the LengthMessage data message's totalStrokes field's current value.
quint32 totalTimerTime() const
Returns the LengthMessage data message's totalTimerTime field's current value.
void setTimestamp(const DateTime timestamp)
Sets the timestamp field to timestamp.
quint8 avgSwimmingCadence() const
Returns the LengthMessage data message's avgSwimmingCadence field's current value.
quint16 totalCalories() const
Returns the LengthMessage data message's totalCalories field's current value.
void setEventGroup(const quint8 eventGroup)
Sets the eventGroup field to eventGroup.
quint32 totalElapsedTime() const
Returns the LengthMessage data message's totalElapsedTime field's current value.
quint16 strokeCount() const
Returns the LengthMessage data message's strokeCount field's current value.
void setLengthType(const LengthType lengthType)
Sets the lengthType field to lengthType.
quint16 zoneCount() const
Returns the LengthMessage data message's zoneCount field's current value.
void setStartTime(const DateTime startTime)
Sets the startTime field to startTime.
LengthMessage()
Constructs a LengthMessage object.
void setTotalElapsedTime(const quint32 totalElapsedTime)
Sets the totalElapsedTime field to totalElapsedTime.
void setZoneCount(const quint16 zoneCount)
Sets the zoneCount field to zoneCount.
void setPlayerScore(const quint16 playerScore)
Sets the playerScore field to playerScore.
SwimStroke swimStroke() const
Returns the LengthMessage data message's swimStroke field's current value.
void setStrokeCount(const quint16 strokeCount)
Sets the strokeCount field to strokeCount.
MessageIndex messageIndex() const
Returns the LengthMessage data message's messageIndex field's current value.
Declares the LengthMessage class.
Declares the LengthMessagePrivate class.
SwimStroke
Garmin FIT SwimStroke type.
EventType
Garmin FIT EventType type.
Event
Garmin FIT Event type.
FitBaseType
Garmin FIT FitBaseType type.
MessageIndex
Garmin FIT MessageIndex type.
LengthType
Garmin FIT LengthType type.
DateTime
Seconds since UTC 00:00 Dec 31 1989.