X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Ffg_commands.cxx;h=8f7a1c18cab9ebb2ca620b7188244e0c520152fe;hb=38226af24ec01e8f0a20d7fd73ef838a69f6ef25;hp=a8c45e99962748cfddf5a22677f499b5641c13c7;hpb=eea6bd1e37a67b29f627e4da3a9305a1cabc15a8;p=flightgear.git diff --git a/src/Main/fg_commands.cxx b/src/Main/fg_commands.cxx index a8c45e999..8f7a1c18c 100644 --- a/src/Main/fg_commands.cxx +++ b/src/Main/fg_commands.cxx @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -47,6 +46,7 @@ #include "viewmgr.hxx" #include "main.hxx" #include
+#include using std::string; using std::ifstream; @@ -221,7 +221,7 @@ do_exit (const SGPropertyNode * arg) static bool do_reset (const SGPropertyNode * arg) { - doSimulatorReset(); + fgReInitSubsystems(); return true; } @@ -247,7 +247,7 @@ do_reinit (const SGPropertyNode * arg) if (subsystem == 0) { result = false; SG_LOG( SG_GENERAL, SG_ALERT, - "Subsystem " << name << "not found" ); + "Subsystem " << name << " not found" ); } else { subsystem->reinit(); } @@ -280,7 +280,7 @@ do_suspend (const SGPropertyNode * arg) SGSubsystem * subsystem = globals->get_subsystem(name); if (subsystem == 0) { result = false; - SG_LOG(SG_GENERAL, SG_ALERT, "Subsystem " << name << "not found"); + SG_LOG(SG_GENERAL, SG_ALERT, "Subsystem " << name << " not found"); } else { subsystem->suspend(); } @@ -304,7 +304,7 @@ do_resume (const SGPropertyNode * arg) SGSubsystem * subsystem = globals->get_subsystem(name); if (subsystem == 0) { result = false; - SG_LOG(SG_GENERAL, SG_ALERT, "Subsystem " << name << "not found"); + SG_LOG(SG_GENERAL, SG_ALERT, "Subsystem " << name << " not found"); } else { subsystem->resume(); } @@ -558,6 +558,9 @@ do_tile_cache_reload (const SGPropertyNode * arg) } +#if 0 +These do_set_(some-environment-parameters) are deprecated and no longer +useful/functional - Torsten Dreyer, January 2011 /** * Set the sea level outside air temperature and assigning that to all * boundary and aloft environment layers. @@ -684,7 +687,7 @@ do_set_dewpoint_degc (const SGPropertyNode * arg) dummy.set_dewpoint_degc( dewpoint_degc ); return do_set_dewpoint_sea_level_degc(dummy.get_dewpoint_sea_level_degc()); } - +#endif /** * Update the lighting manually. */ @@ -1240,8 +1243,10 @@ do_log_level (const SGPropertyNode * arg) static bool do_replay (const SGPropertyNode * arg) { - // freeze the master fdm + // freeze the fdm, resume from sim pause fgSetInt( "/sim/freeze/replay-state", 1 ); + fgSetBool("/sim/freeze/master", 0 ); + fgSetBool("/sim/freeze/clock", 0 ); FGReplay *r = (FGReplay *)(globals->get_subsystem( "replay" )); @@ -1260,29 +1265,21 @@ do_replay (const SGPropertyNode * arg) return true; } - +/* static bool do_decrease_visibility (const SGPropertyNode * arg) { - double new_value = fgGetDouble("/environment/visibility-m") * 0.9; - fgSetDouble("/environment/visibility-m", new_value); - fgDefaultWeatherValue("visibility-m", new_value); - globals->get_subsystem("environment")->reinit(); - + Environment::Presets::VisibilitySingleton::instance()->adjust( 0.9 ); return true; } static bool do_increase_visibility (const SGPropertyNode * arg) { - double new_value = fgGetDouble("/environment/visibility-m") * 1.1; - fgSetDouble("/environment/visibility-m", new_value); - fgDefaultWeatherValue("visibility-m", new_value); - globals->get_subsystem("environment")->reinit(); - + Environment::Presets::VisibilitySingleton::instance()->adjust( 1.1 ); return true; } - +*/ /** * An fgcommand to allow loading of xml files via nasal, * the xml file's structure will be made available within @@ -1454,10 +1451,12 @@ static struct { { "screen-capture", do_screen_capture }, { "hires-screen-capture", do_hires_screen_capture }, { "tile-cache-reload", do_tile_cache_reload }, + /* { "set-sea-level-air-temp-degc", do_set_sea_level_degc }, { "set-outside-air-temp-degc", do_set_oat_degc }, { "set-dewpoint-sea-level-air-temp-degc", do_set_dewpoint_sea_level_degc }, { "set-dewpoint-temp-degc", do_set_dewpoint_degc }, + */ { "timeofday", do_timeofday }, { "property-toggle", do_property_toggle }, { "property-assign", do_property_assign }, @@ -1480,8 +1479,10 @@ static struct { { "presets-commit", do_presets_commit }, { "log-level", do_log_level }, { "replay", do_replay }, + /* { "decrease-visibility", do_decrease_visibility }, { "increase-visibility", do_increase_visibility }, + */ { "loadxml", do_load_xml_to_proptree}, { "savexml", do_save_xml_from_proptree }, { "press-cockpit-button", do_press_cockpit_button },