92 return d->timestampMs;
107 return d->sampleTimeOffset;
162 return d->calibratedGyroX;
175 return d->calibratedGyroY;
188 return d->calibratedGyroZ;
303 , timestamp(static_cast<
DateTime>(-1))
304 , timestampMs(0xFFFF)
305 , sampleTimeOffset(0xFFFF)
309 , calibratedGyroX(static_cast<float>(-1))
310 , calibratedGyroY(static_cast<float>(-1))
311 , calibratedGyroZ(static_cast<float>(-1))
327 const int fieldId,
const QByteArray &data,
const FitBaseType baseType,
const bool bigEndian)
331 if (!
verify(data, baseType, 4, FitBaseType::Uint32,
"gyroscope_data.timestamp"))
return false;
332 this->
timestamp =
static_cast<DateTime>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
335 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"gyroscope_data.timestampMs"))
return false;
336 this->
timestampMs =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
339 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"gyroscope_data.sampleTimeOffset"))
return false;
340 this->
sampleTimeOffset =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
343 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"gyroscope_data.gyroX"))
return false;
344 this->
gyroX =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
347 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"gyroscope_data.gyroY"))
return false;
348 this->
gyroY =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
351 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"gyroscope_data.gyroZ"))
return false;
352 this->
gyroZ =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
355 if (!
verify(data, baseType, 4, FitBaseType::Float32,
"gyroscope_data.calibratedGyroX"))
return false;
356 #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
358 const quint32 localEndian = bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data);
359 static_assert(
sizeof(localEndian) == 4,
"src not expected size");
360 static_assert(
sizeof(this->
calibratedGyroX) == 4,
"src and dst not the same size");
364 this->
calibratedGyroX =
static_cast<float>(bigEndian ? qFromBigEndian<float>(data) : qFromLittleEndian<float>(data));
368 if (!
verify(data, baseType, 4, FitBaseType::Float32,
"gyroscope_data.calibratedGyroY"))
return false;
369 #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
371 const quint32 localEndian = bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data);
372 static_assert(
sizeof(localEndian) == 4,
"src not expected size");
373 static_assert(
sizeof(this->
calibratedGyroY) == 4,
"src and dst not the same size");
377 this->
calibratedGyroY =
static_cast<float>(bigEndian ? qFromBigEndian<float>(data) : qFromLittleEndian<float>(data));
381 if (!
verify(data, baseType, 4, FitBaseType::Float32,
"gyroscope_data.calibratedGyroZ"))
return false;
382 #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
384 const quint32 localEndian = bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data);
385 static_assert(
sizeof(localEndian) == 4,
"src not expected size");
386 static_assert(
sizeof(this->
calibratedGyroZ) == 4,
"src and dst not the same size");
390 this->
calibratedGyroZ =
static_cast<float>(bigEndian ? qFromBigEndian<float>(data) : qFromLittleEndian<float>(data));
394 qWarning() <<
"ignoring unknown gyroscope_data 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.
virtual ~GyroscopeDataMessagePrivate()
quint16 gyroX
The GyroscopeDataMessage FIT message's gyroX field.
bool setField(const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian) override
quint16 gyroY
The GyroscopeDataMessage FIT message's gyroY field.
DateTime timestamp
The GyroscopeDataMessage FIT message's timestamp field.
float calibratedGyroX
The GyroscopeDataMessage FIT message's calibratedGyroX field.
float calibratedGyroY
The GyroscopeDataMessage FIT message's calibratedGyroY field.
quint16 sampleTimeOffset
The GyroscopeDataMessage FIT message's sampleTimeOffset field.
quint16 gyroZ
The GyroscopeDataMessage FIT message's gyroZ field.
quint16 timestampMs
The GyroscopeDataMessage FIT message's timestampMs field.
float calibratedGyroZ
The GyroscopeDataMessage FIT message's calibratedGyroZ field.
The GyroscopeDataMessage class represents a FIT GyroscopeDataMessage data message.
quint16 sampleTimeOffset() const
Returns the GyroscopeDataMessage data message's sampleTimeOffset field's current value.
void setTimestampMs(const quint16 timestampMs)
Sets the timestampMs field to timestampMs.
void setCalibratedGyroZ(const float calibratedGyroZ)
Sets the calibratedGyroZ field to calibratedGyroZ.
quint16 gyroX() const
Returns the GyroscopeDataMessage data message's gyroX field's current value.
void setGyroX(const quint16 gyroX)
Sets the gyroX field to gyroX.
void setCalibratedGyroY(const float calibratedGyroY)
Sets the calibratedGyroY field to calibratedGyroY.
void setGyroY(const quint16 gyroY)
Sets the gyroY field to gyroY.
void setGyroZ(const quint16 gyroZ)
Sets the gyroZ field to gyroZ.
void setSampleTimeOffset(const quint16 sampleTimeOffset)
Sets the sampleTimeOffset field to sampleTimeOffset.
DateTime timestamp() const
Returns the GyroscopeDataMessage data message's timestamp field's current value.
void setTimestamp(const DateTime timestamp)
Sets the timestamp field to timestamp.
float calibratedGyroY() const
Returns the GyroscopeDataMessage data message's calibratedGyroY field's current value.
void setCalibratedGyroX(const float calibratedGyroX)
Sets the calibratedGyroX field to calibratedGyroX.
float calibratedGyroZ() const
Returns the GyroscopeDataMessage data message's calibratedGyroZ field's current value.
GyroscopeDataMessage()
Constructs a GyroscopeDataMessage object.
float calibratedGyroX() const
Returns the GyroscopeDataMessage data message's calibratedGyroX field's current value.
quint16 gyroZ() const
Returns the GyroscopeDataMessage data message's gyroZ field's current value.
quint16 timestampMs() const
Returns the GyroscopeDataMessage data message's timestampMs field's current value.
quint16 gyroY() const
Returns the GyroscopeDataMessage data message's gyroY field's current value.
Declares the GyroscopeDataMessage class.
Declares the GyroscopeDataMessagePrivate class.
FitBaseType
Garmin FIT FitBaseType type.
DateTime
Seconds since UTC 00:00 Dec 31 1989.