399 lines
11 KiB
C++
399 lines
11 KiB
C++
/**
|
|
* Jungfraujoch
|
|
* Jungfraujoch Broker Web API
|
|
*
|
|
* The version of the OpenAPI document: 1.0.0
|
|
*
|
|
*
|
|
* 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_Storage_cell_countIsSet = false;
|
|
m_Internal_frame_generator = false;
|
|
m_Internal_frame_generatorIsSet = false;
|
|
m_Collect_raw_data = false;
|
|
m_Collect_raw_dataIsSet = false;
|
|
m_Pedestal_g0_frames = 0L;
|
|
m_Pedestal_g0_framesIsSet = false;
|
|
m_Pedestal_g1_frames = 0L;
|
|
m_Pedestal_g1_framesIsSet = false;
|
|
m_Pedestal_g2_frames = 0L;
|
|
m_Pedestal_g2_framesIsSet = false;
|
|
m_Storage_cell_delay_ns = 0L;
|
|
m_Storage_cell_delay_nsIsSet = 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;";
|
|
}
|
|
|
|
}
|
|
|
|
if (storageCellCountIsSet())
|
|
{
|
|
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;";
|
|
}
|
|
|
|
}
|
|
|
|
if (pedestalG0FramesIsSet())
|
|
{
|
|
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;";
|
|
}
|
|
|
|
}
|
|
|
|
if (pedestalG1FramesIsSet())
|
|
{
|
|
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;";
|
|
}
|
|
|
|
}
|
|
|
|
if (pedestalG2FramesIsSet())
|
|
{
|
|
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;";
|
|
}
|
|
|
|
}
|
|
|
|
return success;
|
|
}
|
|
|
|
bool Detector_settings::operator==(const Detector_settings& rhs) const
|
|
{
|
|
return
|
|
|
|
|
|
(getFrameTimeUs() == rhs.getFrameTimeUs())
|
|
&&
|
|
|
|
|
|
((!countTimeUsIsSet() && !rhs.countTimeUsIsSet()) || (countTimeUsIsSet() && rhs.countTimeUsIsSet() && getCountTimeUs() == rhs.getCountTimeUs())) &&
|
|
|
|
|
|
((!storageCellCountIsSet() && !rhs.storageCellCountIsSet()) || (storageCellCountIsSet() && rhs.storageCellCountIsSet() && getStorageCellCount() == rhs.getStorageCellCount())) &&
|
|
|
|
|
|
((!internalFrameGeneratorIsSet() && !rhs.internalFrameGeneratorIsSet()) || (internalFrameGeneratorIsSet() && rhs.internalFrameGeneratorIsSet() && isInternalFrameGenerator() == rhs.isInternalFrameGenerator())) &&
|
|
|
|
|
|
((!collectRawDataIsSet() && !rhs.collectRawDataIsSet()) || (collectRawDataIsSet() && rhs.collectRawDataIsSet() && isCollectRawData() == rhs.isCollectRawData())) &&
|
|
|
|
|
|
((!pedestalG0FramesIsSet() && !rhs.pedestalG0FramesIsSet()) || (pedestalG0FramesIsSet() && rhs.pedestalG0FramesIsSet() && getPedestalG0Frames() == rhs.getPedestalG0Frames())) &&
|
|
|
|
|
|
((!pedestalG1FramesIsSet() && !rhs.pedestalG1FramesIsSet()) || (pedestalG1FramesIsSet() && rhs.pedestalG1FramesIsSet() && getPedestalG1Frames() == rhs.getPedestalG1Frames())) &&
|
|
|
|
|
|
((!pedestalG2FramesIsSet() && !rhs.pedestalG2FramesIsSet()) || (pedestalG2FramesIsSet() && rhs.pedestalG2FramesIsSet() && getPedestalG2Frames() == rhs.getPedestalG2Frames())) &&
|
|
|
|
|
|
((!storageCellDelayNsIsSet() && !rhs.storageCellDelayNsIsSet()) || (storageCellDelayNsIsSet() && rhs.storageCellDelayNsIsSet() && getStorageCellDelayNs() == rhs.getStorageCellDelayNs()))
|
|
|
|
;
|
|
}
|
|
|
|
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();
|
|
j["frame_time_us"] = o.m_Frame_time_us;
|
|
if(o.countTimeUsIsSet())
|
|
j["count_time_us"] = o.m_Count_time_us;
|
|
if(o.storageCellCountIsSet())
|
|
j["storage_cell_count"] = o.m_Storage_cell_count;
|
|
if(o.internalFrameGeneratorIsSet())
|
|
j["internal_frame_generator"] = o.m_Internal_frame_generator;
|
|
if(o.collectRawDataIsSet())
|
|
j["collect_raw_data"] = o.m_Collect_raw_data;
|
|
if(o.pedestalG0FramesIsSet())
|
|
j["pedestal_g0_frames"] = o.m_Pedestal_g0_frames;
|
|
if(o.pedestalG1FramesIsSet())
|
|
j["pedestal_g1_frames"] = o.m_Pedestal_g1_frames;
|
|
if(o.pedestalG2FramesIsSet())
|
|
j["pedestal_g2_frames"] = o.m_Pedestal_g2_frames;
|
|
if(o.storageCellDelayNsIsSet())
|
|
j["storage_cell_delay_ns"] = o.m_Storage_cell_delay_ns;
|
|
|
|
}
|
|
|
|
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;
|
|
}
|
|
if(j.find("storage_cell_count") != j.end())
|
|
{
|
|
j.at("storage_cell_count").get_to(o.m_Storage_cell_count);
|
|
o.m_Storage_cell_countIsSet = true;
|
|
}
|
|
if(j.find("internal_frame_generator") != j.end())
|
|
{
|
|
j.at("internal_frame_generator").get_to(o.m_Internal_frame_generator);
|
|
o.m_Internal_frame_generatorIsSet = true;
|
|
}
|
|
if(j.find("collect_raw_data") != j.end())
|
|
{
|
|
j.at("collect_raw_data").get_to(o.m_Collect_raw_data);
|
|
o.m_Collect_raw_dataIsSet = true;
|
|
}
|
|
if(j.find("pedestal_g0_frames") != j.end())
|
|
{
|
|
j.at("pedestal_g0_frames").get_to(o.m_Pedestal_g0_frames);
|
|
o.m_Pedestal_g0_framesIsSet = true;
|
|
}
|
|
if(j.find("pedestal_g1_frames") != j.end())
|
|
{
|
|
j.at("pedestal_g1_frames").get_to(o.m_Pedestal_g1_frames);
|
|
o.m_Pedestal_g1_framesIsSet = true;
|
|
}
|
|
if(j.find("pedestal_g2_frames") != j.end())
|
|
{
|
|
j.at("pedestal_g2_frames").get_to(o.m_Pedestal_g2_frames);
|
|
o.m_Pedestal_g2_framesIsSet = true;
|
|
}
|
|
if(j.find("storage_cell_delay_ns") != j.end())
|
|
{
|
|
j.at("storage_cell_delay_ns").get_to(o.m_Storage_cell_delay_ns);
|
|
o.m_Storage_cell_delay_nsIsSet = 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;
|
|
m_Storage_cell_countIsSet = true;
|
|
}
|
|
bool Detector_settings::storageCellCountIsSet() const
|
|
{
|
|
return m_Storage_cell_countIsSet;
|
|
}
|
|
void Detector_settings::unsetStorage_cell_count()
|
|
{
|
|
m_Storage_cell_countIsSet = false;
|
|
}
|
|
bool Detector_settings::isInternalFrameGenerator() const
|
|
{
|
|
return m_Internal_frame_generator;
|
|
}
|
|
void Detector_settings::setInternalFrameGenerator(bool const value)
|
|
{
|
|
m_Internal_frame_generator = value;
|
|
m_Internal_frame_generatorIsSet = true;
|
|
}
|
|
bool Detector_settings::internalFrameGeneratorIsSet() const
|
|
{
|
|
return m_Internal_frame_generatorIsSet;
|
|
}
|
|
void Detector_settings::unsetInternal_frame_generator()
|
|
{
|
|
m_Internal_frame_generatorIsSet = false;
|
|
}
|
|
bool Detector_settings::isCollectRawData() const
|
|
{
|
|
return m_Collect_raw_data;
|
|
}
|
|
void Detector_settings::setCollectRawData(bool const value)
|
|
{
|
|
m_Collect_raw_data = value;
|
|
m_Collect_raw_dataIsSet = true;
|
|
}
|
|
bool Detector_settings::collectRawDataIsSet() const
|
|
{
|
|
return m_Collect_raw_dataIsSet;
|
|
}
|
|
void Detector_settings::unsetCollect_raw_data()
|
|
{
|
|
m_Collect_raw_dataIsSet = false;
|
|
}
|
|
int64_t Detector_settings::getPedestalG0Frames() const
|
|
{
|
|
return m_Pedestal_g0_frames;
|
|
}
|
|
void Detector_settings::setPedestalG0Frames(int64_t const value)
|
|
{
|
|
m_Pedestal_g0_frames = value;
|
|
m_Pedestal_g0_framesIsSet = true;
|
|
}
|
|
bool Detector_settings::pedestalG0FramesIsSet() const
|
|
{
|
|
return m_Pedestal_g0_framesIsSet;
|
|
}
|
|
void Detector_settings::unsetPedestal_g0_frames()
|
|
{
|
|
m_Pedestal_g0_framesIsSet = false;
|
|
}
|
|
int64_t Detector_settings::getPedestalG1Frames() const
|
|
{
|
|
return m_Pedestal_g1_frames;
|
|
}
|
|
void Detector_settings::setPedestalG1Frames(int64_t const value)
|
|
{
|
|
m_Pedestal_g1_frames = value;
|
|
m_Pedestal_g1_framesIsSet = true;
|
|
}
|
|
bool Detector_settings::pedestalG1FramesIsSet() const
|
|
{
|
|
return m_Pedestal_g1_framesIsSet;
|
|
}
|
|
void Detector_settings::unsetPedestal_g1_frames()
|
|
{
|
|
m_Pedestal_g1_framesIsSet = false;
|
|
}
|
|
int64_t Detector_settings::getPedestalG2Frames() const
|
|
{
|
|
return m_Pedestal_g2_frames;
|
|
}
|
|
void Detector_settings::setPedestalG2Frames(int64_t const value)
|
|
{
|
|
m_Pedestal_g2_frames = value;
|
|
m_Pedestal_g2_framesIsSet = true;
|
|
}
|
|
bool Detector_settings::pedestalG2FramesIsSet() const
|
|
{
|
|
return m_Pedestal_g2_framesIsSet;
|
|
}
|
|
void Detector_settings::unsetPedestal_g2_frames()
|
|
{
|
|
m_Pedestal_g2_framesIsSet = false;
|
|
}
|
|
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;
|
|
m_Storage_cell_delay_nsIsSet = true;
|
|
}
|
|
bool Detector_settings::storageCellDelayNsIsSet() const
|
|
{
|
|
return m_Storage_cell_delay_nsIsSet;
|
|
}
|
|
void Detector_settings::unsetStorage_cell_delay_ns()
|
|
{
|
|
m_Storage_cell_delay_nsIsSet = false;
|
|
}
|
|
|
|
|
|
} // namespace org::openapitools::server::model
|
|
|