484 lines
13 KiB
C++
484 lines
13 KiB
C++
/**
|
|
* Jungfraujoch
|
|
* Jungfraujoch Broker Web API
|
|
*
|
|
* The version of the OpenAPI document: 1.0.0-rc.13
|
|
* 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 "Detector_settings.h"
|
|
#include "Helpers.h"
|
|
|
|
#include <sstream>
|
|
|
|
namespace org::openapitools::server::model
|
|
{
|
|
|
|
Detector_settings::Detector_settings()
|
|
{
|
|
m_Frame_time_us = 0L;
|
|
m_Count_time_us = 0L;
|
|
m_Count_time_usIsSet = false;
|
|
m_Storage_cell_count = 1L;
|
|
m_Internal_frame_generator = false;
|
|
m_Internal_frame_generator_images = 1L;
|
|
m_Pedestal_g0_frames = 2000L;
|
|
m_Pedestal_g1_frames = 300L;
|
|
m_Pedestal_g2_frames = 300L;
|
|
m_Pedestal_g0_rms_limit = 100L;
|
|
m_Pedestal_window_size = 128L;
|
|
m_Storage_cell_delay_ns = 5000L;
|
|
m_Detector_trigger_delay_ns = 0L;
|
|
m_Detector_trigger_delay_nsIsSet = false;
|
|
m_Fixed_gain_g1 = false;
|
|
m_Fixed_gain_g1IsSet = false;
|
|
m_Use_gain_hg0 = false;
|
|
m_Use_gain_hg0IsSet = false;
|
|
|
|
}
|
|
|
|
void Detector_settings::validate() const
|
|
{
|
|
std::stringstream msg;
|
|
if (!validate(msg))
|
|
{
|
|
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
|
}
|
|
}
|
|
|
|
bool Detector_settings::validate(std::stringstream& msg) const
|
|
{
|
|
return validate(msg, "");
|
|
}
|
|
|
|
bool Detector_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
|
{
|
|
bool success = true;
|
|
const std::string _pathPrefix = pathPrefix.empty() ? "Detector_settings" : pathPrefix;
|
|
|
|
|
|
|
|
/* Frame_time_us */ {
|
|
const int64_t& value = m_Frame_time_us;
|
|
const std::string currentValuePath = _pathPrefix + ".frameTimeUs";
|
|
|
|
|
|
if (value < 450ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 450;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Storage_cell_count */ {
|
|
const int64_t& value = m_Storage_cell_count;
|
|
const std::string currentValuePath = _pathPrefix + ".storageCellCount";
|
|
|
|
|
|
if (value < 1ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 1;";
|
|
}
|
|
if (value > 16ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be less than or equal to 16;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Internal_frame_generator_images */ {
|
|
const int64_t& value = m_Internal_frame_generator_images;
|
|
const std::string currentValuePath = _pathPrefix + ".internalFrameGeneratorImages";
|
|
|
|
|
|
if (value < 1ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 1;";
|
|
}
|
|
if (value > 128ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be less than or equal to 128;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Pedestal_g0_frames */ {
|
|
const int64_t& value = m_Pedestal_g0_frames;
|
|
const std::string currentValuePath = _pathPrefix + ".pedestalG0Frames";
|
|
|
|
|
|
if (value < 0ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Pedestal_g1_frames */ {
|
|
const int64_t& value = m_Pedestal_g1_frames;
|
|
const std::string currentValuePath = _pathPrefix + ".pedestalG1Frames";
|
|
|
|
|
|
if (value < 0ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Pedestal_g2_frames */ {
|
|
const int64_t& value = m_Pedestal_g2_frames;
|
|
const std::string currentValuePath = _pathPrefix + ".pedestalG2Frames";
|
|
|
|
|
|
if (value < 0ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Pedestal_g0_rms_limit */ {
|
|
const int64_t& value = m_Pedestal_g0_rms_limit;
|
|
const std::string currentValuePath = _pathPrefix + ".pedestalG0RmsLimit";
|
|
|
|
|
|
if (value < 0ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Pedestal_window_size */ {
|
|
const int64_t& value = m_Pedestal_window_size;
|
|
const std::string currentValuePath = _pathPrefix + ".pedestalWindowSize";
|
|
|
|
|
|
if (value < 32ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 32;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Storage_cell_delay_ns */ {
|
|
const int64_t& value = m_Storage_cell_delay_ns;
|
|
const std::string currentValuePath = _pathPrefix + ".storageCellDelayNs";
|
|
|
|
|
|
if (value < 2100ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 2100;";
|
|
}
|
|
|
|
}
|
|
|
|
if (detectorTriggerDelayNsIsSet())
|
|
{
|
|
const int64_t& value = m_Detector_trigger_delay_ns;
|
|
const std::string currentValuePath = _pathPrefix + ".detectorTriggerDelayNs";
|
|
|
|
|
|
if (value < 0ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0;";
|
|
}
|
|
|
|
}
|
|
|
|
return success;
|
|
}
|
|
|
|
bool Detector_settings::operator==(const Detector_settings& rhs) const
|
|
{
|
|
return
|
|
|
|
|
|
(getFrameTimeUs() == rhs.getFrameTimeUs())
|
|
&&
|
|
|
|
|
|
((!countTimeUsIsSet() && !rhs.countTimeUsIsSet()) || (countTimeUsIsSet() && rhs.countTimeUsIsSet() && getCountTimeUs() == rhs.getCountTimeUs())) &&
|
|
|
|
(getStorageCellCount() == rhs.getStorageCellCount())
|
|
&&
|
|
|
|
(isInternalFrameGenerator() == rhs.isInternalFrameGenerator())
|
|
&&
|
|
|
|
(getInternalFrameGeneratorImages() == rhs.getInternalFrameGeneratorImages())
|
|
&&
|
|
|
|
(getPedestalG0Frames() == rhs.getPedestalG0Frames())
|
|
&&
|
|
|
|
(getPedestalG1Frames() == rhs.getPedestalG1Frames())
|
|
&&
|
|
|
|
(getPedestalG2Frames() == rhs.getPedestalG2Frames())
|
|
&&
|
|
|
|
(getPedestalG0RmsLimit() == rhs.getPedestalG0RmsLimit())
|
|
&&
|
|
|
|
(getPedestalWindowSize() == rhs.getPedestalWindowSize())
|
|
&&
|
|
|
|
(getStorageCellDelayNs() == rhs.getStorageCellDelayNs())
|
|
&&
|
|
|
|
|
|
((!detectorTriggerDelayNsIsSet() && !rhs.detectorTriggerDelayNsIsSet()) || (detectorTriggerDelayNsIsSet() && rhs.detectorTriggerDelayNsIsSet() && getDetectorTriggerDelayNs() == rhs.getDetectorTriggerDelayNs())) &&
|
|
|
|
|
|
((!fixedGainG1IsSet() && !rhs.fixedGainG1IsSet()) || (fixedGainG1IsSet() && rhs.fixedGainG1IsSet() && isFixedGainG1() == rhs.isFixedGainG1())) &&
|
|
|
|
|
|
((!useGainHg0IsSet() && !rhs.useGainHg0IsSet()) || (useGainHg0IsSet() && rhs.useGainHg0IsSet() && isUseGainHg0() == rhs.isUseGainHg0()))
|
|
|
|
;
|
|
}
|
|
|
|
bool Detector_settings::operator!=(const Detector_settings& rhs) const
|
|
{
|
|
return !(*this == rhs);
|
|
}
|
|
|
|
void to_json(nlohmann::json& j, const Detector_settings& o)
|
|
{
|
|
j = nlohmann::json::object();
|
|
j["frame_time_us"] = o.m_Frame_time_us;
|
|
if(o.countTimeUsIsSet())
|
|
j["count_time_us"] = o.m_Count_time_us;
|
|
j["storage_cell_count"] = o.m_Storage_cell_count;
|
|
j["internal_frame_generator"] = o.m_Internal_frame_generator;
|
|
j["internal_frame_generator_images"] = o.m_Internal_frame_generator_images;
|
|
j["pedestal_g0_frames"] = o.m_Pedestal_g0_frames;
|
|
j["pedestal_g1_frames"] = o.m_Pedestal_g1_frames;
|
|
j["pedestal_g2_frames"] = o.m_Pedestal_g2_frames;
|
|
j["pedestal_g0_rms_limit"] = o.m_Pedestal_g0_rms_limit;
|
|
j["pedestal_window_size"] = o.m_Pedestal_window_size;
|
|
j["storage_cell_delay_ns"] = o.m_Storage_cell_delay_ns;
|
|
if(o.detectorTriggerDelayNsIsSet())
|
|
j["detector_trigger_delay_ns"] = o.m_Detector_trigger_delay_ns;
|
|
if(o.fixedGainG1IsSet())
|
|
j["fixed_gain_g1"] = o.m_Fixed_gain_g1;
|
|
if(o.useGainHg0IsSet())
|
|
j["use_gain_hg0"] = o.m_Use_gain_hg0;
|
|
|
|
}
|
|
|
|
void from_json(const nlohmann::json& j, Detector_settings& o)
|
|
{
|
|
j.at("frame_time_us").get_to(o.m_Frame_time_us);
|
|
if(j.find("count_time_us") != j.end())
|
|
{
|
|
j.at("count_time_us").get_to(o.m_Count_time_us);
|
|
o.m_Count_time_usIsSet = true;
|
|
}
|
|
j.at("storage_cell_count").get_to(o.m_Storage_cell_count);
|
|
j.at("internal_frame_generator").get_to(o.m_Internal_frame_generator);
|
|
j.at("internal_frame_generator_images").get_to(o.m_Internal_frame_generator_images);
|
|
j.at("pedestal_g0_frames").get_to(o.m_Pedestal_g0_frames);
|
|
j.at("pedestal_g1_frames").get_to(o.m_Pedestal_g1_frames);
|
|
j.at("pedestal_g2_frames").get_to(o.m_Pedestal_g2_frames);
|
|
j.at("pedestal_g0_rms_limit").get_to(o.m_Pedestal_g0_rms_limit);
|
|
j.at("pedestal_window_size").get_to(o.m_Pedestal_window_size);
|
|
j.at("storage_cell_delay_ns").get_to(o.m_Storage_cell_delay_ns);
|
|
if(j.find("detector_trigger_delay_ns") != j.end())
|
|
{
|
|
j.at("detector_trigger_delay_ns").get_to(o.m_Detector_trigger_delay_ns);
|
|
o.m_Detector_trigger_delay_nsIsSet = true;
|
|
}
|
|
if(j.find("fixed_gain_g1") != j.end())
|
|
{
|
|
j.at("fixed_gain_g1").get_to(o.m_Fixed_gain_g1);
|
|
o.m_Fixed_gain_g1IsSet = true;
|
|
}
|
|
if(j.find("use_gain_hg0") != j.end())
|
|
{
|
|
j.at("use_gain_hg0").get_to(o.m_Use_gain_hg0);
|
|
o.m_Use_gain_hg0IsSet = true;
|
|
}
|
|
|
|
}
|
|
|
|
int64_t Detector_settings::getFrameTimeUs() const
|
|
{
|
|
return m_Frame_time_us;
|
|
}
|
|
void Detector_settings::setFrameTimeUs(int64_t const value)
|
|
{
|
|
m_Frame_time_us = value;
|
|
}
|
|
int64_t Detector_settings::getCountTimeUs() const
|
|
{
|
|
return m_Count_time_us;
|
|
}
|
|
void Detector_settings::setCountTimeUs(int64_t const value)
|
|
{
|
|
m_Count_time_us = value;
|
|
m_Count_time_usIsSet = true;
|
|
}
|
|
bool Detector_settings::countTimeUsIsSet() const
|
|
{
|
|
return m_Count_time_usIsSet;
|
|
}
|
|
void Detector_settings::unsetCount_time_us()
|
|
{
|
|
m_Count_time_usIsSet = false;
|
|
}
|
|
int64_t Detector_settings::getStorageCellCount() const
|
|
{
|
|
return m_Storage_cell_count;
|
|
}
|
|
void Detector_settings::setStorageCellCount(int64_t const value)
|
|
{
|
|
m_Storage_cell_count = value;
|
|
}
|
|
bool Detector_settings::isInternalFrameGenerator() const
|
|
{
|
|
return m_Internal_frame_generator;
|
|
}
|
|
void Detector_settings::setInternalFrameGenerator(bool const value)
|
|
{
|
|
m_Internal_frame_generator = value;
|
|
}
|
|
int64_t Detector_settings::getInternalFrameGeneratorImages() const
|
|
{
|
|
return m_Internal_frame_generator_images;
|
|
}
|
|
void Detector_settings::setInternalFrameGeneratorImages(int64_t const value)
|
|
{
|
|
m_Internal_frame_generator_images = value;
|
|
}
|
|
int64_t Detector_settings::getPedestalG0Frames() const
|
|
{
|
|
return m_Pedestal_g0_frames;
|
|
}
|
|
void Detector_settings::setPedestalG0Frames(int64_t const value)
|
|
{
|
|
m_Pedestal_g0_frames = value;
|
|
}
|
|
int64_t Detector_settings::getPedestalG1Frames() const
|
|
{
|
|
return m_Pedestal_g1_frames;
|
|
}
|
|
void Detector_settings::setPedestalG1Frames(int64_t const value)
|
|
{
|
|
m_Pedestal_g1_frames = value;
|
|
}
|
|
int64_t Detector_settings::getPedestalG2Frames() const
|
|
{
|
|
return m_Pedestal_g2_frames;
|
|
}
|
|
void Detector_settings::setPedestalG2Frames(int64_t const value)
|
|
{
|
|
m_Pedestal_g2_frames = value;
|
|
}
|
|
int64_t Detector_settings::getPedestalG0RmsLimit() const
|
|
{
|
|
return m_Pedestal_g0_rms_limit;
|
|
}
|
|
void Detector_settings::setPedestalG0RmsLimit(int64_t const value)
|
|
{
|
|
m_Pedestal_g0_rms_limit = value;
|
|
}
|
|
int64_t Detector_settings::getPedestalWindowSize() const
|
|
{
|
|
return m_Pedestal_window_size;
|
|
}
|
|
void Detector_settings::setPedestalWindowSize(int64_t const value)
|
|
{
|
|
m_Pedestal_window_size = value;
|
|
}
|
|
int64_t Detector_settings::getStorageCellDelayNs() const
|
|
{
|
|
return m_Storage_cell_delay_ns;
|
|
}
|
|
void Detector_settings::setStorageCellDelayNs(int64_t const value)
|
|
{
|
|
m_Storage_cell_delay_ns = value;
|
|
}
|
|
int64_t Detector_settings::getDetectorTriggerDelayNs() const
|
|
{
|
|
return m_Detector_trigger_delay_ns;
|
|
}
|
|
void Detector_settings::setDetectorTriggerDelayNs(int64_t const value)
|
|
{
|
|
m_Detector_trigger_delay_ns = value;
|
|
m_Detector_trigger_delay_nsIsSet = true;
|
|
}
|
|
bool Detector_settings::detectorTriggerDelayNsIsSet() const
|
|
{
|
|
return m_Detector_trigger_delay_nsIsSet;
|
|
}
|
|
void Detector_settings::unsetDetector_trigger_delay_ns()
|
|
{
|
|
m_Detector_trigger_delay_nsIsSet = false;
|
|
}
|
|
bool Detector_settings::isFixedGainG1() const
|
|
{
|
|
return m_Fixed_gain_g1;
|
|
}
|
|
void Detector_settings::setFixedGainG1(bool const value)
|
|
{
|
|
m_Fixed_gain_g1 = value;
|
|
m_Fixed_gain_g1IsSet = true;
|
|
}
|
|
bool Detector_settings::fixedGainG1IsSet() const
|
|
{
|
|
return m_Fixed_gain_g1IsSet;
|
|
}
|
|
void Detector_settings::unsetFixed_gain_g1()
|
|
{
|
|
m_Fixed_gain_g1IsSet = false;
|
|
}
|
|
bool Detector_settings::isUseGainHg0() const
|
|
{
|
|
return m_Use_gain_hg0;
|
|
}
|
|
void Detector_settings::setUseGainHg0(bool const value)
|
|
{
|
|
m_Use_gain_hg0 = value;
|
|
m_Use_gain_hg0IsSet = true;
|
|
}
|
|
bool Detector_settings::useGainHg0IsSet() const
|
|
{
|
|
return m_Use_gain_hg0IsSet;
|
|
}
|
|
void Detector_settings::unsetUse_gain_hg0()
|
|
{
|
|
m_Use_gain_hg0IsSet = false;
|
|
}
|
|
|
|
|
|
} // namespace org::openapitools::server::model
|
|
|