196 lines
5.7 KiB
C++
196 lines
5.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. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
|
*
|
|
* The version of the OpenAPI document: 1.0.0-rc.94
|
|
* 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
|
|
|