]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fg_commands.cxx
Be more tolerant about locale name when detecting the default language,
[flightgear.git] / src / Main / fg_commands.cxx
index c3c60fbec236f98a692e0aa3cd8b01ba41444203..cf36a7777cecedc9bb7f6f5f5e94efc2844e015d 100644 (file)
 #include <simgear/structure/exception.hxx>
 #include <simgear/structure/commands.hxx>
 #include <simgear/props/props.hxx>
+#include <simgear/props/props_io.hxx>
 #include <simgear/structure/event_mgr.hxx>
 #include <simgear/sound/soundmgr_openal.hxx>
 #include <simgear/timing/sg_time.hxx>
+#include <simgear/misc/interpolator.hxx>
+#include <simgear/io/HTTPRequest.hxx>
 
 #include <Cockpit/panel.hxx>
 #include <Cockpit/panel_io.hxx>
-#include <Environment/environment.hxx>
 #include <FDM/flight.hxx>
 #include <GUI/gui.h>
 #include <GUI/new_gui.hxx>
 #include <GUI/dialog.hxx>
 #include <Aircraft/replay.hxx>
-#include <Scenery/tilemgr.hxx>
 #include <Scenery/scenery.hxx>
 #include <Scripting/NasalSys.hxx>
 #include <Sound/sample_queue.hxx>
-#include <Time/sunsolver.hxx>
+#include <Airports/xmlloader.hxx>
+#include <ATC/CommStation.hxx>
+#include <Navaids/navrecord.hxx>
+#include <Navaids/navlist.hxx>
+#include <Network/HTTPClient.hxx>
 
 #include "fg_init.hxx"
 #include "fg_io.hxx"
@@ -48,6 +53,9 @@
 #include "viewmgr.hxx"
 #include "main.hxx"
 #include <Main/viewer.hxx>
+#include <Environment/presets.hxx>
+
+#include <boost/scoped_array.hpp>
 
 using std::string;
 using std::ifstream;
@@ -186,31 +194,7 @@ do_exit (const SGPropertyNode * arg)
 {
     SG_LOG(SG_INPUT, SG_INFO, "Program exit requested.");
     fgSetBool("/sim/signals/exit", true);
-
-    if (fgGetBool("/sim/startup/save-on-exit")) {
-#ifdef _WIN32
-        char* envp = ::getenv( "APPDATA" );
-        if ( envp != NULL ) {
-            SGPath config( envp );
-            config.append( "flightgear.org" );
-#else
-        if ( homedir != NULL ) {
-            SGPath config( homedir );
-            config.append( ".fgfs" );
-#endif
-            config.append( "autosave.xml" );
-            config.create_dir( 0700 );
-            SG_LOG(SG_IO, SG_INFO, "Saving user settings to " << config.str());
-            try {
-                writeProperties(config.str(), globals->get_props(), false, SGPropertyNode::USERARCHIVE);
-            } catch (const sg_exception &e) {
-                guiErrorMessage("Error writing autosave.xml: ", e);
-            }
-
-            SG_LOG(SG_INPUT, SG_DEBUG, "Finished Saving user settings");
-        }
-    }
-    
+    globals->saveUserSettings();
     fgOSExit(arg->getIntValue("status", 0));
     return true;
 }
@@ -222,7 +206,7 @@ do_exit (const SGPropertyNode * arg)
 static bool
 do_reset (const SGPropertyNode * arg)
 {
-    doSimulatorReset();
+    fgReInitSubsystems();
     return true;
 }
 
@@ -248,7 +232,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();
             }
@@ -281,7 +265,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();
         }
@@ -305,7 +289,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();
         }
@@ -315,6 +299,34 @@ do_resume (const SGPropertyNode * arg)
 
 #endif
 
+/**
+ * Built-in command: replay the FDR buffer
+ */
+static bool
+do_replay (const SGPropertyNode * arg)
+{
+    FGReplay *r = (FGReplay *)(globals->get_subsystem( "replay" ));
+    return r->start();
+}
+
+/**
+ * Built-in command: pause/unpause the sim
+ */
+static bool
+do_pause (const SGPropertyNode * arg)
+{
+    bool paused = fgGetBool("/sim/freeze/master",true) || fgGetBool("/sim/freeze/clock",true);
+    if (paused && (fgGetInt("/sim/freeze/replay-state",0)>0))
+    {
+        do_replay(NULL);
+    }
+    else
+    {
+        fgSetBool("/sim/freeze/master",!paused);
+        fgSetBool("/sim/freeze/clock",!paused);
+    }
+    return true;
+}
 
 /**
  * Built-in command: load flight.
@@ -404,7 +416,6 @@ do_panel_load (const SGPropertyNode * arg)
   }
   SG_LOG(SG_INPUT, SG_INFO, "Loaded new panel from " << panel_path);
   globals->get_current_panel()->unbind();
-  delete globals->get_current_panel();
   globals->set_current_panel( new_panel );
   globals->get_current_panel()->bind();
   return true;
@@ -559,6 +570,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.
@@ -685,92 +699,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());
 }
-
-/**
- * Update the lighting manually.
- */
-static bool
-do_timeofday (const SGPropertyNode * arg)
-{
-    const string &offset_type = arg->getStringValue("timeofday", "noon");
-
-    static const SGPropertyNode *longitude
-        = fgGetNode("/position/longitude-deg");
-    static const SGPropertyNode *latitude
-        = fgGetNode("/position/latitude-deg");
-    static const SGPropertyNode *cur_time_override
-        = fgGetNode("/sim/time/cur-time-override", true);
-
-    int orig_warp = globals->get_warp();
-    SGTime *t = globals->get_time_params();
-    time_t cur_time = t->get_cur_time();
-    // cout << "cur_time = " << cur_time << endl;
-    // cout << "orig_warp = " << orig_warp << endl;
-
-    int warp = 0;
-    if ( offset_type == "real" ) {
-        warp = -orig_warp;
-    } else if ( offset_type == "dawn" ) {
-        warp = fgTimeSecondsUntilSunAngle( cur_time,
-                                           longitude->getDoubleValue()
-                                             * SGD_DEGREES_TO_RADIANS,
-                                           latitude->getDoubleValue()
-                                             * SGD_DEGREES_TO_RADIANS,
-                                           90.0, true ); 
-    } else if ( offset_type == "morning" ) {
-        warp = fgTimeSecondsUntilSunAngle( cur_time,
-                                           longitude->getDoubleValue()
-                                             * SGD_DEGREES_TO_RADIANS,
-                                           latitude->getDoubleValue()
-                                             * SGD_DEGREES_TO_RADIANS,
-                                           75.0, true ); 
-    } else if ( offset_type == "noon" ) {
-        warp = fgTimeSecondsUntilSunAngle( cur_time,
-                                           longitude->getDoubleValue()
-                                             * SGD_DEGREES_TO_RADIANS,
-                                           latitude->getDoubleValue()
-                                             * SGD_DEGREES_TO_RADIANS,
-                                           0.0, true ); 
-    } else if ( offset_type == "afternoon" ) {
-        warp = fgTimeSecondsUntilSunAngle( cur_time,
-                                           longitude->getDoubleValue()
-                                             * SGD_DEGREES_TO_RADIANS,
-                                           latitude->getDoubleValue()
-                                             * SGD_DEGREES_TO_RADIANS,
-                                           60.0, false ); 
-     } else if ( offset_type == "dusk" ) {
-        warp = fgTimeSecondsUntilSunAngle( cur_time,
-                                           longitude->getDoubleValue()
-                                             * SGD_DEGREES_TO_RADIANS,
-                                           latitude->getDoubleValue()
-                                             * SGD_DEGREES_TO_RADIANS,
-                                           90.0, false ); 
-     } else if ( offset_type == "evening" ) {
-        warp = fgTimeSecondsUntilSunAngle( cur_time,
-                                           longitude->getDoubleValue()
-                                             * SGD_DEGREES_TO_RADIANS,
-                                           latitude->getDoubleValue()
-                                             * SGD_DEGREES_TO_RADIANS,
-                                           100.0, false ); 
-    } else if ( offset_type == "midnight" ) {
-        warp = fgTimeSecondsUntilSunAngle( cur_time,
-                                           longitude->getDoubleValue()
-                                             * SGD_DEGREES_TO_RADIANS,
-                                           latitude->getDoubleValue()
-                                             * SGD_DEGREES_TO_RADIANS,
-                                           180.0, false ); 
-    }
-    // cout << "warp = " << warp << endl;
-    globals->set_warp( orig_warp + warp );
-
-    t->update( longitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS,
-               latitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS,
-               cur_time_override->getLongValue(),
-               globals->get_warp() );
-
-    return true;
-}
-
+#endif
 
 /**
  * Built-in command: toggle a bool property value.
@@ -796,15 +725,18 @@ static bool
 do_property_assign (const SGPropertyNode * arg)
 {
   SGPropertyNode * prop = get_prop(arg);
-  const SGPropertyNode * prop2 = get_prop2(arg);
   const SGPropertyNode * value = arg->getNode("value");
 
   if (value != 0)
       return prop->setUnspecifiedValue(value->getStringValue());
-  else if (prop2)
-      return prop->setUnspecifiedValue(prop2->getStringValue());
   else
-      return false;
+  {
+      const SGPropertyNode * prop2 = get_prop2(arg);
+      if (prop2)
+          return prop->setUnspecifiedValue(prop2->getStringValue());
+      else
+          return false;
+  }
 }
 
 
@@ -1002,6 +934,62 @@ do_property_randomize (const SGPropertyNode * arg)
     return true;
 }
 
+/**
+ * Built-in command: interpolate a property value over time
+ *
+ * property: the name of the property value to interpolate.
+ * value[0..n] any number of constant values to interpolate
+ * time[0..n]  time between each value, number of time elements must
+ *          match those of value elements
+ * -or-
+ * property[1..n] any number of target values taken from named properties
+ * time[0..n]     time between each value, number of time elements must
+ *                match those of property elements minus one
+ */
+static bool
+do_property_interpolate (const SGPropertyNode * arg)
+{
+    SGPropertyNode * prop = get_prop(arg);
+
+    simgear::PropertyList valueNodes = arg->getChildren( "value" );
+    simgear::PropertyList timeNodes = arg->getChildren( "time" );
+
+    boost::scoped_array<double> value;
+    boost::scoped_array<double> time;
+
+    if( valueNodes.size() > 0 ) {
+        // must match
+        if( timeNodes.size() != valueNodes.size() )
+            return false;
+
+        value.reset( new double[valueNodes.size()] );
+        for( simgear::PropertyList::size_type n = 0; n < valueNodes.size(); n++ ) {
+            value[n] = valueNodes[n]->getDoubleValue();
+        }
+    } else {
+        valueNodes = arg->getChildren("property");
+        // must have one more property node
+        if( valueNodes.size() - 1 != timeNodes.size() )
+          return false;
+
+        value.reset( new double[valueNodes.size()-1] );
+        for( simgear::PropertyList::size_type n = 0; n < valueNodes.size()-1; n++ ) {
+            value[n] = fgGetNode(valueNodes[n+1]->getStringValue(), "/null")->getDoubleValue();
+        }
+
+    }
+
+    time.reset( new double[timeNodes.size()] );
+    for( simgear::PropertyList::size_type n = 0; n < timeNodes.size(); n++ ) {
+        time[n] = timeNodes[n]->getDoubleValue();
+    }
+
+    ((SGInterpolator*)globals->get_subsystem_mgr()
+      ->get_group(SGSubsystemMgr::INIT)->get_subsystem("interpolator"))
+      ->interpolate(prop, timeNodes.size(), value.get(), time.get() );
+
+    return true;
+}
 
 /**
  * Built-in command: reinit the data logging system based on the
@@ -1088,6 +1076,20 @@ do_dialog_update (const SGPropertyNode * arg)
     }
 }
 
+static bool
+do_open_browser (const SGPropertyNode * arg)
+{
+    string path;
+    if (arg->hasValue("path"))
+        path = arg->getStringValue("path");
+    else
+    if (arg->hasValue("url"))
+        path = arg->getStringValue("url");
+    else
+        return false;
+
+    return openBrowser(path);
+}
 
 /**
  * Apply a value in the active XML-configured dialog.
@@ -1134,14 +1136,9 @@ static bool
 do_add_model (const SGPropertyNode * arg)
 {
     SGPropertyNode * model = fgGetNode("models", true);
-    for (int i = 0;; i++) {
-        if (i < 0)
-            return false;
-        if (!model->getChild("model", i, false)) {
-            model = model->getChild("model", i, true);
-            break;
-        }
-    }
+    int i;
+    for (i = 0; model->hasChild("model",i); i++);
+    model = model->getChild("model", i, true);
     copyProperties(arg, model);
     if (model->hasValue("elevation-m"))
         model->setDoubleValue("elevation-ft", model->getDoubleValue("elevation-m")
@@ -1241,55 +1238,21 @@ do_log_level (const SGPropertyNode * arg)
    return true;
 }
 
-/**
- * Built-in command: replay the FDR buffer
- */
-static bool
-do_replay (const SGPropertyNode * arg)
-{
-    // freeze the master fdm
-    fgSetInt( "/sim/freeze/replay-state", 1 );
-
-    FGReplay *r = (FGReplay *)(globals->get_subsystem( "replay" ));
-
-    fgSetDouble( "/sim/replay/start-time", r->get_start_time() );
-    fgSetDouble( "/sim/replay/end-time", r->get_end_time() );
-    double duration = fgGetDouble( "/sim/replay/duration" );
-    if( duration && duration < (r->get_end_time() - r->get_start_time()) ) {
-        fgSetDouble( "/sim/replay/time", r->get_end_time() - duration );
-    } else {
-        fgSetDouble( "/sim/replay/time", r->get_start_time() );
-    }
-
-    // cout << "start = " << r->get_start_time()
-    //      << "  end = " << r->get_end_time() << endl;
-
-    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
@@ -1311,11 +1274,28 @@ do_load_xml_to_proptree(const SGPropertyNode * arg)
 
     if (file.extension() != "xml")
         file.concat(".xml");
-
-    if (file.isRelative()) {
-      file = globals->resolve_maybe_aircraft_path(file.str());
+    
+    std::string icao = arg->getStringValue("icao");
+    if (icao.empty()) {
+        if (file.isRelative()) {
+          SGPath absPath = globals->resolve_maybe_aircraft_path(file.str());
+          if (!absPath.isNull())
+              file = absPath;
+          else
+          {
+              SG_LOG(SG_IO, SG_ALERT, "loadxml: Cannot find XML property file '"  
+                          << file.str() << "'.");
+              return false;
+          }
+        }
+    } else {
+        if (!XMLLoader::findAirportData(icao, file.str(), file)) {
+          SG_LOG(SG_IO, SG_INFO, "loadxml: failed to find airport data for "
+            << file.str() << " at ICAO:" << icao);
+          return false;
+        }
     }
-
+    
     if (!fgValidatePath(file.c_str(), false)) {
         SG_LOG(SG_IO, SG_ALERT, "loadxml: reading '" << file.str() << "' denied "
                 "(unauthorized access)");
@@ -1338,6 +1318,93 @@ do_load_xml_to_proptree(const SGPropertyNode * arg)
     return true;
 }
 
+class RemoteXMLRequest : public simgear::HTTP::Request
+{
+public:
+    SGPropertyNode_ptr _complete;
+    SGPropertyNode_ptr _status;
+    SGPropertyNode_ptr _failed;
+    SGPropertyNode_ptr _target;
+    string propsData;
+    
+    RemoteXMLRequest(const std::string& url, SGPropertyNode* targetNode) : 
+        simgear::HTTP::Request(url),
+        _target(targetNode)
+    {
+    }
+    
+    void setCompletionProp(SGPropertyNode_ptr p)
+    {
+        _complete = p;
+    }
+    
+    void setStatusProp(SGPropertyNode_ptr p)
+    {
+        _status = p;
+    }
+    
+    void setFailedProp(SGPropertyNode_ptr p)
+    {
+        _failed = p;
+    }
+protected:
+    virtual void gotBodyData(const char* s, int n)
+    {
+        propsData += string(s, n);
+    }
+    
+    virtual void responseComplete()
+    {
+        int response = responseCode();
+        bool failed = false;
+        if (response == 200) {
+            try {
+                const char* buffer = propsData.c_str();
+                readProperties(buffer, propsData.size(), _target, true);
+            } catch (const sg_exception &e) {
+                SG_LOG(SG_IO, SG_WARN, "parsing XML from remote, failed: " << e.getFormattedMessage());
+                failed = true;
+                response = 406; // 'not acceptable', anything better?
+            }
+        } else {
+            failed = true;
+        }
+    // now the response data is output, signal Nasal / listeners
+        if (_complete) _complete->setBoolValue(true);
+        if (_status) _status->setIntValue(response);
+        if (_failed) _failed->setBoolValue(failed);
+    }
+};
+
+
+static bool
+do_load_xml_from_url(const SGPropertyNode * arg)
+{
+    std::string url(arg->getStringValue("url"));
+    if (url.empty())
+        return false;
+        
+    SGPropertyNode *targetnode;
+    if (arg->hasValue("targetnode"))
+        targetnode = fgGetNode(arg->getStringValue("targetnode"), true);
+    else
+        targetnode = const_cast<SGPropertyNode *>(arg)->getNode("data", true);
+    
+    RemoteXMLRequest* req = new RemoteXMLRequest(url, targetnode);
+    
+// connect up optional reporting properties
+    if (arg->hasValue("complete")) 
+        req->setCompletionProp(fgGetNode(arg->getStringValue("complete"), true));
+    if (arg->hasValue("failure")) 
+        req->setFailedProp(fgGetNode(arg->getStringValue("failure"), true));
+    if (arg->hasValue("status")) 
+        req->setStatusProp(fgGetNode(arg->getStringValue("status"), true));
+        
+    FGHTTPClient::instance()->makeRequest(req);
+    
+    return true;
+}
+
 
 /**
  * An fgcommand to allow saving of xml files via nasal,
@@ -1429,7 +1496,63 @@ do_release_cockpit_button (const SGPropertyNode *arg)
   return true;
 }
 
+static SGGeod commandSearchPos(const SGPropertyNode* arg)
+{
+  if (arg->hasChild("longitude-deg") && arg->hasChild("latitude-deg")) {
+    return SGGeod::fromDeg(arg->getDoubleValue("longitude-deg"),
+                           arg->getDoubleValue("latitude-deg"));
+  }
+  
+  // use current viewer/aircraft position
+  return SGGeod::fromDeg(fgGetDouble("/position/longitude-deg"), 
+                         fgGetDouble("/position/latitude-deg"));
+}
+  
+static bool
+do_comm_search(const SGPropertyNode* arg)
+{
+  SGGeod pos = commandSearchPos(arg);
+  int khz = static_cast<int>(arg->getDoubleValue("frequency-mhz") * 100.0 + 0.25);
+  
+  flightgear::CommStation* sta = flightgear::CommStation::findByFreq(khz, pos, NULL);
+  if (!sta) {
+    return true;
+  }
+  
+  SGPropertyNode* result = fgGetNode(arg->getStringValue("result"));
+  sta->createBinding(result);
+  return true;
+}
 
+static bool
+do_nav_search(const SGPropertyNode* arg)
+{
+  SGGeod pos = commandSearchPos(arg);
+  double mhz = arg->getDoubleValue("frequency-mhz");
+
+  FGNavList* navList = globals->get_navlist();
+  string type(arg->getStringValue("type", "vor"));
+  if (type == "dme") {
+    navList = globals->get_dmelist();
+  } else if (type == "tacan") {
+    navList = globals->get_tacanlist();
+  }
+  
+  FGNavRecord* nav = navList->findByFreq(mhz, pos);
+  if (!nav && (type == "vor")) {
+    // if we're searching VORs, look for localizers too
+    nav = globals->get_loclist()->findByFreq(mhz, pos);
+  }
+  
+  if (!nav) {
+    return true;
+  }
+  
+  SGPropertyNode* result = fgGetNode(arg->getStringValue("result"));
+  nav->createBinding(result);
+  return true;
+}
+  
 ////////////////////////////////////////////////////////////////////////
 // Command setup.
 ////////////////////////////////////////////////////////////////////////
@@ -1452,6 +1575,7 @@ static struct {
     { "reinit", do_reinit },
     { "suspend", do_reinit },
     { "resume", do_reinit },
+    { "pause", do_pause },
     { "load", do_load },
     { "save", do_save },
     { "panel-load", do_panel_load },
@@ -1461,11 +1585,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 },
     { "property-adjust", do_property_adjust },
@@ -1474,12 +1599,14 @@ static struct {
     { "property-scale", do_property_scale },
     { "property-cycle", do_property_cycle },
     { "property-randomize", do_property_randomize },
+    { "property-interpolate", do_property_interpolate },
     { "data-logging-commit", do_data_logging_commit },
     { "dialog-new", do_dialog_new },
     { "dialog-show", do_dialog_show },
     { "dialog-close", do_dialog_close },
     { "dialog-update", do_dialog_update },
     { "dialog-apply", do_dialog_apply },
+    { "open-browser", do_open_browser },
     { "gui-redraw", do_gui_redraw },
     { "add-model", do_add_model },
     { "set-cursor", do_set_cursor },
@@ -1487,16 +1614,23 @@ 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 },
+    { "xmlhttprequest", do_load_xml_from_url },
     { "press-cockpit-button", do_press_cockpit_button },
     { "release-cockpit-button", do_release_cockpit_button },
     { "dump-scenegraph", do_dump_scene_graph },
     { "dump-terrainbranch", do_dump_terrain_branch },
     { "print-visible-scene", do_print_visible_scene_info },
     { "reload-shaders", do_reload_shaders },
+  
+    { "find-navaid", do_nav_search },
+    { "find-comm", do_comm_search },
+  
     { 0, 0 }                   // zero-terminated
 };