From e4b3eebdbb156474f07414f7f4bf29c251536c6b Mon Sep 17 00:00:00 2001 From: curt Date: Sun, 12 Jan 2003 23:28:21 +0000 Subject: [PATCH] Added a "mini fdm" output. This could (for example) be useful for an external gui if it wanted to monitor some key sim position/orientation varialbles without saturating the net with the full slate of fdm data @60hz. --- src/Network/Makefile.am | 3 +- src/Network/native_ctrls.hxx | 1 + src/Network/native_fdm.cxx | 5 +- src/Network/native_fdm_mini.cxx | 244 ++++++++++++++++++++++++++++++++ src/Network/native_fdm_mini.hxx | 68 +++++++++ src/Network/net_fdm_mini.hxx | 75 ++++++++++ 6 files changed, 393 insertions(+), 3 deletions(-) create mode 100644 src/Network/native_fdm_mini.cxx create mode 100644 src/Network/native_fdm_mini.hxx create mode 100644 src/Network/net_fdm_mini.hxx diff --git a/src/Network/Makefile.am b/src/Network/Makefile.am index a1306b5cd..d9a2eed61 100644 --- a/src/Network/Makefile.am +++ b/src/Network/Makefile.am @@ -17,7 +17,8 @@ libNetwork_a_SOURCES = \ native.cxx native.hxx \ native_ctrls.cxx native_ctrls.hxx \ native_fdm.cxx native_fdm.hxx \ - net_ctrls.hxx net_fdm.hxx \ + native_fdm_mini.cxx native_fdm_mini.hxx \ + net_ctrls.hxx net_fdm.hxx net_fdm_mini.hxx \ nmea.cxx nmea.hxx \ opengc.cxx opengc.hxx opengc_data.hxx \ props.cxx props.hxx \ diff --git a/src/Network/native_ctrls.hxx b/src/Network/native_ctrls.hxx index 9b1b7ba27..e903e3b03 100644 --- a/src/Network/native_ctrls.hxx +++ b/src/Network/native_ctrls.hxx @@ -68,6 +68,7 @@ void FGProps2NetCtrls( FGNetCtrls *net ); // Update the property tree from the FGNetCtrls structure. void FGNetCtrls2Props( FGNetCtrls *net ); + #endif // _FG_NATIVE_CTRLS_HXX diff --git a/src/Network/native_fdm.cxx b/src/Network/native_fdm.cxx index a43c7f22a..eb2a9a5ca 100644 --- a/src/Network/native_fdm.cxx +++ b/src/Network/native_fdm.cxx @@ -367,11 +367,12 @@ void FGNetFDM2Props( FGNetFDM *net ) { last_warp = net->warp; */ } else { - SG_LOG( SG_IO, SG_ALERT, "Error: version mismatch in net2global()" ); + SG_LOG( SG_IO, SG_ALERT, + "Error: version mismatch in FGNetFDM2Props()" ); SG_LOG( SG_IO, SG_ALERT, "\tread " << net->version << " need " << FG_NET_FDM_VERSION ); SG_LOG( SG_IO, SG_ALERT, - "\tsomeone needs to upgrade net_fdm.hxx and recompile." ); + "\tNeeds to upgrade net_fdm.hxx and recompile." ); } } diff --git a/src/Network/native_fdm_mini.cxx b/src/Network/native_fdm_mini.cxx new file mode 100644 index 000000000..3375df8be --- /dev/null +++ b/src/Network/native_fdm_mini.cxx @@ -0,0 +1,244 @@ +// native_fdm.cxx -- FGFS "Native" flight dynamics protocal class +// +// Written by Curtis Olson, started September 2001. +// +// Copyright (C) 2001 Curtis L. Olson - curt@flightgear.org +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// 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. +// +// $Id$ + + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include // endian tests +#include +#include + +#include +#include