// Copyright (2019-2023) Paul Scherrer Institute #ifndef JUNGFRAUJOCH_PROCESSJFPACKET_H #define JUNGFRAUJOCH_PROCESSJFPACKET_H #include "../common/ThreadSafeFIFO.h" #include "../common/DiffractionExperiment.h" #include "../receiver/Completion.h" #include "JFConversion.h" #include "JFCalibration.h" #include "jf_packet.h" #include struct ModuleInfo { uint16_t *ptr; Completion c; }; class ProcessJFPacket { std::atomic completed_descriptors; std::vector m; ThreadSafeFIFO &c_fifo; ThreadSafeFIFO &wr_fifo; std::vector module_info; std::atomic packet_counter = 0; public: ProcessJFPacket(ThreadSafeFIFO &c, ThreadSafeFIFO &wr, uint32_t nmodules); ~ProcessJFPacket(); void ProcessPacket(jf_udp_payload *datagram); uint64_t GetCounter(); uint32_t GetCompletedDescriptors() const; }; #endif //JUNGFRAUJOCH_PROCESSJFPACKET_H