2119db35c3
scene management code and organizing it within simgear. My strategy is to identify the code I want to move, and break it's direct flightgear dependencies. Then it will be free to move over into the simgear package. - Moved some property specific code into simgear/props/ - Split out the condition code from fgfs/src/Main/fg_props and put it in it's own source file in simgear/props/ - Created a scene subdirectory for scenery, model, and material property related code. - Moved location.[ch]xx into simgear/scene/model/ - The location and condition code had dependencies on flightgear's global state (all the globals-> stuff, the flightgear property tree, etc.) SimGear code can't depend on it so that data has to be passed as parameters to the functions/methods/constructors. - This need to pass data as function parameters had a dramatic cascading effect throughout the FlightGear code.
67 lines
1.2 KiB
C++
67 lines
1.2 KiB
C++
// logger.hxx - log properties.
|
|
// Written by David Megginson, started 2002.
|
|
//
|
|
// This file is in the Public Domain, and comes with no warranty.
|
|
|
|
#ifndef __LOGGER_HXX
|
|
#define __LOGGER_HXX 1
|
|
|
|
#ifndef __cplusplus
|
|
# error This library requires C++
|
|
#endif
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
# include <config.h>
|
|
#endif
|
|
|
|
#include <iostream>
|
|
#include <vector>
|
|
|
|
#include <simgear/compiler.h>
|
|
#include <simgear/debug/logstream.hxx>
|
|
#include <simgear/misc/exception.hxx>
|
|
#include <simgear/props/props.hxx>
|
|
|
|
SG_USING_STD(ostream);
|
|
SG_USING_STD(vector);
|
|
|
|
#include "fgfs.hxx"
|
|
|
|
|
|
/**
|
|
* Log any property values to any number of CSV files.
|
|
*/
|
|
class FGLogger : public FGSubsystem
|
|
{
|
|
public:
|
|
|
|
FGLogger ();
|
|
virtual ~FGLogger ();
|
|
|
|
// Implementation of FGSubsystem
|
|
virtual void init ();
|
|
virtual void reinit ();
|
|
virtual void bind ();
|
|
virtual void unbind ();
|
|
virtual void update (double dt);
|
|
|
|
private:
|
|
|
|
/**
|
|
* A single instance of a log file (the logger can contain many).
|
|
*/
|
|
struct Log {
|
|
Log ();
|
|
virtual ~Log ();
|
|
vector<SGPropertyNode *> nodes;
|
|
ostream * output;
|
|
long interval_ms;
|
|
double last_time_ms;
|
|
char delimiter;
|
|
};
|
|
|
|
vector<Log> _logs;
|
|
|
|
};
|
|
|
|
#endif // __LOGGER_HXX
|