SGSubsystem classes: Renaming of the subsystem ID variables and functions.
This commit is contained in:
parent
a9e0ec843b
commit
fb5c36fc82
29 changed files with 32 additions and 32 deletions
|
@ -65,7 +65,7 @@ SGSubsystem and define at least a small set of functions:
|
|||
void update(double dt) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "subsystem-example"; }
|
||||
static const char* staticSubsystemClassId() { return "subsystem-example"; }
|
||||
};
|
||||
|
||||
The init() functions should make sure everything is set and ready so the
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
void update(double dt) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "ai-model"; }
|
||||
static const char* staticSubsystemClassId() { return "ai-model"; }
|
||||
|
||||
void updateLOD(SGPropertyNode* node);
|
||||
void attach(FGAIBase *model);
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
void update(double dt) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "aircraft-performance-db"; }
|
||||
static const char* staticSubsystemClassId() { return "aircraft-performance-db"; }
|
||||
|
||||
bool havePerformanceDataForAircraftType(const std::string& acType) const;
|
||||
|
||||
|
|
|
@ -265,7 +265,7 @@ public:
|
|||
void update(double dt) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "controls"; }
|
||||
static const char* staticSubsystemClassId() { return "controls"; }
|
||||
|
||||
// Reset function
|
||||
void reset_all(void);
|
||||
|
|
|
@ -73,7 +73,7 @@ public:
|
|||
void update(double dt) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "replay"; }
|
||||
static const char* staticSubsystemClassId() { return "replay"; }
|
||||
|
||||
bool start(bool NewTape=false);
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
void update(double dt) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "airport-dynamics"; }
|
||||
static const char* staticSubsystemClassId() { return "airport-dynamics"; }
|
||||
|
||||
static FGAirportDynamicsRef find(const std::string& icao);
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
void update(double dt) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "route-manager"; }
|
||||
static const char* staticSubsystemClassId() { return "route-manager"; }
|
||||
|
||||
bool isRouteActive() const;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
void shutdown() override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "Canvas"; }
|
||||
static const char* staticSubsystemClassId() { return "Canvas"; }
|
||||
|
||||
/**
|
||||
* Get OpenGL texture name for given canvas
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
void update(double dt) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "ephemeris"; }
|
||||
static const char* staticSubsystemClassId() { return "ephemeris"; }
|
||||
|
||||
SGEphemeris* data();
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
void update(double dt) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "flight"; }
|
||||
static const char* staticSubsystemClassId() { return "flight"; }
|
||||
|
||||
FGInterface* getInterface() const;
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ public:
|
|||
void update(double delta_time_sec) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "gui"; }
|
||||
static const char* staticSubsystemClassId() { return "gui"; }
|
||||
|
||||
/**
|
||||
* Redraw the GUI picking up new GUI colors.
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
void update(double dt) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "input-hid"; }
|
||||
static const char* staticSubsystemClassId() { return "input-hid"; }
|
||||
|
||||
private:
|
||||
class FGHIDEventInputPrivate;
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
void update(double dt) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "input-mouse"; }
|
||||
static const char* staticSubsystemClassId() { return "input-mouse"; }
|
||||
|
||||
void doMouseClick (int b, int updown, int x, int y, bool mainWindow, const osgGA::GUIEventAdapter* ea);
|
||||
void doMouseMotion (int x, int y, const osgGA::GUIEventAdapter*);
|
||||
|
|
|
@ -62,7 +62,7 @@ FGInput::FGInput () : SGSubsystemGroup("FGInput")
|
|||
if( fgGetBool("/sim/input/no-mouse-input",false) ) {
|
||||
SG_LOG(SG_INPUT,SG_ALERT,"Mouse input disabled!");
|
||||
} else {
|
||||
set_subsystem( FGMouseInput::subsystemName(), new FGMouseInput() );
|
||||
set_subsystem( FGMouseInput::staticSubsystemClassId(), new FGMouseInput() );
|
||||
}
|
||||
|
||||
if( fgGetBool("/sim/input/no-keyboard-input",false) ) {
|
||||
|
|
|
@ -56,7 +56,7 @@ public:
|
|||
virtual ~FGInput();
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "input"; }
|
||||
static const char* staticSubsystemClassId() { return "input"; }
|
||||
};
|
||||
|
||||
#endif // _INPUT_HXX
|
||||
|
|
|
@ -1153,7 +1153,7 @@ void fgStartNewReset()
|
|||
SGSubsystemGroup* grp = subsystemManger->get_group(static_cast<SGSubsystemMgr::GroupType>(g));
|
||||
for (auto nm : grp->member_names()) {
|
||||
if ((nm == "time") || (nm == "terrasync") || (nm == "events")
|
||||
|| (nm == "lighting") || (nm == FGScenery::subsystemName()))
|
||||
|| (nm == "lighting") || (nm == FGScenery::staticSubsystemClassId()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -1176,7 +1176,7 @@ void fgStartNewReset()
|
|||
|
||||
// order is important here since tile-manager shutdown needs to
|
||||
// access the scenery object
|
||||
subsystemManger->remove(FGScenery::subsystemName());
|
||||
subsystemManger->remove(FGScenery::staticSubsystemClassId());
|
||||
|
||||
FGScenery::getPagerSingleton()->clearRequests();
|
||||
flightgear::CameraGroup::setDefault(NULL);
|
||||
|
|
|
@ -213,7 +213,7 @@ FGGlobals::~FGGlobals()
|
|||
}
|
||||
|
||||
osgDB::Registry::instance()->clearObjectCache();
|
||||
subsystem_mgr->remove(FGScenery::subsystemName());
|
||||
subsystem_mgr->remove(FGScenery::staticSubsystemClassId());
|
||||
|
||||
// renderer touches subsystems during its destruction
|
||||
set_renderer(NULL);
|
||||
|
|
|
@ -174,7 +174,7 @@ public:
|
|||
template<class T>
|
||||
T* get_subsystem() const
|
||||
{
|
||||
return dynamic_cast<T*>(get_subsystem(T::subsystemName()));
|
||||
return dynamic_cast<T*>(get_subsystem(T::staticSubsystemClassId()));
|
||||
}
|
||||
|
||||
|
||||
|
@ -190,7 +190,7 @@ public:
|
|||
double min_time_sec = 0)
|
||||
{
|
||||
T* sub = new T;
|
||||
add_subsystem(T::subsystemName(), sub, type, min_time_sec);
|
||||
add_subsystem(T::staticSubsystemClassId(), sub, type, min_time_sec);
|
||||
return sub;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
void update(double dt) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "aircraft-model"; }
|
||||
static const char* staticSubsystemClassId() { return "aircraft-model"; }
|
||||
|
||||
virtual SGModelPlacement * get3DModel() { return _aircraft.get(); }
|
||||
virtual SGVec3d& getVelocity() { return _velocity; }
|
||||
|
|
|
@ -62,7 +62,7 @@ public:
|
|||
void update(double dt) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "model-manager"; }
|
||||
static const char* staticSubsystemClassId() { return "model-manager"; }
|
||||
|
||||
virtual void add_model (SGPropertyNode * node);
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
void update(double) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "dns"; }
|
||||
static const char* staticSubsystemClassId() { return "dns"; }
|
||||
|
||||
void makeRequest(const simgear::DNS::Request_ptr& req);
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
void update(double) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "http"; }
|
||||
static const char* staticSubsystemClassId() { return "http"; }
|
||||
|
||||
void makeRequest(const simgear::HTTP::Request_ptr& req);
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ public:
|
|||
void update(double dt) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "scenery"; }
|
||||
static const char* staticSubsystemClassId() { return "scenery"; }
|
||||
|
||||
/// Compute the elevation of the scenery at geodetic latitude lat,
|
||||
/// geodetic longitude lon and not higher than max_alt.
|
||||
|
|
|
@ -111,7 +111,7 @@ public:
|
|||
bool schedule_scenery(const SGGeod& position, double range_m, double duration=0.0);
|
||||
void materialLibChanged();
|
||||
|
||||
static const char* subsystemName() { return "scenery"; }
|
||||
static const char* staticSubsystemClassId() { return "scenery"; }
|
||||
|
||||
private:
|
||||
// terrain branch of scene graph
|
||||
|
|
|
@ -109,7 +109,7 @@ public:
|
|||
bool schedule_scenery(const SGGeod& position, double range_m, double duration=0.0);
|
||||
void materialLibChanged();
|
||||
|
||||
static const char* subsystemName() { return "scenery"; }
|
||||
static const char* staticSubsystemClassId() { return "scenery"; }
|
||||
|
||||
private:
|
||||
// tile manager
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
void update(double dt) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "nasal"; }
|
||||
static const char* staticSubsystemClassId() { return "nasal"; }
|
||||
|
||||
// Loads a nasal script from an external file and inserts it as a
|
||||
// global module of the specified name.
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
void update(double dt) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "sound"; }
|
||||
static const char* staticSubsystemClassId() { return "sound"; }
|
||||
|
||||
void activate(bool State);
|
||||
void update_device_list();
|
||||
|
@ -81,7 +81,7 @@ public:
|
|||
void update(double dt) {} override
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "sound"; }
|
||||
static const char* staticSubsystemClassId() { return "sound"; }
|
||||
};
|
||||
|
||||
#endif // ENABLE_AUDIO_SUPPORT
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
void update(double dt) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "time"; }
|
||||
static const char* staticSubsystemClassId() { return "time"; }
|
||||
|
||||
void computeTimeDeltas(double& simDt, double& realDt);
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public:
|
|||
void update(double dt) override;
|
||||
|
||||
// Subsystem identification.
|
||||
static const char* subsystemName() { return "view-manager"; }
|
||||
static const char* staticSubsystemClassId() { return "view-manager"; }
|
||||
|
||||
// getters
|
||||
inline int size() const { return views.size(); }
|
||||
|
|
Loading…
Reference in a new issue