/** * 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. * * The version of the OpenAPI document: 1.0.0-rc.42 * 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 "Spot_finding_settings.h" #include "Helpers.h" #include namespace org::openapitools::server::model { Spot_finding_settings::Spot_finding_settings() { m_Enable = true; m_Indexing = true; m_Filter_powder_rings = false; m_Filter_powder_ringsIsSet = false; m_Min_spot_count_powder_ring = 0L; m_Min_spot_count_powder_ringIsSet = false; 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_Resolution_estimate = true; m_Resolution_estimateIsSet = false; m_Quick_integration = false; m_Quick_integration_high_res_A = 1.5f; } 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; if (minSpotCountPowderRingIsSet()) { const int64_t& value = m_Min_spot_count_powder_ring; const std::string currentValuePath = _pathPrefix + ".minSpotCountPowderRing"; if (value < 5ll) { success = false; msg << currentValuePath << ": must be greater than or equal to 5;"; } } /* 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 Spot_finding_settings::operator==(const Spot_finding_settings& rhs) const { return (isEnable() == rhs.isEnable()) && (isIndexing() == rhs.isIndexing()) && ((!filterPowderRingsIsSet() && !rhs.filterPowderRingsIsSet()) || (filterPowderRingsIsSet() && rhs.filterPowderRingsIsSet() && isFilterPowderRings() == rhs.isFilterPowderRings())) && ((!minSpotCountPowderRingIsSet() && !rhs.minSpotCountPowderRingIsSet()) || (minSpotCountPowderRingIsSet() && rhs.minSpotCountPowderRingIsSet() && getMinSpotCountPowderRing() == rhs.getMinSpotCountPowderRing())) && (getSignalToNoiseThreshold() == rhs.getSignalToNoiseThreshold()) && (getPhotonCountThreshold() == rhs.getPhotonCountThreshold()) && (getMinPixPerSpot() == rhs.getMinPixPerSpot()) && (getMaxPixPerSpot() == rhs.getMaxPixPerSpot()) && (getHighResolutionLimit() == rhs.getHighResolutionLimit()) && (getLowResolutionLimit() == rhs.getLowResolutionLimit()) && ((!resolutionEstimateIsSet() && !rhs.resolutionEstimateIsSet()) || (resolutionEstimateIsSet() && rhs.resolutionEstimateIsSet() && isResolutionEstimate() == rhs.isResolutionEstimate())) && (isQuickIntegration() == rhs.isQuickIntegration()) && (getQuickIntegrationHighResA() == rhs.getQuickIntegrationHighResA()) ; } 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::object(); j["enable"] = o.m_Enable; j["indexing"] = o.m_Indexing; if(o.filterPowderRingsIsSet()) j["filter_powder_rings"] = o.m_Filter_powder_rings; if(o.minSpotCountPowderRingIsSet()) j["min_spot_count_powder_ring"] = o.m_Min_spot_count_powder_ring; 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.resolutionEstimateIsSet()) j["resolution_estimate"] = o.m_Resolution_estimate; j["quick_integration"] = o.m_Quick_integration; j["quick_integration_high_res_A"] = o.m_Quick_integration_high_res_A; } 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); if(j.find("filter_powder_rings") != j.end()) { j.at("filter_powder_rings").get_to(o.m_Filter_powder_rings); o.m_Filter_powder_ringsIsSet = true; } if(j.find("min_spot_count_powder_ring") != j.end()) { j.at("min_spot_count_powder_ring").get_to(o.m_Min_spot_count_powder_ring); o.m_Min_spot_count_powder_ringIsSet = true; } 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("resolution_estimate") != j.end()) { j.at("resolution_estimate").get_to(o.m_Resolution_estimate); o.m_Resolution_estimateIsSet = true; } j.at("quick_integration").get_to(o.m_Quick_integration); j.at("quick_integration_high_res_A").get_to(o.m_Quick_integration_high_res_A); } 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; } bool Spot_finding_settings::isFilterPowderRings() const { return m_Filter_powder_rings; } void Spot_finding_settings::setFilterPowderRings(bool const value) { m_Filter_powder_rings = value; m_Filter_powder_ringsIsSet = true; } bool Spot_finding_settings::filterPowderRingsIsSet() const { return m_Filter_powder_ringsIsSet; } void Spot_finding_settings::unsetFilter_powder_rings() { m_Filter_powder_ringsIsSet = false; } int64_t Spot_finding_settings::getMinSpotCountPowderRing() const { return m_Min_spot_count_powder_ring; } void Spot_finding_settings::setMinSpotCountPowderRing(int64_t const value) { m_Min_spot_count_powder_ring = value; m_Min_spot_count_powder_ringIsSet = true; } bool Spot_finding_settings::minSpotCountPowderRingIsSet() const { return m_Min_spot_count_powder_ringIsSet; } void Spot_finding_settings::unsetMin_spot_count_powder_ring() { m_Min_spot_count_powder_ringIsSet = false; } 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; } bool Spot_finding_settings::isResolutionEstimate() const { return m_Resolution_estimate; } void Spot_finding_settings::setResolutionEstimate(bool const value) { m_Resolution_estimate = value; m_Resolution_estimateIsSet = true; } bool Spot_finding_settings::resolutionEstimateIsSet() const { return m_Resolution_estimateIsSet; } void Spot_finding_settings::unsetResolution_estimate() { m_Resolution_estimateIsSet = false; } bool Spot_finding_settings::isQuickIntegration() const { return m_Quick_integration; } void Spot_finding_settings::setQuickIntegration(bool const value) { m_Quick_integration = value; } float Spot_finding_settings::getQuickIntegrationHighResA() const { return m_Quick_integration_high_res_A; } void Spot_finding_settings::setQuickIntegrationHighResA(float const value) { m_Quick_integration_high_res_A = value; } } // namespace org::openapitools::server::model