38 lines
1.3 KiB
C++
38 lines
1.3 KiB
C++
// Copyright (2019-2022) Paul Scherrer Institute
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#ifndef JUNGFRAUJOCH_TESTIMAGEPUSHER_H
|
|
#define JUNGFRAUJOCH_TESTIMAGEPUSHER_H
|
|
|
|
#include <mutex>
|
|
|
|
#include "ImagePusher.h"
|
|
#include "Logger.h"
|
|
#include "DiffractionExperiment.h"
|
|
#include "../jungfrau/JFCalibration.h"
|
|
#include "../jungfrau/JFModuleGainCalibration.h"
|
|
|
|
class TestImagePusher : public ImagePusher {
|
|
mutable std::mutex m;
|
|
std::vector<uint8_t> receiver_generated_image;
|
|
int64_t image_id;
|
|
bool correct_sequence = true;
|
|
bool is_running = false;
|
|
size_t frame_counter = 0;
|
|
void SendDataInternal(const std::vector<uint8_t> &serialized_image, int64_t image_number) override;
|
|
public:
|
|
explicit TestImagePusher(int64_t image_number);
|
|
void StartDataCollection(const StartMessage& message) override;
|
|
void EndDataCollection(const EndMessage& message) override;
|
|
bool CheckImage(const DiffractionExperiment &x,
|
|
const std::vector<uint16_t> &raw_reference_image,
|
|
const JFCalibration &calibration,
|
|
Logger &logger);
|
|
[[nodiscard]] bool CheckSequence() const;
|
|
[[nodiscard]] const std::vector<uint8_t> &GetImage() const;
|
|
[[nodiscard]] size_t GetCounter() const;
|
|
};
|
|
|
|
|
|
#endif //JUNGFRAUJOCH_TESTIMAGEPUSHER_H
|