#include "fgfs.hxx"
#include "fg_props.hxx"
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
SG_USING_STD(istream);
SG_USING_STD(ostream);
-#endif
#ifdef FG_WEATHERCM
static double getWindNorth ();
static void
setWindEast (double speed)
{
- cout << "Set wind-east to " << speed << endl;
+ SG_LOG(SG_GENERAL, SG_INFO,, "Set wind-east to " << speed );
current_aircraft.fdm_state->set_Velocities_Local_Airmass(getWindNorth(),
speed,
getWindDown());
void
fgInitProps ()
{
- cout << "start of fgInitProps()" << endl;
+ SG_LOG(SG_GENERAL, SG_DEBUG, "start of fgInitProps()" );
// Simulation
fgTie("/sim/logging/priority", getLoggingPriority, setLoggingPriority);
fgTie("/sim/logging/classes", getLoggingClasses, setLoggingClasses);
fgTie("/sim/temp/full-screen", getFullScreen, setFullScreen);
fgTie("/sim/temp/fdm-data-logging", getFDMDataLogging, setFDMDataLogging);
- cout << "end of fgInitProps()" << endl;
+ SG_LOG(SG_GENERAL, SG_DEBUG, "end of fgInitProps()" );
}
}
-void
-fgLoadProps (const char * path, SGPropertyNode * props)
-{
- SGPath loadpath(globals->get_fg_root());
- loadpath.append(path);
- readProperties(loadpath.c_str(), props);
+bool
+fgLoadProps (const char * path, SGPropertyNode * props, bool in_fg_root)
+{
+ string fullpath;
+ if (in_fg_root) {
+ SGPath loadpath(globals->get_fg_root());
+ loadpath.append(path);
+ fullpath = loadpath.str();
+ } else {
+ fullpath = path;
+ }
+
+ try {
+ readProperties(fullpath, props);
+ } catch (const sg_exception &e) {
+ guiErrorMessage("Error reading properties: ", e);
+ return false;
+ }
+ return true;
}