QtFit  0.1
Internal library development documentation
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
exddatafieldconfigurationmessage.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 ExdDataFieldConfigurationMessage, and ExdDataFieldConfigurationMessagePrivate classes.
28  */
29 
32 
33 #include <QDebug>
34 #include <QtEndian>
35 
37 
38 /*!
39  * \class ExdDataFieldConfigurationMessage
40  *
41  * The ExdDataFieldConfigurationMessage class represents a FIT ExdDataFieldConfigurationMessage data message.
42  *
43  * \sa DataMessage
44  */
45 
46 /*!
47  * Constructs a ExdDataFieldConfigurationMessage 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 ExdDataFieldConfigurationMessage object with private implementation \a d.
61  *
62  * \param d Pointer to private implementation.
63  */
65 {
66 
67 }
68 
69 /*!
70  * Returns the ExdDataFieldConfigurationMessage 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 ExdDataFieldConfigurationMessage data message's \c conceptField field's current value.
82  *
83  * \return the \c conceptField field value.
84  */
86 {
88  return d->conceptField;
89 }
90 
91 /*!
92  * Returns the ExdDataFieldConfigurationMessage data message's \c fieldId field's current value.
93  *
94  * \return the \c fieldId field value.
95  */
97 {
99  return d->fieldId;
100 }
101 
102 /*!
103  * Returns the ExdDataFieldConfigurationMessage data message's \c conceptCount field's current value.
104  *
105  * \return the \c conceptCount field value.
106  */
108 {
110  return d->conceptCount;
111 }
112 
113 /*!
114  * Returns the ExdDataFieldConfigurationMessage data message's \c displayType field's current value.
115  *
116  * \return the \c displayType field value.
117  */
119 {
121  return d->displayType;
122 }
123 
124 /*!
125  * Returns the ExdDataFieldConfigurationMessage data message's \c title field's current value.
126  *
127  * \return the \c title field value.
128  */
130 {
132  return d->title;
133 }
134 
135 /*!
136  * Sets the \c screenIndex field to \a screenIndex.
137  *
138  * \param screenIndex The field value to set.
139  */
141 {
143  d->screenIndex = screenIndex;
144 }
145 /*!
146  * Sets the \c conceptField field to \a conceptField.
147  *
148  * \param conceptField The field value to set.
149  */
151 {
153  d->conceptField = conceptField;
154 }
155 /*!
156  * Sets the \c fieldId field to \a fieldId.
157  *
158  * \param fieldId The field value to set.
159  */
161 {
163  d->fieldId = fieldId;
164 }
165 /*!
166  * Sets the \c conceptCount field to \a conceptCount.
167  *
168  * \param conceptCount The field value to set.
169  */
171 {
173  d->conceptCount = conceptCount;
174 }
175 /*!
176  * Sets the \c displayType field to \a displayType.
177  *
178  * \param displayType The field value to set.
179  */
181 {
183  d->displayType = displayType;
184 }
185 /*!
186  * Sets the \c title field to \a title.
187  *
188  * \param title The field value to set.
189  */
191 {
193  d->title = title;
194 }
195 
196 /// \cond internal
197 
198 /*!
199  * \internal
200  *
201  * \class ExdDataFieldConfigurationMessagePrivate
202  *
203  * The ExdDataFieldConfigurationMessagePrivate class provides private implementation for the ExdDataFieldConfigurationMessage.
204  *
205  * \sa ExdDataFieldConfigurationMessage
206  */
207 
208 /*!
209  * \internal
210  *
211  * Constructs a ExdDataFieldConfigurationMessagePrivate object with public implementation \a q.
212  *
213  * \param q Pointer to public implementaton.
214  */
215 ExdDataFieldConfigurationMessagePrivate::ExdDataFieldConfigurationMessagePrivate(ExdDataFieldConfigurationMessage * const q)
217  , screenIndex(0xFF)
218  , conceptField(0xFF)
219  , fieldId(0xFF)
220  , conceptCount(0xFF)
221  , displayType(static_cast<ExdDisplayType>(-1))
222 {
223  globalMessageNumber = MesgNum::ExdDataFieldConfiguration;
224 }
225 
226 /*!
227  * \internal
228  *
229  * Destroys the ExdDataFieldConfigurationMessagePrivate object.
230  */
232 {
233 
234 }
235 
237  const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian)
238 {
239  switch (fieldId) {
240  case 0: // See Profile.xlsx::Messages:exd_data_field_configuration.screenIndex
241  if (!verify(data, baseType, 1, FitBaseType::Uint8, "exd_data_field_configuration.screenIndex")) return false;
242  this->screenIndex = static_cast<quint8>(data.at(0));
243  break;
244  case 1: // See Profile.xlsx::Messages:exd_data_field_configuration.conceptField
245  if (!verify(data, baseType, 1, FitBaseType::Byte, "exd_data_field_configuration.conceptField")) return false;
246  this->conceptField = static_cast<quint8>(data.at(0));
247  break;
248  case 2: // See Profile.xlsx::Messages:exd_data_field_configuration.fieldId
249  if (!verify(data, baseType, 1, FitBaseType::Uint8, "exd_data_field_configuration.fieldId")) return false;
250  this->fieldId = static_cast<quint8>(data.at(0));
251  break;
252  case 3: // See Profile.xlsx::Messages:exd_data_field_configuration.conceptCount
253  if (!verify(data, baseType, 1, FitBaseType::Uint8, "exd_data_field_configuration.conceptCount")) return false;
254  this->conceptCount = static_cast<quint8>(data.at(0));
255  break;
256  case 4: // See Profile.xlsx::Messages:exd_data_field_configuration.displayType
257  if (!verify(data, baseType, 1, FitBaseType::Enum, "exd_data_field_configuration.displayType")) return false;
258  this->displayType = static_cast<ExdDisplayType>(data.at(0));
259  break;
260  case 5: // See Profile.xlsx::Messages:exd_data_field_configuration.title
261  if (!verify(data, baseType, 1, FitBaseType::String, "exd_data_field_configuration.title")) return false;
262  this->title = QString::fromUtf8(data);
263  break;
264  default:
265  qWarning() << "ignoring unknown exd_data_field_configuration message field number" << fieldId << bigEndian;
266  // Fall through to return true, as its still 'safe' to continue parsing data messages.
267  }
268  return true;
269 }
270 
271 /// \endcond
272 
#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 screenIndex
The ExdDataFieldConfigurationMessage FIT message's screenIndex field.
ExdDisplayType displayType
The ExdDataFieldConfigurationMessage FIT message's displayType field.
quint8 conceptCount
The ExdDataFieldConfigurationMessage FIT message's conceptCount field.
QString title
The ExdDataFieldConfigurationMessage FIT message's title field.
quint8 fieldId
The ExdDataFieldConfigurationMessage FIT message's fieldId field.
bool setField(const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian) override
quint8 conceptField
The ExdDataFieldConfigurationMessage FIT message's conceptField field.
The ExdDataFieldConfigurationMessage class represents a FIT ExdDataFieldConfigurationMessage data mes...
QString title() const
Returns the ExdDataFieldConfigurationMessage data message's title field's current value.
quint8 fieldId() const
Returns the ExdDataFieldConfigurationMessage data message's fieldId field's current value.
void setFieldId(const quint8 fieldId)
Sets the fieldId field to fieldId.
void setScreenIndex(const quint8 screenIndex)
Sets the screenIndex field to screenIndex.
void setDisplayType(const ExdDisplayType displayType)
Sets the displayType field to displayType.
void setConceptField(const quint8 conceptField)
Sets the conceptField field to conceptField.
ExdDisplayType displayType() const
Returns the ExdDataFieldConfigurationMessage data message's displayType field's current value.
void setConceptCount(const quint8 conceptCount)
Sets the conceptCount field to conceptCount.
quint8 conceptCount() const
Returns the ExdDataFieldConfigurationMessage data message's conceptCount field's current value.
void setTitle(const QString title)
Sets the title field to title.
ExdDataFieldConfigurationMessage()
Constructs a ExdDataFieldConfigurationMessage object.
quint8 conceptField() const
Returns the ExdDataFieldConfigurationMessage data message's conceptField field's current value.
quint8 screenIndex() const
Returns the ExdDataFieldConfigurationMessage data message's screenIndex field's current value.
Declares the ExdDataFieldConfigurationMessage class.
Declares the ExdDataFieldConfigurationMessagePrivate class.
FitBaseType
Garmin FIT FitBaseType type.
Definition: types.h:3388
ExdDisplayType
Garmin FIT ExdDisplayType type.
Definition: types.h:3099