Commit 6abc3aae authored by Thomas Edwards's avatar Thomas Edwards
Browse files

Added debugging timestamps

parent 34ad56f8
This diff is collapsed.
......@@ -325,6 +325,17 @@ int data_obs_vector::filter_fir_sym(std::vector <data_obs*>* data,
int N=data->size();
if (data->size() != win->size()){
// debug printing
time_t timer;
char time_str_buffer[26];
struct tm* tm_info;
timer = time(NULL);
tm_info = localtime(&timer);
strftime(time_str_buffer, 26, "[%Y-%m-%d %H:%M:%S]: ", tm_info);
puts(time_str_buffer);
// fprintf(stderr,time_str_buffer);
std::cerr << time_str_buffer;
std::cerr << "Number of elements in data and win"
"must match !" << std::endl;
return(-1);
......
......@@ -1050,6 +1050,19 @@ int driver_obs_obsdaq::parse_data_bin(data_obs_vector* data, char* buf) {
}
// Last byte must contain sum of last (N-1) bytes in bits 0-6
if ( (tmp_d&0x7F) != (buf[reclen-1]&0x7F) ){
// debug printing
time_t timer;
char time_str_buffer[26];
struct tm* tm_info;
timer = time(NULL);
tm_info = localtime(&timer);
strftime(time_str_buffer, 26, "[%Y-%m-%d %H:%M:%S]: ", tm_info);
puts(time_str_buffer);
// fprintf(stderr,time_str_buffer);
std::cerr << time_str_buffer;
fprintf(stderr,"Faulty data: Control sum check failed for ");
for (int i=0; i<reclen-1;i++){
fprintf(stderr,"%02X ",buf[i]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment