diff --git a/src/AIModel/AIBase.cxx b/src/AIModel/AIBase.cxx index 1e3b775d4..33cb073cb 100644 --- a/src/AIModel/AIBase.cxx +++ b/src/AIModel/AIBase.cxx @@ -59,8 +59,8 @@ FGAIBase::FGAIBase(object_type ot) : props( NULL ), model_removed( fgGetNode("/ai/models/model-removed", true) ), manager( NULL ), - fp( NULL ), _installed(false), + fp( NULL ), _impact_lat(0), _impact_lon(0), _impact_elev(0), diff --git a/src/AIModel/AIWingman.cxx b/src/AIModel/AIWingman.cxx index cef9ad737..be053c447 100644 --- a/src/AIModel/AIWingman.cxx +++ b/src/AIModel/AIWingman.cxx @@ -375,7 +375,7 @@ void FGAIWingman::Break(double dt) { void FGAIWingman::Join(double dt) { double range, bearing, az2; - double parent_hdg, parent_spd, parent_ht= 0; + double parent_hdg, parent_spd = 0; double p_hdg, p_pch, p_rll = 0; setTgtOffsets(dt, 25); @@ -425,7 +425,7 @@ void FGAIWingman::Join(double dt) { double rel_brg = calcRelBearingDeg(bearing, hdg); double recip_brg = calcRecipBearingDeg(bearing); double angle = calcAngle(distance,_offsetpos, pos); - double approx_angle = atan2(daltM, range); + //double approx_angle = atan2(daltM, range); double frm_spd = 50; // formation speed double join_rnge = 1000.0; double recip_parent_hdg = calcRecipBearingDeg(parent_hdg); diff --git a/src/Environment/environment.hxx b/src/Environment/environment.hxx index 048b17992..c1da68037 100644 --- a/src/Environment/environment.hxx +++ b/src/Environment/environment.hxx @@ -25,7 +25,7 @@ #include <simgear/compiler.h> #include <cmath> -#include "tiedpropertylist.hxx" +#include <simgear/props/tiedpropertylist.hxx> /** * Model the natural environment. @@ -146,7 +146,7 @@ private: double wind_from_down_fps; bool live_update; - TiedPropertyList _tiedProperties; + simgear::TiedPropertyList _tiedProperties; }; diff --git a/src/Environment/environment_ctrl.cxx b/src/Environment/environment_ctrl.cxx index d4ebbf595..c182f0625 100644 --- a/src/Environment/environment_ctrl.cxx +++ b/src/Environment/environment_ctrl.cxx @@ -123,7 +123,7 @@ private: LayerTable _aloft_table; FGEnvironment _environment; - TiedPropertyList _tiedProperties; + simgear::TiedPropertyList _tiedProperties; }; ////////////////////////////////////////////////////////////////////////////// diff --git a/src/Environment/environment_mgr.hxx b/src/Environment/environment_mgr.hxx index d9c770319..e6041f813 100644 --- a/src/Environment/environment_mgr.hxx +++ b/src/Environment/environment_mgr.hxx @@ -25,7 +25,7 @@ #include <simgear/compiler.h> #include <simgear/structure/subsystem_mgr.hxx> #include <simgear/math/SGMath.hxx> -#include "tiedpropertylist.hxx" +#include <simgear/props/tiedpropertylist.hxx> #ifdef SG_HAVE_STD_INCLUDES # include <cmath> @@ -96,7 +96,7 @@ private: FGClouds *fgClouds; SGPropertyNode_ptr _altitudeNode; bool _cloudLayersDirty; - TiedPropertyList _tiedProperties; + simgear::TiedPropertyList _tiedProperties; }; #endif // _ENVIRONMENT_MGR_HXX diff --git a/src/Environment/metarairportfilter.hxx b/src/Environment/metarairportfilter.hxx index 568a28b95..f31eb64f5 100644 --- a/src/Environment/metarairportfilter.hxx +++ b/src/Environment/metarairportfilter.hxx @@ -24,7 +24,6 @@ #include <Airports/simple.hxx> #include <simgear/props/props.hxx> -#include "tiedpropertylist.hxx" namespace Environment { diff --git a/src/Environment/metarproperties.hxx b/src/Environment/metarproperties.hxx index 0e157169e..7d108100d 100644 --- a/src/Environment/metarproperties.hxx +++ b/src/Environment/metarproperties.hxx @@ -25,7 +25,7 @@ #include <Airports/simple.hxx> #include <simgear/props/props.hxx> -#include "tiedpropertylist.hxx" +#include <simgear/props/tiedpropertylist.hxx> namespace Environment { @@ -89,7 +89,7 @@ private: bool _snow_cover; std::string _decoded; protected: - TiedPropertyList _tiedProperties; + simgear::TiedPropertyList _tiedProperties; MagneticVariation * _magneticVariation; }; diff --git a/src/Environment/realwx_ctrl.cxx b/src/Environment/realwx_ctrl.cxx index 98fe6ed3b..197f4cf52 100644 --- a/src/Environment/realwx_ctrl.cxx +++ b/src/Environment/realwx_ctrl.cxx @@ -25,7 +25,6 @@ #endif #include "realwx_ctrl.hxx" -#include "tiedpropertylist.hxx" #include "metarproperties.hxx" #include "metarairportfilter.hxx" #include "fgmetar.hxx" @@ -34,6 +33,7 @@ #include <simgear/structure/exception.hxx> #include <simgear/misc/strutils.hxx> +#include <simgear/props/tiedpropertylist.hxx> #include <algorithm> #if defined(ENABLE_THREADS) #include <OpenThreads/Thread> @@ -105,7 +105,7 @@ protected: bool _enabled; bool __enabled; - TiedPropertyList _tiedProperties; + simgear::TiedPropertyList _tiedProperties; ; typedef std::vector<LiveMetarProperties_ptr> MetarPropertiesList; MetarPropertiesList _metarProperties; }; diff --git a/src/Environment/terrainsampler.cxx b/src/Environment/terrainsampler.cxx index 276c8ffb1..0d08af84e 100644 --- a/src/Environment/terrainsampler.cxx +++ b/src/Environment/terrainsampler.cxx @@ -32,7 +32,7 @@ #include "terrainsampler.hxx" using simgear::PropertyList; -#include "tiedpropertylist.hxx" +#include <simgear/props/tiedpropertylist.hxx> namespace Environment { /** @@ -93,7 +93,7 @@ private: SGPropertyNode_ptr _positionLongitudeNode; deque<double> _elevations; - TiedPropertyList _tiedProperties; + simgear::TiedPropertyList _tiedProperties; }; AreaSampler::AreaSampler( SGPropertyNode_ptr rootNode ) : @@ -329,7 +329,7 @@ private: SGPropertyNode_ptr _rootNode; bool _enabled; - TiedPropertyList _tiedProperties; + simgear::TiedPropertyList _tiedProperties; }; TerrainSamplerImplementation::TerrainSamplerImplementation( SGPropertyNode_ptr rootNode ) : diff --git a/src/Environment/tiedpropertylist.hxx b/src/Environment/tiedpropertylist.hxx deleted file mode 100644 index cfdd57c97..000000000 --- a/src/Environment/tiedpropertylist.hxx +++ /dev/null @@ -1,80 +0,0 @@ -#ifndef __TIEDPROPERTYLIST_HXX -#define __TIEDPROPERTYLIST_HXX -#include <simgear/props/props.hxx> -using simgear::PropertyList; - -// Maybe this goes into SimGear's props.hxx later? -class TiedPropertyList : PropertyList { -public: - TiedPropertyList() {} - TiedPropertyList( SGPropertyNode_ptr root ) : _root(root) {} - - void setRoot( SGPropertyNode_ptr root ) { _root = root; } - SGPropertyNode_ptr getRoot() const { return _root; } - - template<typename T> SGPropertyNode_ptr Tie( SGPropertyNode_ptr node, const SGRawValue<T> &rawValue, bool useDefault = true ) { - bool success = node->tie( rawValue, useDefault ); - if( success ) { - SG_LOG( SG_ALL, SG_INFO, "Tied " << node->getPath() ); - push_back( node ); - } else { -#if PROPS_STANDALONE - cerr << "Failed to tie property " << node->getPath() << endl; -#else - SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << node->getPath() ); -#endif - } - return node; - } - - template <class V> SGPropertyNode_ptr Tie( SGPropertyNode_ptr node, V * value, bool useDefault = true ) { - return Tie( node, SGRawValuePointer<V>(value), useDefault ); - } - - template <class V> SGPropertyNode_ptr Tie( const char * relative_path, V * value, bool useDefault = true ) { - return Tie( _root->getNode(relative_path,true), SGRawValuePointer<V>(value), useDefault ); - } - - template <class V> SGPropertyNode_ptr Tie( SGPropertyNode_ptr node, V (*getter)(), void (*setter)(V) = 0, bool useDefault = true ) { - return Tie(node, SGRawValueFunctions<V>(getter, setter), useDefault ); - } - - template <class V> SGPropertyNode_ptr Tie( const char * relative_path, V (*getter)(), void (*setter)(V) = 0, bool useDefault = true ) { - return Tie(_root->getNode(relative_path, true), SGRawValueFunctions<V>(getter, setter), useDefault ); - } - - template <class V> SGPropertyNode_ptr Tie( SGPropertyNode_ptr node, int index, V (*getter)(int), void (*setter)(int, V) = 0, bool useDefault = true) { - return Tie( node, SGRawValueFunctionsIndexed<V>(index, getter, setter), useDefault ); - } - - template <class V> SGPropertyNode_ptr Tie( const char * relative_path, int index, V (*getter)(int), void (*setter)(int, V) = 0, bool useDefault = true) { - return Tie( _root->getNode( relative_path, true ), SGRawValueFunctionsIndexed<V>(index, getter, setter), useDefault ); - } - - template <class T, class V> SGPropertyNode_ptr Tie( SGPropertyNode_ptr node, T * obj, V (T::*getter)() const, void (T::*setter)(V) = 0, bool useDefault = true) { - return Tie( node, SGRawValueMethods<T,V>(*obj, getter, setter), useDefault ); - } - - template <class T, class V> SGPropertyNode_ptr Tie( const char * relative_path, T * obj, V (T::*getter)() const, void (T::*setter)(V) = 0, bool useDefault = true) { - return Tie( _root->getNode( relative_path, true), SGRawValueMethods<T,V>(*obj, getter, setter), useDefault ); - } - - template <class T, class V> SGPropertyNode_ptr Tie( SGPropertyNode_ptr node, T * obj, int index, V (T::*getter)(int) const, void (T::*setter)(int, V) = 0, bool useDefault = true) { - return Tie( node, SGRawValueMethodsIndexed<T,V>(*obj, index, getter, setter), useDefault); - } - - template <class T, class V> SGPropertyNode_ptr Tie( const char * relative_path, T * obj, int index, V (T::*getter)(int) const, void (T::*setter)(int, V) = 0, bool useDefault = true) { - return Tie( _root->getNode( relative_path, true ), SGRawValueMethodsIndexed<T,V>(*obj, index, getter, setter), useDefault); - } - - void Untie() { - while( size() > 0 ) { - SG_LOG( SG_ALL, SG_INFO, "untie of " << back()->getPath() ); - back()->untie(); - pop_back(); - } - } -private: - SGPropertyNode_ptr _root; -}; -#endif diff --git a/src/FDM/JSBSim/FGFDMExec.cpp b/src/FDM/JSBSim/FGFDMExec.cpp index b3b7003c2..ade4209cd 100644 --- a/src/FDM/JSBSim/FGFDMExec.cpp +++ b/src/FDM/JSBSim/FGFDMExec.cpp @@ -78,22 +78,6 @@ static const char *IdHdr = ID_FDMEXEC; CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -void checkTied ( FGPropertyManager *node ) -{ - int N = node->nChildren(); - string name; - - for (int i=0; i<N; i++) { - if (node->getChild(i)->nChildren() ) { - checkTied( (FGPropertyManager*)node->getChild(i) ); - } - if ( node->getChild(i)->isTied() ) { - name = ((FGPropertyManager*)node->getChild(i))->GetFullyQualifiedName(); - node->Untie(name); - } - } -} - //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // Constructor @@ -185,7 +169,7 @@ FGFDMExec::FGFDMExec(FGPropertyManager* root, unsigned int* fdmctr) : Root(root) FGFDMExec::~FGFDMExec() { try { - checkTied( instance ); + Unbind(); DeAllocate(); if (IdFDM == 0) { // Meaning this is no child FDM diff --git a/src/FDM/JSBSim/FGFDMExec.h b/src/FDM/JSBSim/FGFDMExec.h index 10736f4a4..b982654e7 100644 --- a/src/FDM/JSBSim/FGFDMExec.h +++ b/src/FDM/JSBSim/FGFDMExec.h @@ -101,8 +101,8 @@ CLASS DOCUMENTATION file: @code - fdmex = new FGFDMExec( � ); - result = fdmex->LoadModel( � ); + fdmex = new FGFDMExec( ... ); + result = fdmex->LoadModel( ... ); @endcode When an aircraft model is loaded, the config file is parsed and for each of the @@ -226,6 +226,9 @@ public: /// Default destructor ~FGFDMExec(); + /** Unbind all tied JSBSim properties. */ + void Unbind(void) {instance->Unbind();} + /** This routine places a model into the runlist at the specified rate. The "rate" is not really a clock rate. It represents how many calls to the FGFDMExec::Run() method must be made before the model is executed. A diff --git a/src/FDM/JSBSim/JSBSim.cxx b/src/FDM/JSBSim/JSBSim.cxx index a9e9be771..b1daa9cd3 100644 --- a/src/FDM/JSBSim/JSBSim.cxx +++ b/src/FDM/JSBSim/JSBSim.cxx @@ -422,28 +422,9 @@ void FGJSBsim::init() /******************************************************************************/ -void checkTied ( FGPropertyManager *node ) -{ - int N = node->nChildren(); - string name; - - for (int i=0; i<N; i++) { - if (node->getChild(i)->nChildren() ) { - checkTied( (FGPropertyManager*)node->getChild(i) ); - } - if ( node->getChild(i)->isTied() ) { - name = ((FGPropertyManager*)node->getChild(i))->GetFullyQualifiedName(); - node->Untie(name); - } - } -} - -/******************************************************************************/ - void FGJSBsim::unbind() { - SGPropertyNode* instance = globals->get_props()->getNode("/fdm/jsbsim"); - checkTied((FGPropertyManager*)instance); + fdmex->Unbind(); FGInterface::unbind(); } diff --git a/src/FDM/JSBSim/input_output/FGPropertyManager.cpp b/src/FDM/JSBSim/input_output/FGPropertyManager.cpp index 11e566965..c0218ec20 100755 --- a/src/FDM/JSBSim/input_output/FGPropertyManager.cpp +++ b/src/FDM/JSBSim/input_output/FGPropertyManager.cpp @@ -49,6 +49,19 @@ COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] namespace JSBSim { bool FGPropertyManager::suppress_warning = true; +std::vector<std::string> FGPropertyManager::tied_properties; + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +void FGPropertyManager::Unbind(void) +{ + vector<string>::iterator it; + for (it = tied_properties.begin();it < tied_properties.end();it++) + { + Untie(*it); + } + tied_properties.clear(); +} //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -303,8 +316,10 @@ void FGPropertyManager::Tie (const string &name, bool *pointer, bool useDefault) { if (!tie(name.c_str(), SGRawValuePointer<bool>(pointer), useDefault)) cerr << "Failed to tie property " << name << " to a pointer" << endl; - else if (debug_lvl & 0x20) - cout << name << endl; + else { + tied_properties.push_back(name); + if (debug_lvl & 0x20) std::cout << name << std::endl; + } } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -314,8 +329,10 @@ void FGPropertyManager::Tie (const string &name, int *pointer, { if (!tie(name.c_str(), SGRawValuePointer<int>(pointer), useDefault)) cerr << "Failed to tie property " << name << " to a pointer" << endl; - else if (debug_lvl & 0x20) - cout << name << endl; + else { + tied_properties.push_back(name); + if (debug_lvl & 0x20) std::cout << name << std::endl; + } } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -325,8 +342,10 @@ void FGPropertyManager::Tie (const string &name, long *pointer, { if (!tie(name.c_str(), SGRawValuePointer<long>(pointer), useDefault)) cerr << "Failed to tie property " << name << " to a pointer" << endl; - else if (debug_lvl & 0x20) - cout << name << endl; + else { + tied_properties.push_back(name); + if (debug_lvl & 0x20) std::cout << name << std::endl; + } } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -336,8 +355,10 @@ void FGPropertyManager::Tie (const string &name, float *pointer, { if (!tie(name.c_str(), SGRawValuePointer<float>(pointer), useDefault)) cerr << "Failed to tie property " << name << " to a pointer" << endl; - else if (debug_lvl & 0x20) - cout << name << endl; + else { + tied_properties.push_back(name); + if (debug_lvl & 0x20) std::cout << name << std::endl; + } } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -346,8 +367,10 @@ void FGPropertyManager::Tie (const string &name, double *pointer, bool useDefaul { if (!tie(name.c_str(), SGRawValuePointer<double>(pointer), useDefault)) cerr << "Failed to tie property " << name << " to a pointer" << endl; - else if (debug_lvl & 0x20) - cout << name << endl; + else { + tied_properties.push_back(name); + if (debug_lvl & 0x20) std::cout << name << std::endl; + } } } // namespace JSBSim diff --git a/src/FDM/JSBSim/input_output/FGPropertyManager.h b/src/FDM/JSBSim/input_output/FGPropertyManager.h index c29b5a412..a08f89681 100644 --- a/src/FDM/JSBSim/input_output/FGPropertyManager.h +++ b/src/FDM/JSBSim/input_output/FGPropertyManager.h @@ -77,6 +77,7 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase { private: static bool suppress_warning; + static std::vector<std::string> tied_properties; public: /// Constructor FGPropertyManager(void) {suppress_warning = false;} @@ -399,6 +400,13 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase */ void Untie (const std::string &name); + /** + * Unbind all properties bound by this manager to an external data source. + * + * Classes should use this function to release control of any + * properties they have bound using this property manager. + */ + void Unbind (void); // Templates cause ambiguity here @@ -526,8 +534,10 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase { if (!tie(name.c_str(), SGRawValueFunctions<V>(getter, setter), useDefault)) std::cout << "Failed to tie property " << name << " to functions" << std::endl; - else if (debug_lvl & 0x20) - std::cout << name << std::endl; + else { + tied_properties.push_back(name); + if (debug_lvl & 0x20) std::cout << name << std::endl; + } } @@ -554,8 +564,10 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase { if (!tie(name.c_str(), SGRawValueFunctionsIndexed<V>(index, getter, setter), useDefault)) std::cout << "Failed to tie property " << name << " to indexed functions" << std::endl; - else if (debug_lvl & 0x20) - std::cout << name << std::endl; + else { + tied_properties.push_back(name); + if (debug_lvl & 0x20) std::cout << name << std::endl; + } } @@ -584,8 +596,10 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase { if (!tie(name.c_str(), SGRawValueMethods<T,V>(*obj, getter, setter), useDefault)) std::cout << "Failed to tie property " << name << " to object methods" << std::endl; - else if (debug_lvl & 0x20) - std::cout << name << std::endl; + else { + tied_properties.push_back(name); + if (debug_lvl & 0x20) std::cout << name << std::endl; + } } /** @@ -613,8 +627,10 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase { if (!tie(name.c_str(), SGRawValueMethodsIndexed<T,V>(*obj, index, getter, setter), useDefault)) std::cout << "Failed to tie property " << name << " to indexed object methods" << std::endl; - else if (debug_lvl & 0x20) - std::cout << name << std::endl; + else { + tied_properties.push_back(name); + if (debug_lvl & 0x20) std::cout << name << std::endl; + } } }; } diff --git a/src/FDM/YASim/Gear.cpp b/src/FDM/YASim/Gear.cpp index 886a1a989..ce2517c73 100644 --- a/src/FDM/YASim/Gear.cpp +++ b/src/FDM/YASim/Gear.cpp @@ -332,8 +332,10 @@ void Gear::calcForce(RigidBody* body, State *s, float* v, float* rot) float b = ground[3] - Math::dot3(tmp, ground)+BumpAltitude; // Calculate the point of ground _contact. - _frac = a/(a-b); - if(b < 0) _frac = 1; + if(b < 0) + _frac = 1; + else + _frac = a/(a-b); for(i=0; i<3; i++) _contact[i] = _pos[i] + _frac*_cmpr[i]; diff --git a/src/FDM/YASim/Rotorpart.cpp b/src/FDM/YASim/Rotorpart.cpp index 77520dee9..bd54f4122 100644 --- a/src/FDM/YASim/Rotorpart.cpp +++ b/src/FDM/YASim/Rotorpart.cpp @@ -99,7 +99,7 @@ void Rotorpart::inititeration(float dt,float *rot) float b; b=_rotor->getBalance(); float s =Math::sin(_phi+_direction); - float c =Math::cos(_phi+_direction); + //float c =Math::cos(_phi+_direction); if (s>0) _balance=(b>0)?(1.-s*(1.-b)):(1.-s)*(1.+b); else @@ -548,7 +548,7 @@ void Rotorpart::calcForce(float* v, float rho, float* out, float* torque, float dirblade[3]; Math::cross3(_normal,_directionofcentripetalforce,dirblade); - float vblade=Math::abs(Math::dot3(dirblade,v)); + //float vblade=Math::abs(Math::dot3(dirblade,v)); alpha=_alphaalt+(alpha-_alphaalt)*factor; _alpha=alpha; diff --git a/src/Instrumentation/dclgps.cxx b/src/Instrumentation/dclgps.cxx index 58e87dc20..ec78643aa 100644 --- a/src/Instrumentation/dclgps.cxx +++ b/src/Instrumentation/dclgps.cxx @@ -654,7 +654,7 @@ string DCLGPS::ExpandSIAPIdent(const string& ident) { Col 107-111 MSA center fix. We can ignore this. */ void DCLGPS::LoadApproachData() { - FGNPIAP* iap; + FGNPIAP* iap = NULL; GPSWaypoint* wp; GPSFlightPlan* fp; const GPSWaypoint* cwp; diff --git a/src/Instrumentation/heading_indicator_dg.cxx b/src/Instrumentation/heading_indicator_dg.cxx index 9bcd19b67..bb9c1620e 100644 --- a/src/Instrumentation/heading_indicator_dg.cxx +++ b/src/Instrumentation/heading_indicator_dg.cxx @@ -125,7 +125,6 @@ HeadingIndicatorDG::update (double dt) double yaw_rate = _yaw_rate_node->getDoubleValue(); double error = _error_node->getDoubleValue(); double g = _g_node->getDoubleValue(); - int sign = 0; if ( fabs ( yaw_rate ) > 5 ) { error += 0.033 * -yaw_rate * dt ; diff --git a/src/Instrumentation/rnav_waypt_controller.cxx b/src/Instrumentation/rnav_waypt_controller.cxx index 278484d0a..e728b88d2 100644 --- a/src/Instrumentation/rnav_waypt_controller.cxx +++ b/src/Instrumentation/rnav_waypt_controller.cxx @@ -342,6 +342,9 @@ public: case RESTRICT_NONE: assert(false); break; + case SPEED_RESTRICT_MACH: + assert(false); + break; } } diff --git a/src/Model/modelmgr.cxx b/src/Model/modelmgr.cxx index 181435ef1..2e6ad72bc 100644 --- a/src/Model/modelmgr.cxx +++ b/src/Model/modelmgr.cxx @@ -70,10 +70,6 @@ FGModelMgr::add_model (SGPropertyNode * node) { SG_LOG(SG_GENERAL, SG_INFO, "Adding model " << node->getStringValue("name", "[unnamed]")); - Instance * instance = new Instance; - SGModelPlacement *model = new SGModelPlacement; - instance->model = model; - instance->node = node; const char *path = node->getStringValue("path", "Models/Geometry/glider.ac"); osg::Node *object; @@ -83,9 +79,13 @@ FGModelMgr::add_model (SGPropertyNode * node) } catch (const sg_throwable& t) { SG_LOG(SG_GENERAL, SG_ALERT, "Error loading " << path << ":\n " << t.getFormattedMessage() << t.getOrigin()); - delete instance; return; } + + Instance * instance = new Instance; + SGModelPlacement *model = new SGModelPlacement; + instance->model = model; + instance->node = node; model->init( object ); diff --git a/src/Time/sunsolver.cxx b/src/Time/sunsolver.cxx index b903f5e56..b45e0bf2c 100644 --- a/src/Time/sunsolver.cxx +++ b/src/Time/sunsolver.cxx @@ -53,13 +53,12 @@ void fgSunPositionGST(double gst, double *lon, double *lat) { /* double *lat; (return) latitude */ /* double *lon; (return) longitude */ - double alpha, delta; double tmp; SGPropertyNode* sun = fgGetNode("/ephemeris/sun"); assert(sun); double xs = sun->getDoubleValue("xs"); - double ys = sun->getDoubleValue("ys"); + //double ys = sun->getDoubleValue("ys"); double ye = sun->getDoubleValue("ye"); double ze = sun->getDoubleValue("ze"); double ra = atan2(ye, xs);