77 return d->messageIndex;
165 return d->targetValue;
176 return d->recurrence;
187 return d->recurrenceValue;
365 , sport(static_cast<
Sport>(-1))
366 , subSport(static_cast<
SubSport>(-1))
367 , startDate(static_cast<
DateTime>(-1))
368 , endDate(static_cast<
DateTime>(-1))
369 , type(static_cast<
Goal>(-1))
371 , repeat(static_cast<bool>(-1))
372 , targetValue(0xFFFFFFFF)
374 , recurrenceValue(0xFFFF)
375 , enabled(static_cast<bool>(-1))
392 const int fieldId,
const QByteArray &data,
const FitBaseType baseType,
const bool bigEndian)
396 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"goal.messageIndex"))
return false;
397 this->
messageIndex =
static_cast<MessageIndex>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
400 if (!
verify(data, baseType, 1, FitBaseType::Enum,
"goal.sport"))
return false;
404 if (!
verify(data, baseType, 1, FitBaseType::Enum,
"goal.subSport"))
return false;
408 if (!
verify(data, baseType, 4, FitBaseType::Uint32,
"goal.startDate"))
return false;
409 this->
startDate =
static_cast<DateTime>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
412 if (!
verify(data, baseType, 4, FitBaseType::Uint32,
"goal.endDate"))
return false;
413 this->
endDate =
static_cast<DateTime>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
416 if (!
verify(data, baseType, 1, FitBaseType::Enum,
"goal.type"))
return false;
417 this->
type =
static_cast<Goal>(data.at(0));
420 if (!
verify(data, baseType, 4, FitBaseType::Uint32,
"goal.value"))
return false;
421 this->
value =
static_cast<quint32
>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
424 if (!
verify(data, baseType, 0, FitBaseType::Byte,
"goal.repeat"))
return false;
425 this->
repeat =
static_cast<bool>(data.at(0));
428 if (!
verify(data, baseType, 4, FitBaseType::Uint32,
"goal.targetValue"))
return false;
429 this->
targetValue =
static_cast<quint32
>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
432 if (!
verify(data, baseType, 1, FitBaseType::Enum,
"goal.recurrence"))
return false;
436 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"goal.recurrenceValue"))
return false;
437 this->
recurrenceValue =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
440 if (!
verify(data, baseType, 0, FitBaseType::Byte,
"goal.enabled"))
return false;
441 this->
enabled =
static_cast<bool>(data.at(0));
444 if (!
verify(data, baseType, 1, FitBaseType::Enum,
"goal.source"))
return false;
448 qWarning() <<
"ignoring unknown goal 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 targetValue
The GoalMessage FIT message's targetValue field.
SubSport subSport
The GoalMessage FIT message's subSport field.
DateTime startDate
The GoalMessage FIT message's startDate field.
MessageIndex messageIndex
The GoalMessage FIT message's messageIndex field.
quint32 value
The GoalMessage FIT message's value field.
GoalSource source
The GoalMessage FIT message's source field.
GoalRecurrence recurrence
The GoalMessage FIT message's recurrence field.
virtual ~GoalMessagePrivate()
Sport sport
The GoalMessage FIT message's sport field.
DateTime endDate
The GoalMessage FIT message's endDate field.
quint16 recurrenceValue
The GoalMessage FIT message's recurrenceValue field.
Goal type
The GoalMessage FIT message's type field.
bool setField(const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian) override
bool enabled
The GoalMessage FIT message's enabled field.
bool repeat
The GoalMessage FIT message's repeat field.
The GoalMessage class represents a FIT GoalMessage data message.
GoalRecurrence recurrence() const
Returns the GoalMessage data message's recurrence field's current value.
GoalMessage()
Constructs a GoalMessage object.
MessageIndex messageIndex() const
Returns the GoalMessage data message's messageIndex field's current value.
bool enabled() const
Returns the GoalMessage data message's enabled field's current value.
void setEndDate(const DateTime endDate)
Sets the endDate field to endDate.
quint32 targetValue() const
Returns the GoalMessage data message's targetValue field's current value.
DateTime startDate() const
Returns the GoalMessage data message's startDate field's current value.
Sport sport() const
Returns the GoalMessage data message's sport field's current value.
GoalSource source() const
Returns the GoalMessage data message's source field's current value.
bool repeat() const
Returns the GoalMessage data message's repeat field's current value.
quint32 value() const
Returns the GoalMessage data message's value field's current value.
void setSport(const Sport sport)
Sets the sport field to sport.
void setSource(const GoalSource source)
Sets the source field to source.
Goal type() const
Returns the GoalMessage data message's type field's current value.
quint16 recurrenceValue() const
Returns the GoalMessage data message's recurrenceValue field's current value.
SubSport subSport() const
Returns the GoalMessage data message's subSport field's current value.
void setRecurrenceValue(const quint16 recurrenceValue)
Sets the recurrenceValue field to recurrenceValue.
void setTargetValue(const quint32 targetValue)
Sets the targetValue field to targetValue.
void setEnabled(const bool enabled)
Sets the enabled field to enabled.
void setMessageIndex(const MessageIndex messageIndex)
Sets the messageIndex field to messageIndex.
void setSubSport(const SubSport subSport)
Sets the subSport field to subSport.
void setValue(const quint32 value)
Sets the value field to value.
void setType(const Goal type)
Sets the type field to type.
void setStartDate(const DateTime startDate)
Sets the startDate field to startDate.
DateTime endDate() const
Returns the GoalMessage data message's endDate field's current value.
void setRepeat(const bool repeat)
Sets the repeat field to repeat.
void setRecurrence(const GoalRecurrence recurrence)
Sets the recurrence field to recurrence.
Declares the GoalMessage class.
Declares the GoalMessagePrivate class.
Goal
Garmin FIT Goal type.
FitBaseType
Garmin FIT FitBaseType type.
GoalRecurrence
Garmin FIT GoalRecurrence type.
Sport
Garmin FIT Sport type.
GoalSource
Garmin FIT GoalSource type.
MessageIndex
Garmin FIT MessageIndex type.
SubSport
Garmin FIT SubSport type.
DateTime
Seconds since UTC 00:00 Dec 31 1989.