mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-04-22 23:54:36 +02:00
Fix build
This commit is contained in:
@@ -1,64 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
#include <UdpReceiver.hpp>
|
||||
#include "jungfrau.hpp"
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main (int argc, char *argv[]) {
|
||||
if (argc != 4) {
|
||||
cout << endl;
|
||||
cout << "Usage: sf_buffer [device_name] [udp_port] [root_folder]";
|
||||
cout << endl;
|
||||
cout << "\tdevice_name: Name to write to disk.";
|
||||
cout << "\tudp_port: UDP port to connect to." << endl;
|
||||
cout << "\troot_folder: FS root folder." << endl;
|
||||
cout << endl;
|
||||
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
string device_name = string(argv[1]);
|
||||
int udp_port = atoi(argv[2]);
|
||||
string root_folder = string(argv[3]);
|
||||
|
||||
UdpReceiver receiver;
|
||||
receiver.bind(udp_port);
|
||||
|
||||
jungfrau_packet recv_buffer;
|
||||
|
||||
uint64_t current_pulse_id = 0;
|
||||
uint64_t n_recv_packets = 0;
|
||||
uint64_t n_missing_packets = 0;
|
||||
uint16_t loop_counter = 0;
|
||||
|
||||
while (true) {
|
||||
if (receiver.receive(&recv_buffer, sizeof(jungfrau_packet))) {
|
||||
|
||||
loop_counter++;
|
||||
|
||||
if (recv_buffer.bunchid != current_pulse_id) {
|
||||
if (current_pulse_id != 0) {
|
||||
n_missing_packets += (128-n_recv_packets);
|
||||
}
|
||||
n_recv_packets = 0;
|
||||
current_pulse_id = recv_buffer.bunchid;
|
||||
}
|
||||
|
||||
n_recv_packets++;
|
||||
|
||||
if (loop_counter == 1000) {
|
||||
|
||||
using namespace date;
|
||||
using namespace chrono;
|
||||
|
||||
cout << system_clock::now();
|
||||
cout << " miss " << n_missing_packets;
|
||||
cout << endl;
|
||||
|
||||
loop_counter = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <thread>
|
||||
#include <chrono>
|
||||
#include "SFWriter.hpp"
|
||||
#include <config.hpp>
|
||||
#include <FastQueue.hpp>
|
||||
#include <cstring>
|
||||
#include "date.h"
|
||||
@@ -190,7 +189,7 @@ int main (int argc, char *argv[])
|
||||
|
||||
if(slot_id == -1) {
|
||||
this_thread::sleep_for(chrono::milliseconds(
|
||||
config::ring_buffer_read_retry_interval));
|
||||
RB_READ_RETRY_INTERVAL_MS));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user