103 return d->repetitions;
164 return d->categorySubtype;
175 return d->weightDisplayUnit;
186 return d->messageIndex;
197 return d->wktStepIndex;
332 , timestamp(static_cast<
DateTime>(-1))
333 , duration(0xFFFFFFFF)
334 , repetitions(0xFFFF)
336 , setType(static_cast<
SetType>(-1))
337 , startTime(static_cast<
DateTime>(-1))
339 , categorySubtype(0xFFFF)
358 const int fieldId,
const QByteArray &data,
const FitBaseType baseType,
const bool bigEndian)
362 if (!
verify(data, baseType, 4, FitBaseType::Uint32,
"set.timestamp"))
return false;
363 this->
timestamp =
static_cast<DateTime>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
366 if (!
verify(data, baseType, 4, FitBaseType::Uint32,
"set.duration"))
return false;
367 this->
duration =
static_cast<quint32
>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
370 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"set.repetitions"))
return false;
371 this->
repetitions =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
374 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"set.weight"))
return false;
375 this->
weight =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
378 if (!
verify(data, baseType, 1, FitBaseType::Uint8,
"set.setType"))
return false;
382 if (!
verify(data, baseType, 4, FitBaseType::Uint32,
"set.startTime"))
return false;
383 this->
startTime =
static_cast<DateTime>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
386 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"set.category"))
return false;
387 this->
category =
static_cast<ExerciseCategory>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
390 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"set.categorySubtype"))
return false;
391 this->
categorySubtype =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
394 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"set.weightDisplayUnit"))
return false;
398 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"set.messageIndex"))
return false;
399 this->
messageIndex =
static_cast<MessageIndex>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
402 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"set.wktStepIndex"))
return false;
403 this->
wktStepIndex =
static_cast<MessageIndex>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
406 qWarning() <<
"ignoring unknown set 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.
quint32 duration
The SetMessage FIT message's duration field.
bool setField(const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian) override
virtual ~SetMessagePrivate()
SetType setType
The SetMessage FIT message's setType field.
quint16 weight
The SetMessage FIT message's weight field.
MessageIndex wktStepIndex
The SetMessage FIT message's wktStepIndex field.
quint16 repetitions
The SetMessage FIT message's repetitions field.
quint16 categorySubtype
The SetMessage FIT message's categorySubtype field.
DateTime timestamp
The SetMessage FIT message's timestamp field.
FitBaseUnit weightDisplayUnit
The SetMessage FIT message's weightDisplayUnit field.
ExerciseCategory category
The SetMessage FIT message's category field.
DateTime startTime
The SetMessage FIT message's startTime field.
MessageIndex messageIndex
The SetMessage FIT message's messageIndex field.
The SetMessage class represents a FIT SetMessage data message.
void setWeightDisplayUnit(const FitBaseUnit weightDisplayUnit)
Sets the weightDisplayUnit field to weightDisplayUnit.
void setWktStepIndex(const MessageIndex wktStepIndex)
Sets the wktStepIndex field to wktStepIndex.
SetMessage()
Constructs a SetMessage object.
void setDuration(const quint32 duration)
Sets the duration field to duration.
DateTime timestamp() const
Returns the SetMessage data message's timestamp field's current value.
quint16 weight() const
Returns the SetMessage data message's weight field's current value.
MessageIndex messageIndex() const
Returns the SetMessage data message's messageIndex field's current value.
void setSetType(const SetType setType)
Sets the setType field to setType.
void setWeight(const quint16 weight)
Sets the weight field to weight.
void setTimestamp(const DateTime timestamp)
Sets the timestamp field to timestamp.
ExerciseCategory category() const
Returns the SetMessage data message's category field's current value.
void setStartTime(const DateTime startTime)
Sets the startTime field to startTime.
void setRepetitions(const quint16 repetitions)
Sets the repetitions field to repetitions.
void setMessageIndex(const MessageIndex messageIndex)
Sets the messageIndex field to messageIndex.
SetType setType() const
Returns the SetMessage data message's setType field's current value.
void setCategory(const ExerciseCategory category)
Sets the category field to category.
FitBaseUnit weightDisplayUnit() const
Returns the SetMessage data message's weightDisplayUnit field's current value.
quint16 repetitions() const
Returns the SetMessage data message's repetitions field's current value.
MessageIndex wktStepIndex() const
Returns the SetMessage data message's wktStepIndex field's current value.
quint32 duration() const
Returns the SetMessage data message's duration field's current value.
DateTime startTime() const
Returns the SetMessage data message's startTime field's current value.
void setCategorySubtype(const quint16 categorySubtype)
Sets the categorySubtype field to categorySubtype.
quint16 categorySubtype() const
Returns the SetMessage data message's categorySubtype field's current value.
Declares the SetMessage class.
Declares the SetMessagePrivate class.
SetType
Garmin FIT SetType type.
FitBaseType
Garmin FIT FitBaseType type.
ExerciseCategory
Garmin FIT ExerciseCategory type.
FitBaseUnit
Garmin FIT FitBaseUnit type.
MessageIndex
Garmin FIT MessageIndex type.
DateTime
Seconds since UTC 00:00 Dec 31 1989.