77 return d->messageIndex;
145 return d->waterDensity;
171 return d->po2Critical;
193 return d->safetyStopEnabled;
204 return d->bottomDepth;
215 return d->bottomTime;
226 return d->apneaCountdownEnabled;
237 return d->apneaCountdownTime;
248 return d->backlightMode;
259 return d->backlightBrightness;
270 return d->backlightTimeout;
283 return d->repeatDiveInterval;
296 return d->safetyStopTime;
307 return d->heartRateSourceType;
318 return d->heartRateSource;
568 , waterDensity(static_cast<float>(-1))
572 , safetyStopEnabled(static_cast<bool>(-1))
573 , bottomDepth(static_cast<float>(-1))
574 , bottomTime(0xFFFFFFFF)
575 , apneaCountdownEnabled(static_cast<bool>(-1))
576 , apneaCountdownTime(0xFFFFFFFF)
578 , backlightBrightness(0xFF)
580 , repeatDiveInterval(0xFFFF)
581 , safetyStopTime(0xFFFF)
582 , heartRateSourceType(static_cast<
SourceType>(-1))
583 , heartRateSource(0xFF)
599 const int fieldId,
const QByteArray &data,
const FitBaseType baseType,
const bool bigEndian)
603 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"dive_settings.messageIndex"))
return false;
604 this->
messageIndex =
static_cast<MessageIndex>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
607 if (!
verify(data, baseType, 1, FitBaseType::String,
"dive_settings.name"))
return false;
608 this->
name = QString::fromUtf8(data);
611 if (!
verify(data, baseType, 1, FitBaseType::Enum,
"dive_settings.model"))
return false;
615 if (!
verify(data, baseType, 1, FitBaseType::Uint8,
"dive_settings.gfLow"))
return false;
616 this->
gfLow =
static_cast<quint8
>(data.at(0));
619 if (!
verify(data, baseType, 1, FitBaseType::Uint8,
"dive_settings.gfHigh"))
return false;
620 this->
gfHigh =
static_cast<quint8
>(data.at(0));
623 if (!
verify(data, baseType, 1, FitBaseType::Enum,
"dive_settings.waterType"))
return false;
627 if (!
verify(data, baseType, 4, FitBaseType::Float32,
"dive_settings.waterDensity"))
return false;
628 #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
630 const quint32 localEndian = bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data);
631 static_assert(
sizeof(localEndian) == 4,
"src not expected size");
632 static_assert(
sizeof(this->
waterDensity) == 4,
"src and dst not the same size");
636 this->
waterDensity =
static_cast<float>(bigEndian ? qFromBigEndian<float>(data) : qFromLittleEndian<float>(data));
640 if (!
verify(data, baseType, 1, FitBaseType::Uint8,
"dive_settings.po2Warn"))
return false;
641 this->
po2Warn =
static_cast<quint8
>(data.at(0));
644 if (!
verify(data, baseType, 1, FitBaseType::Uint8,
"dive_settings.po2Critical"))
return false;
645 this->
po2Critical =
static_cast<quint8
>(data.at(0));
648 if (!
verify(data, baseType, 1, FitBaseType::Uint8,
"dive_settings.po2Deco"))
return false;
649 this->
po2Deco =
static_cast<quint8
>(data.at(0));
652 if (!
verify(data, baseType, 0, FitBaseType::Byte,
"dive_settings.safetyStopEnabled"))
return false;
656 if (!
verify(data, baseType, 4, FitBaseType::Float32,
"dive_settings.bottomDepth"))
return false;
657 #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
659 const quint32 localEndian = bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data);
660 static_assert(
sizeof(localEndian) == 4,
"src not expected size");
661 static_assert(
sizeof(this->
bottomDepth) == 4,
"src and dst not the same size");
662 memcpy(&this->
bottomDepth, &localEndian, data.size());
665 this->
bottomDepth =
static_cast<float>(bigEndian ? qFromBigEndian<float>(data) : qFromLittleEndian<float>(data));
669 if (!
verify(data, baseType, 4, FitBaseType::Uint32,
"dive_settings.bottomTime"))
return false;
670 this->
bottomTime =
static_cast<quint32
>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
673 if (!
verify(data, baseType, 0, FitBaseType::Byte,
"dive_settings.apneaCountdownEnabled"))
return false;
677 if (!
verify(data, baseType, 4, FitBaseType::Uint32,
"dive_settings.apneaCountdownTime"))
return false;
678 this->
apneaCountdownTime =
static_cast<quint32
>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
681 if (!
verify(data, baseType, 1, FitBaseType::Enum,
"dive_settings.backlightMode"))
return false;
685 if (!
verify(data, baseType, 1, FitBaseType::Uint8,
"dive_settings.backlightBrightness"))
return false;
689 if (!
verify(data, baseType, 1, FitBaseType::Uint8,
"dive_settings.backlightTimeout"))
return false;
693 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"dive_settings.repeatDiveInterval"))
return false;
694 this->
repeatDiveInterval =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
697 if (!
verify(data, baseType, 2, FitBaseType::Uint16,
"dive_settings.safetyStopTime"))
return false;
698 this->
safetyStopTime =
static_cast<quint16
>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
701 if (!
verify(data, baseType, 1, FitBaseType::Enum,
"dive_settings.heartRateSourceType"))
return false;
705 if (!
verify(data, baseType, 1, FitBaseType::Uint8,
"dive_settings.heartRateSource"))
return false;
709 qWarning() <<
"ignoring unknown dive_settings 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
quint8 gfLow
The DiveSettingsMessage FIT message's gfLow field.
bool safetyStopEnabled
The DiveSettingsMessage FIT message's safetyStopEnabled field.
quint8 po2Deco
The DiveSettingsMessage FIT message's po2Deco field.
float waterDensity
The DiveSettingsMessage FIT message's waterDensity field.
float bottomDepth
The DiveSettingsMessage FIT message's bottomDepth field.
DiveBacklightMode backlightMode
The DiveSettingsMessage FIT message's backlightMode field.
quint8 po2Critical
The DiveSettingsMessage FIT message's po2Critical field.
QString name
The DiveSettingsMessage FIT message's name field.
quint8 po2Warn
The DiveSettingsMessage FIT message's po2Warn field.
BacklightTimeout backlightTimeout
The DiveSettingsMessage FIT message's backlightTimeout field.
quint16 safetyStopTime
The DiveSettingsMessage FIT message's safetyStopTime field.
quint32 apneaCountdownTime
The DiveSettingsMessage FIT message's apneaCountdownTime field.
quint8 heartRateSource
The DiveSettingsMessage FIT message's heartRateSource field.
SourceType heartRateSourceType
The DiveSettingsMessage FIT message's heartRateSourceType field.
quint8 gfHigh
The DiveSettingsMessage FIT message's gfHigh field.
WaterType waterType
The DiveSettingsMessage FIT message's waterType field.
TissueModelType model
The DiveSettingsMessage FIT message's model field.
quint8 backlightBrightness
The DiveSettingsMessage FIT message's backlightBrightness field.
MessageIndex messageIndex
The DiveSettingsMessage FIT message's messageIndex field.
virtual ~DiveSettingsMessagePrivate()
quint16 repeatDiveInterval
The DiveSettingsMessage FIT message's repeatDiveInterval field.
bool apneaCountdownEnabled
The DiveSettingsMessage FIT message's apneaCountdownEnabled field.
quint32 bottomTime
The DiveSettingsMessage FIT message's bottomTime field.
The DiveSettingsMessage class represents a FIT DiveSettingsMessage data message.
void setPo2Critical(const quint8 po2Critical)
Sets the po2Critical field to po2Critical.
void setBacklightTimeout(const BacklightTimeout backlightTimeout)
Sets the backlightTimeout field to backlightTimeout.
quint8 po2Warn() const
Returns the DiveSettingsMessage data message's po2Warn field's current value.
void setGfHigh(const quint8 gfHigh)
Sets the gfHigh field to gfHigh.
void setApneaCountdownTime(const quint32 apneaCountdownTime)
Sets the apneaCountdownTime field to apneaCountdownTime.
BacklightTimeout backlightTimeout() const
Returns the DiveSettingsMessage data message's backlightTimeout field's current value.
bool safetyStopEnabled() const
Returns the DiveSettingsMessage data message's safetyStopEnabled field's current value.
DiveSettingsMessage()
Constructs a DiveSettingsMessage object.
void setBottomTime(const quint32 bottomTime)
Sets the bottomTime field to bottomTime.
quint8 gfLow() const
Returns the DiveSettingsMessage data message's gfLow field's current value.
quint32 bottomTime() const
Returns the DiveSettingsMessage data message's bottomTime field's current value.
quint8 po2Deco() const
Returns the DiveSettingsMessage data message's po2Deco field's current value.
float bottomDepth() const
Returns the DiveSettingsMessage data message's bottomDepth field's current value.
void setPo2Deco(const quint8 po2Deco)
Sets the po2Deco field to po2Deco.
quint32 apneaCountdownTime() const
Returns the DiveSettingsMessage data message's apneaCountdownTime field's current value.
quint16 repeatDiveInterval() const
Returns the DiveSettingsMessage data message's repeatDiveInterval field's current value.
void setSafetyStopEnabled(const bool safetyStopEnabled)
Sets the safetyStopEnabled field to safetyStopEnabled.
void setBottomDepth(const float bottomDepth)
Sets the bottomDepth field to bottomDepth.
quint8 gfHigh() const
Returns the DiveSettingsMessage data message's gfHigh field's current value.
quint8 po2Critical() const
Returns the DiveSettingsMessage data message's po2Critical field's current value.
MessageIndex messageIndex() const
Returns the DiveSettingsMessage data message's messageIndex field's current value.
void setMessageIndex(const MessageIndex messageIndex)
Sets the messageIndex field to messageIndex.
void setApneaCountdownEnabled(const bool apneaCountdownEnabled)
Sets the apneaCountdownEnabled field to apneaCountdownEnabled.
void setHeartRateSourceType(const SourceType heartRateSourceType)
Sets the heartRateSourceType field to heartRateSourceType.
void setHeartRateSource(const quint8 heartRateSource)
Sets the heartRateSource field to heartRateSource.
void setRepeatDiveInterval(const quint16 repeatDiveInterval)
Sets the repeatDiveInterval field to repeatDiveInterval.
QString name() const
Returns the DiveSettingsMessage data message's name field's current value.
void setModel(const TissueModelType model)
Sets the model field to model.
void setWaterType(const WaterType waterType)
Sets the waterType field to waterType.
SourceType heartRateSourceType() const
Returns the DiveSettingsMessage data message's heartRateSourceType field's current value.
bool apneaCountdownEnabled() const
Returns the DiveSettingsMessage data message's apneaCountdownEnabled field's current value.
void setPo2Warn(const quint8 po2Warn)
Sets the po2Warn field to po2Warn.
TissueModelType model() const
Returns the DiveSettingsMessage data message's model field's current value.
void setGfLow(const quint8 gfLow)
Sets the gfLow field to gfLow.
void setName(const QString name)
Sets the name field to name.
void setWaterDensity(const float waterDensity)
Sets the waterDensity field to waterDensity.
quint8 heartRateSource() const
Returns the DiveSettingsMessage data message's heartRateSource field's current value.
void setBacklightBrightness(const quint8 backlightBrightness)
Sets the backlightBrightness field to backlightBrightness.
quint16 safetyStopTime() const
Returns the DiveSettingsMessage data message's safetyStopTime field's current value.
DiveBacklightMode backlightMode() const
Returns the DiveSettingsMessage data message's backlightMode field's current value.
WaterType waterType() const
Returns the DiveSettingsMessage data message's waterType field's current value.
void setSafetyStopTime(const quint16 safetyStopTime)
Sets the safetyStopTime field to safetyStopTime.
quint8 backlightBrightness() const
Returns the DiveSettingsMessage data message's backlightBrightness field's current value.
float waterDensity() const
Returns the DiveSettingsMessage data message's waterDensity field's current value.
void setBacklightMode(const DiveBacklightMode backlightMode)
Sets the backlightMode field to backlightMode.
Declares the DiveSettingsMessage class.
Declares the DiveSettingsMessagePrivate class.
SourceType
Garmin FIT SourceType type.
DiveBacklightMode
Garmin FIT DiveBacklightMode type.
TissueModelType
Garmin FIT TissueModelType type.
FitBaseType
Garmin FIT FitBaseType type.
BacklightTimeout
Timeout in seconds.
MessageIndex
Garmin FIT MessageIndex type.
WaterType
Garmin FIT WaterType type.