Files
Jungfraujoch/broker/gen/model/Spot_finding_settings.cpp
2024-04-11 09:25:48 +02:00

246 lines
6.0 KiB
C++

/**
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Spot_finding_settings.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Spot_finding_settings::Spot_finding_settings()
{
m_Enable = true;
m_Indexing = true;
m_Signal_to_noise_threshold = 0.0f;
m_Photon_count_threshold = 0L;
m_Min_pix_per_spot = 0L;
m_Max_pix_per_spot = 0L;
m_High_resolution_limit = 0.0f;
m_Low_resolution_limit = 0.0f;
}
void Spot_finding_settings::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Spot_finding_settings::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Spot_finding_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Spot_finding_settings" : pathPrefix;
/* Signal_to_noise_threshold */ {
const float& value = m_Signal_to_noise_threshold;
const std::string currentValuePath = _pathPrefix + ".signalToNoiseThreshold";
if (value < static_cast<float>(0))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
/* Photon_count_threshold */ {
const int64_t& value = m_Photon_count_threshold;
const std::string currentValuePath = _pathPrefix + ".photonCountThreshold";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
/* Min_pix_per_spot */ {
const int64_t& value = m_Min_pix_per_spot;
const std::string currentValuePath = _pathPrefix + ".minPixPerSpot";
if (value < 1ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 1;";
}
}
/* Max_pix_per_spot */ {
const int64_t& value = m_Max_pix_per_spot;
const std::string currentValuePath = _pathPrefix + ".maxPixPerSpot";
if (value < 1ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 1;";
}
}
return success;
}
bool Spot_finding_settings::operator==(const Spot_finding_settings& rhs) const
{
return
(isEnable() == rhs.isEnable())
&&
(isIndexing() == rhs.isIndexing())
&&
(getSignalToNoiseThreshold() == rhs.getSignalToNoiseThreshold())
&&
(getPhotonCountThreshold() == rhs.getPhotonCountThreshold())
&&
(getMinPixPerSpot() == rhs.getMinPixPerSpot())
&&
(getMaxPixPerSpot() == rhs.getMaxPixPerSpot())
&&
(getHighResolutionLimit() == rhs.getHighResolutionLimit())
&&
(getLowResolutionLimit() == rhs.getLowResolutionLimit())
;
}
bool Spot_finding_settings::operator!=(const Spot_finding_settings& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Spot_finding_settings& o)
{
j = nlohmann::json();
j["enable"] = o.m_Enable;
j["indexing"] = o.m_Indexing;
j["signal_to_noise_threshold"] = o.m_Signal_to_noise_threshold;
j["photon_count_threshold"] = o.m_Photon_count_threshold;
j["min_pix_per_spot"] = o.m_Min_pix_per_spot;
j["max_pix_per_spot"] = o.m_Max_pix_per_spot;
j["high_resolution_limit"] = o.m_High_resolution_limit;
j["low_resolution_limit"] = o.m_Low_resolution_limit;
}
void from_json(const nlohmann::json& j, Spot_finding_settings& o)
{
j.at("enable").get_to(o.m_Enable);
j.at("indexing").get_to(o.m_Indexing);
j.at("signal_to_noise_threshold").get_to(o.m_Signal_to_noise_threshold);
j.at("photon_count_threshold").get_to(o.m_Photon_count_threshold);
j.at("min_pix_per_spot").get_to(o.m_Min_pix_per_spot);
j.at("max_pix_per_spot").get_to(o.m_Max_pix_per_spot);
j.at("high_resolution_limit").get_to(o.m_High_resolution_limit);
j.at("low_resolution_limit").get_to(o.m_Low_resolution_limit);
}
bool Spot_finding_settings::isEnable() const
{
return m_Enable;
}
void Spot_finding_settings::setEnable(bool const value)
{
m_Enable = value;
}
bool Spot_finding_settings::isIndexing() const
{
return m_Indexing;
}
void Spot_finding_settings::setIndexing(bool const value)
{
m_Indexing = value;
}
float Spot_finding_settings::getSignalToNoiseThreshold() const
{
return m_Signal_to_noise_threshold;
}
void Spot_finding_settings::setSignalToNoiseThreshold(float const value)
{
m_Signal_to_noise_threshold = value;
}
int64_t Spot_finding_settings::getPhotonCountThreshold() const
{
return m_Photon_count_threshold;
}
void Spot_finding_settings::setPhotonCountThreshold(int64_t const value)
{
m_Photon_count_threshold = value;
}
int64_t Spot_finding_settings::getMinPixPerSpot() const
{
return m_Min_pix_per_spot;
}
void Spot_finding_settings::setMinPixPerSpot(int64_t const value)
{
m_Min_pix_per_spot = value;
}
int64_t Spot_finding_settings::getMaxPixPerSpot() const
{
return m_Max_pix_per_spot;
}
void Spot_finding_settings::setMaxPixPerSpot(int64_t const value)
{
m_Max_pix_per_spot = value;
}
float Spot_finding_settings::getHighResolutionLimit() const
{
return m_High_resolution_limit;
}
void Spot_finding_settings::setHighResolutionLimit(float const value)
{
m_High_resolution_limit = value;
}
float Spot_finding_settings::getLowResolutionLimit() const
{
return m_Low_resolution_limit;
}
void Spot_finding_settings::setLowResolutionLimit(float const value)
{
m_Low_resolution_limit = value;
}
} // namespace org::openapitools::server::model