Howto:Disable Nasal entirely: Difference between revisions

Jump to navigation Jump to search
m
→‎Patch: patch up fg_init.cxx and options.cxx to include a --disable-nasal option and show a corresponding warning
m (→‎Patch: FGNasalSys null pointer check for NasalModelData)
m (→‎Patch: patch up fg_init.cxx and options.cxx to include a --disable-nasal option and show a corresponding warning)
Line 298: Line 298:
  /**
  /**
diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx
diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx
index 61d3425..d8bd11a 100644
index 61d3425..b7fea20 100644
--- a/src/Main/fg_init.cxx
--- a/src/Main/fg_init.cxx
+++ b/src/Main/fg_init.cxx
+++ b/src/Main/fg_init.cxx
@@ -904,11 +904,12 @@ void fgPostInitSubsystems()
@@ -904,11 +904,19 @@ void fgPostInitSubsystems()
     // Initialize the Nasal interpreter.
     // Initialize the Nasal interpreter.
     // Do this last, so that the loaded scripts see initialized state
     // Do this last, so that the loaded scripts see initialized state
Line 311: Line 311:
     SG_LOG(SG_GENERAL, SG_INFO, "Nasal init took:" << st.elapsedMSec());
     SG_LOG(SG_GENERAL, SG_INFO, "Nasal init took:" << st.elapsedMSec());
-
-
+}  else NASAL_DISABLED("Initialization");
+}  else {
+ NASAL_DISABLED("Initialization");
+ SG_LOG(SG_GENERAL, SG_ALERT,
+ "Warning: Nasal being disabled will render most of the current UI (PUI/Canvas) and "
+ "aircraft/scenery scripts non-functional. This startup mode is only intended for "
+ " developers and power users wanting to do regression testing! "
+ "You are advised to use Phi and/or the telnet/props protocol to control FG in this  mode");
+    }
     // initialize methods that depend on other subsystems.
     // initialize methods that depend on other subsystems.
     st.stamp();
     st.stamp();
     globals->get_subsystem_mgr()->postinit();
     globals->get_subsystem_mgr()->postinit();
diff --git a/src/Main/options.cxx b/src/Main/options.cxx
index 3c412ca..2292e3e 100644
--- a/src/Main/options.cxx
+++ b/src/Main/options.cxx
@@ -1706,6 +1706,7 @@ struct OptionDesc {
    {"no-default-config",            false, OPTION_IGNORE, "", false, "", 0},
    {"prop",                        true,  OPTION_FUNC | OPTION_MULTI,  "", false, "", fgOptSetProperty},
    {"load-tape",                    true,  OPTION_FUNC,  "", false, "", fgOptLoadTape },
+    {"disable-nasal",     false, OPTION_BOOL,  "/sim/startup/disable-nasal", true, "", 0 },
    {0}
};
diff --git a/src/Network/ATC-Main.cxx b/src/Network/ATC-Main.cxx
diff --git a/src/Network/ATC-Main.cxx b/src/Network/ATC-Main.cxx
index 6c0da9b..00cd91a 100644
index 6c0da9b..00cd91a 100644

Navigation menu