BeamData Class Reference

#include <BeamData.h>

List of all members.

Public Member Functions

 BeamData ()
 ~BeamData ()
int32_t open_connection (const char *host)
int32_t close_connection ()
 close it
int32_t open_file (int sec, int nanosec)
 open file using sec/nsec to build filename
int32_t close_file ()
 close the open file
int send_data ()
 send data currently accumulated via methods below.
void start_block (int32_t seconds, int32_t nanosecs, int32_t spillcount, int32_t tclk_event, int32_t tclk_delay)
 Fill the block. Order matters.
void set_device_header (const char *name, int32_t dae_sec, int32_t dae_msec)
void add_device_value (const char *name, double value)
const char * current_filename ()
const char * error (int32_t errcode)
 BeamData ()
 ~BeamData ()
int32_t open_connection (const char *host)
int32_t close_connection ()
 close it
int32_t open_file (int sec, int nanosec)
 open file using sec/nsec to build filename
int32_t close_file ()
 close the open file
int send_data ()
 send data currently accumulated via methods below.
void start_block (int32_t seconds, int32_t nanosecs, int32_t spillcount, int32_t tclk_event, int32_t tclk_delay)
 Fill the block. Order matters.
void set_device_header (const char *name, int32_t dae_sec, int32_t dae_msec)
void add_device_value (const char *name, double value)
const char * current_filename ()
const char * error (int32_t errcode)

Private Attributes

BeamDataImpfImp

Detailed Description

Definition at line 8 of file BeamData.h.


Constructor & Destructor Documentation

BeamData::BeamData (  ) 

Definition at line 166 of file BeamData.cc.

References fImp.

00167 {
00168     fImp = new BeamDataImp;
00169 }

BeamData::~BeamData (  ) 

Definition at line 170 of file BeamData.cc.

References fImp.

00171 {
00172     if (fImp) delete fImp;
00173 }

BeamData::BeamData (  ) 
BeamData::~BeamData (  ) 

Member Function Documentation

void BeamData::add_device_value ( const char *  name,
double  value 
)
void BeamData::add_device_value ( const char *  name,
double  value 
)

Definition at line 247 of file BeamData.cc.

References BeamDataImp::append_payload(), and fImp.

Referenced by cfProcessor::SendToRotorooter(), and ifbProcRoto::SpillDevice().

00248 {
00249     int32_t temp[2] = { 0 };
00250     // Egads!  Avert yer eye's if ye worry about yer sanity
00251     memcpy(temp,&value,sizeof(double));
00252     fImp->append_payload(name,temp);
00253 }

int32_t BeamData::close_connection (  ) 

close it

int32_t BeamData::close_connection (  ) 

close it

Definition at line 180 of file BeamData.cc.

References roto_close_connection().

Referenced by ifbProcRoto::Finish(), and cfProcessor::SendToRotorooter().

00181 {
00182     return roto_close_connection();
00183 }

int32_t BeamData::close_file (  ) 

close the open file

int32_t BeamData::close_file (  ) 

close the open file

Definition at line 220 of file BeamData.cc.

References BeamDataImp::current_file(), fImp, and roto_close_beammonfile().

Referenced by ifbProcRoto::Finish(), and cfProcessor::SendToRotorooter().

00221 {
00222     int32_t ret = roto_close_beammonfile();
00223     fImp->current_file() = "";
00224     return ret;
00225 }

const char* BeamData::current_filename (  ) 
const char * BeamData::current_filename (  ) 

Definition at line 255 of file BeamData.cc.

References BeamDataImp::current_file(), and fImp.

00256 {
00257     return fImp->current_file().c_str();
00258 }

const char* BeamData::error ( int32_t  errcode  ) 
const char * BeamData::error ( int32_t  errcode  ) 

Definition at line 260 of file BeamData.cc.

References rototalk_last_of_errors.

00261 {
00262     const char* errtable[] = {
00263         "rototalk_success",
00264         "rototalk_err_whoami",
00265         "rototalk_err_alreadyconn",
00266         "rototalk_err_unknownhost",
00267         "rototalk_err_notinethost",
00268         "rototalk_err_socketfail",
00269         "rototalk_err_connectfail",
00270         "rototalk_err_notconnected",
00271         "rototalk_err_illegalmethod",
00272         "rototalk_err_badsender",
00273         "rototalk_err_badsendcmd",
00274         "rototalk_err_badsendsize",
00275         "rototalk_err_badsenddata",
00276         "rototalk_err_badrecvack",
00277         "rototalk_err_badrecvacksize",
00278         "rototalk_err_badrecvackdata",
00279         "rototalk_err_badrecvstate",
00280         "rototalk_err_nack",
00281         "rototalk_err_reallocate",
00282         "rototalk_err_badconfig",
00283         "rototalk_last_of_errors",
00284         0
00285     };
00286     if (err < 0 || err >= rototalk_last_of_errors) return "unknown";
00287     return errtable[err];
00288 }

int32_t BeamData::open_connection ( const char *  host  ) 

Roto interface open connection to host running rotorooter

int32_t BeamData::open_connection ( const char *  host  ) 

Roto interface open connection to host running rotorooter

Definition at line 175 of file BeamData.cc.

References roto_open_BeamMon_connection().

Referenced by ifbProcRoto::Init(), and cfProcessor::SendToRotorooter().

00176 {
00177     return roto_open_BeamMon_connection(host);
00178 }

int32_t BeamData::open_file ( int  sec,
int  nanosec 
)

open file using sec/nsec to build filename

int32_t BeamData::open_file ( int  sec,
int  nanosec 
)

open file using sec/nsec to build filename

Referenced by ifbProcRoto::Init(), and cfProcessor::SendToRotorooter().

int BeamData::send_data (  ) 

send data currently accumulated via methods below.

int32_t BeamData::send_data (  ) 

send data currently accumulated via methods below.

Definition at line 227 of file BeamData.cc.

References BeamDataImp::create_block(), BeamDataImp::delete_block(), fImp, roto_send_record(), and BeamDataImp::words().

Referenced by cfProcessor::SendToRotorooter(), and ifbProcRoto::SpillFinish().

00228 {
00229     int32_t* data = fImp->create_block();
00230     //cerr << data[9] << " devices, block 1 " << data[0] << " words, block 2 " << data[6] << " words, total words = " << fImp->words() << endl;
00231     int32_t res = roto_send_record(data,fImp->words()*4);
00232     fImp->delete_block(data);
00233     return res;
00234 }

void BeamData::set_device_header ( const char *  name,
int32_t  dae_sec,
int32_t  dae_msec 
)
void BeamData::set_device_header ( const char *  name,
int32_t  dae_sec,
int32_t  dae_msec 
)

Definition at line 243 of file BeamData.cc.

References fImp, and BeamDataImp::set_device_header().

Referenced by cfProcessor::SendToRotorooter(), and ifbProcRoto::SpillDevice().

00244 {
00245     fImp->set_device_header(name,sec,msec);
00246 }

void BeamData::start_block ( int32_t  seconds,
int32_t  nanosecs,
int32_t  spillcount,
int32_t  tclk_event,
int32_t  tclk_delay 
)

Fill the block. Order matters.

void BeamData::start_block ( int32_t  seconds,
int32_t  nanosecs,
int32_t  spillcount,
int32_t  tclk_event,
int32_t  tclk_delay 
)

Fill the block. Order matters.

Definition at line 236 of file BeamData.cc.

References BeamDataImp::clear(), fImp, and BeamDataImp::header().

Referenced by cfProcessor::SendToRotorooter(), and ifbProcRoto::SpillInit().

00238 {
00239     fImp->clear();
00240     fImp->header(seconds,nanosecs,spillcount,event,delay);
00241 }


Member Data Documentation


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1