1
0
Fork 0

Reset: remove commands

This commit is contained in:
James Turner 2013-11-05 05:29:55 +00:00
parent 069a098909
commit 0751556aab
4 changed files with 31 additions and 15 deletions

View file

@ -181,6 +181,9 @@ FGAIManager::shutdown()
}
ai_list.clear();
globals->get_commands()->removeCommand("load-scenario");
globals->get_commands()->removeCommand("unload-scenario");
}
void

View file

@ -238,9 +238,16 @@ FGRouteMgr::~FGRouteMgr()
_plan->removeDelegate(this);
}
//SGCommandMgr* cmdMgr = SGCommandMgr::instance();
//cmdMgr->removeCommand("define-user-waypoint");
SGCommandMgr* cmdMgr = SGCommandMgr::instance();
cmdMgr->removeCommand("define-user-waypoint");
cmdMgr->removeCommand("delete-user-waypoint");
cmdMgr->removeCommand("load-flightplan");
cmdMgr->removeCommand("save-flightplan");
cmdMgr->removeCommand("activate-flightplan");
cmdMgr->removeCommand("clear-flightplan");
cmdMgr->removeCommand("set-active-waypt");
cmdMgr->removeCommand("insert-waypt");
cmdMgr->removeCommand("delete-waypt");
}

View file

@ -57,6 +57,10 @@ FGClouds::FGClouds() :
FGClouds::~FGClouds()
{
globals->get_commands()->removeCommand("add-cloud");
globals->get_commands()->removeCommand("del-cloud");
globals->get_commands()->removeCommand("move-cloud");
}
int FGClouds::get_update_event(void) const {

View file

@ -232,16 +232,6 @@ BasicRealWxController::BasicRealWxController( SGPropertyNode_ptr rootNode, Metar
_wasEnabled(false),
_requester(metarRequester)
{
// at least instantiate MetarProperties for /environment/metar
_metarProperties.push_back( new LiveMetarProperties(
fgGetNode( rootNode->getStringValue("metar", "/environment/metar"), true ),
metarRequester,
getMetarMaxAgeMin()));
BOOST_FOREACH( SGPropertyNode_ptr n, rootNode->getChildren("metar") ) {
SGPropertyNode_ptr metarNode = fgGetNode( n->getStringValue(), true );
addMetarAtPath(metarNode->getPath(), "");
}
SGCommandMgr::instance()->addCommand("request-metar", commandRequestMetar);
SGCommandMgr::instance()->addCommand("clear-metar", commandClearMetar);
@ -249,13 +239,25 @@ BasicRealWxController::BasicRealWxController( SGPropertyNode_ptr rootNode, Metar
BasicRealWxController::~BasicRealWxController()
{
//SGCommandMgr::instance()->removeCommand("request-metar");
SGCommandMgr::instance()->removeCommand("request-metar");
SGCommandMgr::instance()->removeCommand("clear-metar");
}
void BasicRealWxController::init()
{
_wasEnabled = false;
// at least instantiate MetarProperties for /environment/metar
SGPropertyNode_ptr metarNode = fgGetNode( _rootNode->getStringValue("metar", "/environment/metar"), true );
_metarProperties.push_back( new LiveMetarProperties(metarNode,
_requester,
getMetarMaxAgeMin()));
BOOST_FOREACH( SGPropertyNode_ptr n, _rootNode->getChildren("metar") ) {
SGPropertyNode_ptr metarNode = fgGetNode( n->getStringValue(), true );
addMetarAtPath(metarNode->getPath(), "");
}
checkNearbyMetar();
update(0); // fetch data ASAP