QtFit  0.1
Internal library development documentation
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
userprofilemessage.cpp
Go to the documentation of this file.
1 /*
2  Copyright 2021 Paul Colby
3 
4  This file is part of QtFit.
5 
6  QtFit is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  QtFit is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with QtFit. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 /*!
21  * \file
22  * \note This file is automatcially generated. Any changes here are likely to be overwritten.
23  */
24 
25 /*!
26  * \file
27  * Defines the UserProfileMessage, and UserProfileMessagePrivate classes.
28  */
29 
30 #include "userprofilemessage.h"
31 #include "userprofilemessage_p.h"
32 
33 #include <QDebug>
34 #include <QtEndian>
35 
37 
38 /*!
39  * \class UserProfileMessage
40  *
41  * The UserProfileMessage class represents a FIT UserProfileMessage data message.
42  *
43  * \sa DataMessage
44  */
45 
46 /*!
47  * Constructs a UserProfileMessage object.
48  *
49  * Typically, instances of this class will be returned by FitStreamReader::readNext, but this
50  * constructor may be used, along with the relevant setter methods, to create a valid message.
51  */
53 {
54 
55 }
56 
57 /*!
58  * \internal
59  *
60  * Constructs a UserProfileMessage object with private implementation \a d.
61  *
62  * \param d Pointer to private implementation.
63  */
65 {
66 
67 }
68 
69 /*!
70  * Returns the UserProfileMessage data message's \c messageIndex field's current value.
71  *
72  * \return the \c messageIndex field value.
73  */
75 {
76  Q_D(const UserProfileMessage);
77  return d->messageIndex;
78 }
79 
80 /*!
81  * Returns the UserProfileMessage data message's \c friendlyName field's current value.
82  *
83  * \return the \c friendlyName field value.
84  */
86 {
87  Q_D(const UserProfileMessage);
88  return d->friendlyName;
89 }
90 
91 /*!
92  * Returns the UserProfileMessage data message's \c gender field's current value.
93  *
94  * \return the \c gender field value.
95  */
97 {
98  Q_D(const UserProfileMessage);
99  return d->gender;
100 }
101 
102 /*!
103  * Returns the UserProfileMessage data message's \c age field's current value.
104  *
105  * \return the \c age field value.
106  */
108 {
109  Q_D(const UserProfileMessage);
110  return d->age;
111 }
112 
113 /*!
114  * Returns the UserProfileMessage data message's \c height field's current value.
115  *
116  * \return the \c height field value.
117  */
119 {
120  Q_D(const UserProfileMessage);
121  return d->height;
122 }
123 
124 /*!
125  * Returns the UserProfileMessage data message's \c weight field's current value.
126  *
127  * \return the \c weight field value.
128  */
130 {
131  Q_D(const UserProfileMessage);
132  return d->weight;
133 }
134 
135 /*!
136  * Returns the UserProfileMessage data message's \c language field's current value.
137  *
138  * \return the \c language field value.
139  */
141 {
142  Q_D(const UserProfileMessage);
143  return d->language;
144 }
145 
146 /*!
147  * Returns the UserProfileMessage data message's \c elevSetting field's current value.
148  *
149  * \return the \c elevSetting field value.
150  */
152 {
153  Q_D(const UserProfileMessage);
154  return d->elevSetting;
155 }
156 
157 /*!
158  * Returns the UserProfileMessage data message's \c weightSetting field's current value.
159  *
160  * \return the \c weightSetting field value.
161  */
163 {
164  Q_D(const UserProfileMessage);
165  return d->weightSetting;
166 }
167 
168 /*!
169  * Returns the UserProfileMessage data message's \c restingHeartRate field's current value.
170  *
171  * \return the \c restingHeartRate field value.
172  */
174 {
175  Q_D(const UserProfileMessage);
176  return d->restingHeartRate;
177 }
178 
179 /*!
180  * Returns the UserProfileMessage data message's \c defaultMaxRunningHeartRate field's current value.
181  *
182  * \return the \c defaultMaxRunningHeartRate field value.
183  */
185 {
186  Q_D(const UserProfileMessage);
187  return d->defaultMaxRunningHeartRate;
188 }
189 
190 /*!
191  * Returns the UserProfileMessage data message's \c defaultMaxBikingHeartRate field's current value.
192  *
193  * \return the \c defaultMaxBikingHeartRate field value.
194  */
196 {
197  Q_D(const UserProfileMessage);
198  return d->defaultMaxBikingHeartRate;
199 }
200 
201 /*!
202  * Returns the UserProfileMessage data message's \c defaultMaxHeartRate field's current value.
203  *
204  * \return the \c defaultMaxHeartRate field value.
205  */
207 {
208  Q_D(const UserProfileMessage);
209  return d->defaultMaxHeartRate;
210 }
211 
212 /*!
213  * Returns the UserProfileMessage data message's \c hrSetting field's current value.
214  *
215  * \return the \c hrSetting field value.
216  */
218 {
219  Q_D(const UserProfileMessage);
220  return d->hrSetting;
221 }
222 
223 /*!
224  * Returns the UserProfileMessage data message's \c speedSetting field's current value.
225  *
226  * \return the \c speedSetting field value.
227  */
229 {
230  Q_D(const UserProfileMessage);
231  return d->speedSetting;
232 }
233 
234 /*!
235  * Returns the UserProfileMessage data message's \c distSetting field's current value.
236  *
237  * \return the \c distSetting field value.
238  */
240 {
241  Q_D(const UserProfileMessage);
242  return d->distSetting;
243 }
244 
245 /*!
246  * Returns the UserProfileMessage data message's \c powerSetting field's current value.
247  *
248  * \return the \c powerSetting field value.
249  */
251 {
252  Q_D(const UserProfileMessage);
253  return d->powerSetting;
254 }
255 
256 /*!
257  * Returns the UserProfileMessage data message's \c activityClass field's current value.
258  *
259  * \return the \c activityClass field value.
260  */
262 {
263  Q_D(const UserProfileMessage);
264  return d->activityClass;
265 }
266 
267 /*!
268  * Returns the UserProfileMessage data message's \c positionSetting field's current value.
269  *
270  * \return the \c positionSetting field value.
271  */
273 {
274  Q_D(const UserProfileMessage);
275  return d->positionSetting;
276 }
277 
278 /*!
279  * Returns the UserProfileMessage data message's \c temperatureSetting field's current value.
280  *
281  * \return the \c temperatureSetting field value.
282  */
284 {
285  Q_D(const UserProfileMessage);
286  return d->temperatureSetting;
287 }
288 
289 /*!
290  * Returns the UserProfileMessage data message's \c localId field's current value.
291  *
292  * \return the \c localId field value.
293  */
295 {
296  Q_D(const UserProfileMessage);
297  return d->localId;
298 }
299 
300 /*!
301  * Returns the UserProfileMessage data message's \c globalId field's current value.
302  *
303  * \return the \c globalId field value.
304  */
306 {
307  Q_D(const UserProfileMessage);
308  return d->globalId;
309 }
310 
311 /*!
312  * Returns the UserProfileMessage data message's \c wakeTime field's current value.
313  *
314  * Typical wake time
315  *
316  * \return the \c wakeTime field value.
317  */
319 {
320  Q_D(const UserProfileMessage);
321  return d->wakeTime;
322 }
323 
324 /*!
325  * Returns the UserProfileMessage data message's \c sleepTime field's current value.
326  *
327  * Typical bed time
328  *
329  * \return the \c sleepTime field value.
330  */
332 {
333  Q_D(const UserProfileMessage);
334  return d->sleepTime;
335 }
336 
337 /*!
338  * Returns the UserProfileMessage data message's \c heightSetting field's current value.
339  *
340  * \return the \c heightSetting field value.
341  */
343 {
344  Q_D(const UserProfileMessage);
345  return d->heightSetting;
346 }
347 
348 /*!
349  * Returns the UserProfileMessage data message's \c userRunningStepLength field's current value.
350  *
351  * User defined running step length set to 0 for auto length
352  *
353  * \return the \c userRunningStepLength field value.
354  */
356 {
357  Q_D(const UserProfileMessage);
358  return d->userRunningStepLength;
359 }
360 
361 /*!
362  * Returns the UserProfileMessage data message's \c userWalkingStepLength field's current value.
363  *
364  * User defined walking step length set to 0 for auto length
365  *
366  * \return the \c userWalkingStepLength field value.
367  */
369 {
370  Q_D(const UserProfileMessage);
371  return d->userWalkingStepLength;
372 }
373 
374 /*!
375  * Returns the UserProfileMessage data message's \c depthSetting field's current value.
376  *
377  * \return the \c depthSetting field value.
378  */
380 {
381  Q_D(const UserProfileMessage);
382  return d->depthSetting;
383 }
384 
385 /*!
386  * Returns the UserProfileMessage data message's \c diveCount field's current value.
387  *
388  * \return the \c diveCount field value.
389  */
391 {
392  Q_D(const UserProfileMessage);
393  return d->diveCount;
394 }
395 
396 /*!
397  * Sets the \c messageIndex field to \a messageIndex.
398  *
399  * \param messageIndex The field value to set.
400  */
402 {
403  Q_D(UserProfileMessage);
404  d->messageIndex = messageIndex;
405 }
406 /*!
407  * Sets the \c friendlyName field to \a friendlyName.
408  *
409  * \param friendlyName The field value to set.
410  */
411 void UserProfileMessage::setFriendlyName(const QString friendlyName)
412 {
413  Q_D(UserProfileMessage);
414  d->friendlyName = friendlyName;
415 }
416 /*!
417  * Sets the \c gender field to \a gender.
418  *
419  * \param gender The field value to set.
420  */
422 {
423  Q_D(UserProfileMessage);
424  d->gender = gender;
425 }
426 /*!
427  * Sets the \c age field to \a age.
428  *
429  * \param age The field value to set.
430  */
431 void UserProfileMessage::setAge(const quint8 age)
432 {
433  Q_D(UserProfileMessage);
434  d->age = age;
435 }
436 /*!
437  * Sets the \c height field to \a height.
438  *
439  * \param height The field value to set.
440  */
441 void UserProfileMessage::setHeight(const quint8 height)
442 {
443  Q_D(UserProfileMessage);
444  d->height = height;
445 }
446 /*!
447  * Sets the \c weight field to \a weight.
448  *
449  * \param weight The field value to set.
450  */
451 void UserProfileMessage::setWeight(const quint16 weight)
452 {
453  Q_D(UserProfileMessage);
454  d->weight = weight;
455 }
456 /*!
457  * Sets the \c language field to \a language.
458  *
459  * \param language The field value to set.
460  */
462 {
463  Q_D(UserProfileMessage);
464  d->language = language;
465 }
466 /*!
467  * Sets the \c elevSetting field to \a elevSetting.
468  *
469  * \param elevSetting The field value to set.
470  */
472 {
473  Q_D(UserProfileMessage);
474  d->elevSetting = elevSetting;
475 }
476 /*!
477  * Sets the \c weightSetting field to \a weightSetting.
478  *
479  * \param weightSetting The field value to set.
480  */
482 {
483  Q_D(UserProfileMessage);
484  d->weightSetting = weightSetting;
485 }
486 /*!
487  * Sets the \c restingHeartRate field to \a restingHeartRate.
488  *
489  * \param restingHeartRate The field value to set.
490  */
491 void UserProfileMessage::setRestingHeartRate(const quint8 restingHeartRate)
492 {
493  Q_D(UserProfileMessage);
494  d->restingHeartRate = restingHeartRate;
495 }
496 /*!
497  * Sets the \c defaultMaxRunningHeartRate field to \a defaultMaxRunningHeartRate.
498  *
499  * \param defaultMaxRunningHeartRate The field value to set.
500  */
501 void UserProfileMessage::setDefaultMaxRunningHeartRate(const quint8 defaultMaxRunningHeartRate)
502 {
503  Q_D(UserProfileMessage);
504  d->defaultMaxRunningHeartRate = defaultMaxRunningHeartRate;
505 }
506 /*!
507  * Sets the \c defaultMaxBikingHeartRate field to \a defaultMaxBikingHeartRate.
508  *
509  * \param defaultMaxBikingHeartRate The field value to set.
510  */
511 void UserProfileMessage::setDefaultMaxBikingHeartRate(const quint8 defaultMaxBikingHeartRate)
512 {
513  Q_D(UserProfileMessage);
514  d->defaultMaxBikingHeartRate = defaultMaxBikingHeartRate;
515 }
516 /*!
517  * Sets the \c defaultMaxHeartRate field to \a defaultMaxHeartRate.
518  *
519  * \param defaultMaxHeartRate The field value to set.
520  */
521 void UserProfileMessage::setDefaultMaxHeartRate(const quint8 defaultMaxHeartRate)
522 {
523  Q_D(UserProfileMessage);
524  d->defaultMaxHeartRate = defaultMaxHeartRate;
525 }
526 /*!
527  * Sets the \c hrSetting field to \a hrSetting.
528  *
529  * \param hrSetting The field value to set.
530  */
532 {
533  Q_D(UserProfileMessage);
534  d->hrSetting = hrSetting;
535 }
536 /*!
537  * Sets the \c speedSetting field to \a speedSetting.
538  *
539  * \param speedSetting The field value to set.
540  */
542 {
543  Q_D(UserProfileMessage);
544  d->speedSetting = speedSetting;
545 }
546 /*!
547  * Sets the \c distSetting field to \a distSetting.
548  *
549  * \param distSetting The field value to set.
550  */
552 {
553  Q_D(UserProfileMessage);
554  d->distSetting = distSetting;
555 }
556 /*!
557  * Sets the \c powerSetting field to \a powerSetting.
558  *
559  * \param powerSetting The field value to set.
560  */
562 {
563  Q_D(UserProfileMessage);
564  d->powerSetting = powerSetting;
565 }
566 /*!
567  * Sets the \c activityClass field to \a activityClass.
568  *
569  * \param activityClass The field value to set.
570  */
572 {
573  Q_D(UserProfileMessage);
574  d->activityClass = activityClass;
575 }
576 /*!
577  * Sets the \c positionSetting field to \a positionSetting.
578  *
579  * \param positionSetting The field value to set.
580  */
582 {
583  Q_D(UserProfileMessage);
584  d->positionSetting = positionSetting;
585 }
586 /*!
587  * Sets the \c temperatureSetting field to \a temperatureSetting.
588  *
589  * \param temperatureSetting The field value to set.
590  */
592 {
593  Q_D(UserProfileMessage);
594  d->temperatureSetting = temperatureSetting;
595 }
596 /*!
597  * Sets the \c localId field to \a localId.
598  *
599  * \param localId The field value to set.
600  */
602 {
603  Q_D(UserProfileMessage);
604  d->localId = localId;
605 }
606 /*!
607  * Sets the \c globalId field to \a globalId.
608  *
609  * \param globalId The field value to set.
610  */
611 void UserProfileMessage::setGlobalId(const quint8 globalId)
612 {
613  Q_D(UserProfileMessage);
614  d->globalId = globalId;
615 }
616 /*!
617  * Sets the \c wakeTime field to \a wakeTime.
618  *
619  * \param wakeTime The field value to set.
620  */
622 {
623  Q_D(UserProfileMessage);
624  d->wakeTime = wakeTime;
625 }
626 /*!
627  * Sets the \c sleepTime field to \a sleepTime.
628  *
629  * \param sleepTime The field value to set.
630  */
632 {
633  Q_D(UserProfileMessage);
634  d->sleepTime = sleepTime;
635 }
636 /*!
637  * Sets the \c heightSetting field to \a heightSetting.
638  *
639  * \param heightSetting The field value to set.
640  */
642 {
643  Q_D(UserProfileMessage);
644  d->heightSetting = heightSetting;
645 }
646 /*!
647  * Sets the \c userRunningStepLength field to \a userRunningStepLength.
648  *
649  * \param userRunningStepLength The field value to set.
650  */
651 void UserProfileMessage::setUserRunningStepLength(const quint16 userRunningStepLength)
652 {
653  Q_D(UserProfileMessage);
654  d->userRunningStepLength = userRunningStepLength;
655 }
656 /*!
657  * Sets the \c userWalkingStepLength field to \a userWalkingStepLength.
658  *
659  * \param userWalkingStepLength The field value to set.
660  */
661 void UserProfileMessage::setUserWalkingStepLength(const quint16 userWalkingStepLength)
662 {
663  Q_D(UserProfileMessage);
664  d->userWalkingStepLength = userWalkingStepLength;
665 }
666 /*!
667  * Sets the \c depthSetting field to \a depthSetting.
668  *
669  * \param depthSetting The field value to set.
670  */
672 {
673  Q_D(UserProfileMessage);
674  d->depthSetting = depthSetting;
675 }
676 /*!
677  * Sets the \c diveCount field to \a diveCount.
678  *
679  * \param diveCount The field value to set.
680  */
681 void UserProfileMessage::setDiveCount(const quint32 diveCount)
682 {
683  Q_D(UserProfileMessage);
684  d->diveCount = diveCount;
685 }
686 
687 /// \cond internal
688 
689 /*!
690  * \internal
691  *
692  * \class UserProfileMessagePrivate
693  *
694  * The UserProfileMessagePrivate class provides private implementation for the UserProfileMessage.
695  *
696  * \sa UserProfileMessage
697  */
698 
699 /*!
700  * \internal
701  *
702  * Constructs a UserProfileMessagePrivate object with public implementation \a q.
703  *
704  * \param q Pointer to public implementaton.
705  */
706 UserProfileMessagePrivate::UserProfileMessagePrivate(UserProfileMessage * const q)
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)
717  , defaultMaxRunningHeartRate(0xFF)
718  , defaultMaxBikingHeartRate(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 }
739 
740 /*!
741  * \internal
742  *
743  * Destroys the UserProfileMessagePrivate object.
744  */
746 {
747 
748 }
749 
751  const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian)
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 }
876 
877 /// \endcond
878 
#define QTFIT_END_NAMESPACE
Macro for ending the QtFit library's top-most namespace (if one is defined).
Definition: QtFit_global.h:78
#define QTFIT_BEGIN_NAMESPACE
Macro for starting the QtFit library's top-most namespace (if one is defined).
Definition: QtFit_global.h:77
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.
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.
bool setField(const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian) override
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.
QString friendlyName
The UserProfileMessage FIT message's friendlyName field.
DisplayMeasure depthSetting
The UserProfileMessage FIT message's depthSetting field.
The UserProfileMessage class represents a FIT UserProfileMessage data message.
void setLocalId(const UserLocalId localId)
Sets the localId field to localId.
UserProfileMessage()
Constructs a UserProfileMessage object.
DisplayMeasure speedSetting() const
Returns the UserProfileMessage data message's speedSetting field's current value.
DisplayPosition positionSetting() const
Returns the UserProfileMessage data message's positionSetting field's current value.
ActivityClass activityClass() const
Returns the UserProfileMessage data message's activityClass field's current value.
quint8 globalId() const
Returns the UserProfileMessage data message's globalId field's current value.
quint8 defaultMaxHeartRate() const
Returns the UserProfileMessage data message's defaultMaxHeartRate field's current value.
DisplayHeart hrSetting() const
Returns the UserProfileMessage data message's hrSetting field's current value.
quint8 height() const
Returns the UserProfileMessage data message's height field's current value.
quint8 restingHeartRate() const
Returns the UserProfileMessage data message's restingHeartRate field's current value.
QString friendlyName() const
Returns the UserProfileMessage data message's friendlyName field's current value.
void setGender(const Gender gender)
Sets the gender field to gender.
quint16 userRunningStepLength() const
Returns the UserProfileMessage data message's userRunningStepLength field's current value.
void setWeightSetting(const DisplayMeasure weightSetting)
Sets the weightSetting field to weightSetting.
void setRestingHeartRate(const quint8 restingHeartRate)
Sets the restingHeartRate field to restingHeartRate.
void setPowerSetting(const DisplayPower powerSetting)
Sets the powerSetting field to powerSetting.
quint16 weight() const
Returns the UserProfileMessage data message's weight field's current value.
void setHeightSetting(const DisplayMeasure heightSetting)
Sets the heightSetting field to heightSetting.
void setDefaultMaxBikingHeartRate(const quint8 defaultMaxBikingHeartRate)
Sets the defaultMaxBikingHeartRate field to defaultMaxBikingHeartRate.
void setDefaultMaxRunningHeartRate(const quint8 defaultMaxRunningHeartRate)
Sets the defaultMaxRunningHeartRate field to defaultMaxRunningHeartRate.
void setFriendlyName(const QString friendlyName)
Sets the friendlyName field to friendlyName.
DisplayMeasure distSetting() const
Returns the UserProfileMessage data message's distSetting field's current value.
void setPositionSetting(const DisplayPosition positionSetting)
Sets the positionSetting field to positionSetting.
void setDiveCount(const quint32 diveCount)
Sets the diveCount field to diveCount.
void setLanguage(const Language language)
Sets the language field to language.
DisplayMeasure temperatureSetting() const
Returns the UserProfileMessage data message's temperatureSetting field's current value.
DisplayMeasure heightSetting() const
Returns the UserProfileMessage data message's heightSetting field's current value.
quint16 userWalkingStepLength() const
Returns the UserProfileMessage data message's userWalkingStepLength field's current value.
DisplayMeasure depthSetting() const
Returns the UserProfileMessage data message's depthSetting field's current value.
void setMessageIndex(const MessageIndex messageIndex)
Sets the messageIndex field to messageIndex.
Gender gender() const
Returns the UserProfileMessage data message's gender field's current value.
quint8 age() const
Returns the UserProfileMessage data message's age field's current value.
void setSpeedSetting(const DisplayMeasure speedSetting)
Sets the speedSetting field to speedSetting.
void setDistSetting(const DisplayMeasure distSetting)
Sets the distSetting field to distSetting.
void setWakeTime(const LocaltimeIntoDay wakeTime)
Sets the wakeTime field to wakeTime.
void setDepthSetting(const DisplayMeasure depthSetting)
Sets the depthSetting field to depthSetting.
LocaltimeIntoDay sleepTime() const
Returns the UserProfileMessage data message's sleepTime field's current value.
void setUserRunningStepLength(const quint16 userRunningStepLength)
Sets the userRunningStepLength field to userRunningStepLength.
DisplayPower powerSetting() const
Returns the UserProfileMessage data message's powerSetting field's current value.
Language language() const
Returns the UserProfileMessage data message's language field's current value.
LocaltimeIntoDay wakeTime() const
Returns the UserProfileMessage data message's wakeTime field's current value.
quint8 defaultMaxBikingHeartRate() const
Returns the UserProfileMessage data message's defaultMaxBikingHeartRate field's current value.
void setAge(const quint8 age)
Sets the age field to age.
void setElevSetting(const DisplayMeasure elevSetting)
Sets the elevSetting field to elevSetting.
DisplayMeasure weightSetting() const
Returns the UserProfileMessage data message's weightSetting field's current value.
void setGlobalId(const quint8 globalId)
Sets the globalId field to globalId.
void setSleepTime(const LocaltimeIntoDay sleepTime)
Sets the sleepTime field to sleepTime.
void setDefaultMaxHeartRate(const quint8 defaultMaxHeartRate)
Sets the defaultMaxHeartRate field to defaultMaxHeartRate.
quint32 diveCount() const
Returns the UserProfileMessage data message's diveCount field's current value.
void setTemperatureSetting(const DisplayMeasure temperatureSetting)
Sets the temperatureSetting field to temperatureSetting.
DisplayMeasure elevSetting() const
Returns the UserProfileMessage data message's elevSetting field's current value.
void setActivityClass(const ActivityClass activityClass)
Sets the activityClass field to activityClass.
MessageIndex messageIndex() const
Returns the UserProfileMessage data message's messageIndex field's current value.
void setHeight(const quint8 height)
Sets the height field to height.
void setUserWalkingStepLength(const quint16 userWalkingStepLength)
Sets the userWalkingStepLength field to userWalkingStepLength.
UserLocalId localId() const
Returns the UserProfileMessage data message's localId field's current value.
quint8 defaultMaxRunningHeartRate() const
Returns the UserProfileMessage data message's defaultMaxRunningHeartRate field's current value.
void setHrSetting(const DisplayHeart hrSetting)
Sets the hrSetting field to hrSetting.
void setWeight(const quint16 weight)
Sets the weight field to weight.
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
FitBaseType
Garmin FIT FitBaseType type.
Definition: types.h:3388
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
Declares the UserProfileMessage class.
Declares the UserProfileMessagePrivate class.