Files
Jungfraujoch/broker/gen/model/Plots.cpp
2025-07-03 15:10:04 +02:00

212 lines
4.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.
*
* The version of the OpenAPI document: 1.0.0-rc.58
* 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