Public Member Functions | |
| BeamDataImp () | |
| ~BeamDataImp () | |
| void | clear () |
| int | words () |
| long int * | create_block () |
| void | delete_block (long int *data) |
| int | header (int sec, int nsec, int spill, int event, int delay) |
| DeviceData & | get_device (string name) |
| void | set_device_header (string name, int sec, int msec) |
| void | append_payload (string name, int value[2]) |
| string & | current_file () |
Private Types | |
| typedef map< string, DeviceData > | Payload |
| typedef Payload::iterator | PayloadItr |
Private Attributes | |
| string | fCurrentFile |
| int | fSeconds |
| int | fNanosecs |
| int | fSpillcount |
| int | fTclkEvent |
| int | fTclkDelay |
| Payload | fPayload |
|
|
Definition at line 44 of file BeamData.cc. |
|
|
Definition at line 45 of file BeamData.cc. |
|
|
Definition at line 50 of file BeamData.cc. References clear(). 00050 { this->clear(); fCurrentFile = ""; }
|
|
|
Definition at line 51 of file BeamData.cc. 00051 {}
|
|
||||||||||||
|
Definition at line 154 of file BeamData.cc. References BeamDataImp::DeviceData::data. Referenced by BeamData::add_device_value(). 00154 {
00155 DeviceData& d = get_device(name);
00156 d.data.push_back(value[0]);
00157 d.data.push_back(value[1]);
00158 }
|
|
|
Definition at line 53 of file BeamData.cc. Referenced by BeamData::start_block(). 00053 {
00054 fSeconds = fNanosecs = fSpillcount = 0;
00055 fTclkEvent = fTclkDelay = 0;
00056 fPayload.clear();
00057 }
|
|
|
Definition at line 77 of file BeamData.cc. References count, BeamDataImp::DeviceData::data, done(), kMdBlockBeamMonHeader, kMdBlockBeamMonPayload, make_block_id(), BeamDataImp::DeviceData::msec, pld_indx_num_devices, rdxsum_fill(), and BeamDataImp::DeviceData::sec. Referenced by BeamData::send_data(). 00077 {
00078 int siz = this->words();
00079 long int* data = new long int[siz];
00080
00081 // The header block
00082 long int* hdr = data;
00083 hdr[hdr_indx_size] = zzzz_last;
00084 hdr[hdr_indx_checksum] = 0;
00085 hdr[hdr_indx_blockid] = make_block_id(kMdBlockBeamMonHeader);
00086 hdr[hdr_indx_sec] = fSeconds;
00087 hdr[hdr_indx_nsec] = fNanosecs;
00088 hdr[hdr_indx_spillcnt] = fSpillcount;
00089 rdxsum_fill(hdr,0);
00090
00091 // The payload block
00092 long int* pld = data+hdr[hdr_indx_size];
00093 siz -= hdr[hdr_indx_size];
00094 pld[pld_indx_size] = siz;
00095 pld[pld_indx_checksum] = 0;
00096 pld[pld_indx_blockid] = make_block_id(kMdBlockBeamMonPayload);
00097 pld[pld_indx_clbk_event] = fTclkEvent;
00098 pld[pld_indx_clbk_delay] = fTclkDelay;
00099 pld[pld_indx_num_devices] = fPayload.size();
00100
00101 int count=0, index = pld_indx_data_start;
00102 PayloadItr it, done = fPayload.end();
00103 for (it = fPayload.begin(); it != done; ++it) {
00104 string name = it->first;
00105 DeviceData& dd = it->second;
00106
00107 // Pack the ACNET name. This does it in machine order
00108 // unpacking assumes it is written on ix86 ordering.
00109 pld[index++] = (name[0]<<24)+(name[1]<<16)+(name[2]<<8)+name[3];
00110 pld[index++] = (name[4]<<24)+(name[5]<<16)+(name[6]<<8)+name[7];
00111
00112 // Set the relative timestamp
00113 pld[index++] = dd.sec;
00114 pld[index++] = dd.msec;
00115
00116 // Pack number of device values and the values themselves.
00117 int nvalues = dd.data.size();
00118 pld[index++] = nvalues;
00119 for (int ind=0; ind<nvalues; ++ind) pld[index++] = dd.data[ind];
00120 ++count;
00121 }
00122 rdxsum_fill(data+6,0);
00123
00124 assert (siz == index);
00125 assert (count == pld[pld_indx_num_devices]);
00126 return data;
00127 }
|
|
|
Definition at line 160 of file BeamData.cc. Referenced by BeamData::close_file(), BeamData::current_filename(), and BeamData::open_file(). 00160 { return fCurrentFile; }
|
|
|
Definition at line 128 of file BeamData.cc. Referenced by BeamData::send_data(). 00128 { delete [] data; }
|
|
|
Definition at line 138 of file BeamData.cc. 00138 {
00139 // space pad name
00140 while (name.size() < 8u) name.push_back(' ');
00141
00142 PayloadItr it = fPayload.find(name);
00143 if (it == fPayload.end()) {
00144 fPayload[name] = DeviceData();
00145 return fPayload[name];
00146 }
00147 else return it->second;
00148 }
|
|
||||||||||||||||||||||||
|
Definition at line 130 of file BeamData.cc. Referenced by BeamData::start_block(). 00130 {
00131 fSeconds = sec;
00132 fNanosecs = nsec;
00133 fSpillcount = spill;
00134 fTclkEvent = event;
00135 fTclkDelay = delay;
00136 }
|
|
||||||||||||||||
|
Definition at line 149 of file BeamData.cc. References BeamDataImp::DeviceData::msec, and BeamDataImp::DeviceData::sec. Referenced by BeamData::set_device_header(). 00149 {
00150 DeviceData& d = get_device(name);
00151 d.sec = sec;
00152 d.msec = msec;
00153 }
|
|
|
Definition at line 58 of file BeamData.cc. References done(), pld_nvalues_offset, and s(). Referenced by BeamData::send_data(). 00058 {
00059 int s = 0;
00060 // header block is constant size
00061 s += zzzz_last;
00062 // Number of words to get to start of payload
00063 s += pld_indx_data_start;
00064
00065 // Offset from above index + 1 gives number of values in the
00066 // prefix of each device data
00067 s += (pld_nvalues_offset+1) * fPayload.size();
00068
00069 // Finally count up the actual payloads
00070 PayloadItr it, done = fPayload.end();
00071 for (it = fPayload.begin(); it != done; ++it) {
00072 s += it->second.data.size();
00073 }
00074 return s;
00075 }
|
|
|
Definition at line 35 of file BeamData.cc. |
|
|
Definition at line 36 of file BeamData.cc. |
|
|
Definition at line 46 of file BeamData.cc. |
|
|
Definition at line 36 of file BeamData.cc. |
|
|
Definition at line 36 of file BeamData.cc. |
|
|
Definition at line 37 of file BeamData.cc. |
|
|
Definition at line 37 of file BeamData.cc. |
1.3.9.1