FlightGear
next
net_gui.hxx
Go to the documentation of this file.
1
// net_gui.hxx -- defines a simple subset I/O interface to the flight
2
// dynamics model variables
3
//
4
// Written by Curtis Olson - curt@flightgear.com, started January 2002.
5
//
6
// This file is in the Public Domain, and comes with no warranty.
7
//
8
// $Id$
9
10
11
#ifndef _NET_GUI_HXX
12
#define _NET_GUI_HXX
13
14
#include <simgear/misc/stdint.hxx>
15
16
// NOTE: this file defines an external interface structure. Due to
17
// variability between platforms and architectures, we only used fixed
18
// length types here. Specifically, integer types can vary in length.
19
// I am not aware of any platforms that don't use 4 bytes for float
20
// and 8 bytes for double.
21
22
23
const
uint32_t
FG_NET_GUI_VERSION
= 8;
24
25
26
// Define a structure containing the top level flight dynamics model
27
// parameters
28
29
class
FGNetGUI
{
30
31
public
:
32
33
enum
{
34
FG_MAX_ENGINES
= 4,
35
FG_MAX_WHEELS
= 3,
36
FG_MAX_TANKS
= 4
37
};
38
39
// Note: align fields properly and manually to avoid incompatibilities
40
// between 32bit and 64bit CPUs. Make sure that each field is already
41
// placed on an offset which is a multiple of the size of its data
42
// type, i.e. uint32/float need to have on offset of 4, doubles need
43
// an offset of 8. This guarantees that compilers will _not_ add
44
// CPU-specific padding bytes. Whenever in doubt about padding rules,
45
// check "data structure alignment" in Wikipedia/Google :).
46
47
uint32_t
version
;
// increment when data values change
48
uint32_t
padding1
;
// 4 padding bytes, so the next (64bit) var is aligned to 8
49
50
// Positions (note: offset for these doubles is already aligned to 8 - to avoid architecture specific alignments)
51
double
longitude
;
// geodetic (radians)
52
double
latitude
;
// geodetic (radians)
53
54
float
altitude
;
// above sea level (meters)
55
float
agl
;
// above ground level (meters)
56
float
phi
;
// roll (radians)
57
float
theta
;
// pitch (radians)
58
float
psi
;
// yaw or true heading (radians)
59
60
// Velocities
61
float
vcas
;
62
float
climb_rate
;
// feet per second
63
64
// Consumables
65
uint32_t
num_tanks
;
// Max number of fuel tanks
66
float
fuel_quantity
[
FG_MAX_TANKS
];
67
68
// Environment
69
uint32_t
cur_time
;
// current unix time
70
// FIXME: make this uint64_t before 2038
71
uint32_t
warp
;
// offset in seconds to unix time
72
float
ground_elev
;
// ground elev (meters)
73
74
// Approach
75
float
tuned_freq
;
// currently tuned frequency
76
float
nav_radial
;
// target nav radial
77
uint32_t
in_range
;
// tuned navaid is in range?
78
float
dist_nm
;
// distance to tuned navaid in nautical miles
79
float
course_deviation_deg
;
// degrees off target course
80
float
gs_deviation_deg
;
// degrees off target glide slope
81
};
82
83
84
#endif
// _NET_GUI_HXX
FGNetGUI
Definition
net_gui.hxx:29
FGNetGUI::latitude
double latitude
Definition
net_gui.hxx:52
FGNetGUI::climb_rate
float climb_rate
Definition
net_gui.hxx:62
FGNetGUI::phi
float phi
Definition
net_gui.hxx:56
FGNetGUI::course_deviation_deg
float course_deviation_deg
Definition
net_gui.hxx:79
FGNetGUI::fuel_quantity
float fuel_quantity[FG_MAX_TANKS]
Definition
net_gui.hxx:66
FGNetGUI::warp
uint32_t warp
Definition
net_gui.hxx:71
FGNetGUI::ground_elev
float ground_elev
Definition
net_gui.hxx:72
FGNetGUI::num_tanks
uint32_t num_tanks
Definition
net_gui.hxx:65
FGNetGUI::version
uint32_t version
Definition
net_gui.hxx:47
FGNetGUI::padding1
uint32_t padding1
Definition
net_gui.hxx:48
FGNetGUI::dist_nm
float dist_nm
Definition
net_gui.hxx:78
FGNetGUI::psi
float psi
Definition
net_gui.hxx:58
FGNetGUI::altitude
float altitude
Definition
net_gui.hxx:54
FGNetGUI::longitude
double longitude
Definition
net_gui.hxx:51
FGNetGUI::FG_MAX_WHEELS
@ FG_MAX_WHEELS
Definition
net_gui.hxx:35
FGNetGUI::FG_MAX_TANKS
@ FG_MAX_TANKS
Definition
net_gui.hxx:36
FGNetGUI::FG_MAX_ENGINES
@ FG_MAX_ENGINES
Definition
net_gui.hxx:34
FGNetGUI::agl
float agl
Definition
net_gui.hxx:55
FGNetGUI::theta
float theta
Definition
net_gui.hxx:57
FGNetGUI::vcas
float vcas
Definition
net_gui.hxx:61
FGNetGUI::nav_radial
float nav_radial
Definition
net_gui.hxx:76
FGNetGUI::cur_time
uint32_t cur_time
Definition
net_gui.hxx:69
FGNetGUI::gs_deviation_deg
float gs_deviation_deg
Definition
net_gui.hxx:80
FGNetGUI::tuned_freq
float tuned_freq
Definition
net_gui.hxx:75
FGNetGUI::in_range
uint32_t in_range
Definition
net_gui.hxx:77
FG_NET_GUI_VERSION
const uint32_t FG_NET_GUI_VERSION
Definition
net_gui.hxx:23
src
Network
net_gui.hxx
Generated on Tue Jun 3 2025 12:58:41 for FlightGear by
1.13.2