diff --git a/broker/JFJochStateMachine.cpp b/broker/JFJochStateMachine.cpp index 6a31f006..3ea47a2b 100644 --- a/broker/JFJochStateMachine.cpp +++ b/broker/JFJochStateMachine.cpp @@ -143,8 +143,8 @@ void JFJochStateMachine::TakePedestalInternalAll(std::unique_lock &u TakePedestalInternalG1(ul, i); TakePedestalInternalG2(ul, i); } - } catch (...) { - logger.Info("Pedestal sequence error"); + } catch (const std::exception &e) { + logger.Error("Pedestal sequence error {}", e.what()); state = JFJochState::Error; throw; } diff --git a/common/DetectorGeometry.cpp b/common/DetectorGeometry.cpp index 75730e33..9d12470a 100644 --- a/common/DetectorGeometry.cpp +++ b/common/DetectorGeometry.cpp @@ -54,19 +54,6 @@ DetectorGeometry::DetectorGeometry(int32_t nmodules, int32_t horizontal_stacking } } -DetectorGeometry::operator JFJochProtoBuf::DetectorGeometry() const { - JFJochProtoBuf::DetectorGeometry ret; - ret.set_height_pxl(height); - ret.set_width_pxl(width); - for (auto &m: modules) { - auto mpbf = ret.add_module_geometry(); - mpbf->set_pixel0(m.GetPixel0_X() + width * m.GetPixel0_Y()); - mpbf->set_fast_direction_step(GetDirectionStep(m.GetFastAxis())); - mpbf->set_slow_direction_step(GetDirectionStep(m.GetSlowAxis())); - } - return ret; -} - int64_t DetectorGeometry::GetDirectionStep(DetectorModuleGeometry::Direction direction) const { switch (direction) { case DetectorModuleGeometry::Direction::Xneg: @@ -84,4 +71,30 @@ int64_t DetectorGeometry::GetDirectionStep(DetectorModuleGeometry::Direction dir int64_t DetectorGeometry::GetModulesNum() const { return modules.size(); -} \ No newline at end of file +} + +int64_t DetectorGeometry::GetWidth() const { + return width; +} + +int64_t DetectorGeometry::GetHeight() const { + return height; +} + +int64_t DetectorGeometry::GetPixel0(int64_t m) const { + if ((m < 0) || (m >= modules.size())) + throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, "Wrong module number"); + return modules[m].GetPixel0_X() + width * modules[m].GetPixel0_Y(); +} + +int64_t DetectorGeometry::GetFastDirectionStep(int64_t m) const { + if ((m < 0) || (m >= modules.size())) + throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, "Wrong module number"); + return GetDirectionStep(modules[m].GetFastAxis()); +} + +int64_t DetectorGeometry::GetSlowDirectionStep(int64_t m) const { + if ((m < 0) || (m >= modules.size())) + throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, "Wrong module number"); + return GetDirectionStep(modules[m].GetSlowAxis()); +} diff --git a/common/DetectorGeometry.h b/common/DetectorGeometry.h index 44a1d22d..a1f887ff 100644 --- a/common/DetectorGeometry.h +++ b/common/DetectorGeometry.h @@ -5,14 +5,13 @@ #include #include -#include #include "DetectorModuleGeometry.h" class DetectorGeometry { int64_t width; int64_t height; std::vector modules; - int64_t GetDirectionStep(DetectorModuleGeometry::Direction direction) const; + [[nodiscard]] int64_t GetDirectionStep(DetectorModuleGeometry::Direction direction) const; public: DetectorGeometry(const std::vector &pixel_0); DetectorGeometry(int32_t nmodules, @@ -20,8 +19,12 @@ public: int32_t gap_x = 0, int32_t gap_y = 0, bool mirror_y = true); // regular geometry - operator JFJochProtoBuf::DetectorGeometry() const; - int64_t GetModulesNum() const; + [[nodiscard]] int64_t GetModulesNum() const; + [[nodiscard]] int64_t GetWidth() const; + [[nodiscard]] int64_t GetHeight() const; + [[nodiscard]] int64_t GetPixel0(int64_t module_number) const; + [[nodiscard]] int64_t GetFastDirectionStep(int64_t module_number) const; + [[nodiscard]] int64_t GetSlowDirectionStep(int64_t module_number) const; }; #endif //JUNGFRAUJOCH_DETECTORGEOMETRY_H diff --git a/common/DetectorModuleGeometry.h b/common/DetectorModuleGeometry.h index 74b2eca7..f25ba16d 100644 --- a/common/DetectorModuleGeometry.h +++ b/common/DetectorModuleGeometry.h @@ -10,14 +10,14 @@ class DetectorModuleGeometry { public: enum class Direction {Xneg, Xpos, Yneg, Ypos}; private: - const int64_t x0; - const int64_t y0; + int64_t x0; + int64_t y0; constexpr static const int64_t fast_pixels = CONVERTED_MODULE_COLS; constexpr static const int64_t slow_pixels = CONVERTED_MODULE_LINES; - const Direction fast; - const Direction slow; + Direction fast; + Direction slow; public: DetectorModuleGeometry(int64_t x0, int64_t y0, Direction fast, Direction slow); [[nodiscard]] int64_t GetMaxX() const; diff --git a/common/DetectorSetup.cpp b/common/DetectorSetup.cpp index bf7e50da..c7d9783d 100644 --- a/common/DetectorSetup.cpp +++ b/common/DetectorSetup.cpp @@ -55,15 +55,6 @@ const std::vector &DetectorSetup::GetGainCalibration() return gain_calibration; } -DetectorSetup::operator JFJochProtoBuf::Detector() const { - JFJochProtoBuf::Detector ret; - ret.set_nmodules(GetModulesNum()); - ret.set_description(GetDescription()); - ret.set_pixel_size_mm(GetPixelSize_mm()); - ret.set_udp_interface_count(udp_interface_count); - for (const auto& iter: det_modules_hostname) - ret.add_module_hostname(iter); - - *ret.mutable_geometry() = geometry; - return ret; +int64_t DetectorSetup::GetUDPInterfaceCount() const { + return udp_interface_count; } \ No newline at end of file diff --git a/common/DetectorSetup.h b/common/DetectorSetup.h index b8db2862..21ef2c9e 100644 --- a/common/DetectorSetup.h +++ b/common/DetectorSetup.h @@ -27,8 +27,7 @@ public: [[nodiscard]] std::string GetDescription() const; [[nodiscard]] float GetPixelSize_mm() const; [[nodiscard]] const std::vector &GetGainCalibration() const; - - operator JFJochProtoBuf::Detector() const; + [[nodiscard]] int64_t GetUDPInterfaceCount() const; }; diff --git a/common/DiffractionExperiment.cpp b/common/DiffractionExperiment.cpp index 5a78e243..b8f71b53 100644 --- a/common/DiffractionExperiment.cpp +++ b/common/DiffractionExperiment.cpp @@ -16,98 +16,88 @@ DiffractionExperiment::DiffractionExperiment() : DiffractionExperiment(DetectorGeometry(8, 2)) {} -DiffractionExperiment::DiffractionExperiment(const DetectorSetup& det_setup) { - dataset.set_photon_energy_kev(WVL_1A_IN_KEV); - dataset.set_detector_distance_mm(100); +DiffractionExperiment::DiffractionExperiment(const DetectorSetup& det_setup) : detector(det_setup) { + dataset.photon_energy_keV = WVL_1A_IN_KEV; + dataset.detector_distance_mm = 100; - dataset.set_data_file_count(1); - dataset.set_file_prefix("test"); + dataset.data_file_count = 1; + dataset.file_prefix = "test"; - dataset.set_ntrigger(1); - dataset.set_images_per_trigger(1); - dataset.set_summation(1); - dataset.set_fpga_pixel_output(JFJochProtoBuf::AUTO); - dataset.set_space_group_number(0); // not set + dataset.ntrigger = 1; + dataset.images_per_trigger = 1; + dataset.summation = 1; + dataset.fpga_pixel_output = FPGAPixelOutput::Auto; + dataset.space_group_number = 0; // not set - dataset.set_compression(JFJochProtoBuf::BSHUF_LZ4); + dataset.compression = CompressionAlgorithm::BSHUF_LZ4; - dataset.set_rad_int_polarization_corr(false); - dataset.set_rad_int_solid_angle_corr(false); - dataset.set_save_calibration(false); + dataset.rad_int_polarization_corr = false; + dataset.rad_int_solid_angle_corr = false; + dataset.save_calibration = false; - internal.set_debug_pixel_mask(false); + internal_fpga_packet_generator = false; - internal.set_ndatastreams(1); + debug_pixel_mask = false; - internal.set_frame_time_us(MIN_FRAME_TIME_HALF_SPEED_IN_US); - internal.set_count_time_us(MIN_FRAME_TIME_HALF_SPEED_IN_US - READOUT_TIME_IN_US); - internal.set_frame_time_pedestalg1g2_us(FRAME_TIME_PEDE_G1G2_IN_US); + ndatastreams = 1; - internal.set_mask_chip_edges(false); - internal.set_mask_module_edges(false); + frame_time = std::chrono::microseconds(MIN_FRAME_TIME_HALF_SPEED_IN_US); + count_time = std::chrono::microseconds(MIN_FRAME_TIME_HALF_SPEED_IN_US - READOUT_TIME_IN_US); + frame_time_pedestalG1G2 = std::chrono::microseconds(FRAME_TIME_PEDE_G1G2_IN_US); - internal.set_preview_period_us(1000*1000); // 1s / 1 Hz + mask_chip_edges = false; + mask_module_edges = false; - internal.set_low_q(0.1); - internal.set_high_q(5.0); - internal.set_q_spacing(0.05); + preview_period = std::chrono::microseconds(1000*1000); // 1s / 1 Hz - internal.set_ipv4_base_addr(0x0132010a); - internal.set_git_sha1(jfjoch_git_sha1()); - internal.set_git_date(jfjoch_git_date()); + low_q = 0.1; + high_q = 5.0; + q_spacing = 0.05; + + ipv4_base_addr = 0x0132010a; + git_sha1 = jfjoch_git_sha1(); + git_date = jfjoch_git_date(); + + storage_cells = 1; + storage_cell_start = 15; + storage_cell_delay = std::chrono::nanoseconds(10*1000); + + pedestal_g0_frames = 0; + pedestal_g1_frames = 0; + pedestal_g2_frames = 0; - internal.set_storage_cells(1); - internal.set_storage_cell_start(15); - internal.set_storage_cell_delay_ns(10*1000); - Detector(det_setup); Mode(DetectorMode::Conversion); } // setter functions DiffractionExperiment &DiffractionExperiment::Detector(const DetectorSetup &input) { - *internal.mutable_detector() = input; + detector = input; return *this; } DiffractionExperiment &DiffractionExperiment::Mode(DetectorMode input) { - switch (input) { - case DetectorMode::Conversion: - internal.set_mode(JFJochProtoBuf::CONVERSION); - break; - case DetectorMode::Raw: - internal.set_mode(JFJochProtoBuf::RAW); - break; - case DetectorMode::PedestalG0: - internal.set_mode(JFJochProtoBuf::PEDESTAL_G0); - break; - case DetectorMode::PedestalG1: - internal.set_mode(JFJochProtoBuf::PEDESTAL_G1); - break; - case DetectorMode::PedestalG2: - internal.set_mode(JFJochProtoBuf::PEDESTAL_G2); - break; - } + mode = input; return *this; } DiffractionExperiment &DiffractionExperiment::DataStreams(int64_t input) { check_max("Number of data streams", input, 16); check_min("Number of data streams", input, 1); - internal.set_ndatastreams(input); + ndatastreams = input; return *this; } DiffractionExperiment &DiffractionExperiment::ImagesPerTrigger(int64_t input) { check_max("Total number of images", input, 10*1000*1000); check_min("Total number of images", input, 0); - dataset.set_images_per_trigger(input); + dataset.images_per_trigger = input; return *this; } DiffractionExperiment &DiffractionExperiment::NumTriggers(int64_t input) { check_max("Total number of triggers", input, 10*1000*1000); check_min("Total number of triggers", input, 1); - dataset.set_ntrigger(input); + dataset.ntrigger = input; return *this; } @@ -120,37 +110,36 @@ DiffractionExperiment &DiffractionExperiment::FrameTime(std::chrono::microsecond check_min("Count time (us)", in_count_time.count(), MIN_COUNT_TIME_IN_US); } - internal.set_frame_time_us(in_frame_time.count()); + frame_time = in_frame_time; if (in_count_time.count() == 0) - internal.set_count_time_us(in_frame_time.count() - READOUT_TIME_IN_US); + count_time = in_frame_time - std::chrono::microseconds(READOUT_TIME_IN_US); else - internal.set_count_time_us(in_count_time.count()); + count_time = in_count_time; return *this; } DiffractionExperiment &DiffractionExperiment::PedestalG1G2FrameTime(std::chrono::microseconds input) { check_min("Pedestal G1G2 frame time (us) ", input.count(), MIN_FRAME_TIME_FULL_SPEED_IN_US); - internal.set_frame_time_pedestalg1g2_us(input.count()); + frame_time_pedestalG1G2 = input; return *this; } DiffractionExperiment &DiffractionExperiment::PedestalG0Frames(int64_t input) { check_min("Pedestal G0 frames", input, 0); - // Max? - internal.set_pedestal_g0_frames(input); + pedestal_g0_frames = input; return *this; } DiffractionExperiment &DiffractionExperiment::PedestalG1Frames(int64_t input) { check_min("Pedestal G1 frames", input, 0); - internal.set_pedestal_g1_frames(input); + pedestal_g1_frames = input; return *this; } DiffractionExperiment &DiffractionExperiment::PedestalG2Frames(int64_t input) { check_min("Pedestal G2 frames", input, 0); - internal.set_pedestal_g2_frames(input); + pedestal_g2_frames = input; return *this; } @@ -158,23 +147,23 @@ DiffractionExperiment &DiffractionExperiment::PedestalG2Frames(int64_t input) { DiffractionExperiment &DiffractionExperiment::PhotonEnergy_keV(float input) { check_min("Energy (keV)", input, MIN_ENERGY); check_max("Energy (keV)", input, MAX_ENERGY); - dataset.set_photon_energy_kev(input); + dataset.photon_energy_keV = input; return *this; } DiffractionExperiment &DiffractionExperiment::BeamX_pxl(float input) { - dataset.set_beam_x_pxl(input); + dataset.beam_x_pxl = input; return *this; } DiffractionExperiment &DiffractionExperiment::BeamY_pxl(float input) { - dataset.set_beam_y_pxl(input); + dataset.beam_y_pxl = input; return *this; } DiffractionExperiment &DiffractionExperiment::DetectorDistance_mm(float input) { check_min("Detector distance (mm)", input, 1); - dataset.set_detector_distance_mm(input); + dataset.detector_distance_mm = input; return *this; } @@ -191,117 +180,97 @@ DiffractionExperiment &DiffractionExperiment::FilePrefix(std::string input) { "Path cannot contain /../"); if ((input.find("_master.h5") == input.length() - 10) && (input.length() > 10)) - dataset.set_file_prefix(input.substr(0, input.length() - 10)); + dataset.file_prefix = input.substr(0, input.length() - 10); else - dataset.set_file_prefix(input); + dataset.file_prefix = input; return *this; } DiffractionExperiment &DiffractionExperiment::DataFileCount(int64_t input) { check_min("File count", input, 1); check_max("File count", input, 1000); - dataset.set_data_file_count(input); + dataset.data_file_count = input; return *this; } DiffractionExperiment &DiffractionExperiment::UseInternalPacketGenerator(bool input) { - internal.set_internal_fpga_packet_generator(input); + internal_fpga_packet_generator = input; return *this; } DiffractionExperiment &DiffractionExperiment::IPv4BaseAddr(std::string input) { - internal.set_ipv4_base_addr(IPv4AddressFromStr(input)); + ipv4_base_addr = IPv4AddressFromStr(input); return *this; } DiffractionExperiment &DiffractionExperiment::MaskModuleEdges(bool input) { - internal.set_mask_module_edges(input); + mask_module_edges = input; return *this; } DiffractionExperiment &DiffractionExperiment::Compression(CompressionAlgorithm input) { - switch (input) { - case CompressionAlgorithm::NO_COMPRESSION: - dataset.set_compression(JFJochProtoBuf::NO_COMPRESSION); - break; - case CompressionAlgorithm::BSHUF_LZ4: - dataset.set_compression(JFJochProtoBuf::BSHUF_LZ4); - break; - case CompressionAlgorithm::BSHUF_ZSTD: - dataset.set_compression(JFJochProtoBuf::BSHUF_ZSTD); - break; - case CompressionAlgorithm::BSHUF_ZSTD_RLE: - dataset.set_compression(JFJochProtoBuf::BSHUF_ZSTD_RLE); - break; - } + dataset.compression = input; return *this; } DiffractionExperiment &DiffractionExperiment::MaskChipEdges(bool input) { - internal.set_mask_chip_edges(input); + mask_chip_edges = input; return *this; } DiffractionExperiment& DiffractionExperiment::LowResForRadialInt_A(float input) { check_min("Low Resolution for radial integration", input, 0.1); check_max("Low Resolution for radial integration", input, 500.0); - internal.set_low_q(2 * static_cast(M_PI) / input); + low_q = 2 * static_cast(M_PI) / input; return *this; } DiffractionExperiment& DiffractionExperiment::HighResForRadialInt_A(float input) { check_min("High Resolution for radial integration", input, 0.1); check_max("High Resolution for radial integration", input, 500.0); - internal.set_high_q(2 * static_cast(M_PI) / input); + high_q = 2 * static_cast(M_PI) / input; return *this; } DiffractionExperiment& DiffractionExperiment::LowQForRadialInt_recipA(float input) { check_min("Low Q for radial integration", input, 0.001); check_max("Low Q for radial integration", input, 10.0); - internal.set_low_q(input); + low_q = input; return *this; } DiffractionExperiment& DiffractionExperiment::HighQForRadialInt_recipA(float input) { check_min("High Q for radial integration", input, 0.001); check_max("High Q for radial integration", input, 10.0); - internal.set_high_q(input); + high_q = input; return *this; } DiffractionExperiment& DiffractionExperiment::QSpacingForRadialInt_recipA(float input) { check_min("Q spacing for radial integration", input, 0.01); - internal.set_q_spacing(input); + q_spacing = input; return *this; } DiffractionExperiment &DiffractionExperiment::SetUnitCell(const UnitCell &cell) { - JFJochProtoBuf::UnitCell tmp; - tmp.set_a(cell.a); - tmp.set_b(cell.b); - tmp.set_c(cell.c); - tmp.set_alpha(cell.alpha); - tmp.set_beta(cell.beta); - tmp.set_gamma(cell.gamma); - *dataset.mutable_unit_cell() = tmp; + dataset.unit_cell = cell; return *this; } DiffractionExperiment &DiffractionExperiment::SetUnitCell() { - dataset.clear_unit_cell(); + dataset.unit_cell.reset(); return *this; } DiffractionExperiment &DiffractionExperiment::PreviewPeriod(std::chrono::microseconds input) { check_min("Preview image generation period", input.count(), 0); - internal.set_preview_period_us(input.count()); + preview_period = input; return *this; } DiffractionExperiment &DiffractionExperiment::SpaceGroupNumber(int64_t input) { check_min("Space group number", input, 0); check_max("Space group number", input, 230); - dataset.set_space_group_number(input); + dataset.space_group_number = input; return *this; } @@ -311,19 +280,19 @@ DiffractionExperiment &DiffractionExperiment::StorageCells(int64_t input) { //if ((input != 1) && (input != 2) && (input != 4) && (input != 8) && (input != 16)) // throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, // "Storage cell count invalid, must be power of 2"); - internal.set_storage_cells(input); + storage_cells = input; return *this; } DiffractionExperiment &DiffractionExperiment::StorageCellStart(int64_t input) { check_min("Start storage cell", input, 0); check_max("Start storage cell", input, 15); - internal.set_storage_cell_start(input); + storage_cell_start = input; return *this; } DiffractionExperiment &DiffractionExperiment::SampleName(std::string input) { - dataset.set_sample_name(input); + dataset.sample_name = input; return *this; } @@ -332,20 +301,20 @@ int64_t DiffractionExperiment::GetNumTriggers() const { switch (GetDetectorMode()) { case DetectorMode::Conversion: case DetectorMode::Raw: - return dataset.ntrigger(); + return dataset.ntrigger; case DetectorMode::PedestalG0: if (GetPedestalWithExternalTrigger()) - return internal.pedestal_g0_frames(); + return pedestal_g0_frames; else return 1; case DetectorMode::PedestalG1: if (GetPedestalWithExternalTrigger()) - return internal.pedestal_g1_frames(); + return pedestal_g1_frames; else return 1; case DetectorMode::PedestalG2: if (GetPedestalWithExternalTrigger()) - return internal.pedestal_g2_frames(); + return pedestal_g2_frames; else return 1; default: @@ -354,31 +323,19 @@ int64_t DiffractionExperiment::GetNumTriggers() const { } DetectorMode DiffractionExperiment::GetDetectorMode() const { - switch (internal.mode()) { - case JFJochProtoBuf::RAW: - return DetectorMode::Raw; - case JFJochProtoBuf::PEDESTAL_G0: - return DetectorMode::PedestalG0; - case JFJochProtoBuf::PEDESTAL_G1: - return DetectorMode::PedestalG1; - case JFJochProtoBuf::PEDESTAL_G2: - return DetectorMode::PedestalG2; - default: - case JFJochProtoBuf::CONVERSION: - return DetectorMode::Conversion; - } + return mode; } std::chrono::microseconds DiffractionExperiment::GetFrameTime() const { switch (GetDetectorMode()) { case DetectorMode::PedestalG1: case DetectorMode::PedestalG2: - return std::chrono::microseconds(internal.frame_time_pedestalg1g2_us()); + return frame_time_pedestalG1G2; case DetectorMode::Conversion: case DetectorMode::Raw: case DetectorMode::PedestalG0: default: - return std::chrono::microseconds(internal.frame_time_us()); + return frame_time; } } @@ -386,7 +343,7 @@ std::chrono::microseconds DiffractionExperiment::GetImageTime() const { switch (GetDetectorMode()) { case DetectorMode::PedestalG1: case DetectorMode::PedestalG2: - return std::chrono::microseconds(internal.frame_time_pedestalg1g2_us()); + return frame_time_pedestalG1G2; case DetectorMode::Conversion: case DetectorMode::Raw: return GetFrameTime() * GetSummation(); @@ -400,12 +357,12 @@ int64_t DiffractionExperiment::GetImageNum() const { switch (GetDetectorMode()) { case DetectorMode::Conversion: case DetectorMode::Raw: - return GetImageNumPerTrigger() * GetNumTriggers(); + return GetImageNumPerTrigger() * GetNumTriggers(); case DetectorMode::PedestalG0: case DetectorMode::PedestalG1: case DetectorMode::PedestalG2: default: - return 0; + return 0; } } @@ -435,26 +392,26 @@ int64_t DiffractionExperiment::GetFrameNumPerTrigger() const { if (GetStorageCellNumber() > 1) return GetStorageCellNumber(); else - return dataset.images_per_trigger() * GetSummation(); + return dataset.images_per_trigger * GetSummation(); case DetectorMode::PedestalG0: if (GetPedestalWithExternalTrigger()) return GetStorageCellNumber(); - return internal.pedestal_g0_frames() * GetStorageCellNumber(); + return pedestal_g0_frames * GetStorageCellNumber(); case DetectorMode::PedestalG1: if (GetPedestalWithExternalTrigger()) return GetStorageCellNumber(); - return internal.pedestal_g1_frames() * GetStorageCellNumber(); + return pedestal_g1_frames * GetStorageCellNumber(); case DetectorMode::PedestalG2: if (GetPedestalWithExternalTrigger()) return GetStorageCellNumber(); - return internal.pedestal_g2_frames() * GetStorageCellNumber(); + return pedestal_g2_frames * GetStorageCellNumber(); default: return 0; } } std::chrono::microseconds DiffractionExperiment::GetFrameCountTime() const { - return std::chrono::microseconds(internal.count_time_us()); + return count_time; } std::chrono::microseconds DiffractionExperiment::GetImageCountTime() const { @@ -462,47 +419,47 @@ std::chrono::microseconds DiffractionExperiment::GetImageCountTime() const { } int64_t DiffractionExperiment::GetPedestalG0Frames() const { - return internal.pedestal_g0_frames(); + return pedestal_g0_frames; } int64_t DiffractionExperiment::GetPedestalG1Frames() const { - return internal.pedestal_g1_frames(); + return pedestal_g1_frames; } int64_t DiffractionExperiment::GetPedestalG2Frames() const { - return internal.pedestal_g2_frames(); + return pedestal_g2_frames; } float DiffractionExperiment::GetPhotonEnergy_keV() const { - return dataset.photon_energy_kev(); + return dataset.photon_energy_keV; } float DiffractionExperiment::GetWavelength_A() const { - return WVL_1A_IN_KEV / dataset.photon_energy_kev(); + return WVL_1A_IN_KEV / dataset.photon_energy_keV; } float DiffractionExperiment::GetBeamX_pxl() const { - return dataset.beam_x_pxl(); + return dataset.beam_x_pxl; } float DiffractionExperiment::GetBeamY_pxl() const { - return dataset.beam_y_pxl(); + return dataset.beam_y_pxl; } float DiffractionExperiment::GetDetectorDistance_mm() const { - return dataset.detector_distance_mm(); + return dataset.detector_distance_mm; } Coord DiffractionExperiment::GetScatteringVector() const { - return {0,0,dataset.photon_energy_kev() / WVL_1A_IN_KEV}; + return {0,0,dataset.photon_energy_keV / WVL_1A_IN_KEV}; } std::string DiffractionExperiment::GetFilePrefix() const { - return dataset.file_prefix(); + return dataset.file_prefix; } int64_t DiffractionExperiment::GetDataFileCount() const { - return dataset.data_file_count(); + return dataset.data_file_count; } CompressionAlgorithm DiffractionExperiment::GetCompressionAlgorithm() const { @@ -510,46 +467,36 @@ CompressionAlgorithm DiffractionExperiment::GetCompressionAlgorithm() const { // Compression not supported for raw data and pedestal return CompressionAlgorithm::NO_COMPRESSION; - switch (dataset.compression()) { - case JFJochProtoBuf::BSHUF_LZ4: - return CompressionAlgorithm::BSHUF_LZ4; - case JFJochProtoBuf::BSHUF_ZSTD: - return CompressionAlgorithm::BSHUF_ZSTD; - case JFJochProtoBuf::BSHUF_ZSTD_RLE: - return CompressionAlgorithm::BSHUF_ZSTD_RLE; - default: - return CompressionAlgorithm::NO_COMPRESSION; - } + return dataset.compression; } int64_t DiffractionExperiment::GetPixelDepth() const { switch (GetFPGAOutputMode()) { - case JFJochProtoBuf::INT16: - case JFJochProtoBuf::UINT16: + case FPGAPixelOutput::Int16: + case FPGAPixelOutput::Uint16: return 2; - case JFJochProtoBuf::AUTO: + default: + case FPGAPixelOutput::Auto: if (GetSummation() > 2) return 4; else return 2; - default: - case JFJochProtoBuf::INT32: - case JFJochProtoBuf::UINT32: + case FPGAPixelOutput::Int32: + case FPGAPixelOutput::Uint32: return 4; } - } bool DiffractionExperiment::IsPixelSigned() const { switch (GetFPGAOutputMode()) { - case JFJochProtoBuf::INT16: - case JFJochProtoBuf::INT32: + case FPGAPixelOutput::Int16: + case FPGAPixelOutput::Int32: return true; - case JFJochProtoBuf::UINT16: - case JFJochProtoBuf::UINT32: + case FPGAPixelOutput::Uint16: + case FPGAPixelOutput::Uint32: return false; default: - case JFJochProtoBuf::AUTO: + case FPGAPixelOutput::Auto: if (GetDetectorMode() == DetectorMode::Conversion) return true; else @@ -558,17 +505,17 @@ bool DiffractionExperiment::IsPixelSigned() const { } int64_t DiffractionExperiment::GetDataStreamsNum() const { - return std::min(internal.ndatastreams(), internal.detector().nmodules()); + return std::min(ndatastreams, detector.GetModulesNum()); } int64_t DiffractionExperiment::GetModulesNum(uint16_t data_stream) const { if (data_stream == TASK_NO_DATA_STREAM) - return internal.detector().nmodules(); + return detector.GetModulesNum(); if (data_stream >= GetDataStreamsNum()) throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, "Non existing data stream"); - return (internal.detector().nmodules() + (GetDataStreamsNum() - 1) - data_stream) / GetDataStreamsNum(); + return (detector.GetModulesNum() + (GetDataStreamsNum() - 1) - data_stream) / GetDataStreamsNum(); } int64_t DiffractionExperiment::GetFirstModuleOfDataStream(uint16_t data_stream) const { @@ -592,14 +539,14 @@ int64_t DiffractionExperiment::GetXPixelsNum() const { if (GetDetectorMode() != DetectorMode::Conversion) return RAW_MODULE_COLS; else - return internal.detector().geometry().width_pxl(); + return detector.GetGeometry().GetWidth(); } int64_t DiffractionExperiment::GetYPixelsNum() const { if (GetDetectorMode() != DetectorMode::Conversion) return RAW_MODULE_LINES * GetModulesNum(); else - return internal.detector().geometry().height_pxl(); + return detector.GetGeometry().GetHeight(); } int64_t DiffractionExperiment::GetPixel0OfModule(uint16_t module_number) const { @@ -609,7 +556,7 @@ int64_t DiffractionExperiment::GetPixel0OfModule(uint16_t module_number) const { if (GetDetectorMode() != DetectorMode::Conversion) return RAW_MODULE_SIZE * module_number; else - return internal.detector().geometry().module_geometry(module_number).pixel0(); + return detector.GetGeometry().GetPixel0(module_number); } int64_t DiffractionExperiment::GetOverflow() const { @@ -627,7 +574,7 @@ int64_t DiffractionExperiment::GetUnderflow() const { } std::chrono::microseconds DiffractionExperiment::GetPreviewPeriod() const { - return std::chrono::microseconds(internal.preview_period_us()); + return preview_period; } int64_t DiffractionExperiment::GetPreviewStride() const { @@ -651,7 +598,7 @@ int64_t DiffractionExperiment::GetPreviewStride(std::chrono::microseconds period } bool DiffractionExperiment::IsUsingInternalPacketGen() const { - return internal.internal_fpga_packet_generator(); + return internal_fpga_packet_generator; } uint32_t DiffractionExperiment::GetSrcIPv4Address(uint32_t data_stream, uint32_t half_module) const { @@ -662,43 +609,39 @@ uint32_t DiffractionExperiment::GetSrcIPv4Address(uint32_t data_stream, uint32_t uint32_t host = half_module + 2 * GetFirstModuleOfDataStream(data_stream); - return internal.ipv4_base_addr() + (host << 24); + return ipv4_base_addr + (host << 24); } bool DiffractionExperiment::CheckGitSha1Consistent() const { - return (internal.git_sha1() == jfjoch_git_sha1()); + return (git_sha1 == jfjoch_git_sha1()); } std::string DiffractionExperiment::CheckGitSha1Msg() const { - if (internal.git_sha1() == jfjoch_git_sha1()) + if (git_sha1 == jfjoch_git_sha1()) return ""; else { return "Local component git repo is rev. " + jfjoch_git_sha1().substr(0,6) + " (" + jfjoch_git_date() +") remote component repo is rev. " - + internal.git_sha1().substr(0,6) + " (" + internal.git_date() + ")"; + + git_sha1.substr(0,6) + " (" + git_date + ")"; } } bool DiffractionExperiment::GetMaskModuleEdges() const { - return internal.mask_module_edges(); + return mask_module_edges; } bool DiffractionExperiment::GetMaskChipEdges() const { - return internal.mask_chip_edges(); + return mask_chip_edges; } UnitCell DiffractionExperiment::GetUnitCell() const { - return { - .a = dataset.unit_cell().a(), - .b = dataset.unit_cell().b(), - .c = dataset.unit_cell().c(), - .alpha = dataset.unit_cell().alpha(), - .beta = dataset.unit_cell().beta(), - .gamma = dataset.unit_cell().gamma() - }; + if (dataset.unit_cell.has_value()) + return dataset.unit_cell.value(); + else + throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Cannot return empty unit cell"); } bool DiffractionExperiment::HasUnitCell() const { - return dataset.has_unit_cell(); + return dataset.unit_cell.has_value(); } Coord DiffractionExperiment::LabCoord(float detector_x, float detector_y) const { @@ -709,35 +652,35 @@ Coord DiffractionExperiment::LabCoord(float detector_x, float detector_y) const } int64_t DiffractionExperiment::GetSpaceGroupNumber() const { - return dataset.space_group_number(); + return dataset.space_group_number; } int64_t DiffractionExperiment::GetStorageCellNumber() const { switch (GetDetectorMode()) { case DetectorMode::PedestalG1: case DetectorMode::PedestalG2: - if (internal.storage_cells() > 1) + if (storage_cells > 1) return 2; else return 1; default: - return internal.storage_cells(); + return storage_cells; } } int64_t DiffractionExperiment::GetStorageCellStart() const { - return internal.storage_cell_start(); + return storage_cell_start; } float DiffractionExperiment::GetLowQForRadialInt_recipA() const { - return internal.low_q(); + return low_q; } float DiffractionExperiment::GetHighQForRadialInt_recipA() const { - return internal.high_q(); + return high_q; } float DiffractionExperiment::GetQSpacingForRadialInt_recipA() const { - return internal.q_spacing(); + return q_spacing; } int64_t DiffractionExperiment::GetMaxSpotCount() const { @@ -745,7 +688,7 @@ int64_t DiffractionExperiment::GetMaxSpotCount() const { } std::string DiffractionExperiment::GetSampleName() const { - return dataset.sample_name(); + return dataset.sample_name; } // Create ProtoBuf structures @@ -754,7 +697,23 @@ DiffractionExperiment::operator JFJochProtoBuf::DetectorInput() const { JFJochProtoBuf::DetectorInput ret; ret.set_modules_num(GetModulesNum()); - ret.set_mode(internal.mode()); + switch (GetDetectorMode()) { + case DetectorMode::Conversion: + ret.set_mode(JFJochProtoBuf::CONVERSION); + break; + case DetectorMode::Raw: + ret.set_mode(JFJochProtoBuf::RAW); + break; + case DetectorMode::PedestalG0: + ret.set_mode(JFJochProtoBuf::PEDESTAL_G0); + break; + case DetectorMode::PedestalG1: + ret.set_mode(JFJochProtoBuf::PEDESTAL_G1); + break; + case DetectorMode::PedestalG2: + ret.set_mode(JFJochProtoBuf::PEDESTAL_G2); + break; + } if (GetNumTriggers() == 1) { ret.set_num_frames(GetFrameNumPerTrigger() + DELAY_FRAMES_STOP_AND_QUIT); @@ -791,14 +750,15 @@ JFJochProtoBuf::DetectorConfig DiffractionExperiment::DetectorConfig(const std:: throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, "Number of FPGA boards in the receiver is less then necessary"); - if (!internal.detector().module_hostname().empty() && (internal.detector().module_hostname_size() != GetModulesNum())) + if (!detector.GetDetectorModuleHostname().empty() && (detector.GetDetectorModuleHostname().size() != GetModulesNum())) throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, "Inconsistent number of modules and detector module host names"); - if (!internal.detector().module_hostname().empty()) - *ret.mutable_module_hostname() = internal.detector().module_hostname(); + if (!detector.GetDetectorModuleHostname().empty()) + *ret.mutable_module_hostname() = {detector.GetDetectorModuleHostname().begin(), + detector.GetDetectorModuleHostname().end()}; - ret.set_udp_interface_count(internal.detector().udp_interface_count()); + ret.set_udp_interface_count(detector.GetUDPInterfaceCount()); for (int d = 0; d < GetDataStreamsNum(); d++) { for (int m = 0; m < GetModulesNum(d); m++) { @@ -818,11 +778,12 @@ JFJochProtoBuf::DetectorConfig DiffractionExperiment::DetectorConfig(const std:: } void DiffractionExperiment::LoadDatasetSettings(const JFJochProtoBuf::DatasetSettings &settings) { + // TODO Fix // Save DatasetSettings - if something goes wrong, restore old settings auto tmp = dataset; try { - dataset = JFJochProtoBuf::DatasetSettings(); + // dataset = JFJochProtoBuf::DatasetSettings(); ImagesPerTrigger(settings.images_per_trigger()); NumTriggers(settings.ntrigger()); BeamX_pxl(settings.beam_x_pxl()); @@ -862,7 +823,24 @@ void DiffractionExperiment::LoadDatasetSettings(const JFJochProtoBuf::DatasetSet Summation(1); else Summation(settings.summation()); - FPGAOutputMode(settings.fpga_pixel_output()); + switch (settings.fpga_pixel_output()) { + default: + case JFJochProtoBuf::AUTO: + FPGAOutputMode(FPGAPixelOutput::Auto); + break; + case JFJochProtoBuf::INT16: + FPGAOutputMode(FPGAPixelOutput::Int16); + break; + case JFJochProtoBuf::UINT16: + FPGAOutputMode(FPGAPixelOutput::Uint16); + break; + case JFJochProtoBuf::INT32: + FPGAOutputMode(FPGAPixelOutput::Int32); + break; + case JFJochProtoBuf::UINT32: + FPGAOutputMode(FPGAPixelOutput::Uint32); + break; + } } catch (...) { dataset = tmp; throw; @@ -870,7 +848,8 @@ void DiffractionExperiment::LoadDatasetSettings(const JFJochProtoBuf::DatasetSet } void DiffractionExperiment::LoadDetectorSettings(const JFJochProtoBuf::DetectorSettings &settings) { - auto tmp = internal; + // TODO: Fix!!! + //auto tmp = internal; try { if (settings.count_time_us() > 0) FrameTime(std::chrono::microseconds(settings.frame_time_us()), @@ -887,14 +866,12 @@ void DiffractionExperiment::LoadDetectorSettings(const JFJochProtoBuf::DetectorS Mode(DetectorMode::Conversion); PedestalG0Frames(settings.pedestal_g0_frames()); - PedestalG1Frames(settings.pedestal_g1_frames()); - PedestalG2Frames(settings.pedestal_g2_frames()); if (settings.storage_cell_delay_ns() > 0) StorageCellDelay(std::chrono::nanoseconds(settings.storage_cell_delay_ns())); } catch (...) { - internal = tmp; + // internal = tmp; throw; } } @@ -1002,78 +979,78 @@ void DiffractionExperiment::FillMessage(StartMessage &message) const { } DiffractionExperiment &DiffractionExperiment::ApplyPixelMaskInFPGA(bool input) { - internal.set_debug_pixel_mask(!input); + debug_pixel_mask = !input; return *this; } bool DiffractionExperiment::GetApplyPixelMaskInFPGA() const { if (GetDetectorMode() == DetectorMode::Conversion) - return !internal.debug_pixel_mask(); + return !debug_pixel_mask; else return false; } float DiffractionExperiment::GetPixelSize_mm() const { - return internal.detector().pixel_size_mm(); + return detector.GetPixelSize_mm(); } DiffractionExperiment &DiffractionExperiment::SourceName(std::string input) { - internal.set_source_name(input); + source_name = input; return *this; } DiffractionExperiment &DiffractionExperiment::SourceNameShort(std::string input) { - internal.set_source_name_short(input); + source_name_short = input; return *this; } DiffractionExperiment &DiffractionExperiment::InstrumentName(std::string input) { - internal.set_instrument_name(input); + instrument_name = input; return *this; } DiffractionExperiment &DiffractionExperiment::InstrumentNameShort(std::string input) { - internal.set_instrument_name_short(input); + instrument_name_short = input; return *this; } std::string DiffractionExperiment::GetSourceName() const { - return internal.source_name(); + return source_name; } std::string DiffractionExperiment::GetSourceNameShort() const { - return internal.source_name_short(); + return source_name_short; } std::string DiffractionExperiment::GetInstrumentName() const { - return internal.instrument_name(); + return instrument_name; } std::string DiffractionExperiment::GetInstrumentNameShort() const { - return internal.instrument_name_short(); + return instrument_name_short; } int64_t DiffractionExperiment::GetModuleFastDirectionStep(uint16_t module_number) const { if (module_number >= GetModulesNum()) throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, "Module number out of bounds"); - return internal.detector().geometry().module_geometry(module_number).fast_direction_step(); + return detector.GetGeometry().GetFastDirectionStep(module_number); } int64_t DiffractionExperiment::GetModuleSlowDirectionStep(uint16_t module_number) const { if (module_number >= GetModulesNum()) throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, "Module number out of bounds"); - return internal.detector().geometry().module_geometry(module_number).slow_direction_step(); + return detector.GetGeometry().GetSlowDirectionStep(module_number); } void DiffractionExperiment::GetDetectorModuleHostname(std::vector &output) const { - for (const auto &iter: internal.detector().module_hostname()) + for (const auto &iter: detector.GetDetectorModuleHostname()) output.push_back(iter); } std::string DiffractionExperiment::GetDetectorDescription() const { - return internal.detector().description(); + return detector.GetDescription(); } bool DiffractionExperiment::GetPedestalWithExternalTrigger() const { @@ -1081,55 +1058,55 @@ bool DiffractionExperiment::GetPedestalWithExternalTrigger() const { } DiffractionExperiment &DiffractionExperiment::ApplySolidAngleCorr(bool input) { - dataset.set_rad_int_solid_angle_corr(input); + dataset.rad_int_solid_angle_corr = input; return *this; } DiffractionExperiment &DiffractionExperiment::ApplyPolarizationCorr(bool input) { - dataset.set_rad_int_polarization_corr(input); + dataset.rad_int_polarization_corr = input; return *this; } DiffractionExperiment &DiffractionExperiment::PolarizationFactor(float input) { - dataset.set_rad_int_polarization_factor(input); + dataset.rad_int_polarization_factor = input; return *this; } bool DiffractionExperiment::GetApplySolidAngleCorr() const { - return dataset.rad_int_solid_angle_corr(); + return dataset.rad_int_solid_angle_corr; } bool DiffractionExperiment::GetApplyPolarizationCorr() const { - return dataset.rad_int_polarization_corr(); + return dataset.rad_int_polarization_corr; } float DiffractionExperiment::GetPolarizationFactor() const { - return dataset.rad_int_polarization_factor(); + return dataset.rad_int_polarization_factor; } DiffractionExperiment &DiffractionExperiment::SaveCalibration(bool input) { - dataset.set_save_calibration(input); + dataset.save_calibration = input; return *this; } bool DiffractionExperiment::GetSaveCalibration() const { - return dataset.save_calibration(); + return dataset.save_calibration; } DiffractionExperiment &DiffractionExperiment::StorageCellDelay(std::chrono::nanoseconds input) { check_min("Storage cell delay [ns]", input.count(), MIN_STORAGE_CELL_DELAY_IN_NS); - internal.set_storage_cell_delay_ns(input.count()); + storage_cell_delay = input; return *this; } std::chrono::nanoseconds DiffractionExperiment::GetStorageCellDelay() const { - return std::chrono::nanoseconds(internal.storage_cell_delay_ns()); + return storage_cell_delay; } DiffractionExperiment &DiffractionExperiment::Summation(int64_t input) { check_min("Summation", input, 1); check_max("Summation", input, MAX_FPGA_SUMMATION); - dataset.set_summation(input); + dataset.summation = input; return *this; } @@ -1143,16 +1120,16 @@ int64_t DiffractionExperiment::GetSummation() const { case DetectorMode::Conversion: case DetectorMode::Raw: // FPGA summation for raw data makes zero sense - but it is still available as a means for debug, etc. - return dataset.summation(); + return dataset.summation; } } -DiffractionExperiment &DiffractionExperiment::FPGAOutputMode(const JFJochProtoBuf::FPGAPixelOutput &input) { - dataset.set_fpga_pixel_output(input); +DiffractionExperiment &DiffractionExperiment::FPGAOutputMode(FPGAPixelOutput input) { + dataset.fpga_pixel_output = input; return *this; } -JFJochProtoBuf::FPGAPixelOutput DiffractionExperiment::GetFPGAOutputMode() const { - return dataset.fpga_pixel_output(); +FPGAPixelOutput DiffractionExperiment::GetFPGAOutputMode() const { + return dataset.fpga_pixel_output; } diff --git a/common/DiffractionExperiment.h b/common/DiffractionExperiment.h index 65b5a8d6..7604e07c 100644 --- a/common/DiffractionExperiment.h +++ b/common/DiffractionExperiment.h @@ -17,11 +17,16 @@ #include "../frame_serialize/CBORMessages.h" #include "DetectorSetup.h" #include "../image_analysis/DataProcessingSettings.h" +#include -enum class DetectorMode : int { +enum class DetectorMode { Conversion, Raw, PedestalG0, PedestalG1, PedestalG2 }; +enum class FPGAPixelOutput { + Auto, Int16, Uint16, Int32, Uint32 +}; + struct AcquisitionDeviceNetConfig { std::string mac_addr; std::string ipv4_addr; @@ -29,8 +34,74 @@ struct AcquisitionDeviceNetConfig { }; class DiffractionExperiment { - JFJochProtoBuf::DatasetSettings dataset; - JFJochProtoBuf::InternalSettings internal; + // Internal detector settings + std::chrono::microseconds frame_time_pedestalG1G2; + // uint64 frame_time_pedestalG2_us = 2; reserved + std::chrono::microseconds frame_time; + std::chrono::microseconds count_time; + + DetectorSetup detector; + + int64_t ndatastreams; + + bool internal_fpga_packet_generator; + int64_t storage_cells; + int64_t storage_cell_start; + std::chrono::nanoseconds storage_cell_delay; + int64_t pedestal_g0_frames; + int64_t pedestal_g1_frames; + int64_t pedestal_g2_frames; + + std::chrono::microseconds preview_period; + + DetectorMode mode; + bool mask_module_edges; + bool mask_chip_edges; + + int64_t ipv4_base_addr; + + float low_q; + float high_q; + float q_spacing; + + std::string git_sha1; + std::string git_date; + + std::string source_name; + std::string source_name_short; + std::string instrument_name; + std::string instrument_name_short; + + bool debug_pixel_mask; + + // Dataset settings + struct { + int64_t images_per_trigger; + int64_t ntrigger; + + FPGAPixelOutput fpga_pixel_output; + int64_t summation; + + float beam_x_pxl; + float beam_y_pxl; + float detector_distance_mm; + float photon_energy_keV; + + std::string file_prefix; + int64_t data_file_count; + + CompressionAlgorithm compression; + + std::string sample_name; + std::optional unit_cell; + int64_t space_group_number; + + bool rad_int_solid_angle_corr; + bool rad_int_polarization_corr; + float rad_int_polarization_factor; + + bool save_calibration; + } dataset; constexpr static const int64_t max_spot_count = 100; public: @@ -87,10 +158,9 @@ public: DiffractionExperiment& InstrumentNameShort(std::string input); DiffractionExperiment& ApplyPixelMaskInFPGA(bool input); - operator JFJochProtoBuf::DetectorInput() const; - void FillMessage(StartMessage &message) const; + operator JFJochProtoBuf::DetectorInput() const; JFJochProtoBuf::DetectorConfig DetectorConfig(const std::vector& net_config) const; void LoadDatasetSettings(const JFJochProtoBuf::DatasetSettings &settings); void LoadDetectorSettings(const JFJochProtoBuf::DetectorSettings &settings); @@ -207,8 +277,8 @@ public: DiffractionExperiment& Summation(int64_t input); int64_t GetSummation() const; - DiffractionExperiment& FPGAOutputMode(const JFJochProtoBuf::FPGAPixelOutput& input); - JFJochProtoBuf::FPGAPixelOutput GetFPGAOutputMode() const; + DiffractionExperiment& FPGAOutputMode(FPGAPixelOutput input); + FPGAPixelOutput GetFPGAOutputMode() const; }; inline int64_t CalculateStride(const std::chrono::microseconds &frame_time, const std::chrono::microseconds &preview_time) { diff --git a/grpc/jfjoch.proto b/grpc/jfjoch.proto index e36fcb86..6d368bb1 100644 --- a/grpc/jfjoch.proto +++ b/grpc/jfjoch.proto @@ -117,68 +117,6 @@ message DetectorSettings { int64 storage_cell_delay_ns = 10; } -message DetectorModuleGeometry { - int64 pixel0 = 1; - int64 fast_direction_step = 2; - int64 slow_direction_step = 3; -} - -message DetectorGeometry { - int64 width_pxl = 1; - int64 height_pxl = 2; - repeated DetectorModuleGeometry module_geometry = 3; -} - -message Detector { - int64 nmodules = 1; - string description = 2; - float pixel_size_mm = 3; - repeated string module_hostname = 4; - DetectorGeometry geometry = 5; - int64 udp_interface_count = 7; -} - -message InternalSettings { - int64 frame_time_pedestalG1G2_us = 1; - // uint64 frame_time_pedestalG2_us = 2; reserved - int64 frame_time_us = 3; - int64 count_time_us = 4; - - Detector detector = 5; - - int64 ndatastreams = 6; - - bool internal_fpga_packet_generator = 9; - int64 storage_cells = 10; - int64 storage_cell_start = 11; - int64 storage_cell_delay_ns = 39; - int64 pedestal_g0_frames = 12; - int64 pedestal_g1_frames = 13; - int64 pedestal_g2_frames = 14; - - int64 preview_period_us = 15; - - DetectorMode mode = 19; - bool mask_module_edges = 20; - bool mask_chip_edges = 21; - - int64 ipv4_base_addr = 22; - - float low_q = 26; - float high_q = 27; - float q_spacing = 28; - - string git_sha1 = 29; - string git_date = 30; - - string source_name = 32; - string source_name_short = 33; - string instrument_name = 34; - string instrument_name_short = 35; - - bool debug_pixel_mask = 38; -} - // Calibration message ModuleStatistics { diff --git a/python/jfjoch_pb2.py b/python/jfjoch_pb2.py index 3a72a327..e157cb21 100644 --- a/python/jfjoch_pb2.py +++ b/python/jfjoch_pb2.py @@ -13,25 +13,25 @@ _sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cjfjoch.proto\x12\x0eJFJochProtoBuf\"\x07\n\x05\x45mpty\"W\n\x08UnitCell\x12\t\n\x01\x61\x18\x01 \x01(\x02\x12\t\n\x01\x62\x18\x02 \x01(\x02\x12\t\n\x01\x63\x18\x03 \x01(\x02\x12\r\n\x05\x61lpha\x18\x04 \x01(\x02\x12\x0c\n\x04\x62\x65ta\x18\x05 \x01(\x02\x12\r\n\x05gamma\x18\x06 \x01(\x02\")\n\x06Vector\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\"|\n\x10RotationSettings\x12\x17\n\x0fstart_angle_deg\x18\x01 \x01(\x02\x12 \n\x18\x61ngle_incr_per_image_deg\x18\x02 \x01(\x02\x12-\n\rrotation_axis\x18\x03 \x01(\x0b\x32\x16.JFJochProtoBuf.Vector\"\x1c\n\x04Plot\x12\t\n\x01x\x18\x01 \x03(\x02\x12\t\n\x01y\x18\x02 \x03(\x02\"\xb1\x04\n\x0f\x44\x61tasetSettings\x12\x1a\n\x12images_per_trigger\x18\x01 \x01(\x03\x12\x10\n\x08ntrigger\x18\x02 \x01(\x03\x12:\n\x11\x66pga_pixel_output\x18\x03 \x01(\x0e\x32\x1f.JFJochProtoBuf.FPGAPixelOutput\x12\x11\n\tsummation\x18\x04 \x01(\x03\x12\x12\n\nbeam_x_pxl\x18\x05 \x01(\x02\x12\x12\n\nbeam_y_pxl\x18\x06 \x01(\x02\x12\x1c\n\x14\x64\x65tector_distance_mm\x18\x07 \x01(\x02\x12\x19\n\x11photon_energy_keV\x18\x08 \x01(\x02\x12\x13\n\x0b\x66ile_prefix\x18\t \x01(\t\x12\x17\n\x0f\x64\x61ta_file_count\x18\n \x01(\x03\x12\x30\n\x0b\x63ompression\x18\x0b \x01(\x0e\x32\x1b.JFJochProtoBuf.Compression\x12\x13\n\x0bsample_name\x18\x0c \x01(\t\x12+\n\tunit_cell\x18\r \x01(\x0b\x32\x18.JFJochProtoBuf.UnitCell\x12\x1a\n\x12space_group_number\x18\x0e \x01(\x03\x12 \n\x18rad_int_solid_angle_corr\x18\x12 \x01(\x08\x12!\n\x19rad_int_polarization_corr\x18\x13 \x01(\x08\x12#\n\x1brad_int_polarization_factor\x18\x14 \x01(\x02\x12\x18\n\x10save_calibration\x18\x15 \x01(\x08\"\x90\x02\n\x10\x44\x65tectorSettings\x12\x15\n\rframe_time_us\x18\x01 \x01(\x03\x12\x15\n\rcount_time_us\x18\x02 \x01(\x03\x12\x1a\n\x12storage_cell_count\x18\x03 \x01(\x03\x12%\n\x1duse_internal_packet_generator\x18\x04 \x01(\x08\x12\x18\n\x10\x63ollect_raw_data\x18\x05 \x01(\x08\x12\x1a\n\x12pedestal_g0_frames\x18\x06 \x01(\x03\x12\x1a\n\x12pedestal_g1_frames\x18\x07 \x01(\x03\x12\x1a\n\x12pedestal_g2_frames\x18\x08 \x01(\x03\x12\x1d\n\x15storage_cell_delay_ns\x18\n \x01(\x03\"b\n\x16\x44\x65tectorModuleGeometry\x12\x0e\n\x06pixel0\x18\x01 \x01(\x03\x12\x1b\n\x13\x66\x61st_direction_step\x18\x02 \x01(\x03\x12\x1b\n\x13slow_direction_step\x18\x03 \x01(\x03\"z\n\x10\x44\x65tectorGeometry\x12\x11\n\twidth_pxl\x18\x01 \x01(\x03\x12\x12\n\nheight_pxl\x18\x02 \x01(\x03\x12?\n\x0fmodule_geometry\x18\x03 \x03(\x0b\x32&.JFJochProtoBuf.DetectorModuleGeometry\"\xb2\x01\n\x08\x44\x65tector\x12\x10\n\x08nmodules\x18\x01 \x01(\x03\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x15\n\rpixel_size_mm\x18\x03 \x01(\x02\x12\x17\n\x0fmodule_hostname\x18\x04 \x03(\t\x12\x32\n\x08geometry\x18\x05 \x01(\x0b\x32 .JFJochProtoBuf.DetectorGeometry\x12\x1b\n\x13udp_interface_count\x18\x07 \x01(\x03\"\xdf\x05\n\x10InternalSettings\x12\"\n\x1a\x66rame_time_pedestalG1G2_us\x18\x01 \x01(\x03\x12\x15\n\rframe_time_us\x18\x03 \x01(\x03\x12\x15\n\rcount_time_us\x18\x04 \x01(\x03\x12*\n\x08\x64\x65tector\x18\x05 \x01(\x0b\x32\x18.JFJochProtoBuf.Detector\x12\x14\n\x0cndatastreams\x18\x06 \x01(\x03\x12&\n\x1einternal_fpga_packet_generator\x18\t \x01(\x08\x12\x15\n\rstorage_cells\x18\n \x01(\x03\x12\x1a\n\x12storage_cell_start\x18\x0b \x01(\x03\x12\x1d\n\x15storage_cell_delay_ns\x18\' \x01(\x03\x12\x1a\n\x12pedestal_g0_frames\x18\x0c \x01(\x03\x12\x1a\n\x12pedestal_g1_frames\x18\r \x01(\x03\x12\x1a\n\x12pedestal_g2_frames\x18\x0e \x01(\x03\x12\x19\n\x11preview_period_us\x18\x0f \x01(\x03\x12*\n\x04mode\x18\x13 \x01(\x0e\x32\x1c.JFJochProtoBuf.DetectorMode\x12\x19\n\x11mask_module_edges\x18\x14 \x01(\x08\x12\x17\n\x0fmask_chip_edges\x18\x15 \x01(\x08\x12\x16\n\x0eipv4_base_addr\x18\x16 \x01(\x03\x12\r\n\x05low_q\x18\x1a \x01(\x02\x12\x0e\n\x06high_q\x18\x1b \x01(\x02\x12\x11\n\tq_spacing\x18\x1c \x01(\x02\x12\x10\n\x08git_sha1\x18\x1d \x01(\t\x12\x10\n\x08git_date\x18\x1e \x01(\t\x12\x13\n\x0bsource_name\x18 \x01(\t\x12\x19\n\x11source_name_short\x18! \x01(\t\x12\x17\n\x0finstrument_name\x18\" \x01(\t\x12\x1d\n\x15instrument_name_short\x18# \x01(\t\x12\x18\n\x10\x64\x65\x62ug_pixel_mask\x18& \x01(\x08\"\xed\x01\n\x10ModuleStatistics\x12\x15\n\rmodule_number\x18\x01 \x01(\x03\x12\x1b\n\x13storage_cell_number\x18\x02 \x01(\x03\x12\x18\n\x10pedestal_g0_mean\x18\x03 \x01(\x02\x12\x18\n\x10pedestal_g1_mean\x18\x04 \x01(\x02\x12\x18\n\x10pedestal_g2_mean\x18\x05 \x01(\x02\x12\x14\n\x0cgain_g0_mean\x18\x06 \x01(\x02\x12\x14\n\x0cgain_g1_mean\x18\x07 \x01(\x02\x12\x14\n\x0cgain_g2_mean\x18\x08 \x01(\x02\x12\x15\n\rmasked_pixels\x18\t \x01(\x04\"V\n\x17JFCalibrationStatistics\x12;\n\x11module_statistics\x18\x01 \x03(\x0b\x32 .JFJochProtoBuf.ModuleStatistics\"F\n\x0bPlotRequest\x12&\n\x04type\x18\x01 \x01(\x0e\x32\x18.JFJochProtoBuf.PlotType\x12\x0f\n\x07\x62inning\x18\x02 \x01(\x04\"M\n\x18RadialIntegrationProfile\x12\r\n\x05title\x18\x01 \x01(\t\x12\"\n\x04plot\x18\x02 \x01(\x0b\x32\x14.JFJochProtoBuf.Plot\"W\n\x19RadialIntegrationProfiles\x12:\n\x08profiles\x18\x01 \x03(\x0b\x32(.JFJochProtoBuf.RadialIntegrationProfile\">\n\x0bWriterInput\x12\x1c\n\x14zmq_receiver_address\x18\x01 \x01(\t\x12\x11\n\tseries_id\x18\x02 \x01(\x03\"3\n\x12\x44\x61taFileStatistics\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07nimages\x18\x02 \x01(\x03\"\x8d\x01\n\x0cWriterOutput\x12\x0f\n\x07nimages\x18\x01 \x01(\x03\x12\x17\n\x0fperformance_MBs\x18\x02 \x01(\x02\x12\x16\n\x0eperformance_Hz\x18\x03 \x01(\x02\x12;\n\x0f\x66ile_statistics\x18\x04 \x03(\x0b\x32\".JFJochProtoBuf.DataFileStatistics\"\x82\x02\n\x14\x44\x65tectorModuleConfig\x12\x17\n\x0fudp_dest_port_1\x18\x01 \x01(\x04\x12\x17\n\x0fudp_dest_port_2\x18\x02 \x01(\x04\x12\x17\n\x0fipv4_src_addr_1\x18\x03 \x01(\t\x12\x17\n\x0fipv4_src_addr_2\x18\x04 \x01(\t\x12\x18\n\x10ipv4_dest_addr_1\x18\x05 \x01(\t\x12\x18\n\x10ipv4_dest_addr_2\x18\x06 \x01(\t\x12\x17\n\x0fmac_addr_dest_1\x18\x07 \x01(\t\x12\x17\n\x0fmac_addr_dest_2\x18\x08 \x01(\t\x12 \n\x18module_id_in_data_stream\x18\t \x01(\x04\"}\n\x0e\x44\x65tectorConfig\x12\x35\n\x07modules\x18\x01 \x03(\x0b\x32$.JFJochProtoBuf.DetectorModuleConfig\x12\x17\n\x0fmodule_hostname\x18\x02 \x03(\t\x12\x1b\n\x13udp_interface_count\x18\x03 \x01(\x03\"\xfc\x01\n\rDetectorInput\x12\x13\n\x0bmodules_num\x18\x01 \x01(\x03\x12*\n\x04mode\x18\x02 \x01(\x0e\x32\x1c.JFJochProtoBuf.DetectorMode\x12\x12\n\nnum_frames\x18\x03 \x01(\x03\x12\x14\n\x0cnum_triggers\x18\x04 \x01(\x03\x12\x1b\n\x13storage_cell_number\x18\x05 \x01(\x03\x12\x1a\n\x12storage_cell_start\x18\x06 \x01(\x03\x12\x1d\n\x15storage_cell_delay_ns\x18\x07 \x01(\x03\x12\x11\n\tperiod_us\x18\t \x01(\x03\x12\x15\n\rcount_time_us\x18\n \x01(\x03\"\x10\n\x0e\x44\x65tectorOutput\"b\n\x0e\x44\x65tectorStatus\x12$\n\x05state\x18\x01 \x01(\x0e\x32\x15.JFJochProtoBuf.State\x12\x12\n\nfw_version\x18\x02 \x01(\x03\x12\x16\n\x0eserver_version\x18\x03 \x01(\t\"Q\n\x0e\x46PGAFIFOStatus\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x31\n\x05value\x18\x02 \x01(\x0e\x32\".JFJochProtoBuf.FPGAFIFOStatusEnum\"\xbb\x02\n\x16\x44\x61taProcessingSettings\x12!\n\x19signal_to_noise_threshold\x18\x01 \x01(\x02\x12\x1e\n\x16photon_count_threshold\x18\x02 \x01(\x03\x12\x18\n\x10min_pix_per_spot\x18\x03 \x01(\x03\x12\x18\n\x10max_pix_per_spot\x18\x04 \x01(\x03\x12\x16\n\x0elocal_bkg_size\x18\x05 \x01(\x03\x12\x1d\n\x15high_resolution_limit\x18\x06 \x01(\x02\x12\x1c\n\x14low_resolution_limit\x18\x07 \x01(\x02\x12\x1a\n\x12\x62kg_estimate_low_q\x18\x08 \x01(\x02\x12\x1b\n\x13\x62kg_estimate_high_q\x18\t \x01(\x02\x12\x1c\n\x14preview_indexed_only\x18\n \x01(\x08\"I\n\x05Image\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\r\n\x05width\x18\x02 \x01(\x03\x12\x0e\n\x06height\x18\x03 \x01(\x03\x12\x13\n\x0bpixel_depth\x18\x04 \x01(\x03\".\n\nMaskToLoad\x12\x0c\n\x04mask\x18\x01 \x03(\r\x12\x12\n\nbit_to_set\x18\x02 \x01(\x05\"\xc9\x02\n\x15MeasurementStatistics\x12\x13\n\x0b\x66ile_prefix\x18\x01 \x01(\t\x12\x18\n\x10images_collected\x18\x02 \x01(\x03\x12\x1d\n\x15max_image_number_sent\x18\x03 \x01(\x03\x12\x1d\n\x15\x63ollection_efficiency\x18\x04 \x01(\x02\x12\x19\n\x11\x63ompression_ratio\x18\x05 \x01(\x02\x12\x11\n\tcancelled\x18\x06 \x01(\x08\x12\x19\n\x11max_receive_delay\x18\x07 \x01(\x03\x12\x15\n\rindexing_rate\x18\n \x01(\x02\x12\x16\n\x0e\x64\x65tector_width\x18\x0c \x01(\x03\x12\x17\n\x0f\x64\x65tector_height\x18\r \x01(\x03\x12\x1c\n\x14\x64\x65tector_pixel_depth\x18\x0e \x01(\x03\x12\x14\n\x0c\x62kg_estimate\x18\x10 \x01(\x02\"\x89\x01\n\x0c\x42rokerStatus\x12+\n\x0c\x62roker_state\x18\x01 \x01(\x0e\x32\x15.JFJochProtoBuf.State\x12\x10\n\x08progress\x18\x02 \x01(\x02\x12\x15\n\rindexing_rate\x18\x03 \x01(\x02\x12#\n\x1breceiver_send_buffers_avail\x18\x04 \x01(\x02\"H\n\x13\x44\x65tectorListElement\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x10\n\x08nmodules\x18\x02 \x01(\x03\x12\n\n\x02id\x18\x03 \x01(\x03\"v\n\x0c\x44\x65tectorList\x12\x35\n\x08\x64\x65tector\x18\x01 \x03(\x0b\x32#.JFJochProtoBuf.DetectorListElement\x12\x12\n\ncurrent_id\x18\x02 \x01(\x03\x12\x1b\n\x13\x63urrent_description\x18\x03 \x01(\t\"\x1f\n\x11\x44\x65tectorSelection\x12\n\n\x02id\x18\x01 \x01(\x03*T\n\x0b\x43ompression\x12\r\n\tBSHUF_LZ4\x10\x00\x12\x0e\n\nBSHUF_ZSTD\x10\x01\x12\x12\n\x0e\x42SHUF_ZSTD_RLE\x10\x02\x12\x12\n\x0eNO_COMPRESSION\x10\x03*Z\n\x0c\x44\x65tectorMode\x12\x0e\n\nCONVERSION\x10\x00\x12\x07\n\x03RAW\x10\x01\x12\x0f\n\x0bPEDESTAL_G0\x10\x02\x12\x0f\n\x0bPEDESTAL_G1\x10\x03\x12\x0f\n\x0bPEDESTAL_G2\x10\x04*6\n\x12\x46PGAFIFOStatusEnum\x12\t\n\x05\x45MPTY\x10\x00\x12\x08\n\x04\x46ULL\x10\x01\x12\x0b\n\x07PARTIAL\x10\x02*^\n\x05State\x12\x13\n\x0fNOT_INITIALIZED\x10\x00\x12\x08\n\x04IDLE\x10\x01\x12\x08\n\x04\x42USY\x10\x02\x12\x0c\n\x08PEDESTAL\x10\x03\x12\x13\n\x0f\x44\x41TA_COLLECTION\x10\x04\x12\t\n\x05\x45RROR\x10\x05*I\n\x0f\x46PGAPixelOutput\x12\x08\n\x04\x41UTO\x10\x00\x12\t\n\x05INT16\x10\x01\x12\n\n\x06UINT16\x10\x02\x12\t\n\x05INT32\x10\x03\x12\n\n\x06UINT32\x10\x04*{\n\x08PlotType\x12\x10\n\x0c\x42KG_ESTIMATE\x10\x00\x12\x0b\n\x07RAD_INT\x10\x01\x12\x0e\n\nSPOT_COUNT\x10\x02\x12\x11\n\rINDEXING_RATE\x10\x03\x12\x1a\n\x16INDEXING_RATE_PER_FILE\x10\x04\x12\x11\n\rADU_HISTOGRAM\x10\x05\x32\xca\x01\n\x11gRPC_JFJochWriter\x12=\n\x05Start\x12\x1b.JFJochProtoBuf.WriterInput\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x37\n\x05\x41\x62ort\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12=\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.WriterOutput\"\x00\x32\x82\x03\n\x13gRPC_JFJochDetector\x12?\n\x05Start\x12\x1d.JFJochProtoBuf.DetectorInput\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x36\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x41\n\x06Status\x12\x15.JFJochProtoBuf.Empty\x1a\x1e.JFJochProtoBuf.DetectorStatus\"\x00\x12=\n\x02On\x12\x1e.JFJochProtoBuf.DetectorConfig\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x35\n\x03Off\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x39\n\x07Trigger\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x32\xd4\x0c\n\x11gRPC_JFJochBroker\x12\x41\n\x05Start\x12\x1f.JFJochProtoBuf.DatasetSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x36\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12:\n\x08Pedestal\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12<\n\nInitialize\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x38\n\x06\x43\x61ncel\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12<\n\nDeactivate\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x39\n\x07Trigger\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x42\n\tGetStatus\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.BrokerStatus\"\x00\x12\\\n\x18GetCalibrationStatistics\x12\x15.JFJochProtoBuf.Empty\x1a\'.JFJochProtoBuf.JFCalibrationStatistics\"\x00\x12P\n\x13GetDetectorSettings\x12\x15.JFJochProtoBuf.Empty\x1a .JFJochProtoBuf.DetectorSettings\"\x00\x12P\n\x13PutDetectorSettings\x12 .JFJochProtoBuf.DetectorSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12Z\n\x18GetMeasurementStatistics\x12\x15.JFJochProtoBuf.Empty\x1a%.JFJochProtoBuf.MeasurementStatistics\"\x00\x12\\\n\x19GetDataProcessingSettings\x12\x15.JFJochProtoBuf.Empty\x1a&.JFJochProtoBuf.DataProcessingSettings\"\x00\x12\\\n\x19PutDataProcessingSettings\x12&.JFJochProtoBuf.DataProcessingSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12?\n\x08GetPlots\x12\x1b.JFJochProtoBuf.PlotRequest\x1a\x14.JFJochProtoBuf.Plot\"\x00\x12\x62\n\x1cGetRadialIntegrationProfiles\x12\x15.JFJochProtoBuf.Empty\x1a).JFJochProtoBuf.RadialIntegrationProfiles\"\x00\x12?\n\rGetPedestalG0\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12?\n\rGetPedestalG1\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12?\n\rGetPedestalG2\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12\x39\n\x07GetMask\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12H\n\x0fGetDetectorList\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.DetectorList\"\x00\x12L\n\x0eSelectDetector\x12!.JFJochProtoBuf.DetectorSelection\x1a\x15.JFJochProtoBuf.Empty\"\x00\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cjfjoch.proto\x12\x0eJFJochProtoBuf\"\x07\n\x05\x45mpty\"W\n\x08UnitCell\x12\t\n\x01\x61\x18\x01 \x01(\x02\x12\t\n\x01\x62\x18\x02 \x01(\x02\x12\t\n\x01\x63\x18\x03 \x01(\x02\x12\r\n\x05\x61lpha\x18\x04 \x01(\x02\x12\x0c\n\x04\x62\x65ta\x18\x05 \x01(\x02\x12\r\n\x05gamma\x18\x06 \x01(\x02\")\n\x06Vector\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\"|\n\x10RotationSettings\x12\x17\n\x0fstart_angle_deg\x18\x01 \x01(\x02\x12 \n\x18\x61ngle_incr_per_image_deg\x18\x02 \x01(\x02\x12-\n\rrotation_axis\x18\x03 \x01(\x0b\x32\x16.JFJochProtoBuf.Vector\"\x1c\n\x04Plot\x12\t\n\x01x\x18\x01 \x03(\x02\x12\t\n\x01y\x18\x02 \x03(\x02\"\xb1\x04\n\x0f\x44\x61tasetSettings\x12\x1a\n\x12images_per_trigger\x18\x01 \x01(\x03\x12\x10\n\x08ntrigger\x18\x02 \x01(\x03\x12:\n\x11\x66pga_pixel_output\x18\x03 \x01(\x0e\x32\x1f.JFJochProtoBuf.FPGAPixelOutput\x12\x11\n\tsummation\x18\x04 \x01(\x03\x12\x12\n\nbeam_x_pxl\x18\x05 \x01(\x02\x12\x12\n\nbeam_y_pxl\x18\x06 \x01(\x02\x12\x1c\n\x14\x64\x65tector_distance_mm\x18\x07 \x01(\x02\x12\x19\n\x11photon_energy_keV\x18\x08 \x01(\x02\x12\x13\n\x0b\x66ile_prefix\x18\t \x01(\t\x12\x17\n\x0f\x64\x61ta_file_count\x18\n \x01(\x03\x12\x30\n\x0b\x63ompression\x18\x0b \x01(\x0e\x32\x1b.JFJochProtoBuf.Compression\x12\x13\n\x0bsample_name\x18\x0c \x01(\t\x12+\n\tunit_cell\x18\r \x01(\x0b\x32\x18.JFJochProtoBuf.UnitCell\x12\x1a\n\x12space_group_number\x18\x0e \x01(\x03\x12 \n\x18rad_int_solid_angle_corr\x18\x12 \x01(\x08\x12!\n\x19rad_int_polarization_corr\x18\x13 \x01(\x08\x12#\n\x1brad_int_polarization_factor\x18\x14 \x01(\x02\x12\x18\n\x10save_calibration\x18\x15 \x01(\x08\"\x90\x02\n\x10\x44\x65tectorSettings\x12\x15\n\rframe_time_us\x18\x01 \x01(\x03\x12\x15\n\rcount_time_us\x18\x02 \x01(\x03\x12\x1a\n\x12storage_cell_count\x18\x03 \x01(\x03\x12%\n\x1duse_internal_packet_generator\x18\x04 \x01(\x08\x12\x18\n\x10\x63ollect_raw_data\x18\x05 \x01(\x08\x12\x1a\n\x12pedestal_g0_frames\x18\x06 \x01(\x03\x12\x1a\n\x12pedestal_g1_frames\x18\x07 \x01(\x03\x12\x1a\n\x12pedestal_g2_frames\x18\x08 \x01(\x03\x12\x1d\n\x15storage_cell_delay_ns\x18\n \x01(\x03\"\xed\x01\n\x10ModuleStatistics\x12\x15\n\rmodule_number\x18\x01 \x01(\x03\x12\x1b\n\x13storage_cell_number\x18\x02 \x01(\x03\x12\x18\n\x10pedestal_g0_mean\x18\x03 \x01(\x02\x12\x18\n\x10pedestal_g1_mean\x18\x04 \x01(\x02\x12\x18\n\x10pedestal_g2_mean\x18\x05 \x01(\x02\x12\x14\n\x0cgain_g0_mean\x18\x06 \x01(\x02\x12\x14\n\x0cgain_g1_mean\x18\x07 \x01(\x02\x12\x14\n\x0cgain_g2_mean\x18\x08 \x01(\x02\x12\x15\n\rmasked_pixels\x18\t \x01(\x04\"V\n\x17JFCalibrationStatistics\x12;\n\x11module_statistics\x18\x01 \x03(\x0b\x32 .JFJochProtoBuf.ModuleStatistics\"F\n\x0bPlotRequest\x12&\n\x04type\x18\x01 \x01(\x0e\x32\x18.JFJochProtoBuf.PlotType\x12\x0f\n\x07\x62inning\x18\x02 \x01(\x04\"M\n\x18RadialIntegrationProfile\x12\r\n\x05title\x18\x01 \x01(\t\x12\"\n\x04plot\x18\x02 \x01(\x0b\x32\x14.JFJochProtoBuf.Plot\"W\n\x19RadialIntegrationProfiles\x12:\n\x08profiles\x18\x01 \x03(\x0b\x32(.JFJochProtoBuf.RadialIntegrationProfile\">\n\x0bWriterInput\x12\x1c\n\x14zmq_receiver_address\x18\x01 \x01(\t\x12\x11\n\tseries_id\x18\x02 \x01(\x03\"3\n\x12\x44\x61taFileStatistics\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07nimages\x18\x02 \x01(\x03\"\x8d\x01\n\x0cWriterOutput\x12\x0f\n\x07nimages\x18\x01 \x01(\x03\x12\x17\n\x0fperformance_MBs\x18\x02 \x01(\x02\x12\x16\n\x0eperformance_Hz\x18\x03 \x01(\x02\x12;\n\x0f\x66ile_statistics\x18\x04 \x03(\x0b\x32\".JFJochProtoBuf.DataFileStatistics\"\x82\x02\n\x14\x44\x65tectorModuleConfig\x12\x17\n\x0fudp_dest_port_1\x18\x01 \x01(\x04\x12\x17\n\x0fudp_dest_port_2\x18\x02 \x01(\x04\x12\x17\n\x0fipv4_src_addr_1\x18\x03 \x01(\t\x12\x17\n\x0fipv4_src_addr_2\x18\x04 \x01(\t\x12\x18\n\x10ipv4_dest_addr_1\x18\x05 \x01(\t\x12\x18\n\x10ipv4_dest_addr_2\x18\x06 \x01(\t\x12\x17\n\x0fmac_addr_dest_1\x18\x07 \x01(\t\x12\x17\n\x0fmac_addr_dest_2\x18\x08 \x01(\t\x12 \n\x18module_id_in_data_stream\x18\t \x01(\x04\"}\n\x0e\x44\x65tectorConfig\x12\x35\n\x07modules\x18\x01 \x03(\x0b\x32$.JFJochProtoBuf.DetectorModuleConfig\x12\x17\n\x0fmodule_hostname\x18\x02 \x03(\t\x12\x1b\n\x13udp_interface_count\x18\x03 \x01(\x03\"\xfc\x01\n\rDetectorInput\x12\x13\n\x0bmodules_num\x18\x01 \x01(\x03\x12*\n\x04mode\x18\x02 \x01(\x0e\x32\x1c.JFJochProtoBuf.DetectorMode\x12\x12\n\nnum_frames\x18\x03 \x01(\x03\x12\x14\n\x0cnum_triggers\x18\x04 \x01(\x03\x12\x1b\n\x13storage_cell_number\x18\x05 \x01(\x03\x12\x1a\n\x12storage_cell_start\x18\x06 \x01(\x03\x12\x1d\n\x15storage_cell_delay_ns\x18\x07 \x01(\x03\x12\x11\n\tperiod_us\x18\t \x01(\x03\x12\x15\n\rcount_time_us\x18\n \x01(\x03\"\x10\n\x0e\x44\x65tectorOutput\"b\n\x0e\x44\x65tectorStatus\x12$\n\x05state\x18\x01 \x01(\x0e\x32\x15.JFJochProtoBuf.State\x12\x12\n\nfw_version\x18\x02 \x01(\x03\x12\x16\n\x0eserver_version\x18\x03 \x01(\t\"Q\n\x0e\x46PGAFIFOStatus\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x31\n\x05value\x18\x02 \x01(\x0e\x32\".JFJochProtoBuf.FPGAFIFOStatusEnum\"\xbb\x02\n\x16\x44\x61taProcessingSettings\x12!\n\x19signal_to_noise_threshold\x18\x01 \x01(\x02\x12\x1e\n\x16photon_count_threshold\x18\x02 \x01(\x03\x12\x18\n\x10min_pix_per_spot\x18\x03 \x01(\x03\x12\x18\n\x10max_pix_per_spot\x18\x04 \x01(\x03\x12\x16\n\x0elocal_bkg_size\x18\x05 \x01(\x03\x12\x1d\n\x15high_resolution_limit\x18\x06 \x01(\x02\x12\x1c\n\x14low_resolution_limit\x18\x07 \x01(\x02\x12\x1a\n\x12\x62kg_estimate_low_q\x18\x08 \x01(\x02\x12\x1b\n\x13\x62kg_estimate_high_q\x18\t \x01(\x02\x12\x1c\n\x14preview_indexed_only\x18\n \x01(\x08\"I\n\x05Image\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\r\n\x05width\x18\x02 \x01(\x03\x12\x0e\n\x06height\x18\x03 \x01(\x03\x12\x13\n\x0bpixel_depth\x18\x04 \x01(\x03\".\n\nMaskToLoad\x12\x0c\n\x04mask\x18\x01 \x03(\r\x12\x12\n\nbit_to_set\x18\x02 \x01(\x05\"\xc9\x02\n\x15MeasurementStatistics\x12\x13\n\x0b\x66ile_prefix\x18\x01 \x01(\t\x12\x18\n\x10images_collected\x18\x02 \x01(\x03\x12\x1d\n\x15max_image_number_sent\x18\x03 \x01(\x03\x12\x1d\n\x15\x63ollection_efficiency\x18\x04 \x01(\x02\x12\x19\n\x11\x63ompression_ratio\x18\x05 \x01(\x02\x12\x11\n\tcancelled\x18\x06 \x01(\x08\x12\x19\n\x11max_receive_delay\x18\x07 \x01(\x03\x12\x15\n\rindexing_rate\x18\n \x01(\x02\x12\x16\n\x0e\x64\x65tector_width\x18\x0c \x01(\x03\x12\x17\n\x0f\x64\x65tector_height\x18\r \x01(\x03\x12\x1c\n\x14\x64\x65tector_pixel_depth\x18\x0e \x01(\x03\x12\x14\n\x0c\x62kg_estimate\x18\x10 \x01(\x02\"\x89\x01\n\x0c\x42rokerStatus\x12+\n\x0c\x62roker_state\x18\x01 \x01(\x0e\x32\x15.JFJochProtoBuf.State\x12\x10\n\x08progress\x18\x02 \x01(\x02\x12\x15\n\rindexing_rate\x18\x03 \x01(\x02\x12#\n\x1breceiver_send_buffers_avail\x18\x04 \x01(\x02\"H\n\x13\x44\x65tectorListElement\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x10\n\x08nmodules\x18\x02 \x01(\x03\x12\n\n\x02id\x18\x03 \x01(\x03\"v\n\x0c\x44\x65tectorList\x12\x35\n\x08\x64\x65tector\x18\x01 \x03(\x0b\x32#.JFJochProtoBuf.DetectorListElement\x12\x12\n\ncurrent_id\x18\x02 \x01(\x03\x12\x1b\n\x13\x63urrent_description\x18\x03 \x01(\t\"\x1f\n\x11\x44\x65tectorSelection\x12\n\n\x02id\x18\x01 \x01(\x03*T\n\x0b\x43ompression\x12\r\n\tBSHUF_LZ4\x10\x00\x12\x0e\n\nBSHUF_ZSTD\x10\x01\x12\x12\n\x0e\x42SHUF_ZSTD_RLE\x10\x02\x12\x12\n\x0eNO_COMPRESSION\x10\x03*Z\n\x0c\x44\x65tectorMode\x12\x0e\n\nCONVERSION\x10\x00\x12\x07\n\x03RAW\x10\x01\x12\x0f\n\x0bPEDESTAL_G0\x10\x02\x12\x0f\n\x0bPEDESTAL_G1\x10\x03\x12\x0f\n\x0bPEDESTAL_G2\x10\x04*6\n\x12\x46PGAFIFOStatusEnum\x12\t\n\x05\x45MPTY\x10\x00\x12\x08\n\x04\x46ULL\x10\x01\x12\x0b\n\x07PARTIAL\x10\x02*^\n\x05State\x12\x13\n\x0fNOT_INITIALIZED\x10\x00\x12\x08\n\x04IDLE\x10\x01\x12\x08\n\x04\x42USY\x10\x02\x12\x0c\n\x08PEDESTAL\x10\x03\x12\x13\n\x0f\x44\x41TA_COLLECTION\x10\x04\x12\t\n\x05\x45RROR\x10\x05*I\n\x0f\x46PGAPixelOutput\x12\x08\n\x04\x41UTO\x10\x00\x12\t\n\x05INT16\x10\x01\x12\n\n\x06UINT16\x10\x02\x12\t\n\x05INT32\x10\x03\x12\n\n\x06UINT32\x10\x04*{\n\x08PlotType\x12\x10\n\x0c\x42KG_ESTIMATE\x10\x00\x12\x0b\n\x07RAD_INT\x10\x01\x12\x0e\n\nSPOT_COUNT\x10\x02\x12\x11\n\rINDEXING_RATE\x10\x03\x12\x1a\n\x16INDEXING_RATE_PER_FILE\x10\x04\x12\x11\n\rADU_HISTOGRAM\x10\x05\x32\xca\x01\n\x11gRPC_JFJochWriter\x12=\n\x05Start\x12\x1b.JFJochProtoBuf.WriterInput\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x37\n\x05\x41\x62ort\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12=\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.WriterOutput\"\x00\x32\x82\x03\n\x13gRPC_JFJochDetector\x12?\n\x05Start\x12\x1d.JFJochProtoBuf.DetectorInput\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x36\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x41\n\x06Status\x12\x15.JFJochProtoBuf.Empty\x1a\x1e.JFJochProtoBuf.DetectorStatus\"\x00\x12=\n\x02On\x12\x1e.JFJochProtoBuf.DetectorConfig\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x35\n\x03Off\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x39\n\x07Trigger\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x32\xd4\x0c\n\x11gRPC_JFJochBroker\x12\x41\n\x05Start\x12\x1f.JFJochProtoBuf.DatasetSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x36\n\x04Stop\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12:\n\x08Pedestal\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12<\n\nInitialize\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x38\n\x06\x43\x61ncel\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12<\n\nDeactivate\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x39\n\x07Trigger\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12\x42\n\tGetStatus\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.BrokerStatus\"\x00\x12\\\n\x18GetCalibrationStatistics\x12\x15.JFJochProtoBuf.Empty\x1a\'.JFJochProtoBuf.JFCalibrationStatistics\"\x00\x12P\n\x13GetDetectorSettings\x12\x15.JFJochProtoBuf.Empty\x1a .JFJochProtoBuf.DetectorSettings\"\x00\x12P\n\x13PutDetectorSettings\x12 .JFJochProtoBuf.DetectorSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12Z\n\x18GetMeasurementStatistics\x12\x15.JFJochProtoBuf.Empty\x1a%.JFJochProtoBuf.MeasurementStatistics\"\x00\x12\\\n\x19GetDataProcessingSettings\x12\x15.JFJochProtoBuf.Empty\x1a&.JFJochProtoBuf.DataProcessingSettings\"\x00\x12\\\n\x19PutDataProcessingSettings\x12&.JFJochProtoBuf.DataProcessingSettings\x1a\x15.JFJochProtoBuf.Empty\"\x00\x12?\n\x08GetPlots\x12\x1b.JFJochProtoBuf.PlotRequest\x1a\x14.JFJochProtoBuf.Plot\"\x00\x12\x62\n\x1cGetRadialIntegrationProfiles\x12\x15.JFJochProtoBuf.Empty\x1a).JFJochProtoBuf.RadialIntegrationProfiles\"\x00\x12?\n\rGetPedestalG0\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12?\n\rGetPedestalG1\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12?\n\rGetPedestalG2\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12\x39\n\x07GetMask\x12\x15.JFJochProtoBuf.Empty\x1a\x15.JFJochProtoBuf.Image\"\x00\x12H\n\x0fGetDetectorList\x12\x15.JFJochProtoBuf.Empty\x1a\x1c.JFJochProtoBuf.DetectorList\"\x00\x12L\n\x0eSelectDetector\x12!.JFJochProtoBuf.DetectorSelection\x1a\x15.JFJochProtoBuf.Empty\"\x00\x62\x06proto3') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'jfjoch_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - _COMPRESSION._serialized_start=5124 - _COMPRESSION._serialized_end=5208 - _DETECTORMODE._serialized_start=5210 - _DETECTORMODE._serialized_end=5300 - _FPGAFIFOSTATUSENUM._serialized_start=5302 - _FPGAFIFOSTATUSENUM._serialized_end=5356 - _STATE._serialized_start=5358 - _STATE._serialized_end=5452 - _FPGAPIXELOUTPUT._serialized_start=5454 - _FPGAPIXELOUTPUT._serialized_end=5527 - _PLOTTYPE._serialized_start=5529 - _PLOTTYPE._serialized_end=5652 + _COMPRESSION._serialized_start=3981 + _COMPRESSION._serialized_end=4065 + _DETECTORMODE._serialized_start=4067 + _DETECTORMODE._serialized_end=4157 + _FPGAFIFOSTATUSENUM._serialized_start=4159 + _FPGAFIFOSTATUSENUM._serialized_end=4213 + _STATE._serialized_start=4215 + _STATE._serialized_end=4309 + _FPGAPIXELOUTPUT._serialized_start=4311 + _FPGAPIXELOUTPUT._serialized_end=4384 + _PLOTTYPE._serialized_start=4386 + _PLOTTYPE._serialized_end=4509 _EMPTY._serialized_start=32 _EMPTY._serialized_end=39 _UNITCELL._serialized_start=41 @@ -46,62 +46,54 @@ if _descriptor._USE_C_DESCRIPTORS == False: _DATASETSETTINGS._serialized_end=891 _DETECTORSETTINGS._serialized_start=894 _DETECTORSETTINGS._serialized_end=1166 - _DETECTORMODULEGEOMETRY._serialized_start=1168 - _DETECTORMODULEGEOMETRY._serialized_end=1266 - _DETECTORGEOMETRY._serialized_start=1268 - _DETECTORGEOMETRY._serialized_end=1390 - _DETECTOR._serialized_start=1393 - _DETECTOR._serialized_end=1571 - _INTERNALSETTINGS._serialized_start=1574 - _INTERNALSETTINGS._serialized_end=2309 - _MODULESTATISTICS._serialized_start=2312 - _MODULESTATISTICS._serialized_end=2549 - _JFCALIBRATIONSTATISTICS._serialized_start=2551 - _JFCALIBRATIONSTATISTICS._serialized_end=2637 - _PLOTREQUEST._serialized_start=2639 - _PLOTREQUEST._serialized_end=2709 - _RADIALINTEGRATIONPROFILE._serialized_start=2711 - _RADIALINTEGRATIONPROFILE._serialized_end=2788 - _RADIALINTEGRATIONPROFILES._serialized_start=2790 - _RADIALINTEGRATIONPROFILES._serialized_end=2877 - _WRITERINPUT._serialized_start=2879 - _WRITERINPUT._serialized_end=2941 - _DATAFILESTATISTICS._serialized_start=2943 - _DATAFILESTATISTICS._serialized_end=2994 - _WRITEROUTPUT._serialized_start=2997 - _WRITEROUTPUT._serialized_end=3138 - _DETECTORMODULECONFIG._serialized_start=3141 - _DETECTORMODULECONFIG._serialized_end=3399 - _DETECTORCONFIG._serialized_start=3401 - _DETECTORCONFIG._serialized_end=3526 - _DETECTORINPUT._serialized_start=3529 - _DETECTORINPUT._serialized_end=3781 - _DETECTOROUTPUT._serialized_start=3783 - _DETECTOROUTPUT._serialized_end=3799 - _DETECTORSTATUS._serialized_start=3801 - _DETECTORSTATUS._serialized_end=3899 - _FPGAFIFOSTATUS._serialized_start=3901 - _FPGAFIFOSTATUS._serialized_end=3982 - _DATAPROCESSINGSETTINGS._serialized_start=3985 - _DATAPROCESSINGSETTINGS._serialized_end=4300 - _IMAGE._serialized_start=4302 - _IMAGE._serialized_end=4375 - _MASKTOLOAD._serialized_start=4377 - _MASKTOLOAD._serialized_end=4423 - _MEASUREMENTSTATISTICS._serialized_start=4426 - _MEASUREMENTSTATISTICS._serialized_end=4755 - _BROKERSTATUS._serialized_start=4758 - _BROKERSTATUS._serialized_end=4895 - _DETECTORLISTELEMENT._serialized_start=4897 - _DETECTORLISTELEMENT._serialized_end=4969 - _DETECTORLIST._serialized_start=4971 - _DETECTORLIST._serialized_end=5089 - _DETECTORSELECTION._serialized_start=5091 - _DETECTORSELECTION._serialized_end=5122 - _GRPC_JFJOCHWRITER._serialized_start=5655 - _GRPC_JFJOCHWRITER._serialized_end=5857 - _GRPC_JFJOCHDETECTOR._serialized_start=5860 - _GRPC_JFJOCHDETECTOR._serialized_end=6246 - _GRPC_JFJOCHBROKER._serialized_start=6249 - _GRPC_JFJOCHBROKER._serialized_end=7869 + _MODULESTATISTICS._serialized_start=1169 + _MODULESTATISTICS._serialized_end=1406 + _JFCALIBRATIONSTATISTICS._serialized_start=1408 + _JFCALIBRATIONSTATISTICS._serialized_end=1494 + _PLOTREQUEST._serialized_start=1496 + _PLOTREQUEST._serialized_end=1566 + _RADIALINTEGRATIONPROFILE._serialized_start=1568 + _RADIALINTEGRATIONPROFILE._serialized_end=1645 + _RADIALINTEGRATIONPROFILES._serialized_start=1647 + _RADIALINTEGRATIONPROFILES._serialized_end=1734 + _WRITERINPUT._serialized_start=1736 + _WRITERINPUT._serialized_end=1798 + _DATAFILESTATISTICS._serialized_start=1800 + _DATAFILESTATISTICS._serialized_end=1851 + _WRITEROUTPUT._serialized_start=1854 + _WRITEROUTPUT._serialized_end=1995 + _DETECTORMODULECONFIG._serialized_start=1998 + _DETECTORMODULECONFIG._serialized_end=2256 + _DETECTORCONFIG._serialized_start=2258 + _DETECTORCONFIG._serialized_end=2383 + _DETECTORINPUT._serialized_start=2386 + _DETECTORINPUT._serialized_end=2638 + _DETECTOROUTPUT._serialized_start=2640 + _DETECTOROUTPUT._serialized_end=2656 + _DETECTORSTATUS._serialized_start=2658 + _DETECTORSTATUS._serialized_end=2756 + _FPGAFIFOSTATUS._serialized_start=2758 + _FPGAFIFOSTATUS._serialized_end=2839 + _DATAPROCESSINGSETTINGS._serialized_start=2842 + _DATAPROCESSINGSETTINGS._serialized_end=3157 + _IMAGE._serialized_start=3159 + _IMAGE._serialized_end=3232 + _MASKTOLOAD._serialized_start=3234 + _MASKTOLOAD._serialized_end=3280 + _MEASUREMENTSTATISTICS._serialized_start=3283 + _MEASUREMENTSTATISTICS._serialized_end=3612 + _BROKERSTATUS._serialized_start=3615 + _BROKERSTATUS._serialized_end=3752 + _DETECTORLISTELEMENT._serialized_start=3754 + _DETECTORLISTELEMENT._serialized_end=3826 + _DETECTORLIST._serialized_start=3828 + _DETECTORLIST._serialized_end=3946 + _DETECTORSELECTION._serialized_start=3948 + _DETECTORSELECTION._serialized_end=3979 + _GRPC_JFJOCHWRITER._serialized_start=4512 + _GRPC_JFJOCHWRITER._serialized_end=4714 + _GRPC_JFJOCHDETECTOR._serialized_start=4717 + _GRPC_JFJOCHDETECTOR._serialized_end=5103 + _GRPC_JFJOCHBROKER._serialized_start=5106 + _GRPC_JFJOCHBROKER._serialized_end=6726 # @@protoc_insertion_point(module_scope) diff --git a/tests/DetectorGeometryTest.cpp b/tests/DetectorGeometryTest.cpp index a41bc93e..36b4a7ac 100644 --- a/tests/DetectorGeometryTest.cpp +++ b/tests/DetectorGeometryTest.cpp @@ -6,63 +6,59 @@ TEST_CASE("DetectorGeometry_Regular", "[DetectorGeometry]") { DetectorGeometry geometry(18, 3, 8, 36, false); - const JFJochProtoBuf::DetectorGeometry pbuf = geometry; - REQUIRE(pbuf.module_geometry_size() == 18); + REQUIRE(geometry.GetModulesNum() == 18); - REQUIRE(pbuf.width_pxl() == 3 * 1030 + 2 * 8); - REQUIRE(pbuf.height_pxl() == 6 * 514 + 5 * 36); - REQUIRE(pbuf.module_geometry(0).pixel0() == 0); - REQUIRE(pbuf.module_geometry(2).pixel0() == 2 * 1030 + 2 * 8); + REQUIRE(geometry.GetWidth() == 3 * 1030 + 2 * 8); + REQUIRE(geometry.GetHeight() == 6 * 514 + 5 * 36); + REQUIRE(geometry.GetPixel0(0) == 0); + REQUIRE(geometry.GetPixel0(2) == 2 * 1030 + 2 * 8); - REQUIRE(pbuf.module_geometry(15).pixel0() == pbuf.width_pxl() * (514 * 5 + 36 * 5)); - REQUIRE(pbuf.module_geometry(15).fast_direction_step() == 1); - REQUIRE(pbuf.module_geometry(15).slow_direction_step() == pbuf.width_pxl()); + REQUIRE(geometry.GetPixel0(15) == geometry.GetWidth() * (514 * 5 + 36 * 5)); + REQUIRE(geometry.GetFastDirectionStep(15) == 1); + REQUIRE(geometry.GetSlowDirectionStep(15) == geometry.GetWidth()); } TEST_CASE("DetectorGeometry_Regular_1Module", "[DetectorGeometry]") { DetectorGeometry geometry(1, 3, 8, 36, false); - const JFJochProtoBuf::DetectorGeometry pbuf = geometry; - REQUIRE(pbuf.module_geometry_size() == 1); + REQUIRE(geometry.GetModulesNum() == 1); - REQUIRE(pbuf.width_pxl() == CONVERTED_MODULE_COLS); - REQUIRE(pbuf.height_pxl() == CONVERTED_MODULE_LINES); - REQUIRE(pbuf.module_geometry(0).pixel0() == 0); + REQUIRE(geometry.GetWidth() == CONVERTED_MODULE_COLS); + REQUIRE(geometry.GetHeight() == CONVERTED_MODULE_LINES); + REQUIRE(geometry.GetPixel0(0) == 0); - REQUIRE(pbuf.module_geometry(0).fast_direction_step() == 1); - REQUIRE(pbuf.module_geometry(0).slow_direction_step() == CONVERTED_MODULE_COLS); + REQUIRE(geometry.GetFastDirectionStep(0) == 1); + REQUIRE(geometry.GetSlowDirectionStep(0) == CONVERTED_MODULE_COLS); } TEST_CASE("DetectorGeometry_Regular_2Module", "[DetectorGeometry]") { DetectorGeometry geometry(2, 2, 8, 36, false); - const JFJochProtoBuf::DetectorGeometry pbuf = geometry; - REQUIRE(pbuf.module_geometry_size() == 2); + REQUIRE(geometry.GetModulesNum() == 2); - REQUIRE(pbuf.width_pxl() == CONVERTED_MODULE_COLS * 2 + 8); - REQUIRE(pbuf.height_pxl() == CONVERTED_MODULE_LINES); - REQUIRE(pbuf.module_geometry(0).pixel0() == 0); - REQUIRE(pbuf.module_geometry(1).pixel0() == CONVERTED_MODULE_COLS + 8); + REQUIRE(geometry.GetWidth() == CONVERTED_MODULE_COLS * 2 + 8); + REQUIRE(geometry.GetHeight() == CONVERTED_MODULE_LINES); + REQUIRE(geometry.GetPixel0(0) == 0); + REQUIRE(geometry.GetPixel0(1) == CONVERTED_MODULE_COLS + 8); - REQUIRE(pbuf.module_geometry(0).fast_direction_step() == 1); - REQUIRE(pbuf.module_geometry(0).slow_direction_step() == CONVERTED_MODULE_COLS * 2 + 8); + REQUIRE(geometry.GetFastDirectionStep(0) == 1); + REQUIRE(geometry.GetSlowDirectionStep(0) == CONVERTED_MODULE_COLS * 2 + 8); } TEST_CASE("DetectorGeometry_RegularMirror", "[DetectorGeometry]") { DetectorGeometry geometry(18, 3, 8, 36, true); - const JFJochProtoBuf::DetectorGeometry pbuf = geometry; - REQUIRE(pbuf.module_geometry_size() == 18); + REQUIRE(geometry.GetModulesNum() == 18); - REQUIRE(pbuf.width_pxl() == 3 * 1030 + 2 * 8); - REQUIRE(pbuf.height_pxl() == 6 * 514 + 5 * 36); - REQUIRE(pbuf.module_geometry(0).pixel0() == pbuf.width_pxl() * (pbuf.height_pxl() - 1)); - REQUIRE(pbuf.module_geometry(2).pixel0() == pbuf.width_pxl() * (pbuf.height_pxl() - 1) + 2 * 1030 + 2 * 8); + REQUIRE(geometry.GetWidth() == 3 * 1030 + 2 * 8); + REQUIRE(geometry.GetHeight() == 6 * 514 + 5 * 36); + REQUIRE(geometry.GetPixel0(0) == geometry.GetWidth() * (geometry.GetHeight() - 1)); + REQUIRE(geometry.GetPixel0(2) == geometry.GetWidth() * (geometry.GetHeight() - 1) + 2 * 1030 + 2 * 8); - CHECK(pbuf.module_geometry(15).pixel0() == pbuf.width_pxl() * 513); - CHECK(pbuf.module_geometry(17).pixel0() == pbuf.width_pxl() * (513) + 2 * 1030 + 2 * 8); - REQUIRE(pbuf.module_geometry(15).fast_direction_step() == 1); - REQUIRE(pbuf.module_geometry(15).slow_direction_step() == -pbuf.width_pxl()); + CHECK(geometry.GetPixel0(15) == geometry.GetWidth() * 513); + CHECK(geometry.GetPixel0(17) == geometry.GetWidth() * (513) + 2 * 1030 + 2 * 8); + REQUIRE(geometry.GetFastDirectionStep(15) == 1); + REQUIRE(geometry.GetSlowDirectionStep(15) == -geometry.GetWidth()); } TEST_CASE("DetectorModuleGeometry_SameAxis", "[DetectorGeometry]") { @@ -171,19 +167,19 @@ TEST_CASE("DetectorGeometry_Custom", "[DetectorGeometry]") { DetectorGeometry geometry(module_geom); REQUIRE(geometry.GetModulesNum() == 3); - JFJochProtoBuf::DetectorGeometry pbuf_geom = geometry; - CHECK(pbuf_geom.height_pxl() == 2999+1); - CHECK(pbuf_geom.width_pxl() == 5513+1); - CHECK(pbuf_geom.module_geometry(0).pixel0() == 2999 * pbuf_geom.width_pxl() + 2999); - CHECK(pbuf_geom.module_geometry(1).pixel0() == 0); - CHECK(pbuf_geom.module_geometry(2).pixel0() == 5000); - CHECK(pbuf_geom.module_geometry(0).fast_direction_step() == -1); - CHECK(pbuf_geom.module_geometry(1).fast_direction_step() == pbuf_geom.width_pxl()); - CHECK(pbuf_geom.module_geometry(2).fast_direction_step() == pbuf_geom.width_pxl()); + CHECK(geometry.GetHeight() == 2999+1); + CHECK(geometry.GetWidth() == 5513+1); + CHECK(geometry.GetPixel0(0) == 2999 * geometry.GetWidth() + 2999); + CHECK(geometry.GetPixel0(1) == 0); + CHECK(geometry.GetPixel0(2) == 5000); - CHECK(pbuf_geom.module_geometry(0).slow_direction_step() == -pbuf_geom.width_pxl()); - CHECK(pbuf_geom.module_geometry(1).slow_direction_step() == 1); - CHECK(pbuf_geom.module_geometry(2).slow_direction_step() == 1); + CHECK(geometry.GetFastDirectionStep(0) == -1); + CHECK(geometry.GetFastDirectionStep(1) == geometry.GetWidth()); + CHECK(geometry.GetFastDirectionStep(2) == geometry.GetWidth()); + + CHECK(geometry.GetSlowDirectionStep(0) == -geometry.GetWidth()); + CHECK(geometry.GetSlowDirectionStep(1) == 1); + CHECK(geometry.GetSlowDirectionStep(2) == 1); } \ No newline at end of file diff --git a/tests/DetectorSetupTest.cpp b/tests/DetectorSetupTest.cpp index 33099fc3..170698cd 100644 --- a/tests/DetectorSetupTest.cpp +++ b/tests/DetectorSetupTest.cpp @@ -11,25 +11,25 @@ TEST_CASE("DetectorSetup_MismatchInSize") { TEST_CASE("DetectorSetup_ProtoBuf") { DetectorSetup setup(DetectorGeometry(4), "JF", {"mx1","mx2","mx3","mx4"}); - JFJochProtoBuf::Detector detector = setup; - REQUIRE(detector.description() == "JF"); - REQUIRE(detector.module_hostname_size() == 4); - REQUIRE(detector.module_hostname(3) == "mx4"); - REQUIRE(detector.pixel_size_mm() == Approx(0.075)); - REQUIRE(detector.nmodules() == 4); - REQUIRE(detector.geometry().module_geometry_size() == 4); + + REQUIRE(setup.GetDescription() == "JF"); + REQUIRE(setup.GetDetectorModuleHostname().size() == 4); + REQUIRE(setup.GetDetectorModuleHostname()[3] == "mx4"); + REQUIRE(setup.GetPixelSize_mm() == Approx(0.075)); + REQUIRE(setup.GetModulesNum() == 4); + REQUIRE(setup.GetGeometry().GetModulesNum() == 4); } TEST_CASE("DetectorSetup_ProtoBuf_FullSpeed") { DetectorSetup setup(DetectorGeometry(4), "JF", {"mx1","mx2","mx3","mx4"}); - JFJochProtoBuf::Detector detector = setup; - REQUIRE(detector.udp_interface_count() == 2); + + REQUIRE(setup.GetUDPInterfaceCount() == 2); REQUIRE_NOTHROW(setup.UDPInterfaceCount(1)); REQUIRE_THROWS(setup.UDPInterfaceCount(0)); REQUIRE_THROWS(setup.UDPInterfaceCount(5)); REQUIRE_THROWS(setup.UDPInterfaceCount(-56)); - detector = setup; - REQUIRE(detector.udp_interface_count() == 1); + + REQUIRE(setup.GetUDPInterfaceCount() == 1); } TEST_CASE("DetectorSetup_LoadGainFile") { diff --git a/tests/DiffractionExperimentTest.cpp b/tests/DiffractionExperimentTest.cpp index 9aafa3b1..59155d1f 100644 --- a/tests/DiffractionExperimentTest.cpp +++ b/tests/DiffractionExperimentTest.cpp @@ -663,7 +663,7 @@ TEST_CASE("DiffractionExperiment_LoadDatasetSettings", "[DiffractionExperiment]" REQUIRE(x.GetDataFileCount() == 5); REQUIRE(x.GetDetectorDistance_mm() == Approx(57.6)); REQUIRE(x.GetSummation() == 36); - REQUIRE(x.GetFPGAOutputMode() == JFJochProtoBuf::INT16); + REQUIRE(x.GetFPGAOutputMode() == FPGAPixelOutput::Int16); } TEST_CASE("DiffractionExperiment_LoadDatasetSettings_Invalid", "[DiffractionExperiment]") { @@ -782,7 +782,7 @@ TEST_CASE("DiffractionExperiment_FPGA_Summation_output","[DiffractionExperiment] REQUIRE_THROWS(x.Summation(-1)); REQUIRE_THROWS(x.Summation(MAX_FPGA_SUMMATION + 1)); - x.FPGAOutputMode(JFJochProtoBuf::AUTO); + x.FPGAOutputMode(FPGAPixelOutput::Auto); REQUIRE_NOTHROW(x.Summation(1)); REQUIRE(x.IsPixelSigned()); REQUIRE(x.GetPixelDepth() == 2); @@ -793,19 +793,19 @@ TEST_CASE("DiffractionExperiment_FPGA_Summation_output","[DiffractionExperiment] REQUIRE(x.GetPixelDepth() == 4); REQUIRE(x.GetSummation() == 3); - x.FPGAOutputMode(JFJochProtoBuf::INT16); + x.FPGAOutputMode(FPGAPixelOutput::Int16); REQUIRE(x.GetPixelDepth() == 2); REQUIRE(x.IsPixelSigned()); - x.FPGAOutputMode(JFJochProtoBuf::INT32); + x.FPGAOutputMode(FPGAPixelOutput::Int32); REQUIRE(x.GetPixelDepth() == 4); REQUIRE(x.IsPixelSigned()); - x.FPGAOutputMode(JFJochProtoBuf::UINT16); + x.FPGAOutputMode(FPGAPixelOutput::Uint16); REQUIRE(x.GetPixelDepth() == 2); REQUIRE(!x.IsPixelSigned()); - x.FPGAOutputMode(JFJochProtoBuf::UINT32); + x.FPGAOutputMode(FPGAPixelOutput::Uint32); REQUIRE(x.GetPixelDepth() == 4); REQUIRE(!x.IsPixelSigned()); } diff --git a/tests/FPGAIntegrationTest.cpp b/tests/FPGAIntegrationTest.cpp index 01dbfe58..681777da 100644 --- a/tests/FPGAIntegrationTest.cpp +++ b/tests/FPGAIntegrationTest.cpp @@ -410,7 +410,7 @@ TEST_CASE("HLS_C_Simulation_check_convert_full_range_I32", "[FPGA][Full]") { auto gain_from_file = GainCalibrationFromTestFile(); for (const auto energy : energy_values) { - x.PedestalG0Frames(0).NumTriggers(1).ImagesPerTrigger(1).PhotonEnergy_keV(energy).FPGAOutputMode(JFJochProtoBuf::INT32); + x.PedestalG0Frames(0).NumTriggers(1).ImagesPerTrigger(1).PhotonEnergy_keV(energy).FPGAOutputMode(FPGAPixelOutput::Int32); REQUIRE(x.GetPhotonEnergy_keV() == Approx(energy)); @@ -511,7 +511,7 @@ TEST_CASE("HLS_C_Simulation_check_convert_full_range_U16", "[FPGA][Full]") { auto gain_from_file = GainCalibrationFromTestFile(); for (const auto energy : energy_values) { - x.PedestalG0Frames(0).NumTriggers(1).ImagesPerTrigger(1).PhotonEnergy_keV(energy).FPGAOutputMode(JFJochProtoBuf::UINT16); + x.PedestalG0Frames(0).NumTriggers(1).ImagesPerTrigger(1).PhotonEnergy_keV(energy).FPGAOutputMode(FPGAPixelOutput::Uint16); REQUIRE(x.GetPhotonEnergy_keV() == Approx(energy)); @@ -1381,7 +1381,7 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_32bit", "[FPGA][Full]") { i = dist(g1); x.Mode(DetectorMode::Raw); - x.UseInternalPacketGenerator(true).ImagesPerTrigger(nframes).PedestalG0Frames(0).FPGAOutputMode(JFJochProtoBuf::INT32); + x.UseInternalPacketGenerator(true).ImagesPerTrigger(nframes).PedestalG0Frames(0).FPGAOutputMode(FPGAPixelOutput::Int32); HLSSimulatedDevice test(0, 64); test.SetInternalGeneratorFrame(test_frame); diff --git a/tests/FrameTransformationTest.cpp b/tests/FrameTransformationTest.cpp index 1263ed0d..46386ada 100644 --- a/tests/FrameTransformationTest.cpp +++ b/tests/FrameTransformationTest.cpp @@ -289,7 +289,7 @@ TEST_CASE("FrameTransformation_Converted_bshuf_zstd_32bit" ,"") { DiffractionExperiment experiment(DetectorGeometry(ndatastreams * nmodules, 2)); experiment.DataStreams(ndatastreams); - experiment.Mode(DetectorMode::Conversion).Compression(CompressionAlgorithm::BSHUF_ZSTD).FPGAOutputMode(JFJochProtoBuf::INT32); + experiment.Mode(DetectorMode::Conversion).Compression(CompressionAlgorithm::BSHUF_ZSTD).FPGAOutputMode(FPGAPixelOutput::Int32); FrameTransformation transformation(experiment); @@ -353,7 +353,7 @@ TEST_CASE("FrameTransformation_Converted_bshuf_zstd_unsigned_16bit" ,"") { DiffractionExperiment experiment(DetectorGeometry(ndatastreams * nmodules, 2)); experiment.DataStreams(ndatastreams); - experiment.Mode(DetectorMode::Conversion).Compression(CompressionAlgorithm::BSHUF_ZSTD).FPGAOutputMode(JFJochProtoBuf::UINT16); + experiment.Mode(DetectorMode::Conversion).Compression(CompressionAlgorithm::BSHUF_ZSTD).FPGAOutputMode(FPGAPixelOutput::Uint16); REQUIRE(!experiment.IsPixelSigned()); REQUIRE(experiment.GetPixelDepth() == 2); diff --git a/tests/JFJochBrokerParserTest.cpp b/tests/JFJochBrokerParserTest.cpp index f787aec0..3db27603 100644 --- a/tests/JFJochBrokerParserTest.cpp +++ b/tests/JFJochBrokerParserTest.cpp @@ -31,10 +31,10 @@ TEST_CASE("JFJochBrokerParser_DetectorGeometry_standard_detector") { )"_json; REQUIRE_NOTHROW(ParseDetectorGeometry(j)); - JFJochProtoBuf::DetectorGeometry geom = ParseDetectorGeometry(j); - REQUIRE(geom.width_pxl() == 10 * 2 + 1030 * 3); - REQUIRE(geom.height_pxl() == 20 * 5 + 514 * 6); - REQUIRE(geom.module_geometry_size() == 18); + DetectorGeometry geom = ParseDetectorGeometry(j); + REQUIRE(geom.GetWidth() == 10 * 2 + 1030 * 3); + REQUIRE(geom.GetHeight() == 20 * 5 + 514 * 6); + REQUIRE(geom.GetModulesNum() == 18); } TEST_CASE("JFJochBrokerParser_DetectorGeometry_custom_detector") { @@ -48,18 +48,18 @@ TEST_CASE("JFJochBrokerParser_DetectorGeometry_custom_detector") { )"_json; REQUIRE_NOTHROW(ParseDetectorGeometry(j)); - JFJochProtoBuf::DetectorGeometry geom = ParseDetectorGeometry(j); - REQUIRE(geom.width_pxl() == 2000); - REQUIRE(geom.height_pxl() == 2000); - REQUIRE(geom.module_geometry_size() == 2); + DetectorGeometry geom = ParseDetectorGeometry(j); + REQUIRE(geom.GetWidth() == 2000); + REQUIRE(geom.GetHeight() == 2000); + REQUIRE(geom.GetModulesNum() == 2); - REQUIRE(geom.module_geometry(0).pixel0() == 0); - REQUIRE(geom.module_geometry(0).fast_direction_step() == 1); - REQUIRE(geom.module_geometry(0).slow_direction_step() == 2000); + REQUIRE(geom.GetPixel0(0) == 0); + REQUIRE(geom.GetFastDirectionStep(0) == 1); + REQUIRE(geom.GetSlowDirectionStep(0) == 2000); - REQUIRE(geom.module_geometry(1).pixel0() == 2000*2000-1); - REQUIRE(geom.module_geometry(1).fast_direction_step() == -2000); - REQUIRE(geom.module_geometry(1).slow_direction_step() == -1); + REQUIRE(geom.GetPixel0(1) == 2000*2000-1); + REQUIRE(geom.GetFastDirectionStep(1) == -2000); + REQUIRE(geom.GetSlowDirectionStep(1) == -1); } TEST_CASE("JFJochBrokerParser_DetectorSetup") { @@ -86,15 +86,15 @@ TEST_CASE("JFJochBrokerParser_DetectorSetup") { REQUIRE_NOTHROW(ParseDetectorSetup(j)); auto detector = ParseDetectorSetup(j); - JFJochProtoBuf::Detector detector_pbuf = detector; - REQUIRE(detector_pbuf.geometry().width_pxl() == 1030 * 2 + 10); - REQUIRE(detector_pbuf.geometry().height_pxl() == 20 * 1 + 514 * 2); - REQUIRE(detector_pbuf.geometry().module_geometry_size() == 4); - REQUIRE(detector_pbuf.description() == "PSI JUNGFRAU 2M"); - REQUIRE(detector_pbuf.module_hostname_size() == 4); - REQUIRE(detector_pbuf.module_hostname(2) == "mx3"); + + REQUIRE(detector.GetGeometry().GetWidth() == 1030 * 2 + 10); + REQUIRE(detector.GetGeometry().GetHeight() == 20 * 1 + 514 * 2); + REQUIRE(detector.GetGeometry().GetModulesNum() == 4); + REQUIRE(detector.GetDescription() == "PSI JUNGFRAU 2M"); + REQUIRE(detector.GetDetectorModuleHostname().size() == 4); + REQUIRE(detector.GetDetectorModuleHostname()[2] == "mx3"); REQUIRE(detector.GetGainCalibration().size() == 4); - REQUIRE(detector_pbuf.udp_interface_count() == 1); + REQUIRE(detector.GetUDPInterfaceCount() == 1); } TEST_CASE("JFJochBrokerParser_ParseFacilityConfiguration") { diff --git a/tests/JFJochReceiverIntegrationTest.cpp b/tests/JFJochReceiverIntegrationTest.cpp index b409e857..ea55f2b2 100644 --- a/tests/JFJochReceiverIntegrationTest.cpp +++ b/tests/JFJochReceiverIntegrationTest.cpp @@ -73,7 +73,7 @@ TEST_CASE("JFJochReceiverTest_Conversion_U16", "[JFJochReceiver]") { x.Mode(DetectorMode::Conversion); x.PedestalG0Frames(0).NumTriggers(1).UseInternalPacketGenerator(true) - .ImagesPerTrigger(32).DataFileCount(16).PhotonEnergy_keV(12.4).Compression(CompressionAlgorithm::BSHUF_ZSTD).FPGAOutputMode(JFJochProtoBuf::UINT16); + .ImagesPerTrigger(32).DataFileCount(16).PhotonEnergy_keV(12.4).Compression(CompressionAlgorithm::BSHUF_ZSTD).FPGAOutputMode(FPGAPixelOutput::Uint16); REQUIRE(!x.IsPixelSigned()); AcquisitionDeviceGroup aq_devices; @@ -101,7 +101,7 @@ TEST_CASE("JFJochReceiverTest_Conversion_I32", "[JFJochReceiver]") { x.Mode(DetectorMode::Conversion); x.PedestalG0Frames(0).NumTriggers(1).UseInternalPacketGenerator(true) - .ImagesPerTrigger(32).DataFileCount(16).PhotonEnergy_keV(12.4).Compression(CompressionAlgorithm::BSHUF_ZSTD).FPGAOutputMode(JFJochProtoBuf::INT32); + .ImagesPerTrigger(32).DataFileCount(16).PhotonEnergy_keV(12.4).Compression(CompressionAlgorithm::BSHUF_ZSTD).FPGAOutputMode(FPGAPixelOutput::Int32); AcquisitionDeviceGroup aq_devices; for (int i = 0; i < x.GetDataStreamsNum(); i++) { diff --git a/tests/RawToConvertedGeometryTest.cpp b/tests/RawToConvertedGeometryTest.cpp index 60642308..91479ab4 100644 --- a/tests/RawToConvertedGeometryTest.cpp +++ b/tests/RawToConvertedGeometryTest.cpp @@ -151,7 +151,7 @@ TEST_CASE("RawToConvertedGeometry_Transform_AdjustMultipixels","[RawToConvertedG DiffractionExperiment x(DetectorGeometry(20, 2, 0, 0, false)); x.DataStreams(4); - x.Mode(DetectorMode::Conversion).FPGAOutputMode(JFJochProtoBuf::INT32); + x.Mode(DetectorMode::Conversion).FPGAOutputMode(FPGAPixelOutput::Int32); REQUIRE(x.GetPixelDepth() == 4); REQUIRE(x.GetModulesNum(0) == 5); diff --git a/tests/ZSTDCompressorTest.cpp b/tests/ZSTDCompressorTest.cpp index 9ee57f3f..706707ca 100644 --- a/tests/ZSTDCompressorTest.cpp +++ b/tests/ZSTDCompressorTest.cpp @@ -227,7 +227,7 @@ TEST_CASE("JFjochZstdCompressor_Frame_ones","[ZSTD]") { TEST_CASE("JFJochCompressor_JFJochDecompressor_ZSTD","[ZSTD]") { DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36)); - x.Compression(CompressionAlgorithm::BSHUF_ZSTD).FPGAOutputMode(JFJochProtoBuf::INT32); + x.Compression(CompressionAlgorithm::BSHUF_ZSTD).FPGAOutputMode(FPGAPixelOutput::Int32); std::vector image(x.GetPixelsNum()); @@ -249,7 +249,7 @@ TEST_CASE("JFJochCompressor_JFJochDecompressor_ZSTD","[ZSTD]") { TEST_CASE("JFJochCompressor_JFJochDecompressor_LZ4","[ZSTD]") { DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36)); - x.Compression(CompressionAlgorithm::BSHUF_LZ4).FPGAOutputMode(JFJochProtoBuf::INT32); + x.Compression(CompressionAlgorithm::BSHUF_LZ4).FPGAOutputMode(FPGAPixelOutput::Int32); std::vector image(x.GetPixelsNum()); @@ -271,7 +271,7 @@ TEST_CASE("JFJochCompressor_JFJochDecompressor_LZ4","[ZSTD]") { TEST_CASE("JFJochDecompressor_None","[ZSTD]") { DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36)); - x.Compression(CompressionAlgorithm::NO_COMPRESSION).FPGAOutputMode(JFJochProtoBuf::INT32); + x.Compression(CompressionAlgorithm::NO_COMPRESSION).FPGAOutputMode(FPGAPixelOutput::Int32); std::vector image(x.GetPixelsNum()); for (auto &i: image)