299 |
ClassDef(GL_TIMESYNC,2); |
ClassDef(GL_TIMESYNC,2); |
300 |
}; |
}; |
301 |
|
|
302 |
/* Class to query a TLE from the db. |
|
303 |
|
/* |
304 |
|
* Class to query a TLE from the db. |
305 |
* |
* |
306 |
* Two methods are implemented. |
* Two non default constructor are avaiable. It is the same to call |
307 |
|
* the Query method. |
308 |
|
* |
309 |
|
* The class looks for a TLE in the GL_TLE table using the connection |
310 |
|
* dbc. You need to pass an UTC date in SQL datetime format or in |
311 |
|
* unix time (UTC) and it will look for the tle with the nearest and |
312 |
|
* previous date. Then it initialize tle to a cTle object, |
313 |
|
* tleFromTime to the UTC unix time of the tle and tleToTime to the |
314 |
|
* UTC unix time of the next avaible tle. |
315 |
*/ |
*/ |
316 |
class GL_TLE : public TObject{ |
class GL_TLE : public TObject{ |
317 |
private: |
private: |
318 |
cTle *Query_GL_TLE_go(TString, TSQLServer *); |
Int_t DoQuery(TString query, TSQLServer *dbc); |
319 |
|
cTle* GiveTle(TSQLRow*); |
320 |
|
|
321 |
public: |
cTle *tle; // the requested tle |
322 |
GL_TLE(); |
UInt_t tleFromTime; // unix time (UTC) of the tle |
323 |
|
UInt_t tleToTime; // unix time (UTC) of the next tle |
324 |
|
|
325 |
cTle* Query_GL_TLE(UInt_t unixtime, TSQLServer *dbc); |
public: |
326 |
cTle* Query_GL_TLE(TString date, TSQLServer *dbc); |
GL_TLE(){ |
327 |
|
tle = NULL; |
328 |
|
tleFromTime = 0; |
329 |
|
tleToTime = 0; |
330 |
|
}; |
331 |
|
|
332 |
|
GL_TLE(UInt_t unixtime, TSQLServer *dbc) { |
333 |
|
Query(unixtime, dbc); |
334 |
|
}; |
335 |
|
|
336 |
|
GL_TLE(TString date, TSQLServer *dbc) { |
337 |
|
Query(date, dbc); |
338 |
|
}; |
339 |
|
|
340 |
|
Int_t Query(UInt_t unixtime, TSQLServer *dbc); |
341 |
|
Int_t Query(TString date, TSQLServer *dbc); |
342 |
|
|
343 |
|
cTle* GetTle() const { return tle; } |
344 |
|
UInt_t GetFromTime() const { return tleFromTime; } |
345 |
|
UInt_t GetToTime() const { return tleToTime; } |
346 |
|
|
347 |
ClassDef(GL_TLE,1); |
ClassDef(GL_TLE,1); |
348 |
}; |
}; |