Changeset 400
- Timestamp:
- Apr 9, 2006, 10:03:43 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/core/RpUnits.h
r388 r400 299 299 300 300 // retrieve a list of compatible units. 301 std::list<std::string> getCompatible( ) const;301 std::list<std::string> getCompatible(double expMultiplier=1.0) const; 302 302 303 303 … … 343 343 static const RpUnits* find(std::string key); 344 344 345 // validate is very similar to find, but it works better 346 // for seeing complex units can be interpreted. 347 // it validates that if the a certain units string is 348 // provided as a unit type, then all of the base components 349 // of that unit are available for conversions. 350 // returns 0 on success (units are valid) 351 // returns !0 on failure (units not valid) 352 static int validate(const std::string& inUnits, 353 std::string& type, 354 std::list<std::string>* compatList=NULL); 355 345 356 // user calls define to add a RpUnits object or to add a relation rule 346 357 // -
trunk/src/core/RpLibrary.cc
r394 r400 237 237 238 238 if (!path.str().empty()) { 239 path.str(_node2comp(snode) + "." + path.str()); 239 // path.str(_node2comp(snode) + "." + path.str()); 240 path.str("." + _node2comp(snode) + path.str()); 240 241 } 241 242 else { 242 path.str(_node2comp(snode)); 243 // path.str(_node2comp(snode)); 244 path.str("." + _node2comp(snode)); 243 245 } 244 246 … … 1296 1298 // METHOD: put() 1297 1299 /// Put a RpLibrary* value into the xml. 1298 // Append flag is ignored for this function. 1299 /** 1300 /** 1301 * Append flag adds additional nodes, it does not merge same 1302 * named nodes together 1300 1303 */ 1301 1304 … … 1303 1306 RpLibrary::put ( std::string path, RpLibrary* value, std::string id, int append ) 1304 1307 { 1305 scew_element* retNode = NULL; 1306 scew_element* new_elem = NULL; 1308 scew_element* retNode = NULL; 1309 // scew_element* old_elem = NULL; 1310 scew_element* new_elem = NULL; 1311 scew_element* childNode = NULL; 1312 // std::string nodeName = ""; 1313 1307 1314 int retVal = 1; 1308 1315 … … 1318 1325 } 1319 1326 1327 // nodeName = value->nodeComp(); 1328 // old_elem = _find(path+"."+nodeName,NO_CREATE_PATH); 1329 1330 if (!append) { 1331 retNode = _find(path,NO_CREATE_PATH); 1332 if (retNode) { 1333 scew_element_free(retNode); 1334 } 1335 else { 1336 // path did not exist and was not created 1337 // do nothing 1338 } 1339 } 1340 1320 1341 retNode = _find(path,CREATE_PATH); 1321 1342 1343 if (retNode) { 1344 while ( (childNode = scew_element_next(value->root,childNode)) ) { 1345 if ((new_elem = scew_element_copy(childNode))) { 1346 if (scew_element_add_elem(retNode, new_elem)) { 1347 // maybe we want to count the number of children 1348 // that we have successfully added? 1349 retVal = 0; 1350 } 1351 else { 1352 // adding new element failed 1353 } 1354 } 1355 else { 1356 // copying new element failed 1357 } 1358 } 1359 } 1360 else { 1361 // path did not exist and was not created. 1362 } 1363 1364 /* 1322 1365 if (retNode) { 1323 1366 if ((new_elem = scew_element_copy(value->root))) { … … 1327 1370 } 1328 1371 } 1372 1373 */ 1329 1374 1330 1375 return *this; -
trunk/src/core/RpUnits.cc
r399 r400 249 249 // add the other unit's name to the list of compatible units 250 250 // compatList.push_back(otherName.str()); 251 std::cout << " pushing " << otherName << std::endl;252 251 compatList.push_back(otherName); 253 252 -
trunk/src/tcl/src/RpLibraryTclInterface.cc
r399 r400 1063 1063 int opt_argc = 2; // max number of optional parameters 1064 1064 int argsLeft = 0; // temp variable for calculation 1065 int noerr = 0; 1066 Tcl_CmdInfo info; // pointer to the command info 1065 1067 1066 1068 while (opt_argc--) { … … 1119 1121 } 1120 1122 1123 noerr = Tcl_GetCommandInfo(interp, addStr.c_str(), &info); 1124 if (noerr == 1) { 1125 // valid command 1126 if (info.proc == &RpLibCallCmd) { 1127 // call the rappture library put function with the Rappture Object 1128 ((RpLibrary*) cdata)->put( path, 1129 (RpLibrary*)info.clientData, 1130 id, append); 1131 } 1132 else { 1133 // object is not a RpLibrary 1134 // call the rappture library put function with the inputted string 1135 ((RpLibrary*) cdata)->put(path, addStr, id, append); 1136 } 1137 } 1138 else { 1139 // invalid command 1140 // call the rappture library put function with the inputted string 1141 ((RpLibrary*) cdata)->put(path, addStr, id, append); 1142 } 1143 1121 1144 // call the rappture library put function 1122 ((RpLibrary*) cdata)->put(path, addStr, id, append);1145 // ((RpLibrary*) cdata)->put(path, addStr, id, append); 1123 1146 1124 1147 // clear any previous result in the interpreter
Note: See TracChangeset
for help on using the changeset viewer.