1
0
Fork 0

Enable AI traffic for offline users and issue #248

- #248: new enable/disable-ai-traffic command-line option
- AI traffic: don't wait for METAR when real-wx-fetch disabled, to
enable AI traffic when running offline
This commit is contained in:
ThorstenB 2011-01-08 21:38:26 +01:00
parent 9a0f0cb15a
commit 4458f7ce73
3 changed files with 8 additions and 5 deletions

View file

@ -1334,6 +1334,8 @@ struct OptionDesc {
{"metar", true, OPTION_STRING, "/environment/metar/data", false, "", 0 },
{"disable-ai-models", false, OPTION_BOOL, "/sim/ai/enabled", false, "", 0 },
{"enable-ai-models", false, OPTION_BOOL, "/sim/ai/enabled", true, "", 0 },
{"disable-ai-traffic", false, OPTION_BOOL, "/sim/traffic-manager/enabled", false, "", 0 },
{"enable-ai-traffic", false, OPTION_BOOL, "/sim/traffic-manager/enabled", true, "", 0 },
{"disable-freeze", false, OPTION_BOOL, "/sim/freeze/master", false, "", 0 },
{"enable-freeze", false, OPTION_BOOL, "/sim/freeze/master", true, "", 0 },
{"disable-fuel-freeze", false, OPTION_BOOL, "/sim/freeze/fuel", false, "", 0 },
@ -1419,7 +1421,7 @@ struct OptionDesc {
{"enable-skyblend", false, OPTION_BOOL, "/sim/rendering/skyblend", true, "", 0 },
{"disable-textures", false, OPTION_BOOL, "/sim/rendering/textures", false, "", 0 },
{"enable-textures", false, OPTION_BOOL, "/sim/rendering/textures", true, "", 0 },
{"texture-filtering", false, OPTION_INT, "/sim/rendering/filtering", 1, "", 0 },
{"texture-filtering", false, OPTION_INT, "/sim/rendering/filtering", 1, "", 0 },
{"disable-wireframe", false, OPTION_BOOL, "/sim/rendering/wireframe", false, "", 0 },
{"enable-wireframe", false, OPTION_BOOL, "/sim/rendering/wireframe", true, "", 0 },
{"geometry", true, OPTION_FUNC, "", false, "", fgOptGeometry },
@ -1489,8 +1491,8 @@ struct OptionDesc {
{"ai-scenario", true, OPTION_FUNC, "", false, "", fgOptScenario },
{"parking-id", true, OPTION_FUNC, "", false, "", fgOptParking },
{"version", false, OPTION_FUNC, "", false, "", fgOptVersion },
{"enable-fpe", false, OPTION_FUNC, "", false, "", fgOptFpe},
{"fgviewer", false, OPTION_FUNC, "", false, "", fgOptFgviewer},
{"enable-fpe", false, OPTION_FUNC, "", false, "", fgOptFpe},
{"fgviewer", false, OPTION_FUNC, "", false, "", fgOptFgviewer},
{0}
};

View file

@ -79,6 +79,7 @@ FGTrafficManager::FGTrafficManager() :
inited(false),
enabled("/sim/traffic-manager/enabled"),
aiEnabled("/sim/ai/enabled"),
realWxEnabled("/environment/realwx/enabled"),
metarValid("/environment/metar/valid")
{
//score = 0;
@ -232,7 +233,7 @@ void FGTrafficManager::init()
void FGTrafficManager::update(double /*dt */ )
{
if (!enabled || !aiEnabled || !metarValid) {
if (!enabled || !aiEnabled || (realWxEnabled && !metarValid)) {
return;
}

View file

@ -99,7 +99,7 @@ private:
void readTimeTableFromFile(SGPath infilename);
void Tokenize(const string& str, vector<string>& tokens, const string& delimiters = " ");
simgear::PropertyObject<bool> enabled, aiEnabled, metarValid;
simgear::PropertyObject<bool> enabled, aiEnabled, realWxEnabled, metarValid;
public:
FGTrafficManager();
~FGTrafficManager();