193 lines
4.9 KiB
C++
193 lines
4.9 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.49
|
|
* 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 "Instrument_metadata.h"
|
|
#include "Helpers.h"
|
|
|
|
#include <sstream>
|
|
|
|
namespace org::openapitools::server::model
|
|
{
|
|
|
|
Instrument_metadata::Instrument_metadata()
|
|
{
|
|
m_Source_name = "";
|
|
m_Source_type = "";
|
|
m_Source_typeIsSet = false;
|
|
m_Instrument_name = "";
|
|
m_Pulsed_source = false;
|
|
m_Pulsed_sourceIsSet = false;
|
|
m_Electron_source = false;
|
|
m_Electron_sourceIsSet = false;
|
|
|
|
}
|
|
|
|
void Instrument_metadata::validate() const
|
|
{
|
|
std::stringstream msg;
|
|
if (!validate(msg))
|
|
{
|
|
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
|
}
|
|
}
|
|
|
|
bool Instrument_metadata::validate(std::stringstream& msg) const
|
|
{
|
|
return validate(msg, "");
|
|
}
|
|
|
|
bool Instrument_metadata::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
|
{
|
|
bool success = true;
|
|
const std::string _pathPrefix = pathPrefix.empty() ? "Instrument_metadata" : pathPrefix;
|
|
|
|
|
|
return success;
|
|
}
|
|
|
|
bool Instrument_metadata::operator==(const Instrument_metadata& rhs) const
|
|
{
|
|
return
|
|
|
|
|
|
(getSourceName() == rhs.getSourceName())
|
|
&&
|
|
|
|
|
|
((!sourceTypeIsSet() && !rhs.sourceTypeIsSet()) || (sourceTypeIsSet() && rhs.sourceTypeIsSet() && getSourceType() == rhs.getSourceType())) &&
|
|
|
|
(getInstrumentName() == rhs.getInstrumentName())
|
|
&&
|
|
|
|
|
|
((!pulsedSourceIsSet() && !rhs.pulsedSourceIsSet()) || (pulsedSourceIsSet() && rhs.pulsedSourceIsSet() && isPulsedSource() == rhs.isPulsedSource())) &&
|
|
|
|
|
|
((!electronSourceIsSet() && !rhs.electronSourceIsSet()) || (electronSourceIsSet() && rhs.electronSourceIsSet() && isElectronSource() == rhs.isElectronSource()))
|
|
|
|
;
|
|
}
|
|
|
|
bool Instrument_metadata::operator!=(const Instrument_metadata& rhs) const
|
|
{
|
|
return !(*this == rhs);
|
|
}
|
|
|
|
void to_json(nlohmann::json& j, const Instrument_metadata& o)
|
|
{
|
|
j = nlohmann::json::object();
|
|
j["source_name"] = o.m_Source_name;
|
|
if(o.sourceTypeIsSet())
|
|
j["source_type"] = o.m_Source_type;
|
|
j["instrument_name"] = o.m_Instrument_name;
|
|
if(o.pulsedSourceIsSet())
|
|
j["pulsed_source"] = o.m_Pulsed_source;
|
|
if(o.electronSourceIsSet())
|
|
j["electron_source"] = o.m_Electron_source;
|
|
|
|
}
|
|
|
|
void from_json(const nlohmann::json& j, Instrument_metadata& o)
|
|
{
|
|
j.at("source_name").get_to(o.m_Source_name);
|
|
if(j.find("source_type") != j.end())
|
|
{
|
|
j.at("source_type").get_to(o.m_Source_type);
|
|
o.m_Source_typeIsSet = true;
|
|
}
|
|
j.at("instrument_name").get_to(o.m_Instrument_name);
|
|
if(j.find("pulsed_source") != j.end())
|
|
{
|
|
j.at("pulsed_source").get_to(o.m_Pulsed_source);
|
|
o.m_Pulsed_sourceIsSet = true;
|
|
}
|
|
if(j.find("electron_source") != j.end())
|
|
{
|
|
j.at("electron_source").get_to(o.m_Electron_source);
|
|
o.m_Electron_sourceIsSet = true;
|
|
}
|
|
|
|
}
|
|
|
|
std::string Instrument_metadata::getSourceName() const
|
|
{
|
|
return m_Source_name;
|
|
}
|
|
void Instrument_metadata::setSourceName(std::string const& value)
|
|
{
|
|
m_Source_name = value;
|
|
}
|
|
std::string Instrument_metadata::getSourceType() const
|
|
{
|
|
return m_Source_type;
|
|
}
|
|
void Instrument_metadata::setSourceType(std::string const& value)
|
|
{
|
|
m_Source_type = value;
|
|
m_Source_typeIsSet = true;
|
|
}
|
|
bool Instrument_metadata::sourceTypeIsSet() const
|
|
{
|
|
return m_Source_typeIsSet;
|
|
}
|
|
void Instrument_metadata::unsetSource_type()
|
|
{
|
|
m_Source_typeIsSet = false;
|
|
}
|
|
std::string Instrument_metadata::getInstrumentName() const
|
|
{
|
|
return m_Instrument_name;
|
|
}
|
|
void Instrument_metadata::setInstrumentName(std::string const& value)
|
|
{
|
|
m_Instrument_name = value;
|
|
}
|
|
bool Instrument_metadata::isPulsedSource() const
|
|
{
|
|
return m_Pulsed_source;
|
|
}
|
|
void Instrument_metadata::setPulsedSource(bool const value)
|
|
{
|
|
m_Pulsed_source = value;
|
|
m_Pulsed_sourceIsSet = true;
|
|
}
|
|
bool Instrument_metadata::pulsedSourceIsSet() const
|
|
{
|
|
return m_Pulsed_sourceIsSet;
|
|
}
|
|
void Instrument_metadata::unsetPulsed_source()
|
|
{
|
|
m_Pulsed_sourceIsSet = false;
|
|
}
|
|
bool Instrument_metadata::isElectronSource() const
|
|
{
|
|
return m_Electron_source;
|
|
}
|
|
void Instrument_metadata::setElectronSource(bool const value)
|
|
{
|
|
m_Electron_source = value;
|
|
m_Electron_sourceIsSet = true;
|
|
}
|
|
bool Instrument_metadata::electronSourceIsSet() const
|
|
{
|
|
return m_Electron_sourceIsSet;
|
|
}
|
|
void Instrument_metadata::unsetElectron_source()
|
|
{
|
|
m_Electron_sourceIsSet = false;
|
|
}
|
|
|
|
|
|
} // namespace org::openapitools::server::model
|
|
|