dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
uavtrailtype.h
Go to the documentation of this file.
1 
13 /*
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, see <http://www.gnu.org/licenses/>
26 */
27 
28 #ifndef UAVTRAILTYPE_H
29 #define UAVTRAILTYPE_H
30 #include <QObject>
31 #include <QMetaObject>
32 #include <QMetaEnum>
33 #include <QStringList>
34 #include "../core/corecommon.h"
35 
36 namespace mapcontrol {
37  class TLMAPWIDGET_EXPORT UAVTrailType:public QObject
38  {
39  Q_OBJECT
40  Q_ENUMS(Types)
41  public:
42  enum Types
43  {
49  NoTrail,
55  ByTimeElapsed,
61  ByDistance
62  };
63  static QString StrByType(Types const& value)
64  {
65  QMetaObject metaObject = UAVTrailType().staticMetaObject;
66  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
67  QString s=metaEnum.valueToKey(value);
68  return s;
69  }
70  static Types TypeByStr(QString const& value)
71  {
72  QMetaObject metaObject = UAVTrailType().staticMetaObject;
73  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
74  Types s=(Types)metaEnum.keyToValue(value.toLatin1());
75  return s;
76  }
77  static QStringList TypesList()
78  {
79  QStringList ret;
80  QMetaObject metaObject = UAVTrailType().staticMetaObject;
81  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
82  for(int x=0;x<metaEnum.keyCount();++x)
83  {
84  ret.append(metaEnum.key(x));
85  }
86  return ret;
87  }
88 
89  };
90 }
91 
92 #endif // UAVTRAILTYPE_H
x
Definition: OPPlots.m:100