QtFit  0.1
Internal library development documentation
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
UserProfileMessagePrivate Class Reference
Inheritance diagram for UserProfileMessagePrivate:
[legend]
Collaboration diagram for UserProfileMessagePrivate:
[legend]

Public Member Functions

 UserProfileMessagePrivate (UserProfileMessage *const q)
 
virtual ~UserProfileMessagePrivate ()
 
- Public Member Functions inherited from AbstractDataMessagePrivate
 AbstractDataMessagePrivate (AbstractDataMessage *const q)
 
virtual ~AbstractDataMessagePrivate ()
 
bool setFields (const DataDefinition *const defn, const QByteArray &record)
 

Public Attributes

MessageIndex messageIndex
 The UserProfileMessage FIT message's messageIndex field.
 
QString friendlyName
 The UserProfileMessage FIT message's friendlyName field.
 
Gender gender
 The UserProfileMessage FIT message's gender field.
 
quint8 age
 The UserProfileMessage FIT message's age field.
 
quint8 height
 The UserProfileMessage FIT message's height field.
 
quint16 weight
 The UserProfileMessage FIT message's weight field.
 
Language language
 The UserProfileMessage FIT message's language field.
 
DisplayMeasure elevSetting
 The UserProfileMessage FIT message's elevSetting field.
 
DisplayMeasure weightSetting
 The UserProfileMessage FIT message's weightSetting field.
 
quint8 restingHeartRate
 The UserProfileMessage FIT message's restingHeartRate field.
 
quint8 defaultMaxRunningHeartRate
 The UserProfileMessage FIT message's defaultMaxRunningHeartRate field.
 
quint8 defaultMaxBikingHeartRate
 The UserProfileMessage FIT message's defaultMaxBikingHeartRate field.
 
quint8 defaultMaxHeartRate
 The UserProfileMessage FIT message's defaultMaxHeartRate field.
 
DisplayHeart hrSetting
 The UserProfileMessage FIT message's hrSetting field.
 
DisplayMeasure speedSetting
 The UserProfileMessage FIT message's speedSetting field.
 
DisplayMeasure distSetting
 The UserProfileMessage FIT message's distSetting field.
 
DisplayPower powerSetting
 The UserProfileMessage FIT message's powerSetting field.
 
ActivityClass activityClass
 The UserProfileMessage FIT message's activityClass field.
 
DisplayPosition positionSetting
 The UserProfileMessage FIT message's positionSetting field.
 
DisplayMeasure temperatureSetting
 The UserProfileMessage FIT message's temperatureSetting field.
 
UserLocalId localId
 The UserProfileMessage FIT message's localId field.
 
quint8 globalId
 The UserProfileMessage FIT message's globalId field.
 
LocaltimeIntoDay wakeTime
 The UserProfileMessage FIT message's wakeTime field. More...
 
LocaltimeIntoDay sleepTime
 The UserProfileMessage FIT message's sleepTime field. More...
 
DisplayMeasure heightSetting
 The UserProfileMessage FIT message's heightSetting field.
 
quint16 userRunningStepLength
 The UserProfileMessage FIT message's userRunningStepLength field. More...
 
quint16 userWalkingStepLength
 The UserProfileMessage FIT message's userWalkingStepLength field. More...
 
DisplayMeasure depthSetting
 The UserProfileMessage FIT message's depthSetting field.
 
quint32 diveCount
 The UserProfileMessage FIT message's diveCount field.
 
- Public Attributes inherited from AbstractDataMessagePrivate
MesgNum globalMessageNumber
 FIT Globla Message Number for this FIT Data Message.
 

Protected Member Functions

bool setField (const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian) override
 
- Protected Member Functions inherited from AbstractDataMessagePrivate
bool verify (const QByteArray &data, const FitBaseType actualType, const int expectedSize, const FitBaseType expectedType, const char *messageFieldName)
 

Additional Inherited Members

- Protected Attributes inherited from AbstractDataMessagePrivate
AbstractDataMessage *const q_ptr
 Internal q-pointer.
 

Detailed Description

The UserProfileMessagePrivate class provides private implementation for the UserProfileMessage.

See also
UserProfileMessage

Definition at line 38 of file userprofilemessage_p.h.

Constructor & Destructor Documentation

◆ UserProfileMessagePrivate()

UserProfileMessagePrivate::UserProfileMessagePrivate ( UserProfileMessage *const  q)
explicit

Constructs a UserProfileMessagePrivate object with public implementation q.

Parameters
qPointer to public implementaton.

Definition at line 706 of file userprofilemessage.cpp.

708  , messageIndex(static_cast<MessageIndex>(-1))
709  , gender(static_cast<Gender>(-1))
710  , age(0xFF)
711  , height(0xFF)
712  , weight(0xFFFF)
713  , language(static_cast<Language>(-1))
714  , elevSetting(static_cast<DisplayMeasure>(-1))
715  , weightSetting(static_cast<DisplayMeasure>(-1))
716  , restingHeartRate(0xFF)
719  , defaultMaxHeartRate(0xFF)
720  , hrSetting(static_cast<DisplayHeart>(-1))
721  , speedSetting(static_cast<DisplayMeasure>(-1))
722  , distSetting(static_cast<DisplayMeasure>(-1))
723  , powerSetting(static_cast<DisplayPower>(-1))
724  , activityClass(static_cast<ActivityClass>(-1))
725  , positionSetting(static_cast<DisplayPosition>(-1))
726  , temperatureSetting(static_cast<DisplayMeasure>(-1))
727  , localId(static_cast<UserLocalId>(-1))
728  , globalId(0xFF)
729  , wakeTime(static_cast<LocaltimeIntoDay>(-1))
730  , sleepTime(static_cast<LocaltimeIntoDay>(-1))
731  , heightSetting(static_cast<DisplayMeasure>(-1))
732  , userRunningStepLength(0xFFFF)
733  , userWalkingStepLength(0xFFFF)
734  , depthSetting(static_cast<DisplayMeasure>(-1))
735  , diveCount(0xFFFFFFFF)
736 {
737  globalMessageNumber = MesgNum::UserProfile;
738 }
MesgNum globalMessageNumber
FIT Globla Message Number for this FIT Data Message.
quint8 restingHeartRate
The UserProfileMessage FIT message's restingHeartRate field.
LocaltimeIntoDay sleepTime
The UserProfileMessage FIT message's sleepTime field.
DisplayHeart hrSetting
The UserProfileMessage FIT message's hrSetting field.
quint8 defaultMaxHeartRate
The UserProfileMessage FIT message's defaultMaxHeartRate field.
quint16 userRunningStepLength
The UserProfileMessage FIT message's userRunningStepLength field.
DisplayMeasure distSetting
The UserProfileMessage FIT message's distSetting field.
MessageIndex messageIndex
The UserProfileMessage FIT message's messageIndex field.
DisplayMeasure heightSetting
The UserProfileMessage FIT message's heightSetting field.
LocaltimeIntoDay wakeTime
The UserProfileMessage FIT message's wakeTime field.
quint8 defaultMaxRunningHeartRate
The UserProfileMessage FIT message's defaultMaxRunningHeartRate field.
Language language
The UserProfileMessage FIT message's language field.
DisplayMeasure weightSetting
The UserProfileMessage FIT message's weightSetting field.
quint8 age
The UserProfileMessage FIT message's age field.
quint16 userWalkingStepLength
The UserProfileMessage FIT message's userWalkingStepLength field.
DisplayMeasure temperatureSetting
The UserProfileMessage FIT message's temperatureSetting field.
Gender gender
The UserProfileMessage FIT message's gender field.
DisplayMeasure elevSetting
The UserProfileMessage FIT message's elevSetting field.
quint8 globalId
The UserProfileMessage FIT message's globalId field.
DisplayPower powerSetting
The UserProfileMessage FIT message's powerSetting field.
quint16 weight
The UserProfileMessage FIT message's weight field.
quint8 defaultMaxBikingHeartRate
The UserProfileMessage FIT message's defaultMaxBikingHeartRate field.
DisplayPosition positionSetting
The UserProfileMessage FIT message's positionSetting field.
quint32 diveCount
The UserProfileMessage FIT message's diveCount field.
UserLocalId localId
The UserProfileMessage FIT message's localId field.
ActivityClass activityClass
The UserProfileMessage FIT message's activityClass field.
quint8 height
The UserProfileMessage FIT message's height field.
DisplayMeasure speedSetting
The UserProfileMessage FIT message's speedSetting field.
DisplayMeasure depthSetting
The UserProfileMessage FIT message's depthSetting field.
UserLocalId
Garmin FIT UserLocalId type.
Definition: types.h:2244
DisplayHeart
Garmin FIT DisplayHeart type.
Definition: types.h:587
Language
Garmin FIT Language type.
Definition: types.h:305
Gender
Garmin FIT Gender type.
Definition: types.h:291
ActivityClass
Garmin FIT ActivityClass type.
Definition: types.h:1267
DisplayMeasure
Garmin FIT DisplayMeasure type.
Definition: types.h:572
MessageIndex
Garmin FIT MessageIndex type.
Definition: types.h:263
DisplayPosition
Garmin FIT DisplayPosition type.
Definition: types.h:616
DisplayPower
Garmin FIT DisplayPower type.
Definition: types.h:602
quint32 LocaltimeIntoDay
Number of seconds into the day since local 00:00:00.
Definition: types.h:2642

References AbstractDataMessagePrivate::globalMessageNumber.

◆ ~UserProfileMessagePrivate()

UserProfileMessagePrivate::~UserProfileMessagePrivate ( )
virtual

Destroys the UserProfileMessagePrivate object.

Definition at line 745 of file userprofilemessage.cpp.

746 {
747 
748 }

Member Function Documentation

◆ setField()

bool UserProfileMessagePrivate::setField ( const int  fieldId,
const QByteArray &  data,
const FitBaseType  baseType,
const bool  bigEndian 
)
overrideprotectedvirtual

Sets the value of the fieldId field.

Derived classes must implement this method to extract the baseType value from data, and assign the extracted value the fieldId field.

Parameters
fieldIdThe field number within the given FIT data message.
dataThe raw data to extract the field value from.
baseTypeThe FIT base type for the field.
bigEndianWhether or not multibyte values in record are big-endian.
Returns
true if the field was set, or safely ignored; false otherwise.

Implements AbstractDataMessagePrivate.

Definition at line 750 of file userprofilemessage.cpp.

752 {
753  switch (fieldId) {
754  case 254: // See Profile.xlsx::Messages:user_profile.messageIndex
755  if (!verify(data, baseType, 2, FitBaseType::Uint16, "user_profile.messageIndex")) return false;
756  this->messageIndex = static_cast<MessageIndex>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
757  break;
758  case 0: // See Profile.xlsx::Messages:user_profile.friendlyName
759  if (!verify(data, baseType, 1, FitBaseType::String, "user_profile.friendlyName")) return false;
760  this->friendlyName = QString::fromUtf8(data);
761  break;
762  case 1: // See Profile.xlsx::Messages:user_profile.gender
763  if (!verify(data, baseType, 1, FitBaseType::Enum, "user_profile.gender")) return false;
764  this->gender = static_cast<Gender>(data.at(0));
765  break;
766  case 2: // See Profile.xlsx::Messages:user_profile.age
767  if (!verify(data, baseType, 1, FitBaseType::Uint8, "user_profile.age")) return false;
768  this->age = static_cast<quint8>(data.at(0));
769  break;
770  case 3: // See Profile.xlsx::Messages:user_profile.height
771  if (!verify(data, baseType, 1, FitBaseType::Uint8, "user_profile.height")) return false;
772  this->height = static_cast<quint8>(data.at(0));
773  break;
774  case 4: // See Profile.xlsx::Messages:user_profile.weight
775  if (!verify(data, baseType, 2, FitBaseType::Uint16, "user_profile.weight")) return false;
776  this->weight = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
777  break;
778  case 5: // See Profile.xlsx::Messages:user_profile.language
779  if (!verify(data, baseType, 1, FitBaseType::Enum, "user_profile.language")) return false;
780  this->language = static_cast<Language>(data.at(0));
781  break;
782  case 6: // See Profile.xlsx::Messages:user_profile.elevSetting
783  if (!verify(data, baseType, 1, FitBaseType::Enum, "user_profile.elevSetting")) return false;
784  this->elevSetting = static_cast<DisplayMeasure>(data.at(0));
785  break;
786  case 7: // See Profile.xlsx::Messages:user_profile.weightSetting
787  if (!verify(data, baseType, 1, FitBaseType::Enum, "user_profile.weightSetting")) return false;
788  this->weightSetting = static_cast<DisplayMeasure>(data.at(0));
789  break;
790  case 8: // See Profile.xlsx::Messages:user_profile.restingHeartRate
791  if (!verify(data, baseType, 1, FitBaseType::Uint8, "user_profile.restingHeartRate")) return false;
792  this->restingHeartRate = static_cast<quint8>(data.at(0));
793  break;
794  case 9: // See Profile.xlsx::Messages:user_profile.defaultMaxRunningHeartRate
795  if (!verify(data, baseType, 1, FitBaseType::Uint8, "user_profile.defaultMaxRunningHeartRate")) return false;
796  this->defaultMaxRunningHeartRate = static_cast<quint8>(data.at(0));
797  break;
798  case 10: // See Profile.xlsx::Messages:user_profile.defaultMaxBikingHeartRate
799  if (!verify(data, baseType, 1, FitBaseType::Uint8, "user_profile.defaultMaxBikingHeartRate")) return false;
800  this->defaultMaxBikingHeartRate = static_cast<quint8>(data.at(0));
801  break;
802  case 11: // See Profile.xlsx::Messages:user_profile.defaultMaxHeartRate
803  if (!verify(data, baseType, 1, FitBaseType::Uint8, "user_profile.defaultMaxHeartRate")) return false;
804  this->defaultMaxHeartRate = static_cast<quint8>(data.at(0));
805  break;
806  case 12: // See Profile.xlsx::Messages:user_profile.hrSetting
807  if (!verify(data, baseType, 1, FitBaseType::Enum, "user_profile.hrSetting")) return false;
808  this->hrSetting = static_cast<DisplayHeart>(data.at(0));
809  break;
810  case 13: // See Profile.xlsx::Messages:user_profile.speedSetting
811  if (!verify(data, baseType, 1, FitBaseType::Enum, "user_profile.speedSetting")) return false;
812  this->speedSetting = static_cast<DisplayMeasure>(data.at(0));
813  break;
814  case 14: // See Profile.xlsx::Messages:user_profile.distSetting
815  if (!verify(data, baseType, 1, FitBaseType::Enum, "user_profile.distSetting")) return false;
816  this->distSetting = static_cast<DisplayMeasure>(data.at(0));
817  break;
818  case 16: // See Profile.xlsx::Messages:user_profile.powerSetting
819  if (!verify(data, baseType, 1, FitBaseType::Enum, "user_profile.powerSetting")) return false;
820  this->powerSetting = static_cast<DisplayPower>(data.at(0));
821  break;
822  case 17: // See Profile.xlsx::Messages:user_profile.activityClass
823  if (!verify(data, baseType, 1, FitBaseType::Enum, "user_profile.activityClass")) return false;
824  this->activityClass = static_cast<ActivityClass>(data.at(0));
825  break;
826  case 18: // See Profile.xlsx::Messages:user_profile.positionSetting
827  if (!verify(data, baseType, 1, FitBaseType::Enum, "user_profile.positionSetting")) return false;
828  this->positionSetting = static_cast<DisplayPosition>(data.at(0));
829  break;
830  case 21: // See Profile.xlsx::Messages:user_profile.temperatureSetting
831  if (!verify(data, baseType, 1, FitBaseType::Enum, "user_profile.temperatureSetting")) return false;
832  this->temperatureSetting = static_cast<DisplayMeasure>(data.at(0));
833  break;
834  case 22: // See Profile.xlsx::Messages:user_profile.localId
835  if (!verify(data, baseType, 2, FitBaseType::Uint16, "user_profile.localId")) return false;
836  this->localId = static_cast<UserLocalId>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
837  break;
838  case 23: // See Profile.xlsx::Messages:user_profile.globalId
839  if (!verify(data, baseType, 1, FitBaseType::Byte, "user_profile.globalId")) return false;
840  this->globalId = static_cast<quint8>(data.at(0));
841  break;
842  case 28: // See Profile.xlsx::Messages:user_profile.wakeTime
843  if (!verify(data, baseType, 4, FitBaseType::Uint32, "user_profile.wakeTime")) return false;
844  this->wakeTime = static_cast<LocaltimeIntoDay>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
845  break;
846  case 29: // See Profile.xlsx::Messages:user_profile.sleepTime
847  if (!verify(data, baseType, 4, FitBaseType::Uint32, "user_profile.sleepTime")) return false;
848  this->sleepTime = static_cast<LocaltimeIntoDay>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
849  break;
850  case 30: // See Profile.xlsx::Messages:user_profile.heightSetting
851  if (!verify(data, baseType, 1, FitBaseType::Enum, "user_profile.heightSetting")) return false;
852  this->heightSetting = static_cast<DisplayMeasure>(data.at(0));
853  break;
854  case 31: // See Profile.xlsx::Messages:user_profile.userRunningStepLength
855  if (!verify(data, baseType, 2, FitBaseType::Uint16, "user_profile.userRunningStepLength")) return false;
856  this->userRunningStepLength = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
857  break;
858  case 32: // See Profile.xlsx::Messages:user_profile.userWalkingStepLength
859  if (!verify(data, baseType, 2, FitBaseType::Uint16, "user_profile.userWalkingStepLength")) return false;
860  this->userWalkingStepLength = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
861  break;
862  case 47: // See Profile.xlsx::Messages:user_profile.depthSetting
863  if (!verify(data, baseType, 1, FitBaseType::Enum, "user_profile.depthSetting")) return false;
864  this->depthSetting = static_cast<DisplayMeasure>(data.at(0));
865  break;
866  case 49: // See Profile.xlsx::Messages:user_profile.diveCount
867  if (!verify(data, baseType, 4, FitBaseType::Uint32, "user_profile.diveCount")) return false;
868  this->diveCount = static_cast<quint32>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
869  break;
870  default:
871  qWarning() << "ignoring unknown user_profile message field number" << fieldId << bigEndian;
872  // Fall through to return true, as its still 'safe' to continue parsing data messages.
873  }
874  return true;
875 }
bool verify(const QByteArray &data, const FitBaseType actualType, const int expectedSize, const FitBaseType expectedType, const char *messageFieldName)
QString friendlyName
The UserProfileMessage FIT message's friendlyName field.

References AbstractDataMessagePrivate::verify().

Here is the call graph for this function:

Member Data Documentation

◆ sleepTime

LocaltimeIntoDay UserProfileMessagePrivate::sleepTime

The UserProfileMessage FIT message's sleepTime field.

Typical bed time

Definition at line 163 of file userprofilemessage_p.h.

◆ userRunningStepLength

quint16 UserProfileMessagePrivate::userRunningStepLength

The UserProfileMessage FIT message's userRunningStepLength field.

User defined running step length set to 0 for auto length

Definition at line 175 of file userprofilemessage_p.h.

◆ userWalkingStepLength

quint16 UserProfileMessagePrivate::userWalkingStepLength

The UserProfileMessage FIT message's userWalkingStepLength field.

User defined walking step length set to 0 for auto length

Definition at line 182 of file userprofilemessage_p.h.

◆ wakeTime

LocaltimeIntoDay UserProfileMessagePrivate::wakeTime

The UserProfileMessage FIT message's wakeTime field.

Typical wake time

Definition at line 156 of file userprofilemessage_p.h.


The documentation for this class was generated from the following files: