Merged in f5soh/librepilot/update_credits (pull request #529)
[librepilot.git] / ground / gcs / src / plugins / hitl / xplanesimulator10.h
blob772672ca2f42f6a3425444f9162fd55b716f348f
1 /**
2 ******************************************************************************
4 * @file xplanesimulator10.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @brief
7 * @see The GNU Public License (GPL) Version 3
8 * @defgroup hitlplugin
9 * @{
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #ifndef XPLANESIMULATOR10_H
29 #define XPLANESIMULATOR10_H
31 #include <QObject>
32 #include <QDataStream>
33 #include <simulator.h>
35 class XplaneSimulator10 : public Simulator {
36 Q_OBJECT
37 public:
38 XplaneSimulator10(const SimulatorSettings & params);
39 ~XplaneSimulator10();
40 bool setupProcess();
42 void setupUdpPorts(const QString & host, int inPort, int outPort);
44 private slots:
45 void transmitUpdate();
47 private:
48 enum XplaneOutputData // ***WARNING***: Elements in this enum are in a precise order, do
49 { // not change. Cf. http://www.nuclearprojects.com/xplane/info.shtml (outdated version 9 info)
50 // These fields have been updated for X-Plane version 10.x
51 /* 0 */ FramRate,
52 /* 1 */ Times,
53 /* 2 */ SimStats,
54 /* 3 */ Speed,
55 /* 4 */ Gload,
56 /* 5 */ AtmosphereWeather,
57 /* 6 */ AtmosphereAircraft,
58 /* 7 */ SystemPressures,
59 /* 8 */ Joystick1,
60 /* 9 */ Joystick2,
61 /* 10 */ ArtStab,
62 /* 11 */ FlightCon,
63 /* 12 */ WingSweep,
64 /* 13 */ Trim,
65 /* 14 */ Brakes,
66 /* 15 */ AngularMoments,
67 /* 16 */ AngularVelocities,
68 /* 17 */ PitchRollHeading,
69 /* 18 */ AoA,
70 /* 19 */ MagCompass,
71 /* 20 */ LatitudeLongitude,
72 /* 21 */ LocVelDistTraveled,
73 /* 22 */ AllPlanesLat,
74 /* 23 */ AllPlanesLon,
75 /* 24 */ AllPlanesAlt,
76 /* 25 */ ThrottleCommand
77 /* .. */
80 void processUpdate(const QByteArray & data);
83 class XplaneSimulatorCreator10 : public SimulatorCreator {
84 public:
85 XplaneSimulatorCreator10(const QString & classId, const QString & description)
86 : SimulatorCreator(classId, description)
89 Simulator *createSimulator(const SimulatorSettings & params)
91 return new XplaneSimulator10(params);
95 #endif // XPLANESIMULATOR10_H