Changeset cb991cf in tol
- Timestamp:
- Mar 15, 2012, 9:43:19 AM (15 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 2c058e5
- Parents:
- a9c6a36
- Location:
- tol/OIS
- Files:
-
- 4 edited
-
ois.cpp (modified) (1 diff)
-
oisapitol.cpp (modified) (1 diff)
-
oisloader.cpp (modified) (11 diffs)
-
tol_ois.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tol/OIS/ois.cpp
ra9c6a36 rcb991cf 65 65 size_t BOis::_MaxBlockLength_ = 1024*1024; 66 66 int BOis::_NumAuxiliarBuffer_ = 9; 67 68 BDat BOis::forceStoredTimeSet_ = 0; 67 69 68 70 #ifdef TRACE_OIS_FILE -
tol/OIS/oisapitol.cpp
ra9c6a36 rcb991cf 216 216 ); 217 217 OIS_def_BAE_->PutConstant(); 218 219 BParamDat* ois_forceStoredTimeSet_= new BParamDat 220 ( 221 "Ois.ForceStoredTimeSet", 222 forceStoredTimeSet_, 223 I2("If true then internally stored TimeSet's will be used even if a " 224 "TimeSet with the same name is available.", 225 "Si es cierto se usarán siempre los TimeSet alamcenados localmente " 226 "incluso si está accesible otro con el mismo nombre.") 227 ); 218 228 219 229 loadModeOptions_.AllocBuffer(3); -
tol/OIS/oisloader.cpp
ra9c6a36 rcb991cf 59 59 if(obj->OisOffset() && (obj->OisOffset()!=offset_)) 60 60 { 61 ::Warning(I2("OIS Object already has assigned offset", 62 "El objecto OIS ya tiene offset asignado")+ 63 ": "+obj->Identify()); 61 if(obj->Grammar()!=GraTimeSet() || forceStoredTimeSet_) 62 { 63 ::Warning(I2("OIS Object already has assigned offset", 64 "El objecto OIS ya tiene offset asignado")+ 65 ": "+obj->Identify()); 66 } 64 67 return(obj); 65 68 } … … 1310 1313 BUserTimeSerie* x = NULL; 1311 1314 List* tree = NULL; 1315 BText expr = ""; 1316 BUserTimeSet* dating = NULL; 1317 BDate first, last, beginCache, endCache; 1312 1318 if(!offset) 1313 1319 { … … 1320 1326 object_->SetPos(offset); 1321 1327 //CALL ReadNextObject 1322 BUserTimeSet* dating = NULL;1323 1328 { 1324 1329 BINT64 offset_tms = object_->Offset(); … … 1328 1333 return(NullError("FATAL cannot built dating of serie")); 1329 1334 } 1330 dating = (BUserTimeSet*)GraTimeSet()->FindOperand(r->Name(), false); 1331 if(!dating) { dating = (BUserTimeSet*)r; } 1332 else if(dating!=r) 1335 if(forceStoredTimeSet_!=0) 1336 { 1337 dating = (BUserTimeSet*)r; 1338 } 1339 else 1333 1340 { 1334 static BOffsetObject ofob_tms; 1335 ofob_tms.PutOffset(offset_tms); 1336 int found_tms = readed_.FindSorted(ofob_tms, CompareOffset); 1337 readed_[found_tms].ReplaceObject(dating); 1338 DESTROY(r); 1339 } 1340 } 1341 BDate first, last, beginCache, endCache; 1341 dating = (BUserTimeSet*)GraTimeSet()->FindOperand(r->Name(), false); 1342 if(!dating) { dating = (BUserTimeSet*)r; } 1343 else if(dating!=r) 1344 { 1345 static BOffsetObject ofob_tms; 1346 ofob_tms.PutOffset(offset_tms); 1347 int found_tms = readed_.FindSorted(ofob_tms, CompareOffset); 1348 readed_[found_tms].ReplaceObject(dating); 1349 DESTROY(r); 1350 } 1351 } 1352 } 1342 1353 ERead(first, serie_); 1343 1354 ERead(last, serie_); … … 1358 1369 name+"' description='"+description+"')")); 1359 1370 } 1371 expr = BParser::Unparse(tree," ","\n"); 1360 1372 bool oldEnabled = BOut::Disable(); 1373 BGrammar::IncLevel(); 1361 1374 x = (BUserTimeSerie*)GraSerie()->EvaluateTree(tree); 1375 BGrammar::DecLevel(); 1362 1376 if(oldEnabled) { BOut::Enable(); } 1363 1377 if(x) … … 1368 1382 else 1369 1383 { 1370 BText expr = BParser::Unparse(tree," ","\n");1371 1384 expr = Compact(expr); 1372 1385 #ifndef NDEBUG … … 1393 1406 else 1394 1407 { result = x; } 1408 BUserTimeSerie* ser = (BUserTimeSerie*)result; 1409 if(dating!=ser->Dating()) 1410 { 1411 if(forceStoredTimeSet_!=0) 1412 { 1413 ser->PutDating(dating); 1414 } 1415 if(!dating->IsCompatibleWith(*(ser->Dating()),beginCache,endCache)) 1416 { 1417 Warning(BText("Dating of loaded Serie ")+name+"="+expr+ 1418 "is not compatible with original dating "+ 1419 dating->Identify()+"="+dating->Expression()+" "+ 1420 "between ["+beginCache+","+endCache+"]"); 1421 } 1422 } 1395 1423 if(tree) 1396 1424 { … … 1413 1441 BHash h(s); 1414 1442 Ensure(Read(h.GetBuffer(),sizeof(double),h.Size(),timeset_)); 1443 BUserTimeSet* x_old = (BUserTimeSet*)GraTimeSet()->FindOperand(name,true); 1415 1444 BUserTimeSet* x = NULL; 1416 1445 char loadTree; 1417 1446 ERead(loadTree,timeset_); 1418 1447 List* tree = NULL; 1448 BText expr; 1419 1449 if(loadTree) 1420 1450 { 1421 1451 tree = ReadTree(timeset_); 1452 expr = Compact(BParser::Unparse(tree," ","\n")); 1422 1453 if(!tree) 1423 1454 { … … 1425 1456 name+"' description='"+description+"')")); 1426 1457 } 1458 } 1459 if(!forceStoredTimeSet_ && x_old) 1460 { 1461 x = x_old; 1462 } 1463 else if(tree) 1464 { 1427 1465 bool oldEnabled = BOut::Disable(); 1428 1466 BDat numErr0 = TOLErrorTryNumber(); 1467 BGrammar::IncLevel(); 1429 1468 x = (BUserTimeSet*)GraTimeSet()->EvaluateTree(tree); 1469 BGrammar::DecLevel(); 1430 1470 BDat numErr1 = TOLErrorTryNumber(); 1431 1471 if(numErr0<numErr1) { DESTROY(x); } … … 1442 1482 } 1443 1483 } 1444 else 1445 { 1446 x = (BUserTimeSet*)GraTimeSet()->FindOperand(name,true); 1447 if(!x) 1448 { 1449 BText expr = Compact(BParser::Unparse(tree," ","\n")); 1450 if(name.HasName()) { expr = name+" = "+expr; } 1451 Warning(BText("Cannot rebuild virtual expression of non " 1452 "bounded TimeSet ")+expr+ "\nOnly cached " 1453 "dates will be accessible between ["+beginCache+","+ 1454 endCache+"]\nTo avoid this problem save just " 1455 "bounded time sets or use expressions that could " 1456 "be evaluated at OIS loading time." ); 1457 } 1484 else 1485 { 1486 if(name.HasName()) { expr = name+" = "+expr; } 1487 Warning(BText("Cannot rebuild virtual expression of non " 1488 "bounded TimeSet ")+expr+ "\nOnly cached " 1489 "dates will be accessible between ["+beginCache+","+ 1490 endCache+"]\nTo avoid this problem save just " 1491 "bounded time sets or use expressions that could " 1492 "be evaluated at OIS loading time." ); 1458 1493 } 1459 1494 } … … 1473 1508 if(tree) 1474 1509 { 1475 if(result && !result->GetOisTree()) { result->PutOisTree(tree); } 1510 if(result && (x!=x_old) && !result->GetOisTree()) 1511 { 1512 result->PutOisTree(tree); 1513 } 1476 1514 tree->Destroy(); 1477 1515 } -
tol/OIS/tol_ois.h
ra9c6a36 rcb991cf 565 565 static bool isLittleEndian_; 566 566 567 //Default for forcing stored TimeSet 568 static BDat forceStoredTimeSet_; 569 567 570 static BStruct* addressStr_; 568 571 static BStruct* docStr_;
Note: See TracChangeset
for help on using the changeset viewer.
