#include <BeamData.h>
Public Member Functions | |
| BeamData () | |
| ~BeamData () | |
| int | open_connection (const char *host) |
| int | close_connection () |
| close it | |
| int | open_file (int sec, int nanosec) |
| open file using sec/nsec to build filename | |
| int | close_file () |
| close the open file | |
| int | send_data () |
| send data currently accumulated via methods below. | |
| void | start_block (int seconds, int nanosecs, int spillcount, int tclk_event, int tclk_delay) |
| Fill the block. Order matters. | |
| void | set_device_header (const char *name, int dae_sec, int dae_msec) |
| void | add_device_value (const char *name, double value) |
| const char * | current_filename () |
| const char * | error (int errcode) |
Private Attributes | |
| BeamDataImp * | fImp |
|
|
Definition at line 164 of file BeamData.cc. References fImp. 00165 {
00166 fImp = new BeamDataImp;
00167 }
|
|
|
Definition at line 168 of file BeamData.cc. 00169 {
00170 if (fImp) delete fImp;
00171 }
|
|
||||||||||||
|
Definition at line 245 of file BeamData.cc. References BeamDataImp::append_payload(), and fImp. Referenced by _wrap_BeamData_add_device_value(). 00246 {
00247 int temp[2] = { 0 };
00248 // Egads! Avert yer eye's if ye worry about yer sanity
00249 memcpy(temp,&value,sizeof(double));
00250 fImp->append_payload(name,temp);
00251 }
|
|
|
close it
Definition at line 178 of file BeamData.cc. References roto_close_connection(). Referenced by _wrap_BeamData_close_connection(). 00179 {
00180 return roto_close_connection();
00181 }
|
|
|
close the open file
Definition at line 218 of file BeamData.cc. References BeamDataImp::current_file(), fImp, and roto_close_beammonfile(). Referenced by _wrap_BeamData_close_file(). 00219 {
00220 int ret = roto_close_beammonfile();
00221 fImp->current_file() = "";
00222 return ret;
00223 }
|
|
|
Definition at line 253 of file BeamData.cc. References BeamDataImp::current_file(), and fImp. Referenced by _wrap_BeamData_current_filename(). 00254 {
00255 return fImp->current_file().c_str();
00256 }
|
|
|
Definition at line 258 of file BeamData.cc. Referenced by _wrap_BeamData_error(). 00259 {
00260 const char* errtable[] = {
00261 "rototalk_success",
00262 "rototalk_err_whoami",
00263 "rototalk_err_alreadyconn",
00264 "rototalk_err_unknownhost",
00265 "rototalk_err_notinethost",
00266 "rototalk_err_socketfail",
00267 "rototalk_err_connectfail",
00268 "rototalk_err_notconnected",
00269 "rototalk_err_illegalmethod",
00270 "rototalk_err_badsender",
00271 "rototalk_err_badsendcmd",
00272 "rototalk_err_badsendsize",
00273 "rototalk_err_badsenddata",
00274 "rototalk_err_badrecvack",
00275 "rototalk_err_badrecvacksize",
00276 "rototalk_err_badrecvackdata",
00277 "rototalk_err_badrecvstate",
00278 "rototalk_err_nack",
00279 "rototalk_err_reallocate",
00280 "rototalk_err_badconfig",
00281 "rototalk_last_of_errors",
00282 0
00283 };
00284 if (err < 0 || err >= rototalk_last_of_errors) return "unknown";
00285 return errtable[err];
00286 }
|
|
|
Roto interface open connection to host running rotorooter Definition at line 173 of file BeamData.cc. References roto_open_BeamMon_connection(). Referenced by _wrap_BeamData_open_connection(). 00174 {
00175 return roto_open_BeamMon_connection(host);
00176 }
|
|
||||||||||||
|
open file using sec/nsec to build filename
Definition at line 208 of file BeamData.cc. References BeamDataImp::current_file(), fImp, roto_open_beammonfile(), and secnsec2filename(). Referenced by _wrap_BeamData_open_file(). 00209 {
00210 int ret = roto_open_beammonfile(sec,nanosec);
00211 if (ret) {
00212 fImp->current_file() = "";
00213 return ret;
00214 }
00215 fImp->current_file() = secnsec2filename(sec,nanosec);
00216 return ret;
00217 }
|
|
|
send data currently accumulated via methods below.
Definition at line 225 of file BeamData.cc. References BeamDataImp::create_block(), BeamDataImp::delete_block(), fImp, roto_send_record(), and BeamDataImp::words(). Referenced by _wrap_BeamData_send_data(). 00226 {
00227 long int* data = fImp->create_block();
00228 //cerr << data[9] << " devices, block 1 " << data[0] << " words, block 2 " << data[6] << " words, total words = " << fImp->words() << endl;
00229 int res = roto_send_record(data,fImp->words()*4);
00230 fImp->delete_block(data);
00231 return res;
00232 }
|
|
||||||||||||||||
|
Definition at line 241 of file BeamData.cc. References fImp, and BeamDataImp::set_device_header(). Referenced by _wrap_BeamData_set_device_header(). 00242 {
00243 fImp->set_device_header(name,sec,msec);
00244 }
|
|
||||||||||||||||||||||||
|
Fill the block. Order matters.
Definition at line 234 of file BeamData.cc. References BeamDataImp::clear(), fImp, and BeamDataImp::header(). Referenced by _wrap_BeamData_start_block().
|
|
|
Definition at line 7 of file BeamData.h. Referenced by add_device_value(), BeamData(), close_file(), current_filename(), open_file(), send_data(), set_device_header(), and start_block(). |
1.3.9.1