All checks were successful
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 10m22s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 11m30s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 11m41s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 12m32s
Build Packages / Generate python client (push) Successful in 18s
Build Packages / Build documentation (push) Successful in 54s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 9m44s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 8m53s
Build Packages / build:rpm (rocky8) (push) Successful in 9m40s
Build Packages / build:rpm (rocky9) (push) Successful in 10m37s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 9m54s
Build Packages / Unit tests (push) Successful in 1h6m33s
This is an UNSTABLE release. * jfjoch_broker: Use newer version of Google Ceres for (potential) CUDA 13 compatibility * jfjoch_broker: Improve performance of generating preview images, especially for large detectors (9M-16M) * jfjoch_viewer: Improve performance of displaying images, especially for large detectors (9M-16M) * jfjoch_viewer: Add more color schemes for better image readability * HDF5: Common mutex for reading and writing HDF5 if both operations were to happen in the same executable * HDF5: suppress warning if path (upstream group) doesn't exists when checking if leaf exists Reviewed-on: #30 Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch> Co-committed-by: Filip Leonarski <filip.leonarski@psi.ch>
228 lines
6.9 KiB
C++
228 lines
6.9 KiB
C++
/**
|
|
* Jungfraujoch
|
|
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
|
*
|
|
* The version of the OpenAPI document: 1.0.0-rc.123
|
|
* Contact: filip.leonarski@psi.ch
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
|
|
#include "Dark_mask_settings.h"
|
|
#include "Helpers.h"
|
|
|
|
#include <sstream>
|
|
|
|
namespace org::openapitools::server::model
|
|
{
|
|
|
|
Dark_mask_settings::Dark_mask_settings()
|
|
{
|
|
m_Detector_threshold_keV = 3.5f;
|
|
m_Frame_time_us = 10000L;
|
|
m_Number_of_frames = 1000L;
|
|
m_Max_allowed_pixel_count = 1L;
|
|
m_Max_frames_with_signal = 10L;
|
|
|
|
}
|
|
|
|
void Dark_mask_settings::validate() const
|
|
{
|
|
std::stringstream msg;
|
|
if (!validate(msg))
|
|
{
|
|
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
|
}
|
|
}
|
|
|
|
bool Dark_mask_settings::validate(std::stringstream& msg) const
|
|
{
|
|
return validate(msg, "");
|
|
}
|
|
|
|
bool Dark_mask_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
|
{
|
|
bool success = true;
|
|
const std::string _pathPrefix = pathPrefix.empty() ? "Dark_mask_settings" : pathPrefix;
|
|
|
|
|
|
|
|
/* Detector_threshold_keV */ {
|
|
const float& value = m_Detector_threshold_keV;
|
|
const std::string currentValuePath = _pathPrefix + ".detectorThresholdKeV";
|
|
|
|
|
|
if (value < static_cast<float>(2.5))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 2.5;";
|
|
}
|
|
if (value > static_cast<float>(100.0))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be less than or equal to 100.0;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Frame_time_us */ {
|
|
const int64_t& value = m_Frame_time_us;
|
|
const std::string currentValuePath = _pathPrefix + ".frameTimeUs";
|
|
|
|
|
|
if (value < 500ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 500;";
|
|
}
|
|
if (value > 100000ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be less than or equal to 100000;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Number_of_frames */ {
|
|
const int64_t& value = m_Number_of_frames;
|
|
const std::string currentValuePath = _pathPrefix + ".numberOfFrames";
|
|
|
|
|
|
if (value < 0ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Max_allowed_pixel_count */ {
|
|
const int64_t& value = m_Max_allowed_pixel_count;
|
|
const std::string currentValuePath = _pathPrefix + ".maxAllowedPixelCount";
|
|
|
|
|
|
if (value < 0ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Max_frames_with_signal */ {
|
|
const int64_t& value = m_Max_frames_with_signal;
|
|
const std::string currentValuePath = _pathPrefix + ".maxFramesWithSignal";
|
|
|
|
|
|
if (value < 0ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0;";
|
|
}
|
|
|
|
}
|
|
|
|
return success;
|
|
}
|
|
|
|
bool Dark_mask_settings::operator==(const Dark_mask_settings& rhs) const
|
|
{
|
|
return
|
|
|
|
|
|
(getDetectorThresholdKeV() == rhs.getDetectorThresholdKeV())
|
|
&&
|
|
|
|
(getFrameTimeUs() == rhs.getFrameTimeUs())
|
|
&&
|
|
|
|
(getNumberOfFrames() == rhs.getNumberOfFrames())
|
|
&&
|
|
|
|
(getMaxAllowedPixelCount() == rhs.getMaxAllowedPixelCount())
|
|
&&
|
|
|
|
(getMaxFramesWithSignal() == rhs.getMaxFramesWithSignal())
|
|
|
|
|
|
;
|
|
}
|
|
|
|
bool Dark_mask_settings::operator!=(const Dark_mask_settings& rhs) const
|
|
{
|
|
return !(*this == rhs);
|
|
}
|
|
|
|
void to_json(nlohmann::json& j, const Dark_mask_settings& o)
|
|
{
|
|
j = nlohmann::json::object();
|
|
j["detector_threshold_keV"] = o.m_Detector_threshold_keV;
|
|
j["frame_time_us"] = o.m_Frame_time_us;
|
|
j["number_of_frames"] = o.m_Number_of_frames;
|
|
j["max_allowed_pixel_count"] = o.m_Max_allowed_pixel_count;
|
|
j["max_frames_with_signal"] = o.m_Max_frames_with_signal;
|
|
|
|
}
|
|
|
|
void from_json(const nlohmann::json& j, Dark_mask_settings& o)
|
|
{
|
|
j.at("detector_threshold_keV").get_to(o.m_Detector_threshold_keV);
|
|
j.at("frame_time_us").get_to(o.m_Frame_time_us);
|
|
j.at("number_of_frames").get_to(o.m_Number_of_frames);
|
|
j.at("max_allowed_pixel_count").get_to(o.m_Max_allowed_pixel_count);
|
|
j.at("max_frames_with_signal").get_to(o.m_Max_frames_with_signal);
|
|
|
|
}
|
|
|
|
float Dark_mask_settings::getDetectorThresholdKeV() const
|
|
{
|
|
return m_Detector_threshold_keV;
|
|
}
|
|
void Dark_mask_settings::setDetectorThresholdKeV(float const value)
|
|
{
|
|
m_Detector_threshold_keV = value;
|
|
}
|
|
int64_t Dark_mask_settings::getFrameTimeUs() const
|
|
{
|
|
return m_Frame_time_us;
|
|
}
|
|
void Dark_mask_settings::setFrameTimeUs(int64_t const value)
|
|
{
|
|
m_Frame_time_us = value;
|
|
}
|
|
int64_t Dark_mask_settings::getNumberOfFrames() const
|
|
{
|
|
return m_Number_of_frames;
|
|
}
|
|
void Dark_mask_settings::setNumberOfFrames(int64_t const value)
|
|
{
|
|
m_Number_of_frames = value;
|
|
}
|
|
int64_t Dark_mask_settings::getMaxAllowedPixelCount() const
|
|
{
|
|
return m_Max_allowed_pixel_count;
|
|
}
|
|
void Dark_mask_settings::setMaxAllowedPixelCount(int64_t const value)
|
|
{
|
|
m_Max_allowed_pixel_count = value;
|
|
}
|
|
int64_t Dark_mask_settings::getMaxFramesWithSignal() const
|
|
{
|
|
return m_Max_frames_with_signal;
|
|
}
|
|
void Dark_mask_settings::setMaxFramesWithSignal(int64_t const value)
|
|
{
|
|
m_Max_frames_with_signal = value;
|
|
}
|
|
|
|
|
|
} // namespace org::openapitools::server::model
|
|
|