| 674 |
Int_t GL_RUN::DeleteRun(TSQLServer *dbc,UInt_t IDRUN,TString FromTable){ |
Int_t GL_RUN::DeleteRun(TSQLServer *dbc,UInt_t IDRUN,TString FromTable){ |
| 675 |
// MySQL variables |
// MySQL variables |
| 676 |
TSQLResult *pResult; |
TSQLResult *pResult; |
| 677 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
| 678 |
stringstream myquery; |
stringstream myquery; |
| 679 |
// |
// |
| 680 |
if ( !IDRUN ) IDRUN = ID; |
if ( !IDRUN ) IDRUN = ID; |
| 738 |
UInt_t idl0 = 0; |
UInt_t idl0 = 0; |
| 739 |
UInt_t idl2 = 0; |
UInt_t idl2 = 0; |
| 740 |
// |
// |
| 741 |
|
if (Row) |
| 742 |
|
delete Row; |
| 743 |
Row = pResult->Next(); |
Row = pResult->Next(); |
| 744 |
if( Row != NULL ){ |
if( Row != NULL ){ |
| 745 |
idtrash = (UInt_t)atoll(Row->GetField(0)); |
idtrash = (UInt_t)atoll(Row->GetField(0)); |
| 759 |
this->GetGLTABLES()->AddQ(); |
this->GetGLTABLES()->AddQ(); |
| 760 |
pResult = dbc->Query(myquery.str().c_str()); |
pResult = dbc->Query(myquery.str().c_str()); |
| 761 |
// |
// |
| 762 |
|
if (Row) |
| 763 |
|
delete Row; |
| 764 |
Row = pResult->Next(); |
Row = pResult->Next(); |
| 765 |
if( Row != NULL ){ |
if( Row != NULL ){ |
| 766 |
fileL0 = (TString)Row->GetField(0); |
fileL0 = (TString)Row->GetField(0); |
| 778 |
this->GetGLTABLES()->AddQ(); |
this->GetGLTABLES()->AddQ(); |
| 779 |
pResult = dbc->Query(myquery.str().c_str()); |
pResult = dbc->Query(myquery.str().c_str()); |
| 780 |
// |
// |
| 781 |
|
if (Row) |
| 782 |
|
delete Row; |
| 783 |
Row = pResult->Next(); |
Row = pResult->Next(); |
| 784 |
if( Row != NULL ){ |
if( Row != NULL ){ |
| 785 |
fileL2 = (TString)Row->GetField(0); |
fileL2 = (TString)Row->GetField(0); |
| 786 |
}; |
} |
| 787 |
|
if (Row){ |
| 788 |
|
delete Row; |
| 789 |
|
Row = NULL; // This variable is not used below |
| 790 |
|
} |
| 791 |
// |
// |
| 792 |
// |
// |
| 793 |
// |
// |
| 852 |
//insert into GL_RUN_TRASH VALUES (ID , ID_RUN_FRAG , ID_ROOT_L0 , ID_ROOT_L2 , RUNHEADER_TIME , RUNTRAILER_TIME , RUNHEADER_OBT , RUNTRAILER_OBT , RUNHEADER_PKT , RUNTRAILER_PKT , BOOT_NUMBER , EV_FROM , EV_TO , NEVENTS , PKT_COUNTER , PKT_READY_COUNTER , COMPILATIONTIMESTAMP , FAV_WRK_SCHEDULE , EFF_WRK_SCHEDULE , PRH_VAR_TRG_MODE_A , PRH_VAR_TRG_MODE_B , ACQ_BUILD_INFO , ACQ_VAR_INFO , RM_ACQ_AFTER_CALIB , RM_ACQ_SETTING_MODE, TRK_CALIB_USED,CAL_DSP_MASK, LAST_TIMESYNC, OBT_TIMESYNC, VALIDATION, INSERT_TIME) select * FROM GL_RUN where ID=11; |
//insert into GL_RUN_TRASH VALUES (ID , ID_RUN_FRAG , ID_ROOT_L0 , ID_ROOT_L2 , RUNHEADER_TIME , RUNTRAILER_TIME , RUNHEADER_OBT , RUNTRAILER_OBT , RUNHEADER_PKT , RUNTRAILER_PKT , BOOT_NUMBER , EV_FROM , EV_TO , NEVENTS , PKT_COUNTER , PKT_READY_COUNTER , COMPILATIONTIMESTAMP , FAV_WRK_SCHEDULE , EFF_WRK_SCHEDULE , PRH_VAR_TRG_MODE_A , PRH_VAR_TRG_MODE_B , ACQ_BUILD_INFO , ACQ_VAR_INFO , RM_ACQ_AFTER_CALIB , RM_ACQ_SETTING_MODE, TRK_CALIB_USED,CAL_DSP_MASK, LAST_TIMESYNC, OBT_TIMESYNC, VALIDATION, INSERT_TIME) select * FROM GL_RUN where ID=11; |
| 853 |
// MySQL variables |
// MySQL variables |
| 854 |
TSQLResult *pResult; |
TSQLResult *pResult; |
| 855 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
| 856 |
stringstream myquery; |
stringstream myquery; |
| 857 |
// |
// |
| 858 |
if ( !IDRUN ) IDRUN = ID; |
if ( !IDRUN ) IDRUN = ID; |
| 1153 |
Int_t GL_RUN::Query_GL_RUN(UInt_t run, TSQLServer *dbc){ |
Int_t GL_RUN::Query_GL_RUN(UInt_t run, TSQLServer *dbc){ |
| 1154 |
// MySQL variables |
// MySQL variables |
| 1155 |
TSQLResult *pResult; |
TSQLResult *pResult; |
| 1156 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
|
int t; |
|
| 1157 |
int r; |
int r; |
| 1158 |
stringstream myquery; |
stringstream myquery; |
| 1159 |
// ---------------- |
// ---------------- |
| 1202 |
// |
// |
| 1203 |
if( !pResult->GetRowCount() ) return(-50); |
if( !pResult->GetRowCount() ) return(-50); |
| 1204 |
// |
// |
| 1205 |
for( r=0; r < 1000; r++){ |
for( r=0; r < 1000; r++){ |
| 1206 |
|
if (Row) |
| 1207 |
|
delete Row; |
| 1208 |
Row = pResult->Next(); |
Row = pResult->Next(); |
| 1209 |
if( Row == NULL ) break; |
if( Row == NULL ) break; |
| 1210 |
// Set_GL_RUN(Row); |
// Set_GL_RUN(Row); |
| 1211 |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
for( int t = 0; t < pResult->GetFieldCount(); t++){ |
| 1212 |
if (t== 0) ID = (UInt_t)atoll(Row->GetField(t)); |
if (t== 0) ID = (UInt_t)atoll(Row->GetField(t)); |
| 1213 |
if (t== 1) ID_RUN_FRAG = (UInt_t)atoll(Row->GetField(t)); |
if (t== 1) ID_RUN_FRAG = (UInt_t)atoll(Row->GetField(t)); |
| 1214 |
if (t== 2) ID_ROOT_L0 = (UInt_t)atoll(Row->GetField(t)); |
if (t== 2) ID_ROOT_L0 = (UInt_t)atoll(Row->GetField(t)); |
| 1242 |
if (t==30) PHYSENDRUN_MASK_S11CRC = (UInt_t)atoll(Row->GetField(t)); |
if (t==30) PHYSENDRUN_MASK_S11CRC = (UInt_t)atoll(Row->GetField(t)); |
| 1243 |
if (t==31) VALIDATION = (UInt_t)atoll(Row->GetField(t)); |
if (t==31) VALIDATION = (UInt_t)atoll(Row->GetField(t)); |
| 1244 |
}; |
}; |
| 1245 |
}; |
} |
| 1246 |
// delete pResult; |
|
| 1247 |
|
if (Row) |
| 1248 |
|
delete Row; |
| 1249 |
|
delete pResult; |
| 1250 |
return(0); |
return(0); |
| 1251 |
}; |
}; |
| 1252 |
|
|
| 1260 |
Int_t GL_RUN::Query_GL_RUN_FRAGMENTS(TString where, TSQLServer *dbc){ |
Int_t GL_RUN::Query_GL_RUN_FRAGMENTS(TString where, TSQLServer *dbc){ |
| 1261 |
// MySQL variables |
// MySQL variables |
| 1262 |
TSQLResult *pResult; |
TSQLResult *pResult; |
| 1263 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
| 1264 |
int t; |
int t; |
| 1265 |
int r; |
int r; |
| 1266 |
stringstream myquery; |
stringstream myquery; |
| 1308 |
pResult = dbc->Query(myquery.str().c_str()); |
pResult = dbc->Query(myquery.str().c_str()); |
| 1309 |
if(!pResult->GetRowCount())return(-50); |
if(!pResult->GetRowCount())return(-50); |
| 1310 |
for( r=0; r < 1000; r++){ |
for( r=0; r < 1000; r++){ |
| 1311 |
|
if (Row) |
| 1312 |
|
delete Row; |
| 1313 |
Row = pResult->Next(); |
Row = pResult->Next(); |
| 1314 |
if( Row == NULL ) break; |
if( Row == NULL ) break; |
| 1315 |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
| 1346 |
if (t==30) PHYSENDRUN_MASK_S11CRC = (UInt_t)atoll(Row->GetField(t)); |
if (t==30) PHYSENDRUN_MASK_S11CRC = (UInt_t)atoll(Row->GetField(t)); |
| 1347 |
if (t==31) VALIDATION = (UInt_t)atoll(Row->GetField(t)); |
if (t==31) VALIDATION = (UInt_t)atoll(Row->GetField(t)); |
| 1348 |
}; |
}; |
| 1349 |
}; |
} |
| 1350 |
// delete pResult; |
|
| 1351 |
|
if (Row) |
| 1352 |
|
delete Row; |
| 1353 |
|
delete pResult; |
| 1354 |
return(0); |
return(0); |
| 1355 |
};// **************************************************** |
};// **************************************************** |
| 1356 |
|
|
| 1363 |
Int_t GL_ROOT::Query_GL_ROOT(UInt_t id, TSQLServer *dbc){ |
Int_t GL_ROOT::Query_GL_ROOT(UInt_t id, TSQLServer *dbc){ |
| 1364 |
// MySQL variables |
// MySQL variables |
| 1365 |
TSQLResult *pResult; |
TSQLResult *pResult; |
| 1366 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
| 1367 |
int t; |
int t; |
| 1368 |
int r; |
int r; |
| 1369 |
stringstream myquery; |
stringstream myquery; |
| 1382 |
pResult = dbc->Query(myquery.str().c_str()); |
pResult = dbc->Query(myquery.str().c_str()); |
| 1383 |
if(!pResult->GetRowCount())return (-51); |
if(!pResult->GetRowCount())return (-51); |
| 1384 |
for( r=0; r < 1000; r++){ |
for( r=0; r < 1000; r++){ |
| 1385 |
|
if (Row) |
| 1386 |
|
delete Row; |
| 1387 |
Row = pResult->Next(); |
Row = pResult->Next(); |
| 1388 |
if( Row == NULL ) break; |
if( Row == NULL ) break; |
| 1389 |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
| 1392 |
if(t==2) ID_TIMESYNC = (UInt_t)atoll(Row->GetField(t)); |
if(t==2) ID_TIMESYNC = (UInt_t)atoll(Row->GetField(t)); |
| 1393 |
if(t==3) PATH = (TString)gSystem->ExpandPathName(Row->GetField(t))+'/'; |
if(t==3) PATH = (TString)gSystem->ExpandPathName(Row->GetField(t))+'/'; |
| 1394 |
if(t==4) NAME = Row->GetField(t); |
if(t==4) NAME = Row->GetField(t); |
| 1395 |
}; |
} |
| 1396 |
}; |
} |
| 1397 |
|
if (Row) |
| 1398 |
|
delete Row; |
| 1399 |
delete pResult; |
delete pResult; |
| 1400 |
return 0; |
return 0; |
| 1401 |
}; |
}; |
| 1410 |
Int_t GL_TRK_CALIB::Query_GL_TRK_CALIB(UInt_t time, TSQLServer *dbc){ |
Int_t GL_TRK_CALIB::Query_GL_TRK_CALIB(UInt_t time, TSQLServer *dbc){ |
| 1411 |
// MySQL variables |
// MySQL variables |
| 1412 |
TSQLResult *pResult; |
TSQLResult *pResult; |
| 1413 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
| 1414 |
int t; |
int t; |
| 1415 |
int r; |
int r; |
| 1416 |
stringstream myquery; |
stringstream myquery; |
| 1426 |
pResult = dbc->Query(myquery.str().c_str()); |
pResult = dbc->Query(myquery.str().c_str()); |
| 1427 |
if(!pResult->GetRowCount())return (-53); |
if(!pResult->GetRowCount())return (-53); |
| 1428 |
for( r=0; r < 1000; r++){ |
for( r=0; r < 1000; r++){ |
| 1429 |
|
if (Row) |
| 1430 |
|
delete Row; |
| 1431 |
Row = pResult->Next(); |
Row = pResult->Next(); |
| 1432 |
if( Row == NULL ) break; |
if( Row == NULL ) break; |
| 1433 |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
| 1448 |
if (t==10) BOOT_NUMBER = (UInt_t)atoll(Row->GetField(t)); |
if (t==10) BOOT_NUMBER = (UInt_t)atoll(Row->GetField(t)); |
| 1449 |
if (t==11) VALIDATION = (UInt_t)atoll(Row->GetField(t)); |
if (t==11) VALIDATION = (UInt_t)atoll(Row->GetField(t)); |
| 1450 |
}; |
}; |
| 1451 |
}; |
} |
| 1452 |
|
if (Row) |
| 1453 |
|
delete Row; |
| 1454 |
delete pResult; |
delete pResult; |
| 1455 |
// |
// |
| 1456 |
// if ( TO_TIME < time ) return(51); |
// if ( TO_TIME < time ) return(51); |
| 1470 |
Int_t GL_CALO_CALIB::Query_GL_CALO_CALIB(UInt_t time, UInt_t &uptime, UInt_t section, TSQLServer *dbc){ |
Int_t GL_CALO_CALIB::Query_GL_CALO_CALIB(UInt_t time, UInt_t &uptime, UInt_t section, TSQLServer *dbc){ |
| 1471 |
// MySQL variables |
// MySQL variables |
| 1472 |
TSQLResult *pResult; |
TSQLResult *pResult; |
| 1473 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
| 1474 |
int t; |
int t; |
| 1475 |
stringstream myquery; |
stringstream myquery; |
| 1476 |
uptime = 0; |
uptime = 0; |
| 1490 |
// printf(" mysquery is %s\n",myquery.str().c_str()); |
// printf(" mysquery is %s\n",myquery.str().c_str()); |
| 1491 |
// |
// |
| 1492 |
if( !pResult->GetRowCount() ) return(-54); |
if( !pResult->GetRowCount() ) return(-54); |
| 1493 |
|
if (Row) |
| 1494 |
|
delete Row; |
| 1495 |
Row = pResult->Next(); |
Row = pResult->Next(); |
| 1496 |
if( Row == NULL ) return (-54); |
if( Row == NULL ) return (-54); |
| 1497 |
// |
// |
| 1519 |
// |
// |
| 1520 |
if( !pResult->GetRowCount() ) return (-54); |
if( !pResult->GetRowCount() ) return (-54); |
| 1521 |
// |
// |
| 1522 |
|
if (Row) |
| 1523 |
|
delete Row; |
| 1524 |
Row = pResult->Next(); |
Row = pResult->Next(); |
| 1525 |
// |
// |
| 1526 |
myfromtime = (UInt_t)atoll(Row->GetField(1)); |
myfromtime = (UInt_t)atoll(Row->GetField(1)); |
| 1555 |
if (t==1) FROM_TIME = myfromtime; |
if (t==1) FROM_TIME = myfromtime; |
| 1556 |
if (t==2) TO_TIME = mytotime; |
if (t==2) TO_TIME = mytotime; |
| 1557 |
if (t==3) EV_ROOT = (UInt_t)atoll(Row->GetField(t)); |
if (t==3) EV_ROOT = (UInt_t)atoll(Row->GetField(t)); |
| 1558 |
}; |
} |
| 1559 |
|
if (Row) |
| 1560 |
|
delete Row; |
| 1561 |
pResult->Delete(); |
pResult->Delete(); |
| 1562 |
return 0; |
return 0; |
| 1563 |
}; |
}; |
| 1573 |
Int_t GL_CALOPULSE_CALIB::Query_GL_CALOPULSE_CALIB(UInt_t time, UInt_t section, UInt_t pampli, TSQLServer *dbc){ |
Int_t GL_CALOPULSE_CALIB::Query_GL_CALOPULSE_CALIB(UInt_t time, UInt_t section, UInt_t pampli, TSQLServer *dbc){ |
| 1574 |
// MySQL variables |
// MySQL variables |
| 1575 |
TSQLResult *pResult; |
TSQLResult *pResult; |
| 1576 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
| 1577 |
int t; |
int t; |
| 1578 |
stringstream myquery; |
stringstream myquery; |
| 1579 |
// |
// |
| 1591 |
// |
// |
| 1592 |
if( !pResult ) return(-54); |
if( !pResult ) return(-54); |
| 1593 |
// |
// |
| 1594 |
|
if (Row) |
| 1595 |
|
delete Row; |
| 1596 |
Row = pResult->Next(); |
Row = pResult->Next(); |
| 1597 |
// |
// |
| 1598 |
if( !Row ) return (-54); |
if( !Row ) return (-54); |
| 1605 |
if (t==1) FROM_TIME = (UInt_t)atoll(Row->GetField(t)); |
if (t==1) FROM_TIME = (UInt_t)atoll(Row->GetField(t)); |
| 1606 |
if (t==2) TO_TIME = (UInt_t)atoll(Row->GetField(t)); |
if (t==2) TO_TIME = (UInt_t)atoll(Row->GetField(t)); |
| 1607 |
if (t==3) EV_ROOT = (UInt_t)atoll(Row->GetField(t)); |
if (t==3) EV_ROOT = (UInt_t)atoll(Row->GetField(t)); |
| 1608 |
}; |
} |
| 1609 |
|
if (Row) |
| 1610 |
|
delete Row; |
| 1611 |
pResult->Delete(); |
pResult->Delete(); |
| 1612 |
return 0; |
return 0; |
| 1613 |
}; |
}; |
| 1623 |
Int_t GL_S4_CALIB::Query_GL_S4_CALIB(UInt_t time, TSQLServer *dbc){ |
Int_t GL_S4_CALIB::Query_GL_S4_CALIB(UInt_t time, TSQLServer *dbc){ |
| 1624 |
// MySQL variables |
// MySQL variables |
| 1625 |
TSQLResult *pResult; |
TSQLResult *pResult; |
| 1626 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
| 1627 |
int t; |
int t; |
| 1628 |
int r; |
int r; |
| 1629 |
stringstream myquery; |
stringstream myquery; |
| 1637 |
pResult = dbc->Query(myquery.str().c_str()); |
pResult = dbc->Query(myquery.str().c_str()); |
| 1638 |
if(!pResult->GetRowCount())return (-55);//throw -55; |
if(!pResult->GetRowCount())return (-55);//throw -55; |
| 1639 |
for( r=0; r < 1000; r++){ |
for( r=0; r < 1000; r++){ |
| 1640 |
|
if (Row) |
| 1641 |
|
delete Row; |
| 1642 |
Row = pResult->Next(); |
Row = pResult->Next(); |
| 1643 |
if( Row == NULL ) break; |
if( Row == NULL ) break; |
| 1644 |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
| 1648 |
if (t==3) FROM_TIME = (UInt_t)atoll(Row->GetField(t)); |
if (t==3) FROM_TIME = (UInt_t)atoll(Row->GetField(t)); |
| 1649 |
if (t==4) TO_TIME = (UInt_t)atoll(Row->GetField(t)); |
if (t==4) TO_TIME = (UInt_t)atoll(Row->GetField(t)); |
| 1650 |
}; |
}; |
| 1651 |
}; |
} |
| 1652 |
|
if (Row) |
| 1653 |
|
delete Row; |
| 1654 |
delete pResult; |
delete pResult; |
| 1655 |
// |
// |
| 1656 |
if(TO_TIME < time)return(51); |
if(TO_TIME < time)return(51); |
| 1669 |
// Bool_t debug = 1; |
// Bool_t debug = 1; |
| 1670 |
// MySQL variables |
// MySQL variables |
| 1671 |
TSQLResult *pResult; |
TSQLResult *pResult; |
| 1672 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
| 1673 |
int t; |
int t; |
| 1674 |
int r; |
int r; |
| 1675 |
stringstream myquery; |
stringstream myquery; |
| 1687 |
pResult = dbc->Query(myquery.str().c_str()); |
pResult = dbc->Query(myquery.str().c_str()); |
| 1688 |
if(!pResult->GetRowCount())return (-52); |
if(!pResult->GetRowCount())return (-52); |
| 1689 |
for( r=0; r < 1000; r++){ |
for( r=0; r < 1000; r++){ |
| 1690 |
|
if (Row) |
| 1691 |
|
delete Row; |
| 1692 |
Row = pResult->Next(); |
Row = pResult->Next(); |
| 1693 |
if( Row == NULL ) break; |
if( Row == NULL ) break; |
| 1694 |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
| 1700 |
if (t==5) TO_TIME = (UInt_t)atoll(Row->GetField(t)); |
if (t==5) TO_TIME = (UInt_t)atoll(Row->GetField(t)); |
| 1701 |
if (t==6) TYPE = (UInt_t)atoll(Row->GetField(t)); |
if (t==6) TYPE = (UInt_t)atoll(Row->GetField(t)); |
| 1702 |
}; |
}; |
| 1703 |
}; |
} |
| 1704 |
|
if (Row) |
| 1705 |
|
delete Row; |
| 1706 |
delete pResult; |
delete pResult; |
| 1707 |
// |
// |
| 1708 |
if(TO_TIME==0) TO_TIME = numeric_limits<UInt_t>::max(); |
if(TO_TIME==0) TO_TIME = numeric_limits<UInt_t>::max(); |
| 1738 |
UInt_t idtsy = 0; |
UInt_t idtsy = 0; |
| 1739 |
// |
// |
| 1740 |
TSQLResult *pResult; |
TSQLResult *pResult; |
| 1741 |
TSQLRow *Row = 0; |
TSQLRow *Row = NULL; |
| 1742 |
stringstream myquery; |
stringstream myquery; |
| 1743 |
stringstream rname; |
stringstream rname; |
| 1744 |
// pcksList packetsNames; |
// pcksList packetsNames; |
| 1758 |
this->GetGLTABLES()->AddQ(); |
this->GetGLTABLES()->AddQ(); |
| 1759 |
pResult = dbc->Query(myquery.str().c_str()); |
pResult = dbc->Query(myquery.str().c_str()); |
| 1760 |
if( pResult->GetRowCount() ){ |
if( pResult->GetRowCount() ){ |
| 1761 |
|
if (Row) |
| 1762 |
|
delete Row; |
| 1763 |
Row = pResult->Next(); |
Row = pResult->Next(); |
| 1764 |
if( Row ){ |
if( Row ){ |
| 1765 |
stringstream fname; |
stringstream fname; |
| 1804 |
pResult = dbc->Query(oss.str().c_str()); |
pResult = dbc->Query(oss.str().c_str()); |
| 1805 |
Bool_t fndit = false; |
Bool_t fndit = false; |
| 1806 |
if ( pResult ){ |
if ( pResult ){ |
| 1807 |
|
if (Row) |
| 1808 |
|
delete Row; |
| 1809 |
Row = pResult->Next(); |
Row = pResult->Next(); |
| 1810 |
if ( Row ){ |
if ( Row ){ |
| 1811 |
// |
// |
| 1821 |
this->GetGLTABLES()->AddQ(); |
this->GetGLTABLES()->AddQ(); |
| 1822 |
delete pResult; |
delete pResult; |
| 1823 |
pResult = dbc->Query(oss.str().c_str()); |
pResult = dbc->Query(oss.str().c_str()); |
| 1824 |
if ( pResult ){ |
if (pResult){ |
| 1825 |
Row = pResult->Next(); |
if (Row) |
| 1826 |
if ( Row ){ |
delete Row; |
| 1827 |
// printf(" GREAT! the DB structure is the new one! \n"); |
Row = pResult->Next(); |
| 1828 |
fndit = true; |
if ( Row ){ |
| 1829 |
dworbit = 1; |
// printf(" GREAT! the DB structure is the new one! \n"); |
| 1830 |
}; |
fndit = true; |
| 1831 |
|
dworbit = 1; |
| 1832 |
|
}; |
| 1833 |
}; |
}; |
| 1834 |
}; |
}; |
| 1835 |
}; |
}; |
| 1848 |
// printf(" T0 %u toffset is %u \n",T0,toffset); |
// printf(" T0 %u toffset is %u \n",T0,toffset); |
| 1849 |
// |
// |
| 1850 |
if ( file ) file->Close(); |
if ( file ) file->Close(); |
| 1851 |
|
if (Row) |
| 1852 |
|
delete Row; |
| 1853 |
delete pResult; |
delete pResult; |
| 1854 |
}; |
}; |
| 1855 |
|
|
| 1859 |
UInt_t idtsy = 0; |
UInt_t idtsy = 0; |
| 1860 |
// |
// |
| 1861 |
TSQLResult *pResult; |
TSQLResult *pResult; |
| 1862 |
TSQLRow *Row = 0; |
TSQLRow *Row = NULL; |
| 1863 |
stringstream myquery; |
stringstream myquery; |
| 1864 |
stringstream rname; |
stringstream rname; |
| 1865 |
// pcksList packetsNames; |
// pcksList packetsNames; |
| 1879 |
this->GetGLTABLES()->AddQ(); |
this->GetGLTABLES()->AddQ(); |
| 1880 |
pResult = dbc->Query(myquery.str().c_str()); |
pResult = dbc->Query(myquery.str().c_str()); |
| 1881 |
if( pResult->GetRowCount() ){ |
if( pResult->GetRowCount() ){ |
| 1882 |
|
if (Row) |
| 1883 |
|
delete Row; |
| 1884 |
Row = pResult->Next(); |
Row = pResult->Next(); |
| 1885 |
if( Row ){ |
if( Row ){ |
| 1886 |
stringstream fname; |
stringstream fname; |
| 1926 |
pResult = dbc->Query(oss.str().c_str()); |
pResult = dbc->Query(oss.str().c_str()); |
| 1927 |
Bool_t fndit = false; |
Bool_t fndit = false; |
| 1928 |
if ( pResult ){ |
if ( pResult ){ |
| 1929 |
|
if (Row) |
| 1930 |
|
delete Row; |
| 1931 |
Row = pResult->Next(); |
Row = pResult->Next(); |
| 1932 |
if ( Row ){ |
if ( Row ){ |
| 1933 |
// |
// |
| 1943 |
this->GetGLTABLES()->AddQ(); |
this->GetGLTABLES()->AddQ(); |
| 1944 |
delete pResult; |
delete pResult; |
| 1945 |
pResult = dbc->Query(oss.str().c_str()); |
pResult = dbc->Query(oss.str().c_str()); |
| 1946 |
if ( pResult ){ |
if (pResult){ |
| 1947 |
Row = pResult->Next(); |
if (Row) |
| 1948 |
if ( Row ){ |
delete Row; |
| 1949 |
// printf(" GREAT! the DB structure is the new one! \n"); |
Row = pResult->Next(); |
| 1950 |
fndit = true; |
if (Row){ |
| 1951 |
dworbit = 1; |
// printf(" GREAT! the DB structure is the new one! \n"); |
| 1952 |
}; |
fndit = true; |
| 1953 |
|
dworbit = 1; |
| 1954 |
|
}; |
| 1955 |
}; |
}; |
| 1956 |
}; |
}; |
| 1957 |
}; |
}; |
| 1970 |
// printf(" T0 %u toffset is %u \n",T0,toffset); |
// printf(" T0 %u toffset is %u \n",T0,toffset); |
| 1971 |
// |
// |
| 1972 |
if ( file ) file->Close(); |
if ( file ) file->Close(); |
| 1973 |
|
if (Row) |
| 1974 |
|
delete Row; |
| 1975 |
delete pResult; |
delete pResult; |
| 1976 |
}; |
}; |
| 1977 |
|
|
| 2242 |
// |
// |
| 2243 |
Int_t GL_TLE::DoQuery(TString myquery, TSQLServer *dbc){ |
Int_t GL_TLE::DoQuery(TString myquery, TSQLServer *dbc){ |
| 2244 |
TSQLResult *result; |
TSQLResult *result; |
| 2245 |
TSQLRow *row; |
TSQLRow *row = NULL; |
| 2246 |
|
|
| 2247 |
// Set the right time_zone (otherwise horrible things will occur! :) |
// Set the right time_zone (otherwise horrible things will occur! :) |
| 2248 |
if ( !this->GetGLTABLES()->IsConnected(dbc) ) return -57; |
if ( !this->GetGLTABLES()->IsConnected(dbc) ) return -57; |
| 2261 |
tle = GiveTle(row); |
tle = GiveTle(row); |
| 2262 |
|
|
| 2263 |
tleFromTime = strtol(row->GetField(4), NULL, 10); |
tleFromTime = strtol(row->GetField(4), NULL, 10); |
| 2264 |
|
if (row) |
| 2265 |
|
delete row; |
| 2266 |
row = result->Next(); // second tle row |
row = result->Next(); // second tle row |
| 2267 |
if(row) |
if(row) |
| 2268 |
tleToTime = strtol(row->GetField(4), NULL, 10); |
tleToTime = strtol(row->GetField(4), NULL, 10); |
| 2271 |
tleToTime = UINT_MAX; |
tleToTime = UINT_MAX; |
| 2272 |
} |
} |
| 2273 |
|
|
| 2274 |
delete row; |
if (row) |
| 2275 |
|
delete row; |
| 2276 |
delete result; |
delete result; |
| 2277 |
|
|
| 2278 |
return 0; |
return 0; |