]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/ExternalPipe/ExternalPipe.hxx
Make FGAircraftModel behave like a standarrd subsystem.
[flightgear.git] / src / FDM / ExternalPipe / ExternalPipe.hxx
index 7043e53a5dbe39583e47ceabec3afb5448eb1936..866967c12e3531aed284f0d47323be7bb5ca6873 100644 (file)
@@ -2,7 +2,7 @@
 //
 // Written by Curtis Olson, started March 2003.
 //
-// Copyright (C) 2003  Curtis L. Olson  - curt@flightgear.org
+// Copyright (C) 2003  Curtis L. Olson  - http://www.flightgear.org/~curt
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 // $Id$
 
 #ifndef _EXTERNAL_PIPE_HXX
 #define _EXTERNAL_PIPE_HXX
 
+#include <stdio.h>              // FILE*, fopen(), fread(), fwrite(), et. al.
+
 #include <simgear/timing/timestamp.hxx> // fine grained timing measurements
 
 #include <Network/net_ctrls.hxx>
 #include <Network/net_fdm.hxx>
+#include <FDM/flight.hxx>
 
 
 class FGExternalPipe: public FGInterface {
@@ -37,17 +40,33 @@ private:
 
     string fifo_name_1;
     string fifo_name_2;
-    int pd1; 
-    int pd2; 
+    FILE *pd1;
+    FILE *pd2;
+    string _protocol;
 
     FGNetCtrls ctrls;
     FGNetFDM fdm;
     char *buf;
 
+    double last_weight;
+    double last_cg_offset;
+
+    vector <string> property_names;
+    vector <SGPropertyNode_ptr> nodes;
+
+    // Protocol specific init routines
+    void init_binary();
+    void init_property();
+
+    // Protocol specific update routines
+    void update_binary( double dt );
+    void update_property( double dt );
+
+    void process_set_command( const string_list &tokens );
 public:
 
     // Constructor
-    FGExternalPipe( double dt, string fifo_name );
+    FGExternalPipe( double dt, string fifo_name, string protocol );
 
     // Destructor
     ~FGExternalPipe();