QtFit  0.1
Internal library development documentation
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
divesettingsmessage.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 DiveSettingsMessage, and DiveSettingsMessagePrivate classes.
28  */
29 
30 #include "divesettingsmessage.h"
31 #include "divesettingsmessage_p.h"
32 
33 #include <QDebug>
34 #include <QtEndian>
35 
37 
38 /*!
39  * \class DiveSettingsMessage
40  *
41  * The DiveSettingsMessage class represents a FIT DiveSettingsMessage data message.
42  *
43  * \sa DataMessage
44  */
45 
46 /*!
47  * Constructs a DiveSettingsMessage 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 DiveSettingsMessage object with private implementation \a d.
61  *
62  * \param d Pointer to private implementation.
63  */
65 {
66 
67 }
68 
69 /*!
70  * Returns the DiveSettingsMessage data message's \c messageIndex field's current value.
71  *
72  * \return the \c messageIndex field value.
73  */
75 {
76  Q_D(const DiveSettingsMessage);
77  return d->messageIndex;
78 }
79 
80 /*!
81  * Returns the DiveSettingsMessage data message's \c name field's current value.
82  *
83  * \return the \c name field value.
84  */
86 {
87  Q_D(const DiveSettingsMessage);
88  return d->name;
89 }
90 
91 /*!
92  * Returns the DiveSettingsMessage data message's \c model field's current value.
93  *
94  * \return the \c model field value.
95  */
97 {
98  Q_D(const DiveSettingsMessage);
99  return d->model;
100 }
101 
102 /*!
103  * Returns the DiveSettingsMessage data message's \c gfLow field's current value.
104  *
105  * \return the \c gfLow field value.
106  */
108 {
109  Q_D(const DiveSettingsMessage);
110  return d->gfLow;
111 }
112 
113 /*!
114  * Returns the DiveSettingsMessage data message's \c gfHigh field's current value.
115  *
116  * \return the \c gfHigh field value.
117  */
119 {
120  Q_D(const DiveSettingsMessage);
121  return d->gfHigh;
122 }
123 
124 /*!
125  * Returns the DiveSettingsMessage data message's \c waterType field's current value.
126  *
127  * \return the \c waterType field value.
128  */
130 {
131  Q_D(const DiveSettingsMessage);
132  return d->waterType;
133 }
134 
135 /*!
136  * Returns the DiveSettingsMessage data message's \c waterDensity field's current value.
137  *
138  * Fresh water is usually 1000; salt water is usually 1025
139  *
140  * \return the \c waterDensity field value.
141  */
143 {
144  Q_D(const DiveSettingsMessage);
145  return d->waterDensity;
146 }
147 
148 /*!
149  * Returns the DiveSettingsMessage data message's \c po2Warn field's current value.
150  *
151  * Typically 1.40
152  *
153  * \return the \c po2Warn field value.
154  */
156 {
157  Q_D(const DiveSettingsMessage);
158  return d->po2Warn;
159 }
160 
161 /*!
162  * Returns the DiveSettingsMessage data message's \c po2Critical field's current value.
163  *
164  * Typically 1.60
165  *
166  * \return the \c po2Critical field value.
167  */
169 {
170  Q_D(const DiveSettingsMessage);
171  return d->po2Critical;
172 }
173 
174 /*!
175  * Returns the DiveSettingsMessage data message's \c po2Deco field's current value.
176  *
177  * \return the \c po2Deco field value.
178  */
180 {
181  Q_D(const DiveSettingsMessage);
182  return d->po2Deco;
183 }
184 
185 /*!
186  * Returns the DiveSettingsMessage data message's \c safetyStopEnabled field's current value.
187  *
188  * \return the \c safetyStopEnabled field value.
189  */
191 {
192  Q_D(const DiveSettingsMessage);
193  return d->safetyStopEnabled;
194 }
195 
196 /*!
197  * Returns the DiveSettingsMessage data message's \c bottomDepth field's current value.
198  *
199  * \return the \c bottomDepth field value.
200  */
202 {
203  Q_D(const DiveSettingsMessage);
204  return d->bottomDepth;
205 }
206 
207 /*!
208  * Returns the DiveSettingsMessage data message's \c bottomTime field's current value.
209  *
210  * \return the \c bottomTime field value.
211  */
213 {
214  Q_D(const DiveSettingsMessage);
215  return d->bottomTime;
216 }
217 
218 /*!
219  * Returns the DiveSettingsMessage data message's \c apneaCountdownEnabled field's current value.
220  *
221  * \return the \c apneaCountdownEnabled field value.
222  */
224 {
225  Q_D(const DiveSettingsMessage);
226  return d->apneaCountdownEnabled;
227 }
228 
229 /*!
230  * Returns the DiveSettingsMessage data message's \c apneaCountdownTime field's current value.
231  *
232  * \return the \c apneaCountdownTime field value.
233  */
235 {
236  Q_D(const DiveSettingsMessage);
237  return d->apneaCountdownTime;
238 }
239 
240 /*!
241  * Returns the DiveSettingsMessage data message's \c backlightMode field's current value.
242  *
243  * \return the \c backlightMode field value.
244  */
246 {
247  Q_D(const DiveSettingsMessage);
248  return d->backlightMode;
249 }
250 
251 /*!
252  * Returns the DiveSettingsMessage data message's \c backlightBrightness field's current value.
253  *
254  * \return the \c backlightBrightness field value.
255  */
257 {
258  Q_D(const DiveSettingsMessage);
259  return d->backlightBrightness;
260 }
261 
262 /*!
263  * Returns the DiveSettingsMessage data message's \c backlightTimeout field's current value.
264  *
265  * \return the \c backlightTimeout field value.
266  */
268 {
269  Q_D(const DiveSettingsMessage);
270  return d->backlightTimeout;
271 }
272 
273 /*!
274  * Returns the DiveSettingsMessage data message's \c repeatDiveInterval field's current value.
275  *
276  * Time between surfacing and ending the activity
277  *
278  * \return the \c repeatDiveInterval field value.
279  */
281 {
282  Q_D(const DiveSettingsMessage);
283  return d->repeatDiveInterval;
284 }
285 
286 /*!
287  * Returns the DiveSettingsMessage data message's \c safetyStopTime field's current value.
288  *
289  * Time at safety stop (if enabled)
290  *
291  * \return the \c safetyStopTime field value.
292  */
294 {
295  Q_D(const DiveSettingsMessage);
296  return d->safetyStopTime;
297 }
298 
299 /*!
300  * Returns the DiveSettingsMessage data message's \c heartRateSourceType field's current value.
301  *
302  * \return the \c heartRateSourceType field value.
303  */
305 {
306  Q_D(const DiveSettingsMessage);
307  return d->heartRateSourceType;
308 }
309 
310 /*!
311  * Returns the DiveSettingsMessage data message's \c heartRateSource field's current value.
312  *
313  * \return the \c heartRateSource field value.
314  */
316 {
317  Q_D(const DiveSettingsMessage);
318  return d->heartRateSource;
319 }
320 
321 /*!
322  * Sets the \c messageIndex field to \a messageIndex.
323  *
324  * \param messageIndex The field value to set.
325  */
327 {
328  Q_D(DiveSettingsMessage);
329  d->messageIndex = messageIndex;
330 }
331 /*!
332  * Sets the \c name field to \a name.
333  *
334  * \param name The field value to set.
335  */
336 void DiveSettingsMessage::setName(const QString name)
337 {
338  Q_D(DiveSettingsMessage);
339  d->name = name;
340 }
341 /*!
342  * Sets the \c model field to \a model.
343  *
344  * \param model The field value to set.
345  */
347 {
348  Q_D(DiveSettingsMessage);
349  d->model = model;
350 }
351 /*!
352  * Sets the \c gfLow field to \a gfLow.
353  *
354  * \param gfLow The field value to set.
355  */
356 void DiveSettingsMessage::setGfLow(const quint8 gfLow)
357 {
358  Q_D(DiveSettingsMessage);
359  d->gfLow = gfLow;
360 }
361 /*!
362  * Sets the \c gfHigh field to \a gfHigh.
363  *
364  * \param gfHigh The field value to set.
365  */
366 void DiveSettingsMessage::setGfHigh(const quint8 gfHigh)
367 {
368  Q_D(DiveSettingsMessage);
369  d->gfHigh = gfHigh;
370 }
371 /*!
372  * Sets the \c waterType field to \a waterType.
373  *
374  * \param waterType The field value to set.
375  */
377 {
378  Q_D(DiveSettingsMessage);
379  d->waterType = waterType;
380 }
381 /*!
382  * Sets the \c waterDensity field to \a waterDensity.
383  *
384  * \param waterDensity The field value to set.
385  */
386 void DiveSettingsMessage::setWaterDensity(const float waterDensity)
387 {
388  Q_D(DiveSettingsMessage);
389  d->waterDensity = waterDensity;
390 }
391 /*!
392  * Sets the \c po2Warn field to \a po2Warn.
393  *
394  * \param po2Warn The field value to set.
395  */
396 void DiveSettingsMessage::setPo2Warn(const quint8 po2Warn)
397 {
398  Q_D(DiveSettingsMessage);
399  d->po2Warn = po2Warn;
400 }
401 /*!
402  * Sets the \c po2Critical field to \a po2Critical.
403  *
404  * \param po2Critical The field value to set.
405  */
406 void DiveSettingsMessage::setPo2Critical(const quint8 po2Critical)
407 {
408  Q_D(DiveSettingsMessage);
409  d->po2Critical = po2Critical;
410 }
411 /*!
412  * Sets the \c po2Deco field to \a po2Deco.
413  *
414  * \param po2Deco The field value to set.
415  */
416 void DiveSettingsMessage::setPo2Deco(const quint8 po2Deco)
417 {
418  Q_D(DiveSettingsMessage);
419  d->po2Deco = po2Deco;
420 }
421 /*!
422  * Sets the \c safetyStopEnabled field to \a safetyStopEnabled.
423  *
424  * \param safetyStopEnabled The field value to set.
425  */
426 void DiveSettingsMessage::setSafetyStopEnabled(const bool safetyStopEnabled)
427 {
428  Q_D(DiveSettingsMessage);
429  d->safetyStopEnabled = safetyStopEnabled;
430 }
431 /*!
432  * Sets the \c bottomDepth field to \a bottomDepth.
433  *
434  * \param bottomDepth The field value to set.
435  */
436 void DiveSettingsMessage::setBottomDepth(const float bottomDepth)
437 {
438  Q_D(DiveSettingsMessage);
439  d->bottomDepth = bottomDepth;
440 }
441 /*!
442  * Sets the \c bottomTime field to \a bottomTime.
443  *
444  * \param bottomTime The field value to set.
445  */
446 void DiveSettingsMessage::setBottomTime(const quint32 bottomTime)
447 {
448  Q_D(DiveSettingsMessage);
449  d->bottomTime = bottomTime;
450 }
451 /*!
452  * Sets the \c apneaCountdownEnabled field to \a apneaCountdownEnabled.
453  *
454  * \param apneaCountdownEnabled The field value to set.
455  */
456 void DiveSettingsMessage::setApneaCountdownEnabled(const bool apneaCountdownEnabled)
457 {
458  Q_D(DiveSettingsMessage);
459  d->apneaCountdownEnabled = apneaCountdownEnabled;
460 }
461 /*!
462  * Sets the \c apneaCountdownTime field to \a apneaCountdownTime.
463  *
464  * \param apneaCountdownTime The field value to set.
465  */
466 void DiveSettingsMessage::setApneaCountdownTime(const quint32 apneaCountdownTime)
467 {
468  Q_D(DiveSettingsMessage);
469  d->apneaCountdownTime = apneaCountdownTime;
470 }
471 /*!
472  * Sets the \c backlightMode field to \a backlightMode.
473  *
474  * \param backlightMode The field value to set.
475  */
477 {
478  Q_D(DiveSettingsMessage);
479  d->backlightMode = backlightMode;
480 }
481 /*!
482  * Sets the \c backlightBrightness field to \a backlightBrightness.
483  *
484  * \param backlightBrightness The field value to set.
485  */
486 void DiveSettingsMessage::setBacklightBrightness(const quint8 backlightBrightness)
487 {
488  Q_D(DiveSettingsMessage);
489  d->backlightBrightness = backlightBrightness;
490 }
491 /*!
492  * Sets the \c backlightTimeout field to \a backlightTimeout.
493  *
494  * \param backlightTimeout The field value to set.
495  */
497 {
498  Q_D(DiveSettingsMessage);
499  d->backlightTimeout = backlightTimeout;
500 }
501 /*!
502  * Sets the \c repeatDiveInterval field to \a repeatDiveInterval.
503  *
504  * \param repeatDiveInterval The field value to set.
505  */
506 void DiveSettingsMessage::setRepeatDiveInterval(const quint16 repeatDiveInterval)
507 {
508  Q_D(DiveSettingsMessage);
509  d->repeatDiveInterval = repeatDiveInterval;
510 }
511 /*!
512  * Sets the \c safetyStopTime field to \a safetyStopTime.
513  *
514  * \param safetyStopTime The field value to set.
515  */
516 void DiveSettingsMessage::setSafetyStopTime(const quint16 safetyStopTime)
517 {
518  Q_D(DiveSettingsMessage);
519  d->safetyStopTime = safetyStopTime;
520 }
521 /*!
522  * Sets the \c heartRateSourceType field to \a heartRateSourceType.
523  *
524  * \param heartRateSourceType The field value to set.
525  */
527 {
528  Q_D(DiveSettingsMessage);
529  d->heartRateSourceType = heartRateSourceType;
530 }
531 /*!
532  * Sets the \c heartRateSource field to \a heartRateSource.
533  *
534  * \param heartRateSource The field value to set.
535  */
536 void DiveSettingsMessage::setHeartRateSource(const quint8 heartRateSource)
537 {
538  Q_D(DiveSettingsMessage);
539  d->heartRateSource = heartRateSource;
540 }
541 
542 /// \cond internal
543 
544 /*!
545  * \internal
546  *
547  * \class DiveSettingsMessagePrivate
548  *
549  * The DiveSettingsMessagePrivate class provides private implementation for the DiveSettingsMessage.
550  *
551  * \sa DiveSettingsMessage
552  */
553 
554 /*!
555  * \internal
556  *
557  * Constructs a DiveSettingsMessagePrivate object with public implementation \a q.
558  *
559  * \param q Pointer to public implementaton.
560  */
561 DiveSettingsMessagePrivate::DiveSettingsMessagePrivate(DiveSettingsMessage * const q)
563  , messageIndex(static_cast<MessageIndex>(-1))
564  , model(static_cast<TissueModelType>(-1))
565  , gfLow(0xFF)
566  , gfHigh(0xFF)
567  , waterType(static_cast<WaterType>(-1))
568  , waterDensity(static_cast<float>(-1))
569  , po2Warn(0xFF)
570  , po2Critical(0xFF)
571  , po2Deco(0xFF)
572  , safetyStopEnabled(static_cast<bool>(-1))
573  , bottomDepth(static_cast<float>(-1))
574  , bottomTime(0xFFFFFFFF)
575  , apneaCountdownEnabled(static_cast<bool>(-1))
576  , apneaCountdownTime(0xFFFFFFFF)
577  , backlightMode(static_cast<DiveBacklightMode>(-1))
578  , backlightBrightness(0xFF)
579  , backlightTimeout(static_cast<BacklightTimeout>(-1))
580  , repeatDiveInterval(0xFFFF)
581  , safetyStopTime(0xFFFF)
582  , heartRateSourceType(static_cast<SourceType>(-1))
583  , heartRateSource(0xFF)
584 {
585  globalMessageNumber = MesgNum::DiveSettings;
586 }
587 
588 /*!
589  * \internal
590  *
591  * Destroys the DiveSettingsMessagePrivate object.
592  */
594 {
595 
596 }
597 
599  const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian)
600 {
601  switch (fieldId) {
602  case 254: // See Profile.xlsx::Messages:dive_settings.messageIndex
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));
605  break;
606  case 0: // See Profile.xlsx::Messages:dive_settings.name
607  if (!verify(data, baseType, 1, FitBaseType::String, "dive_settings.name")) return false;
608  this->name = QString::fromUtf8(data);
609  break;
610  case 1: // See Profile.xlsx::Messages:dive_settings.model
611  if (!verify(data, baseType, 1, FitBaseType::Enum, "dive_settings.model")) return false;
612  this->model = static_cast<TissueModelType>(data.at(0));
613  break;
614  case 2: // See Profile.xlsx::Messages:dive_settings.gfLow
615  if (!verify(data, baseType, 1, FitBaseType::Uint8, "dive_settings.gfLow")) return false;
616  this->gfLow = static_cast<quint8>(data.at(0));
617  break;
618  case 3: // See Profile.xlsx::Messages:dive_settings.gfHigh
619  if (!verify(data, baseType, 1, FitBaseType::Uint8, "dive_settings.gfHigh")) return false;
620  this->gfHigh = static_cast<quint8>(data.at(0));
621  break;
622  case 4: // See Profile.xlsx::Messages:dive_settings.waterType
623  if (!verify(data, baseType, 1, FitBaseType::Enum, "dive_settings.waterType")) return false;
624  this->waterType = static_cast<WaterType>(data.at(0));
625  break;
626  case 5: // See Profile.xlsx::Messages:dive_settings.waterDensity
627  if (!verify(data, baseType, 4, FitBaseType::Float32, "dive_settings.waterDensity")) return false;
628  #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
629  { // Qt's from-endian functions have no float/double specialisations prior to Qt 5.12.
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");
633  memcpy(&this->waterDensity, &localEndian, data.size());
634  }
635  #else
636  this->waterDensity = static_cast<float>(bigEndian ? qFromBigEndian<float>(data) : qFromLittleEndian<float>(data));
637  #endif
638  break;
639  case 6: // See Profile.xlsx::Messages:dive_settings.po2Warn
640  if (!verify(data, baseType, 1, FitBaseType::Uint8, "dive_settings.po2Warn")) return false;
641  this->po2Warn = static_cast<quint8>(data.at(0));
642  break;
643  case 7: // See Profile.xlsx::Messages:dive_settings.po2Critical
644  if (!verify(data, baseType, 1, FitBaseType::Uint8, "dive_settings.po2Critical")) return false;
645  this->po2Critical = static_cast<quint8>(data.at(0));
646  break;
647  case 8: // See Profile.xlsx::Messages:dive_settings.po2Deco
648  if (!verify(data, baseType, 1, FitBaseType::Uint8, "dive_settings.po2Deco")) return false;
649  this->po2Deco = static_cast<quint8>(data.at(0));
650  break;
651  case 9: // See Profile.xlsx::Messages:dive_settings.safetyStopEnabled
652  if (!verify(data, baseType, 0, FitBaseType::Byte, "dive_settings.safetyStopEnabled")) return false;
653  this->safetyStopEnabled = static_cast<bool>(data.at(0));
654  break;
655  case 10: // See Profile.xlsx::Messages:dive_settings.bottomDepth
656  if (!verify(data, baseType, 4, FitBaseType::Float32, "dive_settings.bottomDepth")) return false;
657  #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
658  { // Qt's from-endian functions have no float/double specialisations prior to Qt 5.12.
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());
663  }
664  #else
665  this->bottomDepth = static_cast<float>(bigEndian ? qFromBigEndian<float>(data) : qFromLittleEndian<float>(data));
666  #endif
667  break;
668  case 11: // See Profile.xlsx::Messages:dive_settings.bottomTime
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));
671  break;
672  case 12: // See Profile.xlsx::Messages:dive_settings.apneaCountdownEnabled
673  if (!verify(data, baseType, 0, FitBaseType::Byte, "dive_settings.apneaCountdownEnabled")) return false;
674  this->apneaCountdownEnabled = static_cast<bool>(data.at(0));
675  break;
676  case 13: // See Profile.xlsx::Messages:dive_settings.apneaCountdownTime
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));
679  break;
680  case 14: // See Profile.xlsx::Messages:dive_settings.backlightMode
681  if (!verify(data, baseType, 1, FitBaseType::Enum, "dive_settings.backlightMode")) return false;
682  this->backlightMode = static_cast<DiveBacklightMode>(data.at(0));
683  break;
684  case 15: // See Profile.xlsx::Messages:dive_settings.backlightBrightness
685  if (!verify(data, baseType, 1, FitBaseType::Uint8, "dive_settings.backlightBrightness")) return false;
686  this->backlightBrightness = static_cast<quint8>(data.at(0));
687  break;
688  case 16: // See Profile.xlsx::Messages:dive_settings.backlightTimeout
689  if (!verify(data, baseType, 1, FitBaseType::Uint8, "dive_settings.backlightTimeout")) return false;
690  this->backlightTimeout = static_cast<BacklightTimeout>(data.at(0));
691  break;
692  case 17: // See Profile.xlsx::Messages:dive_settings.repeatDiveInterval
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));
695  break;
696  case 18: // See Profile.xlsx::Messages:dive_settings.safetyStopTime
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));
699  break;
700  case 19: // See Profile.xlsx::Messages:dive_settings.heartRateSourceType
701  if (!verify(data, baseType, 1, FitBaseType::Enum, "dive_settings.heartRateSourceType")) return false;
702  this->heartRateSourceType = static_cast<SourceType>(data.at(0));
703  break;
704  case 20: // See Profile.xlsx::Messages:dive_settings.heartRateSource
705  if (!verify(data, baseType, 1, FitBaseType::Uint8, "dive_settings.heartRateSource")) return false;
706  this->heartRateSource = static_cast<quint8>(data.at(0));
707  break;
708  default:
709  qWarning() << "ignoring unknown dive_settings message field number" << fieldId << bigEndian;
710  // Fall through to return true, as its still 'safe' to continue parsing data messages.
711  }
712  return true;
713 }
714 
715 /// \endcond
716 
#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.
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.
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.
Definition: types.h:2789
DiveBacklightMode
Garmin FIT DiveBacklightMode type.
Definition: types.h:5249
TissueModelType
Garmin FIT TissueModelType type.
Definition: types.h:5207
FitBaseType
Garmin FIT FitBaseType type.
Definition: types.h:3388
BacklightTimeout
Timeout in seconds.
Definition: types.h:1120
MessageIndex
Garmin FIT MessageIndex type.
Definition: types.h:263
WaterType
Garmin FIT WaterType type.
Definition: types.h:5191