212 lines
5.6 KiB
C++
212 lines
5.6 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 "Plots.h"
|
|
#include "Helpers.h"
|
|
|
|
#include <sstream>
|
|
|
|
namespace org::openapitools::server::model
|
|
{
|
|
|
|
Plots::Plots()
|
|
{
|
|
m_Title = "";
|
|
m_TitleIsSet = false;
|
|
m_Size_x = 0.0f;
|
|
m_Size_xIsSet = false;
|
|
m_Size_y = 0.0f;
|
|
m_Size_yIsSet = false;
|
|
|
|
}
|
|
|
|
void Plots::validate() const
|
|
{
|
|
std::stringstream msg;
|
|
if (!validate(msg))
|
|
{
|
|
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
|
}
|
|
}
|
|
|
|
bool Plots::validate(std::stringstream& msg) const
|
|
{
|
|
return validate(msg, "");
|
|
}
|
|
|
|
bool Plots::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
|
{
|
|
bool success = true;
|
|
const std::string _pathPrefix = pathPrefix.empty() ? "Plots" : pathPrefix;
|
|
|
|
|
|
|
|
/* Plot */ {
|
|
const std::vector<org::openapitools::server::model::Plot>& value = m_Plot;
|
|
const std::string currentValuePath = _pathPrefix + ".plot";
|
|
|
|
|
|
{ // Recursive validation of array elements
|
|
const std::string oldValuePath = currentValuePath;
|
|
int i = 0;
|
|
for (const org::openapitools::server::model::Plot& value : value)
|
|
{
|
|
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
|
|
|
success = value.validate(msg, currentValuePath + ".plot") && success;
|
|
|
|
i++;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
return success;
|
|
}
|
|
|
|
bool Plots::operator==(const Plots& rhs) const
|
|
{
|
|
return
|
|
|
|
|
|
|
|
((!titleIsSet() && !rhs.titleIsSet()) || (titleIsSet() && rhs.titleIsSet() && getTitle() == rhs.getTitle())) &&
|
|
|
|
(getUnitX() == rhs.getUnitX())
|
|
&&
|
|
|
|
|
|
((!sizeXIsSet() && !rhs.sizeXIsSet()) || (sizeXIsSet() && rhs.sizeXIsSet() && getSizeX() == rhs.getSizeX())) &&
|
|
|
|
|
|
((!sizeYIsSet() && !rhs.sizeYIsSet()) || (sizeYIsSet() && rhs.sizeYIsSet() && getSizeY() == rhs.getSizeY())) &&
|
|
|
|
(getPlot() == rhs.getPlot())
|
|
|
|
|
|
;
|
|
}
|
|
|
|
bool Plots::operator!=(const Plots& rhs) const
|
|
{
|
|
return !(*this == rhs);
|
|
}
|
|
|
|
void to_json(nlohmann::json& j, const Plots& o)
|
|
{
|
|
j = nlohmann::json::object();
|
|
if(o.titleIsSet())
|
|
j["title"] = o.m_Title;
|
|
j["unit_x"] = o.m_Unit_x;
|
|
if(o.sizeXIsSet())
|
|
j["size_x"] = o.m_Size_x;
|
|
if(o.sizeYIsSet())
|
|
j["size_y"] = o.m_Size_y;
|
|
j["plot"] = o.m_Plot;
|
|
|
|
}
|
|
|
|
void from_json(const nlohmann::json& j, Plots& o)
|
|
{
|
|
if(j.find("title") != j.end())
|
|
{
|
|
j.at("title").get_to(o.m_Title);
|
|
o.m_TitleIsSet = true;
|
|
}
|
|
j.at("unit_x").get_to(o.m_Unit_x);
|
|
if(j.find("size_x") != j.end())
|
|
{
|
|
j.at("size_x").get_to(o.m_Size_x);
|
|
o.m_Size_xIsSet = true;
|
|
}
|
|
if(j.find("size_y") != j.end())
|
|
{
|
|
j.at("size_y").get_to(o.m_Size_y);
|
|
o.m_Size_yIsSet = true;
|
|
}
|
|
j.at("plot").get_to(o.m_Plot);
|
|
|
|
}
|
|
|
|
std::string Plots::getTitle() const
|
|
{
|
|
return m_Title;
|
|
}
|
|
void Plots::setTitle(std::string const& value)
|
|
{
|
|
m_Title = value;
|
|
m_TitleIsSet = true;
|
|
}
|
|
bool Plots::titleIsSet() const
|
|
{
|
|
return m_TitleIsSet;
|
|
}
|
|
void Plots::unsetTitle()
|
|
{
|
|
m_TitleIsSet = false;
|
|
}
|
|
org::openapitools::server::model::Plot_unit_x Plots::getUnitX() const
|
|
{
|
|
return m_Unit_x;
|
|
}
|
|
void Plots::setUnitX(org::openapitools::server::model::Plot_unit_x const& value)
|
|
{
|
|
m_Unit_x = value;
|
|
}
|
|
float Plots::getSizeX() const
|
|
{
|
|
return m_Size_x;
|
|
}
|
|
void Plots::setSizeX(float const value)
|
|
{
|
|
m_Size_x = value;
|
|
m_Size_xIsSet = true;
|
|
}
|
|
bool Plots::sizeXIsSet() const
|
|
{
|
|
return m_Size_xIsSet;
|
|
}
|
|
void Plots::unsetSize_x()
|
|
{
|
|
m_Size_xIsSet = false;
|
|
}
|
|
float Plots::getSizeY() const
|
|
{
|
|
return m_Size_y;
|
|
}
|
|
void Plots::setSizeY(float const value)
|
|
{
|
|
m_Size_y = value;
|
|
m_Size_yIsSet = true;
|
|
}
|
|
bool Plots::sizeYIsSet() const
|
|
{
|
|
return m_Size_yIsSet;
|
|
}
|
|
void Plots::unsetSize_y()
|
|
{
|
|
m_Size_yIsSet = false;
|
|
}
|
|
std::vector<org::openapitools::server::model::Plot> Plots::getPlot() const
|
|
{
|
|
return m_Plot;
|
|
}
|
|
void Plots::setPlot(std::vector<org::openapitools::server::model::Plot> const& value)
|
|
{
|
|
m_Plot = value;
|
|
}
|
|
|
|
|
|
} // namespace org::openapitools::server::model
|
|
|