-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Header: FGOutput.h
Author: Jon Berndt
--------------------------------------------------------------------------------
12/02/98 JSB Created
-********************************************************************************
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SENTRY
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#ifndef FGOUTPUT_H
#define FGOUTPUT_H
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
INCLUDES
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include "FGModel.h"
#ifdef FGFS
-# include <Include/compiler.h>
-# ifdef FG_HAVE_STD_INCLUDES
-# include <iostream>
-# include <fstream>
-# else
-# include <iostream.h>
-# include <fstream.h>
-# endif
+# include <simgear/compiler.h>
+# include STL_IOSTREAM
+# include STL_FSTREAM
#else
# include <iostream>
# include <fstream>
#endif
-//using namespace std;
+#include "FGfdmSocket.h"
-/*******************************************************************************
+#define ID_OUTPUT "$Id$"
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS DECLARATION
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
class FGOutput : public FGModel
{
public:
FGOutput(FGFDMExec*);
- ~FGOutput(void);
+ ~FGOutput();
bool Run(void);
void DelimitedOutput(void);
void DelimitedOutput(string);
+ void SocketOutput(void);
+ void SocketStatusOutput(string);
+ void SetFilename(string fn) {Filename = fn;}
+ void SetType(string);
+ void SetSubsystems(int tt) {SubSystems = tt;}
+ inline void Enable(void) { enabled = true; }
+ inline void Disable(void) { enabled = false; }
+ inline bool Toggle(void) {enabled = !enabled; return enabled;}
protected:
private:
- bool FirstPass;
+ bool sFirstPass, dFirstPass, enabled;
+ int SubSystems;
+ string Filename;
+ enum {otNone, otCSV, otTab, otSocket, otTerminal, otUnknown} Type;
ofstream datafile;
+ FGfdmSocket* socket;
+ void Debug(void);
};
-/******************************************************************************/
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#endif