From: Matthew G. <mat...@us...> - 2007-09-27 14:46:24
|
Update of /cvsroot/jsbsimcommander/src/math In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24981 Modified Files: FGFunction.cpp FGFunction.h FGPropertyValue.cpp FGPropertyValue.h Log Message: make FGPropertyValue to memorize the its relative name(path) for exporting to xml text Index: FGPropertyValue.h =================================================================== RCS file: /cvsroot/jsbsimcommander/src/math/FGPropertyValue.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FGPropertyValue.h 23 Feb 2007 02:54:18 -0000 1.1 --- FGPropertyValue.h 27 Sep 2007 14:46:21 -0000 1.2 *************** *** 66,76 **** public: ! FGPropertyValue(FGPropertyManager* propNode); ~FGPropertyValue() {}; double GetValue(void) const; private: FGPropertyManager* PropertyManager; }; --- 66,78 ---- public: ! FGPropertyValue(FGPropertyManager* propNode, const string & name=""); ~FGPropertyValue() {}; double GetValue(void) const; + string GetName(void) const; private: FGPropertyManager* PropertyManager; + string PropertyName; }; Index: FGPropertyValue.cpp =================================================================== RCS file: /cvsroot/jsbsimcommander/src/math/FGPropertyValue.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FGPropertyValue.cpp 23 Feb 2007 02:54:18 -0000 1.1 --- FGPropertyValue.cpp 27 Sep 2007 14:46:21 -0000 1.2 *************** *** 40,44 **** %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ ! FGPropertyValue::FGPropertyValue(FGPropertyManager* propNode) : PropertyManager(propNode) { } --- 40,44 ---- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ ! FGPropertyValue::FGPropertyValue(FGPropertyManager* propNode, const string & name) : PropertyManager(propNode), PropertyName(name) { } *************** *** 51,53 **** --- 51,64 ---- } + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + string FGPropertyValue::GetName(void) const + { + if (PropertyName.empty()) + { + return PropertyManager->GetFullyQualifiedName(); + } + return PropertyName; + } + } Index: FGFunction.cpp =================================================================== RCS file: /cvsroot/jsbsimcommander/src/math/FGFunction.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FGFunction.cpp 23 Feb 2007 02:54:18 -0000 1.1 --- FGFunction.cpp 27 Sep 2007 14:46:21 -0000 1.2 *************** *** 127,136 **** if (operation == string("property")) { property_name = element->GetDataLine(); ! FGPropertyManager* newNode = PropertyManager->GetNode(property_name); if (newNode == 0) { cerr << "The property " << property_name << " is undefined." << endl; exit(-1); } else { ! Parameters.push_back(new FGPropertyValue( newNode )); } } else if (operation == string("value")) { --- 127,137 ---- if (operation == string("property")) { property_name = element->GetDataLine(); ! // Matt's change here ! FGPropertyManager* newNode = PropertyManager->GetNode(property_name, true); if (newNode == 0) { cerr << "The property " << property_name << " is undefined." << endl; exit(-1); } else { ! Parameters.push_back(new FGPropertyValue( newNode, property_name)); } } else if (operation == string("value")) { *************** *** 170,174 **** { Parameters.push_back(new FGFunction(PropertyManager, element)); ! } else if (operation != string("description")) { cerr << "Bad operation " << operation << " detected in configuration file" << endl; } --- 171,177 ---- { Parameters.push_back(new FGFunction(PropertyManager, element)); ! } else if (operation == string("description")) { ! description = element->GetDataLine(); ! } else { cerr << "Bad operation " << operation << " detected in configuration file" << endl; } Index: FGFunction.h =================================================================== RCS file: /cvsroot/jsbsimcommander/src/math/FGFunction.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FGFunction.h 23 Feb 2007 02:54:18 -0000 1.1 --- FGFunction.h 27 Sep 2007 14:46:21 -0000 1.2 *************** *** 182,185 **** --- 182,186 ---- //Matt's change start: FGParameter* GetParameter(size_t i) {return Parameters[i];} + const FGParameter* GetParameter(size_t i) const {return Parameters[i];} size_t GetParaCount() const {return Parameters.size();} enum functionType {eTopLevel=0, eProduct, eDifference, eSum, eQuotient, ePow, *************** *** 191,194 **** --- 192,196 ---- }; functionType GetType() const {return Type;} + string GetDescription() const {return description;} //Matt's change end. *************** *** 207,210 **** --- 209,213 ---- mutable double old_time; mutable double old_value; + string description; //Matt's change end. string Name; |