ready to check missing trigger

This commit is contained in:
Nam Tran
2020-11-24 22:22:46 -06:00
parent 78fc7cb184
commit b8550dee70
2 changed files with 8 additions and 6 deletions

View File

@@ -47,7 +47,7 @@ Channel::Channel(char const * ptr, size_t len, uint32_t board) {
} }
void Channel::Print(){ void Channel::Print(){
if (valid) { if (valid) {
spdlog::get("zynqDump")->info("board {}, channel {}, spill {}, size {}, blocks {}, crossing {}, integrals {}, {}, {}", spdlog::get("zynqDump")->debug("board {}, channel {}, spill {}, size {}, blocks {}, crossing {}, integrals {}, {}, {}",
board_id, id, spill, size, block_count, crossing, integral[0], integral[1], integral[2]); board_id, id, spill, size, block_count, crossing, integral[0], integral[1], integral[2]);
} }
else { else {

View File

@@ -33,7 +33,7 @@ bool bad_data = true;
int open_socket(); int open_socket();
void signalHandler( int signum ); void signalHandler( int signum );
void setup_logger(); void setup_logger();
size_t process_channel(char const * ptr, size_t len); size_t process_channel(char const * ptr, size_t len, uint32_t board_id);
size_t process_block(char const * ptr, size_t len); size_t process_block(char const * ptr, size_t len);
size_t process_block(char const * ptr, size_t len){ size_t process_block(char const * ptr, size_t len){
return len; return len;
@@ -107,8 +107,10 @@ int main(int argc, char * argv[])
size_t bytes_left = (frameSize - 3 * sizeof(uint32_t)); size_t bytes_left = (frameSize - 3 * sizeof(uint32_t));
size_t bytes_processed = 0; size_t bytes_processed = 0;
while ((bytes_left - bytes_processed >= MIN_CHANNEL_SIZE) && (bytes_processed < bytes_left)) { while ((bytes_left - bytes_processed >= MIN_CHANNEL_SIZE) && (bytes_processed < bytes_left)) {
bytes_processed += process_channel(char_buffer + 2 * sizeof(uint32_t) + bytes_processed, bytes_processed += process_channel(
bytes_left - bytes_processed); char_buffer + 2 * sizeof(uint32_t) + bytes_processed,
bytes_left - bytes_processed,
static_cast<uint32_t>(board_id));
} }
spdlog::get("zynqDump")->debug("Done, {} bytes processed.", bytes_processed); spdlog::get("zynqDump")->debug("Done, {} bytes processed.", bytes_processed);
} }
@@ -163,7 +165,7 @@ void setup_logger(){
} }
} }
size_t process_channel(char const * ptr, size_t len){ size_t process_channel(char const * ptr, size_t len, uint32_t board_id){
if ((len < MIN_CHANNEL_SIZE) || (len > MAX_CHANNEL_SIZE)) { if ((len < MIN_CHANNEL_SIZE) || (len > MAX_CHANNEL_SIZE)) {
spdlog::debug("channel length must be between {} and {}.", spdlog::debug("channel length must be between {} and {}.",
MIN_CHANNEL_SIZE, MAX_CHANNEL_SIZE); MIN_CHANNEL_SIZE, MAX_CHANNEL_SIZE);
@@ -209,7 +211,7 @@ size_t process_channel(char const * ptr, size_t len){
// processing // processing
bytes_left -= channel_size; bytes_left -= channel_size;
Channel c(ptr, channel_size); Channel c(ptr, channel_size, board_id);
c.Print(); c.Print();
} }
} }