//*-- Author : Damir Buskulic 22/11/01//////////////////////////////////////////////////////////////////////////// //// VVirtualFrameChannel //// //// Virtual frame channel (ABC for frame channel) //// ////////////////////////////////////////////////////////////////////////////// need XOPEN for strptime()
#define _XOPEN_SOURCE 1
#define _BSD_SOURCE 1
# include <time.h>
#include "VVirtualFrameChannel.h"
ClassImp(VVirtualFrameChannel)
//______________________________________________________________________________VVirtualFrameChannel::VVirtualFrameChannel()
{
// Default constructor for frame channelmRefTime.SetTimeD(0);
mFrameInfoDB = 0;
mTimerInterval = 0;
}
//______________________________________________________________________________VVirtualFrameChannel::~VVirtualFrameChannel()
{
// Default destructor for frame channel
if (mFrameInfoDB) mFrameInfoDB->Close();
delete mFrameInfoDB;
}
//______________________________________________________________________________Bool_tVVirtualFrameChannel::Connect(char* connectDB, Option_t* openopt)
{
// Connect to the Frame database "connectDB"
if (!mFrameInfoDB) mFrameInfoDB = new VVirtualFrameInfoDB();
return mFrameInfoDB->Open(connectDB,openopt);
}
//______________________________________________________________________________voidVVirtualFrameChannel::Disconnect()
{
// Disconnect to the Frame database "connectDB"
if (mFrameInfoDB) {
mFrameInfoDB->Close();
delete mFrameInfoDB;
mFrameInfoDB = 0;
}
}
//______________________________________________________________________________voidVVirtualFrameChannel::BuildInfoDB(char* nameDB, char* frameFiles, Option_t* opt)
{
// Builds a new meta info database given frame file path and names// has to be overloaded
Warning("BuildInfoDB","This function has to be overloaded in derived class");
}
//______________________________________________________________________________voidVVirtualFrameChannel::SetRefTime(const char* when, Int_t leaps)
{
// Sets the reference time to be the one defined in the string "when"// this variable has a standard time format : // day/month/Year(full) hour(1-24):min:sec// for example 12/04/2000 23:45:03//// when can be equal to// - "now" : In that case, the ref. time set// will be the actual time when the command is issued. The user// may then try to see what hapened a few minutes/hours/days ago.//// - "start" : In that case, the ref. time set// will be the start time of the first frame indexed in the database.//// leaps are the leap seconds to be given for conversion to GPS time.// if you do not know it, set 0 but be warned that the start times of the// frames you will ask for will probably be shifted by this amount.// It is around 34 seconds in the beginning of 2000 and grows roughly// 1s per year.
struct tm* timeinput;
timeinput = new tm;
// The string "when" can be "now"
TString swhen = when;
if (!swhen.CompareTo("now",TString::kIgnoreCase)) {
mRefTime.SetTimeD((double)(time(0) + leaps -19 -315964800));
return;
// The string "when" can be "start"
} else if (!swhen.CompareTo("start",TString::kIgnoreCase)) {
mRefTime.SetTimeD(GetStart());
return;
}
char* c = strptime(when,"%d/%m/%Y %H:%M:%S",timeinput);
if (!c) {
Warning("VFrDatabase","Wrong format for the time string");
return;
}
time_t timeoutput = mktime(timeinput);
mRefTime.SetTimeD((double)(timeoutput + leaps -19 -315964800));
}
- ROOT page - VEGA page - Class index - Top of the page This page has been automatically generated. If you have any comments or suggestions
about the page layout send a mail to
, or
contact
with any questions or problems regarding ROOT or VEGA.