All checks were successful
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 7m51s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 7m19s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 7m46s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 8m32s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 8m6s
Build Packages / build:rpm (rocky8) (push) Successful in 8m7s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 7m37s
Build Packages / Generate python client (push) Successful in 17s
Build Packages / Create release (push) Has been skipped
Build Packages / Build documentation (push) Successful in 32s
Build Packages / build:rpm (rocky9) (push) Successful in 9m6s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 6m53s
Build Packages / Unit tests (push) Successful in 1h9m39s
This is an UNSTABLE release. * jfjoch_viewer: Minor improvements to the viewer * jfjoch_broker: Change behavior for modular detectors: coordinates of 0-th pixel can be now arbitrary and detector will be cropped to the smallest rectangle limited by module coordinates Reviewed-on: #8 Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch> Co-committed-by: Filip Leonarski <filip.leonarski@psi.ch>
261 lines
6.4 KiB
C++
261 lines
6.4 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.103
|
|
* 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 "Unit_cell.h"
|
|
#include "Helpers.h"
|
|
|
|
#include <sstream>
|
|
|
|
namespace org::openapitools::server::model
|
|
{
|
|
|
|
Unit_cell::Unit_cell()
|
|
{
|
|
m_a = 0.0f;
|
|
m_b = 0.0f;
|
|
m_c = 0.0f;
|
|
m_Alpha = 0.0f;
|
|
m_Beta = 0.0f;
|
|
m_Gamma = 0.0f;
|
|
|
|
}
|
|
|
|
void Unit_cell::validate() const
|
|
{
|
|
std::stringstream msg;
|
|
if (!validate(msg))
|
|
{
|
|
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
|
}
|
|
}
|
|
|
|
bool Unit_cell::validate(std::stringstream& msg) const
|
|
{
|
|
return validate(msg, "");
|
|
}
|
|
|
|
bool Unit_cell::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
|
{
|
|
bool success = true;
|
|
const std::string _pathPrefix = pathPrefix.empty() ? "Unit_cell" : pathPrefix;
|
|
|
|
|
|
|
|
/* a */ {
|
|
const float& value = m_a;
|
|
const std::string currentValuePath = _pathPrefix + ".A";
|
|
|
|
|
|
if (value < static_cast<float>(0))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* b */ {
|
|
const float& value = m_b;
|
|
const std::string currentValuePath = _pathPrefix + ".B";
|
|
|
|
|
|
if (value < static_cast<float>(0))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* c */ {
|
|
const float& value = m_c;
|
|
const std::string currentValuePath = _pathPrefix + ".C";
|
|
|
|
|
|
if (value < static_cast<float>(0))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Alpha */ {
|
|
const float& value = m_Alpha;
|
|
const std::string currentValuePath = _pathPrefix + ".alpha";
|
|
|
|
|
|
if (value < static_cast<float>(0))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0;";
|
|
}
|
|
if (value > static_cast<float>(360))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be less than or equal to 360;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Beta */ {
|
|
const float& value = m_Beta;
|
|
const std::string currentValuePath = _pathPrefix + ".beta";
|
|
|
|
|
|
if (value < static_cast<float>(0))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0;";
|
|
}
|
|
if (value > static_cast<float>(360))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be less than or equal to 360;";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Gamma */ {
|
|
const float& value = m_Gamma;
|
|
const std::string currentValuePath = _pathPrefix + ".gamma";
|
|
|
|
|
|
if (value < static_cast<float>(0))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be greater than or equal to 0;";
|
|
}
|
|
if (value > static_cast<float>(360))
|
|
{
|
|
success = false;
|
|
msg << currentValuePath << ": must be less than or equal to 360;";
|
|
}
|
|
|
|
}
|
|
|
|
return success;
|
|
}
|
|
|
|
bool Unit_cell::operator==(const Unit_cell& rhs) const
|
|
{
|
|
return
|
|
|
|
|
|
(getA() == rhs.getA())
|
|
&&
|
|
|
|
(getB() == rhs.getB())
|
|
&&
|
|
|
|
(getC() == rhs.getC())
|
|
&&
|
|
|
|
(getAlpha() == rhs.getAlpha())
|
|
&&
|
|
|
|
(getBeta() == rhs.getBeta())
|
|
&&
|
|
|
|
(getGamma() == rhs.getGamma())
|
|
|
|
|
|
;
|
|
}
|
|
|
|
bool Unit_cell::operator!=(const Unit_cell& rhs) const
|
|
{
|
|
return !(*this == rhs);
|
|
}
|
|
|
|
void to_json(nlohmann::json& j, const Unit_cell& o)
|
|
{
|
|
j = nlohmann::json::object();
|
|
j["a"] = o.m_a;
|
|
j["b"] = o.m_b;
|
|
j["c"] = o.m_c;
|
|
j["alpha"] = o.m_Alpha;
|
|
j["beta"] = o.m_Beta;
|
|
j["gamma"] = o.m_Gamma;
|
|
|
|
}
|
|
|
|
void from_json(const nlohmann::json& j, Unit_cell& o)
|
|
{
|
|
j.at("a").get_to(o.m_a);
|
|
j.at("b").get_to(o.m_b);
|
|
j.at("c").get_to(o.m_c);
|
|
j.at("alpha").get_to(o.m_Alpha);
|
|
j.at("beta").get_to(o.m_Beta);
|
|
j.at("gamma").get_to(o.m_Gamma);
|
|
|
|
}
|
|
|
|
float Unit_cell::getA() const
|
|
{
|
|
return m_a;
|
|
}
|
|
void Unit_cell::setA(float const value)
|
|
{
|
|
m_a = value;
|
|
}
|
|
float Unit_cell::getB() const
|
|
{
|
|
return m_b;
|
|
}
|
|
void Unit_cell::setB(float const value)
|
|
{
|
|
m_b = value;
|
|
}
|
|
float Unit_cell::getC() const
|
|
{
|
|
return m_c;
|
|
}
|
|
void Unit_cell::setC(float const value)
|
|
{
|
|
m_c = value;
|
|
}
|
|
float Unit_cell::getAlpha() const
|
|
{
|
|
return m_Alpha;
|
|
}
|
|
void Unit_cell::setAlpha(float const value)
|
|
{
|
|
m_Alpha = value;
|
|
}
|
|
float Unit_cell::getBeta() const
|
|
{
|
|
return m_Beta;
|
|
}
|
|
void Unit_cell::setBeta(float const value)
|
|
{
|
|
m_Beta = value;
|
|
}
|
|
float Unit_cell::getGamma() const
|
|
{
|
|
return m_Gamma;
|
|
}
|
|
void Unit_cell::setGamma(float const value)
|
|
{
|
|
m_Gamma = value;
|
|
}
|
|
|
|
|
|
} // namespace org::openapitools::server::model
|
|
|