1
0
Fork 0

Build- and run-time concept of developer mode.

Make a single Cmake value to expose the build type to code, and use
this to default a run-time ‘developer-mode’ property, which can be
over-ridden from the command line.

Use this to drive the different warning levels. Policies subject to
review, especially whether nightly builds should default to 
developer mode or not.
This commit is contained in:
James Turner 2017-02-27 23:15:07 +00:00
parent be0ede64be
commit 3653508412
12 changed files with 95 additions and 96 deletions

View file

@ -25,6 +25,13 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
"MinSizeRel" "RelWithDebInfo") "MinSizeRel" "RelWithDebInfo")
endif() endif()
if(NOT FG_BUILD_TYPE)
message(STATUS "Setting build type to 'Dev' as none was specified.")
set(FG_BUILD_TYPE Dev CACHE STRING "Choose the FlightGear build type" FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE FG_BUILD_TYPE PROPERTY STRINGS "Dev" "Nightly" "Release")
endif()
if(APPLE) if(APPLE)
set(CMAKE_INSTALL_RPATH "@loader_path/../Frameworks") set(CMAKE_INSTALL_RPATH "@loader_path/../Frameworks")
# when building, don't use the install RPATH already # when building, don't use the install RPATH already
@ -176,8 +183,6 @@ option(SYSTEM_SPEEX "Set to ON to build IAXClient with the system's speex a
option(SYSTEM_GSM "Set to ON to build IAXClient with the system's GSM library" ${SYSTEM_GSM_DEFAULT}) option(SYSTEM_GSM "Set to ON to build IAXClient with the system's GSM library" ${SYSTEM_GSM_DEFAULT})
option(SYSTEM_FLITE "Set to ON to build Flightgear with the system's Flite library" ${SYSTEM_FLITE_DEFAULT}) option(SYSTEM_FLITE "Set to ON to build Flightgear with the system's Flite library" ${SYSTEM_FLITE_DEFAULT})
option(SYSTEM_HTS_ENGINE "Set to ON to build Flightgear with the system's HTS Engine library" ${SYSTEM_HTS_ENGINE_DEFAULT}) option(SYSTEM_HTS_ENGINE "Set to ON to build Flightgear with the system's HTS Engine library" ${SYSTEM_HTS_ENGINE_DEFAULT})
option(FG_NIGHTLY "Set to ON to mark this as a nightly build" OFF)
option(ENABLE_DEV_WARNINGS "Set to ON to include developer-warnings" OFF)
# additional utilities # additional utilities
option(ENABLE_FGELEV "Set to ON to build the fgelev application (default)" ON) option(ENABLE_FGELEV "Set to ON to build the fgelev application (default)" ON)

View file

@ -212,7 +212,7 @@ void FGSubmodelMgr::update(double dt)
if (trigger && (*submodel_iterator)->count != 0) { if (trigger && (*submodel_iterator)->count != 0) {
//int id = (*submodel_iterator)->id; //int id = (*submodel_iterator)->id;
//const string& name = (*submodel_iterator)->name; //const string& name = (*submodel_iterator)->name;
SG_LOG(SG_AI, SG_DEBUG, SG_LOG(SG_AI, SG_DEBUG,
"Submodels release: " << (*submodel_iterator)->id "Submodels release: " << (*submodel_iterator)->id
<< " name " << (*submodel_iterator)->name << " name " << (*submodel_iterator)->name
@ -345,7 +345,7 @@ void FGSubmodelMgr::transform(submodel *sm)
if (sm->speed_node != 0) if (sm->speed_node != 0)
sm->speed = sm->speed_node->getDoubleValue(); sm->speed = sm->speed_node->getDoubleValue();
// set the Initial Conditions for the types of submodel parent // set the Initial Conditions for the types of submodel parent
if (_impact || _hit || _expiry) { if (_impact || _hit || _expiry) {
_count++; _count++;
@ -576,11 +576,9 @@ void FGSubmodelMgr::setData(int id, const string& path, bool serviceable, const
sm->pitch_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n); sm->pitch_offset = new FGXMLAutopilot::InputValue(*prop_root, b ? *b : n);
if (b) old = true; if (b) old = true;
#if defined(ENABLE_DEV_WARNINGS)
if (old) { if (old) {
SG_LOG(SG_AI, SG_WARN, "Submodels: <*-offset> is deprecated. Use <offsets> instead"); SG_LOG(SG_AI, SG_DEV_WARN, "Submodels: <*-offset> is deprecated. Use <offsets> instead");
} }
#endif
} }
// Randomness // Randomness
@ -716,7 +714,7 @@ SGVec3d FGSubmodelMgr::getCartOffsetPos() const
// And postrotate the orientation of the user model wrt the horizontal // And postrotate the orientation of the user model wrt the horizontal
// local frame // local frame
hlTrans *= SGQuatd::fromYawPitchRollDeg( hlTrans *= SGQuatd::fromYawPitchRollDeg(
IC.azimuth, IC.azimuth,
IC.elevation, IC.elevation,
IC.roll); IC.roll);

View file

@ -113,7 +113,7 @@ void FGFDM::iterate(float dt)
_airplane.setFuel(i, LBS2KG * _tank_level_lbs[i]->getFloatValue()); _airplane.setFuel(i, LBS2KG * _tank_level_lbs[i]->getFloatValue());
} }
_airplane.calcFuelWeights(); _airplane.calcFuelWeights();
setOutputProperties(dt); setOutputProperties(dt);
} }
@ -231,11 +231,9 @@ void FGFDM::startElement(const char* name, const XMLAttributes &atts)
if(a->hasAttribute("version")) { if(a->hasAttribute("version")) {
_airplane.setVersion( a->getValue("version") ); _airplane.setVersion( a->getValue("version") );
} }
#if defined(ENABLE_DEV_WARNINGS)
if( !_airplane.isVersionOrNewer( Version::YASIM_VERSION_CURRENT ) ) { if( !_airplane.isVersionOrNewer( Version::YASIM_VERSION_CURRENT ) ) {
SG_LOG(SG_FLIGHT,SG_ALERT, "This aircraft does not use the latest yasim configuration version."); SG_LOG(SG_FLIGHT, SG_DEV_ALERT, "This aircraft does not use the latest yasim configuration version.");
} }
#endif
} else if(eq(name, "approach")) { } else if(eq(name, "approach")) {
float spd = attrf(a, "speed") * KTS2MPS; float spd = attrf(a, "speed") * KTS2MPS;
float alt = attrf(a, "alt", 0) * FT2M; float alt = attrf(a, "alt", 0) * FT2M;
@ -322,7 +320,7 @@ void FGFDM::startElement(const char* name, const XMLAttributes &atts)
j->setVMax(attrf(a, "exhaust-speed") * KTS2MPS); j->setVMax(attrf(a, "exhaust-speed") * KTS2MPS);
if(a->hasAttribute("spool-time")) if(a->hasAttribute("spool-time"))
j->setSpooling(attrf(a, "spool-time")); j->setSpooling(attrf(a, "spool-time"));
j->setPosition(v); j->setPosition(v);
_airplane.addThruster(j, mass, v); _airplane.addThruster(j, mass, v);
sprintf(buf, "/engines/engine[%d]", _nextEngine++); sprintf(buf, "/engines/engine[%d]", _nextEngine++);
@ -461,14 +459,14 @@ void FGFDM::startElement(const char* name, const XMLAttributes &atts)
float cy = attrf(a, "cy", 1); float cy = attrf(a, "cy", 1);
float cz = attrf(a, "cz", 1); float cz = attrf(a, "cz", 1);
float idrag = attrf(a, "idrag", 1); float idrag = attrf(a, "idrag", 1);
_airplane.addFuselage(v, b, attrf(a, "width"), taper, mid, _airplane.addFuselage(v, b, attrf(a, "width"), taper, mid,
cx, cy, cz, idrag); cx, cy, cz, idrag);
} else if(eq(name, "tank")) { } else if(eq(name, "tank")) {
v[0] = attrf(a, "x"); v[0] = attrf(a, "x");
v[1] = attrf(a, "y"); v[1] = attrf(a, "y");
v[2] = attrf(a, "z"); v[2] = attrf(a, "z");
float density = 6.0; // gasoline, in lbs/gal float density = 6.0; // gasoline, in lbs/gal
if(a->hasAttribute("jet")) density = 6.72; if(a->hasAttribute("jet")) density = 6.72;
density *= LBS2KG*CM2GALS; density *= LBS2KG*CM2GALS;
_airplane.addTank(v, attrf(a, "capacity") * LBS2KG, density); _airplane.addTank(v, attrf(a, "capacity") * LBS2KG, density);
} else if(eq(name, "ballast")) { } else if(eq(name, "ballast")) {
@ -499,7 +497,7 @@ void FGFDM::startElement(const char* name, const XMLAttributes &atts)
((Rotor*)_currObj)->setcollective(attrf(a, "min"), attrf(a, "max")); ((Rotor*)_currObj)->setcollective(attrf(a, "min"), attrf(a, "max"));
} else if(eq(name, "cyclic")) { } else if(eq(name, "cyclic")) {
((Rotor*)_currObj)->setcyclic(attrf(a, "ail"), attrf(a, "ele")); ((Rotor*)_currObj)->setcyclic(attrf(a, "ail"), attrf(a, "ele"));
*/ */
} else if(eq(name, "actionpt")) { } else if(eq(name, "actionpt")) {
v[0] = attrf(a, "x"); v[0] = attrf(a, "x");
v[1] = attrf(a, "y"); v[1] = attrf(a, "y");
@ -527,11 +525,11 @@ void FGFDM::startElement(const char* name, const XMLAttributes &atts)
opt |= a->hasAttribute("split") ? ControlMap::OPT_SPLIT : 0; opt |= a->hasAttribute("split") ? ControlMap::OPT_SPLIT : 0;
opt |= a->hasAttribute("invert") ? ControlMap::OPT_INVERT : 0; opt |= a->hasAttribute("invert") ? ControlMap::OPT_INVERT : 0;
opt |= a->hasAttribute("square") ? ControlMap::OPT_SQUARE : 0; opt |= a->hasAttribute("square") ? ControlMap::OPT_SQUARE : 0;
ControlMap* cm = _airplane.getControlMap(); ControlMap* cm = _airplane.getControlMap();
if(a->hasAttribute("src0")) { if(a->hasAttribute("src0")) {
cm->addMapping(axis, control, _currObj, opt, cm->addMapping(axis, control, _currObj, opt,
attrf(a, "src0"), attrf(a, "src1"), attrf(a, "src0"), attrf(a, "src1"),
attrf(a, "dst0"), attrf(a, "dst1")); attrf(a, "dst0"), attrf(a, "dst1"));
} else { } else {
cm->addMapping(axis, control, _currObj, opt); cm->addMapping(axis, control, _currObj, opt);
@ -557,7 +555,7 @@ void FGFDM::startElement(const char* name, const XMLAttributes &atts)
int type = parseOutput(a->getValue("control")); int type = parseOutput(a->getValue("control"));
int handle = cm->getOutputHandle(_currObj, type); int handle = cm->getOutputHandle(_currObj, type);
float time = attrf(a, "transition-time", 0); float time = attrf(a, "transition-time", 0);
cm->setTransitionTime(handle, time); cm->setTransitionTime(handle, time);
} else { } else {
SG_LOG(SG_FLIGHT,SG_ALERT,"Unexpected tag '" SG_LOG(SG_FLIGHT,SG_ALERT,"Unexpected tag '"
@ -718,7 +716,7 @@ void FGFDM::setOutputProperties(float dt)
// cockpit code can scale them to the right values. // cockpit code can scale them to the right values.
float pnorm = j->getPerfNorm(); float pnorm = j->getPerfNorm();
moveprop(node, "oilp-norm", pnorm, dt/3); // 3s seek time moveprop(node, "oilp-norm", pnorm, dt/3); // 3s seek time
moveprop(node, "oilt-norm", pnorm, dt/30); // 30s moveprop(node, "oilt-norm", pnorm, dt/30); // 30s
moveprop(node, "itt-norm", pnorm, dt/1); // 1s moveprop(node, "itt-norm", pnorm, dt/1); // 1s
} }
} }
@ -826,9 +824,9 @@ Rotor* FGFDM::parseRotor(XMLAttributes* a, const char* type)
w->setTiltCenterZ(attrf(a,"tiltcenterz",0.0)); w->setTiltCenterZ(attrf(a,"tiltcenterz",0.0));
w->setDownwashFactor(attrf(a, "downwashfactor", 1)); w->setDownwashFactor(attrf(a, "downwashfactor", 1));
if(attrb(a,"ccw")) if(attrb(a,"ccw"))
w->setCcw(1); w->setCcw(1);
if(attrb(a,"sharedflaphinge")) if(attrb(a,"sharedflaphinge"))
w->setSharedFlapHinge(true); w->setSharedFlapHinge(true);
if(a->hasAttribute("name")) if(a->hasAttribute("name"))
w->setName(a->getValue("name") ); w->setName(a->getValue("name") );
@ -847,7 +845,7 @@ Rotor* FGFDM::parseRotor(XMLAttributes* a, const char* type)
w->setPowerAtPitch0(attrf(a, "poweratpitch-0", 300)); w->setPowerAtPitch0(attrf(a, "poweratpitch-0", 300));
w->setPowerAtPitchB(attrf(a, "poweratpitch-b", 3000)); w->setPowerAtPitchB(attrf(a, "poweratpitch-b", 3000));
if(attrb(a,"notorque")) if(attrb(a,"notorque"))
w->setNotorque(1); w->setNotorque(1);
#define p(x) if (a->hasAttribute(#x)) w->setParameter((char *)#x,attrf(a,#x) ); #define p(x) if (a->hasAttribute(#x)) w->setParameter((char *)#x,attrf(a,#x) );
#define p2(x,y) if (a->hasAttribute(y)) w->setParameter((char *)#x,attrf(a,y) ); #define p2(x,y) if (a->hasAttribute(y)) w->setParameter((char *)#x,attrf(a,y) );
@ -895,7 +893,7 @@ void FGFDM::parsePistonEngine(XMLAttributes* a)
eng->setDisplacement(attrf(a, "displacement") * CIN2CM); eng->setDisplacement(attrf(a, "displacement") * CIN2CM);
if(a->hasAttribute("compression")) if(a->hasAttribute("compression"))
eng->setCompression(attrf(a, "compression")); eng->setCompression(attrf(a, "compression"));
if(a->hasAttribute("min-throttle")) if(a->hasAttribute("min-throttle"))
eng->setMinThrottle(attrf(a, "min-throttle")); eng->setMinThrottle(attrf(a, "min-throttle"));
@ -946,7 +944,7 @@ void FGFDM::parsePropeller(XMLAttributes* a)
if(a->hasAttribute("displacement")) if(a->hasAttribute("displacement"))
eng->setDisplacement(attrf(a, "displacement") * CIN2CM); eng->setDisplacement(attrf(a, "displacement") * CIN2CM);
if(a->hasAttribute("compression")) if(a->hasAttribute("compression"))
eng->setCompression(attrf(a, "compression")); eng->setCompression(attrf(a, "compression"));
if(a->hasAttribute("turbo-mul")) { if(a->hasAttribute("turbo-mul")) {
float mul = attrf(a, "turbo-mul"); float mul = attrf(a, "turbo-mul");
float mp = attrf(a, "wastegate-mp", 1e6) * INHG2PA; float mp = attrf(a, "wastegate-mp", 1e6) * INHG2PA;
@ -1063,7 +1061,7 @@ int FGFDM::parseOutput(const char* name)
if(eq(name, "TILTYAW")) return ControlMap::TILTYAW; if(eq(name, "TILTYAW")) return ControlMap::TILTYAW;
if(eq(name, "ROTORGEARENGINEON")) return ControlMap::ROTORENGINEON; if(eq(name, "ROTORGEARENGINEON")) return ControlMap::ROTORENGINEON;
if(eq(name, "ROTORBRAKE")) return ControlMap::ROTORBRAKE; if(eq(name, "ROTORBRAKE")) return ControlMap::ROTORBRAKE;
if(eq(name, "ROTORENGINEMAXRELTORQUE")) if(eq(name, "ROTORENGINEMAXRELTORQUE"))
return ControlMap::ROTORENGINEMAXRELTORQUE; return ControlMap::ROTORENGINEMAXRELTORQUE;
if(eq(name, "ROTORRELTARGET")) return ControlMap::ROTORRELTARGET; if(eq(name, "ROTORRELTARGET")) return ControlMap::ROTORRELTARGET;
if(eq(name, "ROTORBALANCE")) return ControlMap::ROTORBALANCE; if(eq(name, "ROTORBALANCE")) return ControlMap::ROTORBALANCE;
@ -1145,7 +1143,7 @@ float FGFDM::attrf(XMLAttributes* atts, const char* attr, float def)
{ {
const char* val = atts->getValue(attr); const char* val = atts->getValue(attr);
if(val == 0) return def; if(val == 0) return def;
else return (float)atof(val); else return (float)atof(val);
} }
double FGFDM::attrd(XMLAttributes* atts, const char* attr) double FGFDM::attrd(XMLAttributes* atts, const char* attr)

View file

@ -1,7 +1,6 @@
#cmakedefine FG_NDEBUG #cmakedefine FG_NDEBUG
#cmakedefine FG_NIGHTLY
#cmakedefine ENABLE_SIMD #cmakedefine ENABLE_SIMD
#cmakedefine ENABLE_SP_FDM #cmakedefine ENABLE_SP_FDM
@ -52,4 +51,4 @@
#cmakedefine HAVE_QT #cmakedefine HAVE_QT
#cmakedefine ENABLE_DEV_WARNINGS #define FG_BUILD_TYPE "@FG_BUILD_TYPE@"

View file

@ -238,7 +238,7 @@ int main ( int argc, char **argv )
char _hostname[256]; char _hostname[256];
gethostname(_hostname, 256); gethostname(_hostname, 256);
hostname = _hostname; hostname = _hostname;
signal(SIGPIPE, SIG_IGN); signal(SIGPIPE, SIG_IGN);
# ifndef NDEBUG # ifndef NDEBUG
signal(SIGSEGV, segfault_handler); signal(SIGSEGV, segfault_handler);
@ -249,36 +249,36 @@ int main ( int argc, char **argv )
#if defined(HAVE_CRASHRPT) #if defined(HAVE_CRASHRPT)
// Define CrashRpt configuration parameters // Define CrashRpt configuration parameters
CR_INSTALL_INFO info; CR_INSTALL_INFO info;
memset(&info, 0, sizeof(CR_INSTALL_INFO)); memset(&info, 0, sizeof(CR_INSTALL_INFO));
info.cb = sizeof(CR_INSTALL_INFO); info.cb = sizeof(CR_INSTALL_INFO);
info.pszAppName = "FlightGear"; info.pszAppName = "FlightGear";
info.pszAppVersion = FLIGHTGEAR_VERSION; info.pszAppVersion = FLIGHTGEAR_VERSION;
info.pszEmailSubject = "FlightGear " FLIGHTGEAR_VERSION " crash report"; info.pszEmailSubject = "FlightGear " FLIGHTGEAR_VERSION " crash report";
info.pszEmailTo = "fgcrash@goneabitbursar.com"; info.pszEmailTo = "fgcrash@goneabitbursar.com";
info.pszUrl = "http://fgfs.goneabitbursar.com/crashreporter/crashrpt.php"; info.pszUrl = "http://fgfs.goneabitbursar.com/crashreporter/crashrpt.php";
info.uPriorities[CR_HTTP] = 3; info.uPriorities[CR_HTTP] = 3;
info.uPriorities[CR_SMTP] = 2; info.uPriorities[CR_SMTP] = 2;
info.uPriorities[CR_SMAPI] = 1; info.uPriorities[CR_SMAPI] = 1;
// Install all available exception handlers // Install all available exception handlers
info.dwFlags |= CR_INST_ALL_POSSIBLE_HANDLERS; info.dwFlags |= CR_INST_ALL_POSSIBLE_HANDLERS;
// Restart the app on crash // Restart the app on crash
info.dwFlags |= CR_INST_SEND_QUEUED_REPORTS; info.dwFlags |= CR_INST_SEND_QUEUED_REPORTS;
// automatically install handlers for all threads // automatically install handlers for all threads
info.dwFlags |= CR_INST_AUTO_THREAD_HANDLERS; info.dwFlags |= CR_INST_AUTO_THREAD_HANDLERS;
// Define the Privacy Policy URL // Define the Privacy Policy URL
info.pszPrivacyPolicyURL = "http://flightgear.org/crash-privacypolicy.html"; info.pszPrivacyPolicyURL = "http://flightgear.org/crash-privacypolicy.html";
// Install crash reporting // Install crash reporting
int nResult = crInstall(&info); int nResult = crInstall(&info);
if(nResult!=0) { if(nResult!=0) {
char buf[1024]; char buf[1024];
crGetLastErrorMsg(buf, 1024); crGetLastErrorMsg(buf, 1024);
flightgear::modalMessageBox("CrashRpt setup failed", flightgear::modalMessageBox("CrashRpt setup failed",
"Failed to setup crash-reporting engine, check the installation is not damaged.", "Failed to setup crash-reporting engine, check the installation is not damaged.",
buf); buf);
} else { } else {
@ -288,10 +288,8 @@ int main ( int argc, char **argv )
char buf[16]; char buf[16];
::snprintf(buf, 16, "%d", HUDSON_BUILD_NUMBER); ::snprintf(buf, 16, "%d", HUDSON_BUILD_NUMBER);
crAddProperty("hudson-build-number", buf); crAddProperty("hudson-build-number", buf);
crAddProperty("git-revision", REVISION); crAddProperty("git-revision", REVISION);
#if defined(FG_NIGHTLY) crAddProperty("build-type", FG_BUILD_TYPE);
crAddProperty("nightly-build", "true");
#endif
} }
#endif #endif
@ -325,7 +323,7 @@ int main ( int argc, char **argv )
fgviewerMain(argc, argv); fgviewerMain(argc, argv);
else else
fgMainInit(argc, argv); fgMainInit(argc, argv);
} catch (const sg_throwable &t) { } catch (const sg_throwable &t) {
std::string info; std::string info;
if (std::strlen(t.getOrigin()) != 0) if (std::strlen(t.getOrigin()) != 0)
@ -361,7 +359,7 @@ void fgExitCleanup() {
fgOSCloseWindow(); fgOSCloseWindow();
} }
// on the common exit path globals is already deleted, and NULL, // on the common exit path globals is already deleted, and NULL,
// so this only happens on error paths. // so this only happens on error paths.
delete globals; delete globals;
@ -372,4 +370,3 @@ void fgExitCleanup() {
simgear::shutdownLogging(); simgear::shutdownLogging();
} }

View file

@ -474,6 +474,21 @@ int fgInitConfig ( int argc, char **argv, bool reinit )
options->init(argc, argv, dataPath); options->init(argc, argv, dataPath);
} }
// establish default for developer-mode based upon compiled build types
bool developerMode = true;
if (!strcmp(FG_BUILD_TYPE, "Release")) {
developerMode = false;
}
// allow command line to override
if (options->isOptionSet("developer")) {
string s = options->valueForOption("developer", "yes");
developerMode = simgear::strutils::to_bool(s);
}
fgSetBool("/sim/developer-mode", developerMode);
sglog().setDeveloperMode(developerMode);
// Read global defaults from $FG_ROOT/defaults // Read global defaults from $FG_ROOT/defaults
SG_LOG(SG_GENERAL, SG_INFO, "Reading global defaults"); SG_LOG(SG_GENERAL, SG_INFO, "Reading global defaults");
SGPath defaultsXML = globals->get_fg_root() / "defaults.xml"; SGPath defaultsXML = globals->get_fg_root() / "defaults.xml";

View file

@ -82,14 +82,12 @@ public:
string_list aircraftDirPieces(sgPathBranchSplit(aircraftDir)); string_list aircraftDirPieces(sgPathBranchSplit(aircraftDir));
if (!aircraftDirPieces.empty() && (aircraftDirPieces.back() == pieces[1])) { if (!aircraftDirPieces.empty() && (aircraftDirPieces.back() == pieces[1])) {
// disable this warning for release builds // disable this warning for release builds
#if defined(ENABLE_DEV_WARNINGS)
SGPath betterPath; SGPath betterPath;
for (unsigned int i=2; i<pieces.size(); ++i) { for (unsigned int i=2; i<pieces.size(); ++i) {
betterPath.append(pieces[i]); betterPath.append(pieces[i]);
} }
SG_LOG(SG_AIRCRAFT, SG_WARN, "resolved path:" << aResource << " using /sim/aircraft-dir.\n" SG_LOG(SG_AIRCRAFT, SG_DEV_WARN, "resolved path:" << aResource << " using /sim/aircraft-dir.\n"
"This is legacy behaviour, change to an aircraft relative path:" << betterPath); "This is legacy behaviour, change to an aircraft relative path:" << betterPath);
#endif
// current aircraft-dir matches resource aircraft // current aircraft-dir matches resource aircraft
SGPath r(aircraftDir); SGPath r(aircraftDir);
@ -375,7 +373,7 @@ void FGGlobals::append_fg_scenery (const SGPath &path)
SGPropertyNode* n = sim->getChild("fg-scenery", propIndex++, true); SGPropertyNode* n = sim->getChild("fg-scenery", propIndex++, true);
n->setStringValue(abspath.utf8Str()); n->setStringValue(abspath.utf8Str());
n->setAttribute(SGPropertyNode::WRITE, false); n->setAttribute(SGPropertyNode::WRITE, false);
// temporary fix so these values survive reset // temporary fix so these values survive reset
n->setAttribute(SGPropertyNode::PRESERVE, true); n->setAttribute(SGPropertyNode::PRESERVE, true);
} }

View file

@ -455,6 +455,7 @@ int fgMainInit( int argc, char **argv )
std::string version(FLIGHTGEAR_VERSION); std::string version(FLIGHTGEAR_VERSION);
SG_LOG( SG_GENERAL, SG_INFO, "FlightGear: Version " SG_LOG( SG_GENERAL, SG_INFO, "FlightGear: Version "
<< version ); << version );
SG_LOG( SG_GENERAL, SG_INFO, "FlightGear: Build Type " << FG_BUILD_TYPE );
SG_LOG( SG_GENERAL, SG_INFO, "Built with " << SG_COMPILER_STR); SG_LOG( SG_GENERAL, SG_INFO, "Built with " << SG_COMPILER_STR);
SG_LOG( SG_GENERAL, SG_INFO, "Jenkins number/ID " << HUDSON_BUILD_NUMBER << ":" SG_LOG( SG_GENERAL, SG_INFO, "Jenkins number/ID " << HUDSON_BUILD_NUMBER << ":"
<< HUDSON_BUILD_ID); << HUDSON_BUILD_ID);

View file

@ -243,11 +243,7 @@ void fgSetDefaults ()
v->setValueReadOnly("build-number", HUDSON_BUILD_NUMBER); v->setValueReadOnly("build-number", HUDSON_BUILD_NUMBER);
v->setValueReadOnly("build-id", HUDSON_BUILD_ID); v->setValueReadOnly("build-id", HUDSON_BUILD_ID);
v->setValueReadOnly("hla-support", bool(FG_HAVE_HLA)); v->setValueReadOnly("hla-support", bool(FG_HAVE_HLA));
#if defined(FG_NIGHTLY) v->setValueReadOnly("build-type", FG_BUILD_TYPE);
v->setValueReadOnly("nightly-build", true);
#else
v->setValueReadOnly("nightly-build", false);
#endif
char* envp = ::getenv( "http_proxy" ); char* envp = ::getenv( "http_proxy" );
if( envp != NULL ) if( envp != NULL )
@ -1755,6 +1751,7 @@ struct OptionDesc {
{"no-default-config", false, OPTION_IGNORE, "", false, "", 0}, {"no-default-config", false, OPTION_IGNORE, "", false, "", 0},
{"prop", true, OPTION_FUNC | OPTION_MULTI, "", false, "", fgOptSetProperty}, {"prop", true, OPTION_FUNC | OPTION_MULTI, "", false, "", fgOptSetProperty},
{"load-tape", true, OPTION_FUNC, "", false, "", fgOptLoadTape }, {"load-tape", true, OPTION_FUNC, "", false, "", fgOptLoadTape },
{"developer", true, OPTION_IGNORE | OPTION_BOOL, "", false, "", nullptr },
{0} {0}
}; };
@ -2637,6 +2634,7 @@ void Options::showVersion() const
cout << "FlightGear version: " << FLIGHTGEAR_VERSION << endl; cout << "FlightGear version: " << FLIGHTGEAR_VERSION << endl;
cout << "Revision: " << REVISION << endl; cout << "Revision: " << REVISION << endl;
cout << "Build-Id: " << HUDSON_BUILD_ID << endl; cout << "Build-Id: " << HUDSON_BUILD_ID << endl;
cout << "Build-Type: " << FG_BUILD_TYPE << endl;
cout << "FG_ROOT=" << globals->get_fg_root().utf8Str() << endl; cout << "FG_ROOT=" << globals->get_fg_root().utf8Str() << endl;
cout << "FG_HOME=" << globals->get_fg_home().utf8Str() << endl; cout << "FG_HOME=" << globals->get_fg_home().utf8Str() << endl;
cout << "FG_SCENERY="; cout << "FG_SCENERY=";
@ -2673,6 +2671,7 @@ void Options::printJSONReport() const
cJSON_AddStringToObject(generalNode, "name", "FlightGear"); cJSON_AddStringToObject(generalNode, "name", "FlightGear");
cJSON_AddStringToObject(generalNode, "version", FLIGHTGEAR_VERSION); cJSON_AddStringToObject(generalNode, "version", FLIGHTGEAR_VERSION);
cJSON_AddStringToObject(generalNode, "build ID", HUDSON_BUILD_ID); cJSON_AddStringToObject(generalNode, "build ID", HUDSON_BUILD_ID);
cJSON_AddStringToObject(generalNode, "build type", FG_BUILD_TYPE);
cJSON *configNode = cJSON_CreateObject(); cJSON *configNode = cJSON_CreateObject();
cJSON_AddItemToObject(rootNode, "config", configNode); cJSON_AddItemToObject(rootNode, "config", configNode);

View file

@ -85,7 +85,7 @@ FGElectricalSupplier::FGElectricalSupplier ( SGPropertyNode *node ) {
} }
_rpm_node = fgGetNode( rpm_src.c_str(), true); _rpm_node = fgGetNode( rpm_src.c_str(), true);
} }
float FGElectricalSupplier::apply_load( float amps, float dt ) { float FGElectricalSupplier::apply_load( float amps, float dt ) {
@ -200,7 +200,7 @@ FGElectricalBus::FGElectricalBus ( SGPropertyNode *node ) {
add_prop( prop ); add_prop( prop );
} }
} }
} }
FGElectricalOutput::FGElectricalOutput ( SGPropertyNode *node ) { FGElectricalOutput::FGElectricalOutput ( SGPropertyNode *node ) {
@ -222,7 +222,7 @@ FGElectricalOutput::FGElectricalOutput ( SGPropertyNode *node ) {
add_prop( prop ); add_prop( prop );
} }
} }
} }
FGElectricalSwitch::FGElectricalSwitch( SGPropertyNode *node ) : FGElectricalSwitch::FGElectricalSwitch( SGPropertyNode *node ) :
@ -248,7 +248,7 @@ FGElectricalSwitch::FGElectricalSwitch( SGPropertyNode *node ) :
rating_amps = atof( cval.c_str() ); rating_amps = atof( cval.c_str() );
circuit_breaker = true; circuit_breaker = true;
// cout << "initial state = " << initial_state << endl; // cout << "initial state = " << initial_state << endl;
} }
} }
switch_node->setBoolValue( initial_state ); switch_node->setBoolValue( initial_state );
@ -276,11 +276,11 @@ FGElectricalConnector::FGElectricalConnector ( SGPropertyNode *node,
s->add_output( this ); s->add_output( this );
} else { } else {
SG_LOG( SG_SYSTEMS, SG_ALERT, SG_LOG( SG_SYSTEMS, SG_ALERT,
"Attempt to connect to something that can't provide an output: " "Attempt to connect to something that can't provide an output: "
<< child->getStringValue() ); << child->getStringValue() );
} }
} else { } else {
SG_LOG( SG_SYSTEMS, SG_ALERT, "Can't find named source: " SG_LOG( SG_SYSTEMS, SG_ALERT, "Can't find named source: "
<< child->getStringValue() ); << child->getStringValue() );
} }
} else if ( cname == "output" ) { } else if ( cname == "output" ) {
@ -297,11 +297,11 @@ FGElectricalConnector::FGElectricalConnector ( SGPropertyNode *node,
s->add_output( this ); s->add_output( this );
} else { } else {
SG_LOG( SG_SYSTEMS, SG_ALERT, SG_LOG( SG_SYSTEMS, SG_ALERT,
"Attempt to connect to something that can't provide an input: " "Attempt to connect to something that can't provide an input: "
<< child->getStringValue() ); << child->getStringValue() );
} }
} else { } else {
SG_LOG( SG_SYSTEMS, SG_ALERT, "Can't find named source: " SG_LOG( SG_SYSTEMS, SG_ALERT, "Can't find named source: "
<< child->getStringValue() ); << child->getStringValue() );
} }
} else if ( cname == "switch" ) { } else if ( cname == "switch" ) {
@ -310,7 +310,7 @@ FGElectricalConnector::FGElectricalConnector ( SGPropertyNode *node,
add_switch( s ); add_switch( s );
} }
} }
} }
// set all switches to the specified state // set all switches to the specified state
@ -375,12 +375,10 @@ void FGElectricalSystem::init () {
if ( path.length() ) { if ( path.length() ) {
SGPath config = globals->resolve_aircraft_path(path); SGPath config = globals->resolve_aircraft_path(path);
#if defined(ENABLE_DEV_WARNINGS)
// load an obsolete xml configuration // load an obsolete xml configuration
SG_LOG( SG_SYSTEMS, SG_WARN, SG_LOG( SG_SYSTEMS, SG_DEV_WARN,
"Reading deprecated xml electrical system model from\n " "Reading deprecated xml electrical system model from\n "
<< config.str() ); << config.str() );
#endif
try { try {
readProperties( config, config_props ); readProperties( config, config_props );
@ -388,7 +386,7 @@ void FGElectricalSystem::init () {
enabled = true; enabled = true;
} else { } else {
throw sg_exception("Logic error in electrical system file."); throw sg_exception("Logic error in electrical system file.");
} }
} catch (const sg_exception&) { } catch (const sg_exception&) {
SG_LOG( SG_SYSTEMS, SG_ALERT, SG_LOG( SG_SYSTEMS, SG_ALERT,
"Failed to load electrical system model: " "Failed to load electrical system model: "
@ -454,7 +452,7 @@ void FGElectricalSystem::update (double dt) {
SG_LOG(SG_SYSTEMS, SG_ALERT, SG_LOG(SG_SYSTEMS, SG_ALERT,
"Error drawing more current than available!"); "Error drawing more current than available!");
} }
} }
} }
// for each "alternator" supplier, propagate the electrical // for each "alternator" supplier, propagate the electrical
@ -474,7 +472,7 @@ void FGElectricalSystem::update (double dt) {
SG_LOG(SG_SYSTEMS, SG_ALERT, SG_LOG(SG_SYSTEMS, SG_ALERT,
"Error drawing more current than available!"); "Error drawing more current than available!");
} }
} }
} }
// for each "battery" supplier, propagate the electrical // for each "battery" supplier, propagate the electrical
@ -495,7 +493,7 @@ void FGElectricalSystem::update (double dt) {
SG_LOG(SG_SYSTEMS, SG_ALERT, SG_LOG(SG_SYSTEMS, SG_ALERT,
"Error drawing more current than available!"); "Error drawing more current than available!");
} }
} }
} }
float alt_norm float alt_norm
@ -575,7 +573,7 @@ bool FGElectricalSystem::build (SGPropertyNode* config_props) {
new FGElectricalConnector( node, this ); new FGElectricalConnector( node, this );
connectors.push_back( c ); connectors.push_back( c );
} else { } else {
SG_LOG( SG_SYSTEMS, SG_ALERT, "Unknown component type specified: " SG_LOG( SG_SYSTEMS, SG_ALERT, "Unknown component type specified: "
<< name ); << name );
return false; return false;
} }
@ -591,7 +589,7 @@ float FGElectricalSystem::propagate( FGElectricalComponent *node, double dt,
float input_volts, float input_amps, float input_volts, float input_amps,
string s ) { string s ) {
s += " "; s += " ";
float total_load = 0.0; float total_load = 0.0;
// determine the current to carry forward // determine the current to carry forward

View file

@ -321,9 +321,7 @@ private:
if (!FGAISchedule::validModelPath(mdl)) { if (!FGAISchedule::validModelPath(mdl)) {
missingModels.insert(mdl); missingModels.insert(mdl);
#if defined(ENABLE_DEV_WARNINGS) SG_LOG(SG_AI, SG_DEV_WARN, "TrafficMgr: Missing model path:" << mdl);
SG_LOG(SG_AI, SG_WARN, "TrafficMgr: Missing model path:" << mdl);
#endif
requiredAircraft = homePort = ""; requiredAircraft = homePort = "";
return; return;
} }
@ -586,17 +584,13 @@ void FGTrafficManager::finishInit()
assert(doingInit); assert(doingInit);
SG_LOG(SG_AI, SG_INFO, "finishing AI-Traffic init"); SG_LOG(SG_AI, SG_INFO, "finishing AI-Traffic init");
loadHeuristics(); loadHeuristics();
#if defined(ENABLE_DEV_WARNINGS)
PerformanceDB* perfDB = globals->get_subsystem<PerformanceDB>(); PerformanceDB* perfDB = globals->get_subsystem<PerformanceDB>();
#endif
// Do sorting and scoring separately, to take advantage of the "homeport" variable // Do sorting and scoring separately, to take advantage of the "homeport" variable
BOOST_FOREACH(FGAISchedule* schedule, scheduledAircraft) { BOOST_FOREACH(FGAISchedule* schedule, scheduledAircraft) {
schedule->setScore(); schedule->setScore();
#if defined(ENABLE_DEV_WARNINGS)
if (!perfDB->havePerformanceDataForAircraftType(schedule->getAircraft())) { if (!perfDB->havePerformanceDataForAircraftType(schedule->getAircraft())) {
SG_LOG(SG_AI, SG_WARN, "AI-Traffic: schedule aircraft missing performance data:" << schedule->getAircraft()); SG_LOG(SG_AI, SG_DEV_WARN, "AI-Traffic: schedule aircraft missing performance data:" << schedule->getAircraft());
} }
#endif
} }
sort(scheduledAircraft.begin(), scheduledAircraft.end(), sort(scheduledAircraft.begin(), scheduledAircraft.end(),
@ -641,10 +635,8 @@ void FGTrafficManager::loadHeuristics()
break; break;
HeuristicMapIterator itr = heurMap.find(h.registration); HeuristicMapIterator itr = heurMap.find(h.registration);
if (itr != heurMap.end()) { if (itr != heurMap.end()) {
#if defined(ENABLE_DEV_WARNINGS) SG_LOG(SG_AI, SG_DEV_WARN,"Traffic Manager Warning: found duplicate tailnumber " <<
SG_LOG(SG_AI, SG_WARN,"Traffic Manager Warning: found duplicate tailnumber " <<
h.registration << " for AI aircraft"); h.registration << " for AI aircraft");
#endif
} else { } else {
heurMap[h.registration] = h; heurMap[h.registration] = h;
} }

View file

@ -176,13 +176,12 @@ void SplashScreen::createNodes()
osgText::Text::RIGHT_BOTTOM, osgText::Text::RIGHT_BOTTOM,
fgGetNode("/sim/startup/splash-progress-spinner", true)); fgGetNode("/sim/startup/splash-progress-spinner", true));
if (!strcmp(FG_BUILD_TYPE, "Nightly")) {
#if defined(FG_NIGHTLY) addText(geode, osg::Vec2(0.5, 0.5), 0.03,
addText(geode, osg::Vec2(0.5, 0.5), 0.03, "Unstable nightly build - some features may be under active development",
"Unstable nightly build - some features may be under active development", osgText::Text::CENTER_CENTER,
osgText::Text::CENTER_CENTER, nullptr, -1.0, osg::Vec4(1.0, 0.0, 0.0, 1.0));
nullptr, -1.0, osg::Vec4(1.0, 0.0, 0.0, 1.0)); }
#endif
/////////// ///////////
@ -349,7 +348,7 @@ void SplashScreen::addText(osg::Geode* geode ,
t->setBackdropType(osgText::Text::OUTLINE); t->setBackdropType(osgText::Text::OUTLINE);
t->setBackdropColor(osg::Vec4(0.2, 0.2, 0.2, 1)); t->setBackdropColor(osg::Vec4(0.2, 0.2, 0.2, 1));
t->setBackdropOffset(0.04); t->setBackdropOffset(0.04);
item.fractionalCharSize = size; item.fractionalCharSize = size;
item.fractionalPosition = pos; item.fractionalPosition = pos;
item.dynamicContent = dynamicValue; item.dynamicContent = dynamicValue;