68 |
return NULL; |
return NULL; |
69 |
}; |
}; |
70 |
// |
// |
71 |
|
if (Row) |
72 |
|
delete Row; |
73 |
pResult = dbc->Query(query.Data()); |
pResult = dbc->Query(query.Data()); |
74 |
// |
// |
75 |
Row = pResult->Next(); |
Row = pResult->Next(); |
99 |
if ( f2 < minf2 ) minf2 = f2; |
if ( f2 < minf2 ) minf2 = f2; |
100 |
|
|
101 |
}; |
}; |
102 |
|
if (Row) |
103 |
|
delete Row; |
104 |
Row = pResult->Next(); |
Row = pResult->Next(); |
105 |
}; |
}; |
106 |
pResult->Delete(); |
pResult->Delete(); |
140 |
// |
// |
141 |
pResult = dbc->Query(query.Data()); |
pResult = dbc->Query(query.Data()); |
142 |
// |
// |
143 |
|
if (Row) |
144 |
|
delete Row; |
145 |
Row = pResult->Next(); |
Row = pResult->Next(); |
146 |
// |
// |
147 |
Int_t r = 0; |
Int_t r = 0; |
157 |
h2->Fill(f1,f2); |
h2->Fill(f1,f2); |
158 |
}; |
}; |
159 |
r++; |
r++; |
160 |
|
if (Row) |
161 |
|
delete Row; |
162 |
Row = pResult->Next(); |
Row = pResult->Next(); |
163 |
}; |
}; |
164 |
// |
// |
172 |
if ( dim == 1 ) h1->Draw(); |
if ( dim == 1 ) h1->Draw(); |
173 |
if ( dim == 2 ) h2->Draw(); |
if ( dim == 2 ) h2->Draw(); |
174 |
// |
// |
175 |
|
if (Row) |
176 |
|
delete Row; |
177 |
pResult->Delete(); |
pResult->Delete(); |
178 |
if ( dim == 1 ) return h1; |
if ( dim == 1 ) return h1; |
179 |
if ( dim == 2 ) return h2; |
if ( dim == 2 ) return h2; |
247 |
if ( dbc ){ |
if ( dbc ){ |
248 |
dbc->Close(); |
dbc->Close(); |
249 |
delete dbc; |
delete dbc; |
250 |
|
dbc = 0; |
251 |
}; |
}; |
252 |
dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
253 |
// |
// |
685 |
Int_t GL_RUN::DeleteRun(TSQLServer *dbc,UInt_t IDRUN,TString FromTable){ |
Int_t GL_RUN::DeleteRun(TSQLServer *dbc,UInt_t IDRUN,TString FromTable){ |
686 |
// MySQL variables |
// MySQL variables |
687 |
TSQLResult *pResult; |
TSQLResult *pResult; |
688 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
689 |
stringstream myquery; |
stringstream myquery; |
690 |
// |
// |
691 |
if ( !IDRUN ) IDRUN = ID; |
if ( !IDRUN ) IDRUN = ID; |
749 |
UInt_t idl0 = 0; |
UInt_t idl0 = 0; |
750 |
UInt_t idl2 = 0; |
UInt_t idl2 = 0; |
751 |
// |
// |
752 |
|
if (Row) |
753 |
|
delete Row; |
754 |
Row = pResult->Next(); |
Row = pResult->Next(); |
755 |
if( Row != NULL ){ |
if( Row != NULL ){ |
756 |
idtrash = (UInt_t)atoll(Row->GetField(0)); |
idtrash = (UInt_t)atoll(Row->GetField(0)); |
770 |
this->GetGLTABLES()->AddQ(); |
this->GetGLTABLES()->AddQ(); |
771 |
pResult = dbc->Query(myquery.str().c_str()); |
pResult = dbc->Query(myquery.str().c_str()); |
772 |
// |
// |
773 |
|
if (Row) |
774 |
|
delete Row; |
775 |
Row = pResult->Next(); |
Row = pResult->Next(); |
776 |
if( Row != NULL ){ |
if( Row != NULL ){ |
777 |
fileL0 = (TString)Row->GetField(0); |
fileL0 = (TString)Row->GetField(0); |
789 |
this->GetGLTABLES()->AddQ(); |
this->GetGLTABLES()->AddQ(); |
790 |
pResult = dbc->Query(myquery.str().c_str()); |
pResult = dbc->Query(myquery.str().c_str()); |
791 |
// |
// |
792 |
|
if (Row) |
793 |
|
delete Row; |
794 |
Row = pResult->Next(); |
Row = pResult->Next(); |
795 |
if( Row != NULL ){ |
if( Row != NULL ){ |
796 |
fileL2 = (TString)Row->GetField(0); |
fileL2 = (TString)Row->GetField(0); |
797 |
}; |
} |
798 |
|
if (Row){ |
799 |
|
delete Row; |
800 |
|
Row = NULL; // This variable is not used below |
801 |
|
} |
802 |
// |
// |
803 |
// |
// |
804 |
// |
// |
863 |
//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; |
864 |
// MySQL variables |
// MySQL variables |
865 |
TSQLResult *pResult; |
TSQLResult *pResult; |
866 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
867 |
stringstream myquery; |
stringstream myquery; |
868 |
// |
// |
869 |
if ( !IDRUN ) IDRUN = ID; |
if ( !IDRUN ) IDRUN = ID; |
1164 |
Int_t GL_RUN::Query_GL_RUN(UInt_t run, TSQLServer *dbc){ |
Int_t GL_RUN::Query_GL_RUN(UInt_t run, TSQLServer *dbc){ |
1165 |
// MySQL variables |
// MySQL variables |
1166 |
TSQLResult *pResult; |
TSQLResult *pResult; |
1167 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
|
int t; |
|
1168 |
int r; |
int r; |
1169 |
stringstream myquery; |
stringstream myquery; |
1170 |
// ---------------- |
// ---------------- |
1213 |
// |
// |
1214 |
if( !pResult->GetRowCount() ) return(-50); |
if( !pResult->GetRowCount() ) return(-50); |
1215 |
// |
// |
1216 |
for( r=0; r < 1000; r++){ |
for( r=0; r < 1000; r++){ |
1217 |
|
if (Row) |
1218 |
|
delete Row; |
1219 |
Row = pResult->Next(); |
Row = pResult->Next(); |
1220 |
if( Row == NULL ) break; |
if( Row == NULL ) break; |
1221 |
// Set_GL_RUN(Row); |
// Set_GL_RUN(Row); |
1222 |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
for( int t = 0; t < pResult->GetFieldCount(); t++){ |
1223 |
if (t== 0) ID = (UInt_t)atoll(Row->GetField(t)); |
if (t== 0) ID = (UInt_t)atoll(Row->GetField(t)); |
1224 |
if (t== 1) ID_RUN_FRAG = (UInt_t)atoll(Row->GetField(t)); |
if (t== 1) ID_RUN_FRAG = (UInt_t)atoll(Row->GetField(t)); |
1225 |
if (t== 2) ID_ROOT_L0 = (UInt_t)atoll(Row->GetField(t)); |
if (t== 2) ID_ROOT_L0 = (UInt_t)atoll(Row->GetField(t)); |
1253 |
if (t==30) PHYSENDRUN_MASK_S11CRC = (UInt_t)atoll(Row->GetField(t)); |
if (t==30) PHYSENDRUN_MASK_S11CRC = (UInt_t)atoll(Row->GetField(t)); |
1254 |
if (t==31) VALIDATION = (UInt_t)atoll(Row->GetField(t)); |
if (t==31) VALIDATION = (UInt_t)atoll(Row->GetField(t)); |
1255 |
}; |
}; |
1256 |
}; |
} |
1257 |
// delete pResult; |
|
1258 |
|
if (Row) |
1259 |
|
delete Row; |
1260 |
|
delete pResult; |
1261 |
return(0); |
return(0); |
1262 |
}; |
}; |
1263 |
|
|
1271 |
Int_t GL_RUN::Query_GL_RUN_FRAGMENTS(TString where, TSQLServer *dbc){ |
Int_t GL_RUN::Query_GL_RUN_FRAGMENTS(TString where, TSQLServer *dbc){ |
1272 |
// MySQL variables |
// MySQL variables |
1273 |
TSQLResult *pResult; |
TSQLResult *pResult; |
1274 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
1275 |
int t; |
int t; |
1276 |
int r; |
int r; |
1277 |
stringstream myquery; |
stringstream myquery; |
1319 |
pResult = dbc->Query(myquery.str().c_str()); |
pResult = dbc->Query(myquery.str().c_str()); |
1320 |
if(!pResult->GetRowCount())return(-50); |
if(!pResult->GetRowCount())return(-50); |
1321 |
for( r=0; r < 1000; r++){ |
for( r=0; r < 1000; r++){ |
1322 |
|
if (Row) |
1323 |
|
delete Row; |
1324 |
Row = pResult->Next(); |
Row = pResult->Next(); |
1325 |
if( Row == NULL ) break; |
if( Row == NULL ) break; |
1326 |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
1357 |
if (t==30) PHYSENDRUN_MASK_S11CRC = (UInt_t)atoll(Row->GetField(t)); |
if (t==30) PHYSENDRUN_MASK_S11CRC = (UInt_t)atoll(Row->GetField(t)); |
1358 |
if (t==31) VALIDATION = (UInt_t)atoll(Row->GetField(t)); |
if (t==31) VALIDATION = (UInt_t)atoll(Row->GetField(t)); |
1359 |
}; |
}; |
1360 |
}; |
} |
1361 |
// delete pResult; |
|
1362 |
|
if (Row) |
1363 |
|
delete Row; |
1364 |
|
delete pResult; |
1365 |
return(0); |
return(0); |
1366 |
};// **************************************************** |
};// **************************************************** |
1367 |
|
|
1374 |
Int_t GL_ROOT::Query_GL_ROOT(UInt_t id, TSQLServer *dbc){ |
Int_t GL_ROOT::Query_GL_ROOT(UInt_t id, TSQLServer *dbc){ |
1375 |
// MySQL variables |
// MySQL variables |
1376 |
TSQLResult *pResult; |
TSQLResult *pResult; |
1377 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
1378 |
int t; |
int t; |
1379 |
int r; |
int r; |
1380 |
stringstream myquery; |
stringstream myquery; |
1393 |
pResult = dbc->Query(myquery.str().c_str()); |
pResult = dbc->Query(myquery.str().c_str()); |
1394 |
if(!pResult->GetRowCount())return (-51); |
if(!pResult->GetRowCount())return (-51); |
1395 |
for( r=0; r < 1000; r++){ |
for( r=0; r < 1000; r++){ |
1396 |
|
if (Row) |
1397 |
|
delete Row; |
1398 |
Row = pResult->Next(); |
Row = pResult->Next(); |
1399 |
if( Row == NULL ) break; |
if( Row == NULL ) break; |
1400 |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
1403 |
if(t==2) ID_TIMESYNC = (UInt_t)atoll(Row->GetField(t)); |
if(t==2) ID_TIMESYNC = (UInt_t)atoll(Row->GetField(t)); |
1404 |
if(t==3) PATH = (TString)gSystem->ExpandPathName(Row->GetField(t))+'/'; |
if(t==3) PATH = (TString)gSystem->ExpandPathName(Row->GetField(t))+'/'; |
1405 |
if(t==4) NAME = Row->GetField(t); |
if(t==4) NAME = Row->GetField(t); |
1406 |
}; |
} |
1407 |
}; |
} |
1408 |
|
if (Row) |
1409 |
|
delete Row; |
1410 |
delete pResult; |
delete pResult; |
1411 |
return 0; |
return 0; |
1412 |
}; |
}; |
1421 |
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){ |
1422 |
// MySQL variables |
// MySQL variables |
1423 |
TSQLResult *pResult; |
TSQLResult *pResult; |
1424 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
1425 |
int t; |
int t; |
1426 |
int r; |
int r; |
1427 |
stringstream myquery; |
stringstream myquery; |
1437 |
pResult = dbc->Query(myquery.str().c_str()); |
pResult = dbc->Query(myquery.str().c_str()); |
1438 |
if(!pResult->GetRowCount())return (-53); |
if(!pResult->GetRowCount())return (-53); |
1439 |
for( r=0; r < 1000; r++){ |
for( r=0; r < 1000; r++){ |
1440 |
|
if (Row) |
1441 |
|
delete Row; |
1442 |
Row = pResult->Next(); |
Row = pResult->Next(); |
1443 |
if( Row == NULL ) break; |
if( Row == NULL ) break; |
1444 |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
1459 |
if (t==10) BOOT_NUMBER = (UInt_t)atoll(Row->GetField(t)); |
if (t==10) BOOT_NUMBER = (UInt_t)atoll(Row->GetField(t)); |
1460 |
if (t==11) VALIDATION = (UInt_t)atoll(Row->GetField(t)); |
if (t==11) VALIDATION = (UInt_t)atoll(Row->GetField(t)); |
1461 |
}; |
}; |
1462 |
}; |
} |
1463 |
|
if (Row) |
1464 |
|
delete Row; |
1465 |
delete pResult; |
delete pResult; |
1466 |
// |
// |
1467 |
// if ( TO_TIME < time ) return(51); |
// if ( TO_TIME < time ) return(51); |
1481 |
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){ |
1482 |
// MySQL variables |
// MySQL variables |
1483 |
TSQLResult *pResult; |
TSQLResult *pResult; |
1484 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
1485 |
int t; |
int t; |
1486 |
stringstream myquery; |
stringstream myquery; |
1487 |
uptime = 0; |
uptime = 0; |
1501 |
// printf(" mysquery is %s\n",myquery.str().c_str()); |
// printf(" mysquery is %s\n",myquery.str().c_str()); |
1502 |
// |
// |
1503 |
if( !pResult->GetRowCount() ) return(-54); |
if( !pResult->GetRowCount() ) return(-54); |
1504 |
|
if (Row) |
1505 |
|
delete Row; |
1506 |
Row = pResult->Next(); |
Row = pResult->Next(); |
1507 |
if( Row == NULL ) return (-54); |
if( Row == NULL ) return (-54); |
1508 |
// |
// |
1530 |
// |
// |
1531 |
if( !pResult->GetRowCount() ) return (-54); |
if( !pResult->GetRowCount() ) return (-54); |
1532 |
// |
// |
1533 |
|
if (Row) |
1534 |
|
delete Row; |
1535 |
Row = pResult->Next(); |
Row = pResult->Next(); |
1536 |
// |
// |
1537 |
myfromtime = (UInt_t)atoll(Row->GetField(1)); |
myfromtime = (UInt_t)atoll(Row->GetField(1)); |
1554 |
// |
// |
1555 |
if( !pResult->GetRowCount() ) return (-54); |
if( !pResult->GetRowCount() ) return (-54); |
1556 |
// |
// |
1557 |
|
if (Row) |
1558 |
|
delete Row; |
1559 |
Row = pResult->Next(); |
Row = pResult->Next(); |
1560 |
// |
// |
1561 |
}; |
}; |
1568 |
if (t==1) FROM_TIME = myfromtime; |
if (t==1) FROM_TIME = myfromtime; |
1569 |
if (t==2) TO_TIME = mytotime; |
if (t==2) TO_TIME = mytotime; |
1570 |
if (t==3) EV_ROOT = (UInt_t)atoll(Row->GetField(t)); |
if (t==3) EV_ROOT = (UInt_t)atoll(Row->GetField(t)); |
1571 |
}; |
} |
1572 |
|
if (Row) |
1573 |
|
delete Row; |
1574 |
pResult->Delete(); |
pResult->Delete(); |
1575 |
return 0; |
return 0; |
1576 |
}; |
}; |
1586 |
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){ |
1587 |
// MySQL variables |
// MySQL variables |
1588 |
TSQLResult *pResult; |
TSQLResult *pResult; |
1589 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
1590 |
int t; |
int t; |
1591 |
stringstream myquery; |
stringstream myquery; |
1592 |
// |
// |
1604 |
// |
// |
1605 |
if( !pResult ) return(-54); |
if( !pResult ) return(-54); |
1606 |
// |
// |
1607 |
|
if (Row) |
1608 |
|
delete Row; |
1609 |
Row = pResult->Next(); |
Row = pResult->Next(); |
1610 |
// |
// |
1611 |
if( !Row ) return (-54); |
if( !Row ) return (-54); |
1618 |
if (t==1) FROM_TIME = (UInt_t)atoll(Row->GetField(t)); |
if (t==1) FROM_TIME = (UInt_t)atoll(Row->GetField(t)); |
1619 |
if (t==2) TO_TIME = (UInt_t)atoll(Row->GetField(t)); |
if (t==2) TO_TIME = (UInt_t)atoll(Row->GetField(t)); |
1620 |
if (t==3) EV_ROOT = (UInt_t)atoll(Row->GetField(t)); |
if (t==3) EV_ROOT = (UInt_t)atoll(Row->GetField(t)); |
1621 |
}; |
} |
1622 |
|
if (Row) |
1623 |
|
delete Row; |
1624 |
pResult->Delete(); |
pResult->Delete(); |
1625 |
return 0; |
return 0; |
1626 |
}; |
}; |
1636 |
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){ |
1637 |
// MySQL variables |
// MySQL variables |
1638 |
TSQLResult *pResult; |
TSQLResult *pResult; |
1639 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
1640 |
int t; |
int t; |
1641 |
int r; |
int r; |
1642 |
stringstream myquery; |
stringstream myquery; |
1650 |
pResult = dbc->Query(myquery.str().c_str()); |
pResult = dbc->Query(myquery.str().c_str()); |
1651 |
if(!pResult->GetRowCount())return (-55);//throw -55; |
if(!pResult->GetRowCount())return (-55);//throw -55; |
1652 |
for( r=0; r < 1000; r++){ |
for( r=0; r < 1000; r++){ |
1653 |
|
if (Row) |
1654 |
|
delete Row; |
1655 |
Row = pResult->Next(); |
Row = pResult->Next(); |
1656 |
if( Row == NULL ) break; |
if( Row == NULL ) break; |
1657 |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
1661 |
if (t==3) FROM_TIME = (UInt_t)atoll(Row->GetField(t)); |
if (t==3) FROM_TIME = (UInt_t)atoll(Row->GetField(t)); |
1662 |
if (t==4) TO_TIME = (UInt_t)atoll(Row->GetField(t)); |
if (t==4) TO_TIME = (UInt_t)atoll(Row->GetField(t)); |
1663 |
}; |
}; |
1664 |
}; |
} |
1665 |
|
if (Row) |
1666 |
|
delete Row; |
1667 |
delete pResult; |
delete pResult; |
1668 |
// |
// |
1669 |
if(TO_TIME < time)return(51); |
if(TO_TIME < time)return(51); |
1682 |
// Bool_t debug = 1; |
// Bool_t debug = 1; |
1683 |
// MySQL variables |
// MySQL variables |
1684 |
TSQLResult *pResult; |
TSQLResult *pResult; |
1685 |
TSQLRow *Row; |
TSQLRow *Row = NULL; |
1686 |
int t; |
int t; |
1687 |
int r; |
int r; |
1688 |
stringstream myquery; |
stringstream myquery; |
1700 |
pResult = dbc->Query(myquery.str().c_str()); |
pResult = dbc->Query(myquery.str().c_str()); |
1701 |
if(!pResult->GetRowCount())return (-52); |
if(!pResult->GetRowCount())return (-52); |
1702 |
for( r=0; r < 1000; r++){ |
for( r=0; r < 1000; r++){ |
1703 |
|
if (Row) |
1704 |
|
delete Row; |
1705 |
Row = pResult->Next(); |
Row = pResult->Next(); |
1706 |
if( Row == NULL ) break; |
if( Row == NULL ) break; |
1707 |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
for( t = 0; t < pResult->GetFieldCount(); t++){ |
1713 |
if (t==5) TO_TIME = (UInt_t)atoll(Row->GetField(t)); |
if (t==5) TO_TIME = (UInt_t)atoll(Row->GetField(t)); |
1714 |
if (t==6) TYPE = (UInt_t)atoll(Row->GetField(t)); |
if (t==6) TYPE = (UInt_t)atoll(Row->GetField(t)); |
1715 |
}; |
}; |
1716 |
}; |
} |
1717 |
|
if (Row) |
1718 |
|
delete Row; |
1719 |
delete pResult; |
delete pResult; |
1720 |
// |
// |
1721 |
if(TO_TIME==0) TO_TIME = numeric_limits<UInt_t>::max(); |
if(TO_TIME==0) TO_TIME = numeric_limits<UInt_t>::max(); |
1751 |
UInt_t idtsy = 0; |
UInt_t idtsy = 0; |
1752 |
// |
// |
1753 |
TSQLResult *pResult; |
TSQLResult *pResult; |
1754 |
TSQLRow *Row = 0; |
TSQLRow *Row = NULL; |
1755 |
stringstream myquery; |
stringstream myquery; |
1756 |
stringstream rname; |
stringstream rname; |
1757 |
// pcksList packetsNames; |
// pcksList packetsNames; |
1771 |
this->GetGLTABLES()->AddQ(); |
this->GetGLTABLES()->AddQ(); |
1772 |
pResult = dbc->Query(myquery.str().c_str()); |
pResult = dbc->Query(myquery.str().c_str()); |
1773 |
if( pResult->GetRowCount() ){ |
if( pResult->GetRowCount() ){ |
1774 |
|
if (Row) |
1775 |
|
delete Row; |
1776 |
Row = pResult->Next(); |
Row = pResult->Next(); |
1777 |
if( Row ){ |
if( Row ){ |
1778 |
stringstream fname; |
stringstream fname; |
1817 |
pResult = dbc->Query(oss.str().c_str()); |
pResult = dbc->Query(oss.str().c_str()); |
1818 |
Bool_t fndit = false; |
Bool_t fndit = false; |
1819 |
if ( pResult ){ |
if ( pResult ){ |
1820 |
|
if (Row) |
1821 |
|
delete Row; |
1822 |
Row = pResult->Next(); |
Row = pResult->Next(); |
1823 |
if ( Row ){ |
if ( Row ){ |
1824 |
// |
// |
1834 |
this->GetGLTABLES()->AddQ(); |
this->GetGLTABLES()->AddQ(); |
1835 |
delete pResult; |
delete pResult; |
1836 |
pResult = dbc->Query(oss.str().c_str()); |
pResult = dbc->Query(oss.str().c_str()); |
1837 |
if ( pResult ){ |
if (pResult){ |
1838 |
Row = pResult->Next(); |
if (Row) |
1839 |
if ( Row ){ |
delete Row; |
1840 |
// printf(" GREAT! the DB structure is the new one! \n"); |
Row = pResult->Next(); |
1841 |
fndit = true; |
if ( Row ){ |
1842 |
dworbit = 1; |
// printf(" GREAT! the DB structure is the new one! \n"); |
1843 |
}; |
fndit = true; |
1844 |
|
dworbit = 1; |
1845 |
|
}; |
1846 |
}; |
}; |
1847 |
}; |
}; |
1848 |
}; |
}; |
1861 |
// printf(" T0 %u toffset is %u \n",T0,toffset); |
// printf(" T0 %u toffset is %u \n",T0,toffset); |
1862 |
// |
// |
1863 |
if ( file ) file->Close(); |
if ( file ) file->Close(); |
1864 |
|
if (Row) |
1865 |
|
delete Row; |
1866 |
delete pResult; |
delete pResult; |
1867 |
}; |
}; |
1868 |
|
|
1872 |
UInt_t idtsy = 0; |
UInt_t idtsy = 0; |
1873 |
// |
// |
1874 |
TSQLResult *pResult; |
TSQLResult *pResult; |
1875 |
TSQLRow *Row = 0; |
TSQLRow *Row = NULL; |
1876 |
stringstream myquery; |
stringstream myquery; |
1877 |
stringstream rname; |
stringstream rname; |
1878 |
// pcksList packetsNames; |
// pcksList packetsNames; |
1892 |
this->GetGLTABLES()->AddQ(); |
this->GetGLTABLES()->AddQ(); |
1893 |
pResult = dbc->Query(myquery.str().c_str()); |
pResult = dbc->Query(myquery.str().c_str()); |
1894 |
if( pResult->GetRowCount() ){ |
if( pResult->GetRowCount() ){ |
1895 |
|
if (Row) |
1896 |
|
delete Row; |
1897 |
Row = pResult->Next(); |
Row = pResult->Next(); |
1898 |
if( Row ){ |
if( Row ){ |
1899 |
stringstream fname; |
stringstream fname; |
1939 |
pResult = dbc->Query(oss.str().c_str()); |
pResult = dbc->Query(oss.str().c_str()); |
1940 |
Bool_t fndit = false; |
Bool_t fndit = false; |
1941 |
if ( pResult ){ |
if ( pResult ){ |
1942 |
|
if (Row) |
1943 |
|
delete Row; |
1944 |
Row = pResult->Next(); |
Row = pResult->Next(); |
1945 |
if ( Row ){ |
if ( Row ){ |
1946 |
// |
// |
1956 |
this->GetGLTABLES()->AddQ(); |
this->GetGLTABLES()->AddQ(); |
1957 |
delete pResult; |
delete pResult; |
1958 |
pResult = dbc->Query(oss.str().c_str()); |
pResult = dbc->Query(oss.str().c_str()); |
1959 |
if ( pResult ){ |
if (pResult){ |
1960 |
Row = pResult->Next(); |
if (Row) |
1961 |
if ( Row ){ |
delete Row; |
1962 |
// printf(" GREAT! the DB structure is the new one! \n"); |
Row = pResult->Next(); |
1963 |
fndit = true; |
if (Row){ |
1964 |
dworbit = 1; |
// printf(" GREAT! the DB structure is the new one! \n"); |
1965 |
}; |
fndit = true; |
1966 |
|
dworbit = 1; |
1967 |
|
}; |
1968 |
}; |
}; |
1969 |
}; |
}; |
1970 |
}; |
}; |
1983 |
// printf(" T0 %u toffset is %u \n",T0,toffset); |
// printf(" T0 %u toffset is %u \n",T0,toffset); |
1984 |
// |
// |
1985 |
if ( file ) file->Close(); |
if ( file ) file->Close(); |
1986 |
|
if (Row) |
1987 |
|
delete Row; |
1988 |
delete pResult; |
delete pResult; |
1989 |
}; |
}; |
1990 |
|
|
2255 |
// |
// |
2256 |
Int_t GL_TLE::DoQuery(TString myquery, TSQLServer *dbc){ |
Int_t GL_TLE::DoQuery(TString myquery, TSQLServer *dbc){ |
2257 |
TSQLResult *result; |
TSQLResult *result; |
2258 |
TSQLRow *row; |
TSQLRow *row = NULL; |
2259 |
|
|
2260 |
// Set the right time_zone (otherwise horrible things will occur! :) |
// Set the right time_zone (otherwise horrible things will occur! :) |
2261 |
if ( !this->GetGLTABLES()->IsConnected(dbc) ) return -57; |
if ( !this->GetGLTABLES()->IsConnected(dbc) ) return -57; |
2274 |
tle = GiveTle(row); |
tle = GiveTle(row); |
2275 |
|
|
2276 |
tleFromTime = strtol(row->GetField(4), NULL, 10); |
tleFromTime = strtol(row->GetField(4), NULL, 10); |
2277 |
|
if (row) |
2278 |
|
delete row; |
2279 |
row = result->Next(); // second tle row |
row = result->Next(); // second tle row |
2280 |
if(row) |
if(row) |
2281 |
tleToTime = strtol(row->GetField(4), NULL, 10); |
tleToTime = strtol(row->GetField(4), NULL, 10); |
2284 |
tleToTime = UINT_MAX; |
tleToTime = UINT_MAX; |
2285 |
} |
} |
2286 |
|
|
2287 |
delete row; |
if (row) |
2288 |
|
delete row; |
2289 |
delete result; |
delete result; |
2290 |
|
|
2291 |
return 0; |
return 0; |