dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
uavmapfollowtype.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 UAVMAPFOLLOWTYPE_H
29 #define UAVMAPFOLLOWTYPE_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 UAVMapFollowType:public QObject
38  {
39  Q_OBJECT
40  Q_ENUMS(Types)
41  public:
42  enum Types
43  {
47  CenterMap,
48 
52  CenterAndRotateMap,
53 
57  None
58  };
59  static QString StrByType(Types const& value)
60  {
61  QMetaObject metaObject = UAVMapFollowType().staticMetaObject;
62  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
63  QString s=metaEnum.valueToKey(value);
64  return s;
65  }
66  static Types TypeByStr(QString const& value)
67  {
68  QMetaObject metaObject = UAVMapFollowType().staticMetaObject;
69  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
70  Types s=(Types)metaEnum.keyToValue(value.toLatin1());
71  return s;
72  }
73  static QStringList TypesList()
74  {
75  QStringList ret;
76  QMetaObject metaObject = UAVMapFollowType().staticMetaObject;
77  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
78  for(int x=0;x<metaEnum.keyCount();++x)
79  {
80  ret.append(metaEnum.key(x));
81  }
82  return ret;
83  }
84 
85  };
86 }
87 
88 #endif // UAVMAPFOLLOWTYPE_H
x
Definition: OPPlots.m:100