196 lines
4.7 KiB
C++
196 lines
4.7 KiB
C++
/**
|
|
* 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.64
|
|
* 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 "Azim_int_settings.h"
|
|
#include "Helpers.h"
|
|
|
|
#include <sstream>
|
|
|
|
namespace org::openapitools::server::model
|
|
{
|
|
|
|
Azim_int_settings::Azim_int_settings()
|
|
{
|
|
m_Polarization_corr = true;
|
|
m_Solid_angle_corr = true;
|
|
m_High_q_recipA = 0.0f;
|
|
m_Low_q_recipA = 0.0f;
|
|
m_Q_spacing = 0.0f;
|
|
m_Azimuthal_bins = 1L;
|
|
m_Azimuthal_binsIsSet = false;
|
|
|
|
}
|
|
|
|
void Azim_int_settings::validate() const
|
|
{
|
|
std::stringstream msg;
|
|
if (!validate(msg))
|
|
{
|
|
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
|
}
|
|
}
|
|
|
|
bool Azim_int_settings::validate(std::stringstream& msg) const
|
|
{
|
|
return validate(msg, "");
|
|
}
|
|
|
|
bool Azim_int_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
|
{
|
|
bool success = true;
|
|
const std::string _pathPrefix = pathPrefix.empty() ? "Azim_int_settings" : pathPrefix;
|
|
|
|
|
|
if (azimuthalBinsIsSet())
|
|
{
|
|
const int64_t& value = m_Azimuthal_bins;
|
|
const std::string currentValuePath = _pathPrefix + ".azimuthalBins";
|
|
|
|
|
|
if (value < 1ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 1;";
|
|
}
|
|
if (value > 256ll)
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be less than or equal to 256;";
|
|
}
|
|
|
|
}
|
|
|
|
return success;
|
|
}
|
|
|
|
bool Azim_int_settings::operator==(const Azim_int_settings& rhs) const
|
|
{
|
|
return
|
|
|
|
|
|
(isPolarizationCorr() == rhs.isPolarizationCorr())
|
|
&&
|
|
|
|
(isSolidAngleCorr() == rhs.isSolidAngleCorr())
|
|
&&
|
|
|
|
(getHighQRecipA() == rhs.getHighQRecipA())
|
|
&&
|
|
|
|
(getLowQRecipA() == rhs.getLowQRecipA())
|
|
&&
|
|
|
|
(getQSpacing() == rhs.getQSpacing())
|
|
&&
|
|
|
|
|
|
((!azimuthalBinsIsSet() && !rhs.azimuthalBinsIsSet()) || (azimuthalBinsIsSet() && rhs.azimuthalBinsIsSet() && getAzimuthalBins() == rhs.getAzimuthalBins()))
|
|
|
|
;
|
|
}
|
|
|
|
bool Azim_int_settings::operator!=(const Azim_int_settings& rhs) const
|
|
{
|
|
return !(*this == rhs);
|
|
}
|
|
|
|
void to_json(nlohmann::json& j, const Azim_int_settings& o)
|
|
{
|
|
j = nlohmann::json::object();
|
|
j["polarization_corr"] = o.m_Polarization_corr;
|
|
j["solid_angle_corr"] = o.m_Solid_angle_corr;
|
|
j["high_q_recipA"] = o.m_High_q_recipA;
|
|
j["low_q_recipA"] = o.m_Low_q_recipA;
|
|
j["q_spacing"] = o.m_Q_spacing;
|
|
if(o.azimuthalBinsIsSet())
|
|
j["azimuthal_bins"] = o.m_Azimuthal_bins;
|
|
|
|
}
|
|
|
|
void from_json(const nlohmann::json& j, Azim_int_settings& o)
|
|
{
|
|
j.at("polarization_corr").get_to(o.m_Polarization_corr);
|
|
j.at("solid_angle_corr").get_to(o.m_Solid_angle_corr);
|
|
j.at("high_q_recipA").get_to(o.m_High_q_recipA);
|
|
j.at("low_q_recipA").get_to(o.m_Low_q_recipA);
|
|
j.at("q_spacing").get_to(o.m_Q_spacing);
|
|
if(j.find("azimuthal_bins") != j.end())
|
|
{
|
|
j.at("azimuthal_bins").get_to(o.m_Azimuthal_bins);
|
|
o.m_Azimuthal_binsIsSet = true;
|
|
}
|
|
|
|
}
|
|
|
|
bool Azim_int_settings::isPolarizationCorr() const
|
|
{
|
|
return m_Polarization_corr;
|
|
}
|
|
void Azim_int_settings::setPolarizationCorr(bool const value)
|
|
{
|
|
m_Polarization_corr = value;
|
|
}
|
|
bool Azim_int_settings::isSolidAngleCorr() const
|
|
{
|
|
return m_Solid_angle_corr;
|
|
}
|
|
void Azim_int_settings::setSolidAngleCorr(bool const value)
|
|
{
|
|
m_Solid_angle_corr = value;
|
|
}
|
|
float Azim_int_settings::getHighQRecipA() const
|
|
{
|
|
return m_High_q_recipA;
|
|
}
|
|
void Azim_int_settings::setHighQRecipA(float const value)
|
|
{
|
|
m_High_q_recipA = value;
|
|
}
|
|
float Azim_int_settings::getLowQRecipA() const
|
|
{
|
|
return m_Low_q_recipA;
|
|
}
|
|
void Azim_int_settings::setLowQRecipA(float const value)
|
|
{
|
|
m_Low_q_recipA = value;
|
|
}
|
|
float Azim_int_settings::getQSpacing() const
|
|
{
|
|
return m_Q_spacing;
|
|
}
|
|
void Azim_int_settings::setQSpacing(float const value)
|
|
{
|
|
m_Q_spacing = value;
|
|
}
|
|
int64_t Azim_int_settings::getAzimuthalBins() const
|
|
{
|
|
return m_Azimuthal_bins;
|
|
}
|
|
void Azim_int_settings::setAzimuthalBins(int64_t const value)
|
|
{
|
|
m_Azimuthal_bins = value;
|
|
m_Azimuthal_binsIsSet = true;
|
|
}
|
|
bool Azim_int_settings::azimuthalBinsIsSet() const
|
|
{
|
|
return m_Azimuthal_binsIsSet;
|
|
}
|
|
void Azim_int_settings::unsetAzimuthal_bins()
|
|
{
|
|
m_Azimuthal_binsIsSet = false;
|
|
}
|
|
|
|
|
|
} // namespace org::openapitools::server::model
|
|
|