/** * 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 "Data_processing_settings.h" #include "Helpers.h" #include namespace org::openapitools::server::model { Data_processing_settings::Data_processing_settings() { 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; m_Preview_indexed_only = false; m_Preview_indexed_onlyIsSet = false; } void Data_processing_settings::validate() const { std::stringstream msg; if (!validate(msg)) { throw org::openapitools::server::helpers::ValidationException(msg.str()); } } bool Data_processing_settings::validate(std::stringstream& msg) const { return validate(msg, ""); } bool Data_processing_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const { bool success = true; const std::string _pathPrefix = pathPrefix.empty() ? "Data_processing_settings" : pathPrefix; /* Signal_to_noise_threshold */ { const float& value = m_Signal_to_noise_threshold; const std::string currentValuePath = _pathPrefix + ".signalToNoiseThreshold"; if (value < static_cast(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 Data_processing_settings::operator==(const Data_processing_settings& rhs) const { return (getSignalToNoiseThreshold() == rhs.getSignalToNoiseThreshold()) && (getPhotonCountThreshold() == rhs.getPhotonCountThreshold()) && (getMinPixPerSpot() == rhs.getMinPixPerSpot()) && (getMaxPixPerSpot() == rhs.getMaxPixPerSpot()) && (getHighResolutionLimit() == rhs.getHighResolutionLimit()) && (getLowResolutionLimit() == rhs.getLowResolutionLimit()) && ((!previewIndexedOnlyIsSet() && !rhs.previewIndexedOnlyIsSet()) || (previewIndexedOnlyIsSet() && rhs.previewIndexedOnlyIsSet() && isPreviewIndexedOnly() == rhs.isPreviewIndexedOnly())) ; } bool Data_processing_settings::operator!=(const Data_processing_settings& rhs) const { return !(*this == rhs); } void to_json(nlohmann::json& j, const Data_processing_settings& o) { j = nlohmann::json(); 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; if(o.previewIndexedOnlyIsSet()) j["preview_indexed_only"] = o.m_Preview_indexed_only; } void from_json(const nlohmann::json& j, Data_processing_settings& o) { 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); if(j.find("preview_indexed_only") != j.end()) { j.at("preview_indexed_only").get_to(o.m_Preview_indexed_only); o.m_Preview_indexed_onlyIsSet = true; } } float Data_processing_settings::getSignalToNoiseThreshold() const { return m_Signal_to_noise_threshold; } void Data_processing_settings::setSignalToNoiseThreshold(float const value) { m_Signal_to_noise_threshold = value; } int64_t Data_processing_settings::getPhotonCountThreshold() const { return m_Photon_count_threshold; } void Data_processing_settings::setPhotonCountThreshold(int64_t const value) { m_Photon_count_threshold = value; } int64_t Data_processing_settings::getMinPixPerSpot() const { return m_Min_pix_per_spot; } void Data_processing_settings::setMinPixPerSpot(int64_t const value) { m_Min_pix_per_spot = value; } int64_t Data_processing_settings::getMaxPixPerSpot() const { return m_Max_pix_per_spot; } void Data_processing_settings::setMaxPixPerSpot(int64_t const value) { m_Max_pix_per_spot = value; } float Data_processing_settings::getHighResolutionLimit() const { return m_High_resolution_limit; } void Data_processing_settings::setHighResolutionLimit(float const value) { m_High_resolution_limit = value; } float Data_processing_settings::getLowResolutionLimit() const { return m_Low_resolution_limit; } void Data_processing_settings::setLowResolutionLimit(float const value) { m_Low_resolution_limit = value; } bool Data_processing_settings::isPreviewIndexedOnly() const { return m_Preview_indexed_only; } void Data_processing_settings::setPreviewIndexedOnly(bool const value) { m_Preview_indexed_only = value; m_Preview_indexed_onlyIsSet = true; } bool Data_processing_settings::previewIndexedOnlyIsSet() const { return m_Preview_indexed_onlyIsSet; } void Data_processing_settings::unsetPreview_indexed_only() { m_Preview_indexed_onlyIsSet = false; } } // namespace org::openapitools::server::model