]> git.mxchange.org Git - flightgear.git/blobdiff - src/Autopilot/xmlauto.hxx
Make FlightGear work with 16bpp:
[flightgear.git] / src / Autopilot / xmlauto.hxx
index 73cee4906264343f67c4bb9eb0ad39280f5c991d..8cf764ae942ae2b7314cb98b5b7406175d5fc26c 100644 (file)
 
 #include STL_STRING
 #include <vector>
+#include <deque>
 
 SG_USING_STD(string);
 SG_USING_STD(vector);
+SG_USING_STD(deque);
 
 #include <simgear/props/props.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
@@ -208,6 +210,37 @@ public:
 };
 
 
+/**
+ * FGDigitalFilter - a selection of digital filters
+ *
+ * Exponential filter
+ * Double exponential filter
+ * Moving average filter
+ * Noise spike filter
+ *
+ * All these filters are low-pass filters.
+ *
+ */
+
+class FGDigitalFilter : public FGXMLAutoComponent
+{
+private:
+    double Tf;            // Filter time [s]
+    unsigned int samples; // Number of input samples to average
+    double rateOfChange;  // The maximum allowable rate of change [1/s]
+    deque <double> output;
+    deque <double> input;
+    string filterType;
+
+    bool debug;
+
+public:
+    FGDigitalFilter(SGPropertyNode *node);
+    ~FGDigitalFilter() {}
+
+    void update(double dt);
+};
+
 /**
  * Model an autopilot system.
  *