]> git.mxchange.org Git - flightgear.git/blob - src/Instrumentation/gyro.hxx
remove old .cvsignore files
[flightgear.git] / src / Instrumentation / gyro.hxx
1 // gyro.hxx - simple model of a spinning gyro.
2
3 #ifndef __INSTRUMENTATION_GYRO_HXX
4 #define __INSTRUMENTATION_GYRO_HXX 1
5
6 /**
7  * Simple model of a spinning gyro.
8  *
9  * The gyro decelerates gradually if no power is available to keep it
10  * spinning, and spins up quickly when power becomes available.
11  */
12 class Gyro
13 {
14 public:
15
16     /**
17      * Constructor.
18      */
19     Gyro ();
20
21
22     /**
23      * Destructor.
24      */
25     virtual ~Gyro ();
26
27
28     /**
29      * Update the gyro.
30      *
31      * @param delta_time_sec The elapsed time since the last update.
32      * @param power_norm The power available to drive the gyro, from
33      *        0.0 to 1.0.
34      */
35     virtual void update (double delta_time_sec);
36
37
38     /**
39      * Set the power available to the gyro.
40      *
41      * @param power_norm The amount of power (vacuum or electrical)
42      *        available to keep the gyro spinning, from 0.0 (none) to
43      *        1.0 (full power)
44      */
45     virtual void set_power_norm (double power_norm);
46
47
48     /**
49      * Get the gyro's current spin.
50      *
51      * @return The spin from 0.0 (not spinning) to 1.0 (full speed).
52      */
53     virtual double get_spin_norm () const;
54
55
56     /**
57      * Set the gyro's current spin.
58      *
59      * @spin_norm The spin from 0.0 (not spinning) to 1.0 (full speed).
60      */
61     virtual void set_spin_norm (double spin_norm);
62
63
64     /**
65      * Test if the gyro is serviceable.
66      *
67      * @return true if the gyro is serviceable, false otherwise.
68      */
69     virtual bool is_serviceable () const;
70
71
72     /**
73      * Set the gyro's serviceability.
74      *
75      * @param serviceable true if the gyro is functional, false otherwise.
76      */
77     virtual void set_serviceable (bool serviceable);
78
79
80 private:
81
82     bool _serviceable;
83     double _power_norm;
84     double _spin_norm;
85
86 };
87
88 #endif // __INSTRUMENTATION_GYRO_HXX