145 return d->positionLat;
156 return d->positionLong;
178 return d->enhancedSpeed;
303 , timestamp(static_cast<
DateTime>(-1))
304 , distance(static_cast<float>(-1))
305 , height(static_cast<float>(-1))
307 , hangTime(static_cast<float>(-1))
308 , score(static_cast<float>(-1))
309 , positionLat(0x7FFFFFFF)
310 , positionLong(0x7FFFFFFF)
312 , enhancedSpeed(0xFFFFFFFF)
328 const int fieldId,
const QByteArray &data,
const FitBaseType baseType,
const bool bigEndian)
332 if (!
verify(data, baseType, 4, FitBaseType::Uint32,
"jump.timestamp"))
return false;
333 this->
timestamp =
static_cast<DateTime>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
336 if (!
verify(data, baseType, 4, FitBaseType::Float32,
"jump.distance"))
return false;
337 #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
339 const quint32 localEndian = bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data);
340 static_assert(
sizeof(localEndian) == 4,
"src not expected size");
341 static_assert(
sizeof(this->
distance) == 4,
"src and dst not the same size");
342 memcpy(&this->
distance, &localEndian, data.size());
345 this->
distance =
static_cast<float>(bigEndian ? qFromBigEndian<float>(data) : qFromLittleEndian<float>(data));
349 if (!
verify(data, baseType, 4, FitBaseType::Float32,
"jump.height"))
return false;
350 #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
352 const quint32 localEndian = bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data);
353 static_assert(
sizeof(localEndian) == 4,
"src not expected size");
354 static_assert(
sizeof(this->
height) == 4,
"src and dst not the same size");
355 memcpy(&this->
height, &localEndian, data.size());
358 this->
height =
static_cast<float>(bigEndian ? qFromBigEndian<float>(data) : qFromLittleEndian<float>(data));
362 if (!
verify(data, baseType, 1, FitBaseType::Uint8,
"jump.rotations"))
return false;
363 this->
rotations =
static_cast<quint8
>(data.at(0));
366 if (!
verify(data, baseType, 4, FitBaseType::Float32,
"jump.hangTime"))
return false;
367 #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
369 const quint32 localEndian = bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data);
370 static_assert(
sizeof(localEndian) == 4,
"src not expected size");
371 static_assert(
sizeof(this->
hangTime) == 4,
"src and dst not the same size");
372 memcpy(&this->
hangTime, &localEndian, data.size());
375 this->
hangTime =
static_cast<float>(bigEndian ? qFromBigEndian<float>(data) : qFromLittleEndian<float>(data));
379 if (!
verify(data, baseType, 4, FitBaseType::Float32,
"jump.score"))
return false;
380 #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
382 const quint32 localEndian = bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data);
383 static_assert(
sizeof(localEndian) == 4,
"src not expected size");
384 static_assert(
sizeof(this->
score) == 4,
"src and dst not the same size");
385 memcpy(&this->
score, &localEndian, data.size());
388 this->
score =
static_cast<float>(bigEndian ? qFromBigEndian<float>(data) : qFromLittleEndian<float>(data));
392 if (!
verify(data, baseType, 4, FitBaseType::Sint32,
"jump.positionLat"))
return false;
393 this->
positionLat =
static_cast<qint32
>(bigEndian ? qFromBigEndian< qint32>(data) : qFromLittleEndian< qint32>(data));
396 if (!
verify(data, baseType, 4, FitBaseType::Sint32,
"jump.positionLong"))
return false;
397 this->
positionLong =
static_cast<qint32
>(bigEndian ? qFromBigEndian< qint32>(data) : qFromLittleEndian< qint32>(data));
400 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"jump.speed"))
return false;
401 this->
speed =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
404 if (!
verify(data, baseType, 4, FitBaseType::Uint32,
"jump.enhancedSpeed"))
return false;
405 this->
enhancedSpeed =
static_cast<quint32
>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
408 qWarning() <<
"ignoring unknown jump 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.
float score
The JumpMessage FIT message's score field.
quint32 enhancedSpeed
The JumpMessage FIT message's enhancedSpeed field.
float height
The JumpMessage FIT message's height field.
quint8 rotations
The JumpMessage FIT message's rotations field.
float distance
The JumpMessage FIT message's distance field.
qint32 positionLong
The JumpMessage FIT message's positionLong field.
float hangTime
The JumpMessage FIT message's hangTime field.
quint16 speed
The JumpMessage FIT message's speed field.
qint32 positionLat
The JumpMessage FIT message's positionLat field.
virtual ~JumpMessagePrivate()
DateTime timestamp
The JumpMessage FIT message's timestamp field.
bool setField(const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian) override
The JumpMessage class represents a FIT JumpMessage data message.
void setDistance(const float distance)
Sets the distance field to distance.
void setHangTime(const float hangTime)
Sets the hangTime field to hangTime.
float score() const
Returns the JumpMessage data message's score field's current value.
quint32 enhancedSpeed() const
Returns the JumpMessage data message's enhancedSpeed field's current value.
DateTime timestamp() const
Returns the JumpMessage data message's timestamp field's current value.
void setRotations(const quint8 rotations)
Sets the rotations field to rotations.
quint8 rotations() const
Returns the JumpMessage data message's rotations field's current value.
float height() const
Returns the JumpMessage data message's height field's current value.
float distance() const
Returns the JumpMessage data message's distance field's current value.
void setSpeed(const quint16 speed)
Sets the speed field to speed.
void setTimestamp(const DateTime timestamp)
Sets the timestamp field to timestamp.
qint32 positionLong() const
Returns the JumpMessage data message's positionLong field's current value.
JumpMessage()
Constructs a JumpMessage object.
qint32 positionLat() const
Returns the JumpMessage data message's positionLat field's current value.
void setEnhancedSpeed(const quint32 enhancedSpeed)
Sets the enhancedSpeed field to enhancedSpeed.
quint16 speed() const
Returns the JumpMessage data message's speed field's current value.
void setPositionLat(const qint32 positionLat)
Sets the positionLat field to positionLat.
void setPositionLong(const qint32 positionLong)
Sets the positionLong field to positionLong.
float hangTime() const
Returns the JumpMessage data message's hangTime field's current value.
void setHeight(const float height)
Sets the height field to height.
void setScore(const float score)
Sets the score field to score.
Declares the JumpMessage class.
Declares the JumpMessagePrivate class.
FitBaseType
Garmin FIT FitBaseType type.
DateTime
Seconds since UTC 00:00 Dec 31 1989.