diff --git a/src/Autopilot/route_mgr.cxx b/src/Autopilot/route_mgr.cxx index 12237717a..56228f3bb 100644 --- a/src/Autopilot/route_mgr.cxx +++ b/src/Autopilot/route_mgr.cxx @@ -215,7 +215,7 @@ FGRouteMgr::FGRouteMgr() : input->setStringValue(""); input->addChangeListener(listener); - SGCommandMgr* cmdMgr = SGCommandMgr::instance(); + SGCommandMgr* cmdMgr = globals->get_commands(); cmdMgr->addCommand("define-user-waypoint", this, &FGRouteMgr::commandDefineUserWaypoint); cmdMgr->addCommand("delete-user-waypoint", this, &FGRouteMgr::commandDeleteUserWaypoint); @@ -238,7 +238,7 @@ FGRouteMgr::~FGRouteMgr() _plan->removeDelegate(this); } - SGCommandMgr* cmdMgr = SGCommandMgr::instance(); + SGCommandMgr* cmdMgr = globals->get_commands(); cmdMgr->removeCommand("define-user-waypoint"); cmdMgr->removeCommand("delete-user-waypoint"); cmdMgr->removeCommand("load-flightplan"); diff --git a/src/Environment/realwx_ctrl.cxx b/src/Environment/realwx_ctrl.cxx index b45e0cbcf..3db5d9058 100644 --- a/src/Environment/realwx_ctrl.cxx +++ b/src/Environment/realwx_ctrl.cxx @@ -233,14 +233,14 @@ BasicRealWxController::BasicRealWxController( SGPropertyNode_ptr rootNode, Metar _requester(metarRequester) { - SGCommandMgr::instance()->addCommand("request-metar", commandRequestMetar); - SGCommandMgr::instance()->addCommand("clear-metar", commandClearMetar); + globals->get_commands()->addCommand("request-metar", commandRequestMetar); + globals->get_commands()->addCommand("clear-metar", commandClearMetar); } BasicRealWxController::~BasicRealWxController() { - SGCommandMgr::instance()->removeCommand("request-metar"); - SGCommandMgr::instance()->removeCommand("clear-metar"); + globals->get_commands()->removeCommand("request-metar"); + globals->get_commands()->removeCommand("clear-metar"); } void BasicRealWxController::init() diff --git a/src/Model/panelnode.cxx b/src/Model/panelnode.cxx index 1194a4512..9de204fcd 100644 --- a/src/Model/panelnode.cxx +++ b/src/Model/panelnode.cxx @@ -162,7 +162,7 @@ FGPanelNode::FGPanelNode() : _resizeToViewport(true), _depthTest(false) { - SGCommandMgr::instance()->addCommand("panel-mouse-click", this, &FGPanelNode::panelMouseClickCommand); + globals->get_commands()->addCommand("panel-mouse-click", this, &FGPanelNode::panelMouseClickCommand); SGPropertyNode* pathNode = fgGetNode("/sim/panel/path"); _pathListener.reset(new PanelPathListener(this)); @@ -185,7 +185,7 @@ FGPanelNode::FGPanelNode() : FGPanelNode::~FGPanelNode() { if (_is2d) { - SGCommandMgr::instance()->removeCommand("panel-mouse-click"); + globals->get_commands()->removeCommand("panel-mouse-click"); SGPropertyNode* pathNode = fgGetNode("/sim/panel/path"); pathNode->removeChangeListener(_pathListener.get()); } diff --git a/src/Time/TimeManager.cxx b/src/Time/TimeManager.cxx index 99ce9642b..fa6727063 100644 --- a/src/Time/TimeManager.cxx +++ b/src/Time/TimeManager.cxx @@ -56,7 +56,12 @@ TimeManager::TimeManager() : _inited(false), _impl(NULL) { - SGCommandMgr::instance()->addCommand("timeofday", do_timeofday); + globals->get_commands()->addCommand("timeofday", do_timeofday); +} + +TimeManager::~TimeManager() +{ + globals->get_commands()->removeCommand("timeofday"); } void TimeManager::init() diff --git a/src/Time/TimeManager.hxx b/src/Time/TimeManager.hxx index a1e8631d5..24c2f841f 100644 --- a/src/Time/TimeManager.hxx +++ b/src/Time/TimeManager.hxx @@ -31,7 +31,8 @@ class TimeManager : public SGSubsystem, public SGPropertyChangeListener { public: TimeManager(); - + virtual ~TimeManager(); + void computeTimeDeltas(double& simDt, double& realDt); virtual void init();