QtFit  0.1
Internal library development documentation
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
exdscreenconfigurationmessage.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 ExdScreenConfigurationMessage, and ExdScreenConfigurationMessagePrivate classes.
28  */
29 
32 
33 #include <QDebug>
34 #include <QtEndian>
35 
37 
38 /*!
39  * \class ExdScreenConfigurationMessage
40  *
41  * The ExdScreenConfigurationMessage class represents a FIT ExdScreenConfigurationMessage data message.
42  *
43  * \sa DataMessage
44  */
45 
46 /*!
47  * Constructs a ExdScreenConfigurationMessage 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 ExdScreenConfigurationMessage object with private implementation \a d.
61  *
62  * \param d Pointer to private implementation.
63  */
65 {
66 
67 }
68 
69 /*!
70  * Returns the ExdScreenConfigurationMessage data message's \c screenIndex field's current value.
71  *
72  * \return the \c screenIndex field value.
73  */
75 {
77  return d->screenIndex;
78 }
79 
80 /*!
81  * Returns the ExdScreenConfigurationMessage data message's \c fieldCount field's current value.
82  *
83  * number of fields in screen
84  *
85  * \return the \c fieldCount field value.
86  */
88 {
90  return d->fieldCount;
91 }
92 
93 /*!
94  * Returns the ExdScreenConfigurationMessage data message's \c layout field's current value.
95  *
96  * \return the \c layout field value.
97  */
99 {
101  return d->layout;
102 }
103 
104 /*!
105  * Returns the ExdScreenConfigurationMessage data message's \c screenEnabled field's current value.
106  *
107  * \return the \c screenEnabled field value.
108  */
110 {
112  return d->screenEnabled;
113 }
114 
115 /*!
116  * Sets the \c screenIndex field to \a screenIndex.
117  *
118  * \param screenIndex The field value to set.
119  */
120 void ExdScreenConfigurationMessage::setScreenIndex(const quint8 screenIndex)
121 {
123  d->screenIndex = screenIndex;
124 }
125 /*!
126  * Sets the \c fieldCount field to \a fieldCount.
127  *
128  * \param fieldCount The field value to set.
129  */
130 void ExdScreenConfigurationMessage::setFieldCount(const quint8 fieldCount)
131 {
133  d->fieldCount = fieldCount;
134 }
135 /*!
136  * Sets the \c layout field to \a layout.
137  *
138  * \param layout The field value to set.
139  */
141 {
143  d->layout = layout;
144 }
145 /*!
146  * Sets the \c screenEnabled field to \a screenEnabled.
147  *
148  * \param screenEnabled The field value to set.
149  */
151 {
153  d->screenEnabled = screenEnabled;
154 }
155 
156 /// \cond internal
157 
158 /*!
159  * \internal
160  *
161  * \class ExdScreenConfigurationMessagePrivate
162  *
163  * The ExdScreenConfigurationMessagePrivate class provides private implementation for the ExdScreenConfigurationMessage.
164  *
165  * \sa ExdScreenConfigurationMessage
166  */
167 
168 /*!
169  * \internal
170  *
171  * Constructs a ExdScreenConfigurationMessagePrivate object with public implementation \a q.
172  *
173  * \param q Pointer to public implementaton.
174  */
175 ExdScreenConfigurationMessagePrivate::ExdScreenConfigurationMessagePrivate(ExdScreenConfigurationMessage * const q)
177  , screenIndex(0xFF)
178  , fieldCount(0xFF)
179  , layout(static_cast<ExdLayout>(-1))
180  , screenEnabled(static_cast<bool>(-1))
181 {
182  globalMessageNumber = MesgNum::ExdScreenConfiguration;
183 }
184 
185 /*!
186  * \internal
187  *
188  * Destroys the ExdScreenConfigurationMessagePrivate object.
189  */
191 {
192 
193 }
194 
196  const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian)
197 {
198  switch (fieldId) {
199  case 0: // See Profile.xlsx::Messages:exd_screen_configuration.screenIndex
200  if (!verify(data, baseType, 1, FitBaseType::Uint8, "exd_screen_configuration.screenIndex")) return false;
201  this->screenIndex = static_cast<quint8>(data.at(0));
202  break;
203  case 1: // See Profile.xlsx::Messages:exd_screen_configuration.fieldCount
204  if (!verify(data, baseType, 1, FitBaseType::Uint8, "exd_screen_configuration.fieldCount")) return false;
205  this->fieldCount = static_cast<quint8>(data.at(0));
206  break;
207  case 2: // See Profile.xlsx::Messages:exd_screen_configuration.layout
208  if (!verify(data, baseType, 1, FitBaseType::Enum, "exd_screen_configuration.layout")) return false;
209  this->layout = static_cast<ExdLayout>(data.at(0));
210  break;
211  case 3: // See Profile.xlsx::Messages:exd_screen_configuration.screenEnabled
212  if (!verify(data, baseType, 0, FitBaseType::Byte, "exd_screen_configuration.screenEnabled")) return false;
213  this->screenEnabled = static_cast<bool>(data.at(0));
214  break;
215  default:
216  qWarning() << "ignoring unknown exd_screen_configuration message field number" << fieldId << bigEndian;
217  // Fall through to return true, as its still 'safe' to continue parsing data messages.
218  }
219  return true;
220 }
221 
222 /// \endcond
223 
#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 fieldCount
The ExdScreenConfigurationMessage FIT message's fieldCount field.
quint8 screenIndex
The ExdScreenConfigurationMessage FIT message's screenIndex field.
bool screenEnabled
The ExdScreenConfigurationMessage FIT message's screenEnabled field.
bool setField(const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian) override
ExdLayout layout
The ExdScreenConfigurationMessage FIT message's layout field.
The ExdScreenConfigurationMessage class represents a FIT ExdScreenConfigurationMessage data message.
quint8 fieldCount() const
Returns the ExdScreenConfigurationMessage data message's fieldCount field's current value.
void setFieldCount(const quint8 fieldCount)
Sets the fieldCount field to fieldCount.
void setLayout(const ExdLayout layout)
Sets the layout field to layout.
void setScreenEnabled(const bool screenEnabled)
Sets the screenEnabled field to screenEnabled.
quint8 screenIndex() const
Returns the ExdScreenConfigurationMessage data message's screenIndex field's current value.
void setScreenIndex(const quint8 screenIndex)
Sets the screenIndex field to screenIndex.
bool screenEnabled() const
Returns the ExdScreenConfigurationMessage data message's screenEnabled field's current value.
ExdScreenConfigurationMessage()
Constructs a ExdScreenConfigurationMessage object.
ExdLayout layout() const
Returns the ExdScreenConfigurationMessage data message's layout field's current value.
Declares the ExdScreenConfigurationMessage class.
Declares the ExdScreenConfigurationMessagePrivate class.
ExdLayout
Garmin FIT ExdLayout type.
Definition: types.h:3078
FitBaseType
Garmin FIT FitBaseType type.
Definition: types.h:3388