1
0
Fork 0
flightgear/src/FDM/JSBSim/models/FGInput.h

108 lines
3.2 KiB
C
Raw Normal View History

2000-11-03 23:02:47 +00:00
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1999-12-20 20:25:13 +00:00
2006-01-12 15:04:22 +00:00
Header: FGInput.h
Author: Jon Berndt
Date started: 12/2/98
1999-12-20 20:25:13 +00:00
------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) -------------
This program is free software; you can redistribute it and/or modify it under
2007-01-15 12:48:54 +00:00
the terms of the GNU Lesser General Public License as published by the Free Software
1999-12-20 20:25:13 +00:00
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
2007-01-15 12:48:54 +00:00
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
1999-12-20 20:25:13 +00:00
details.
2007-01-15 12:48:54 +00:00
You should have received a copy of the GNU Lesser General Public License along with
1999-12-20 20:25:13 +00:00
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA.
2007-01-15 12:48:54 +00:00
Further information about the GNU Lesser General Public License can also be found on
1999-12-20 20:25:13 +00:00
the world wide web at http://www.gnu.org.
HISTORY
--------------------------------------------------------------------------------
2006-01-12 15:04:22 +00:00
12/02/98 JSB Created
1999-12-20 20:25:13 +00:00
2000-11-03 23:02:47 +00:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1999-12-20 20:25:13 +00:00
SENTRY
2000-11-03 23:02:47 +00:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
1999-12-20 20:25:13 +00:00
2006-01-12 15:04:22 +00:00
#ifndef FGINPUT_H
#define FGINPUT_H
1999-12-20 20:25:13 +00:00
2000-11-03 23:02:47 +00:00
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1999-12-20 20:25:13 +00:00
INCLUDES
2000-11-03 23:02:47 +00:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
1999-12-20 20:25:13 +00:00
2006-01-12 15:04:22 +00:00
#include "FGModel.h"
1999-12-20 20:25:13 +00:00
#ifdef FGFS
2000-02-15 03:30:01 +00:00
# include <simgear/compiler.h>
# include STL_IOSTREAM
# include STL_FSTREAM
#else
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
# include <iostream.h>
# include <fstream.h>
# else
# include <iostream>
# include <fstream>
# endif
1999-12-20 20:25:13 +00:00
#endif
2006-01-12 15:04:22 +00:00
#include <input_output/FGfdmSocket.h>
#include <input_output/FGXMLElement.h>
1999-12-20 20:25:13 +00:00
2000-11-03 23:02:47 +00:00
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1999-12-20 20:25:13 +00:00
DEFINITIONS
2000-11-03 23:02:47 +00:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
1999-12-20 20:25:13 +00:00
2006-01-12 15:04:22 +00:00
#define ID_INPUT "$Id$"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
2003-06-03 08:46:15 +00:00
namespace JSBSim {
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS DOCUMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
2006-01-12 15:04:22 +00:00
/** Handles simulation input.
*/
2000-11-03 23:02:47 +00:00
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1999-12-20 20:25:13 +00:00
CLASS DECLARATION
2000-11-03 23:02:47 +00:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
1999-12-20 20:25:13 +00:00
2006-01-12 15:04:22 +00:00
class FGInput : public FGModel
{
1999-12-20 20:25:13 +00:00
public:
2006-01-12 15:04:22 +00:00
FGInput(FGFDMExec*);
~FGInput();
bool Run(void);
void SetType(string);
inline void Enable(void) { enabled = true; }
inline void Disable(void) { enabled = false; }
inline bool Toggle(void) {enabled = !enabled; return enabled;}
bool Load(Element* el);
1999-12-20 20:25:13 +00:00
private:
2006-01-12 15:04:22 +00:00
bool sFirstPass, dFirstPass, enabled;
unsigned int port;
FGfdmSocket* socket;
string data;
2001-12-24 13:54:55 +00:00
void Debug(int from);
1999-12-20 20:25:13 +00:00
};
}
2006-01-12 15:04:22 +00:00
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2000-02-15 03:30:01 +00:00
#endif
2006-01-12 15:04:22 +00:00