Files
Jungfraujoch/broker/gen/model/Indexing_settings.cpp
Filip Leonarski d55dad53c0
Some checks failed
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 10m43s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 11m8s
Build Packages / Generate python client (push) Successful in 29s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 11m40s
Build Packages / Build documentation (push) Successful in 57s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 13m1s
Build Packages / build:rpm (rocky8) (push) Successful in 13m11s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 13m25s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 13m25s
Build Packages / build:rpm (rocky9) (push) Successful in 14m7s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 7m20s
Build Packages / Unit tests (push) Failing after 53m39s
VERSION: 1.0.0-rc.103
2025-11-18 13:54:23 +01:00

372 lines
11 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 "Indexing_settings.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Indexing_settings::Indexing_settings()
{
m_Fft_max_unit_cell_A = 250.0f;
m_Fft_min_unit_cell_A = 10.0f;
m_Fft_high_resolution_A = 2.0f;
m_Fft_num_vectors = 16384L;
m_Tolerance = 0.0f;
m_Thread_count = 0L;
m_Unit_cell_dist_tolerance = 0.05f;
m_Viable_cell_min_spots = 10L;
m_Index_ice_rings = false;
}
void Indexing_settings::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Indexing_settings::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Indexing_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Indexing_settings" : pathPrefix;
/* Fft_max_unit_cell_A */ {
const float& value = m_Fft_max_unit_cell_A;
const std::string currentValuePath = _pathPrefix + ".fftMaxUnitCellA";
if (value < static_cast<float>(50))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 50;";
}
if (value > static_cast<float>(500))
{
success = false;
msg << currentValuePath << ": must be less than or equal to 500;";
}
}
/* Fft_min_unit_cell_A */ {
const float& value = m_Fft_min_unit_cell_A;
const std::string currentValuePath = _pathPrefix + ".fftMinUnitCellA";
if (value < static_cast<float>(5))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 5;";
}
if (value > static_cast<float>(40))
{
success = false;
msg << currentValuePath << ": must be less than or equal to 40;";
}
}
/* Fft_high_resolution_A */ {
const float& value = m_Fft_high_resolution_A;
const std::string currentValuePath = _pathPrefix + ".fftHighResolutionA";
if (value < static_cast<float>(0.5))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0.5;";
}
if (value > static_cast<float>(6.0))
{
success = false;
msg << currentValuePath << ": must be less than or equal to 6.0;";
}
}
/* Fft_num_vectors */ {
const int64_t& value = m_Fft_num_vectors;
const std::string currentValuePath = _pathPrefix + ".fftNumVectors";
if (value < 128ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 128;";
}
}
/* Tolerance */ {
const float& value = m_Tolerance;
const std::string currentValuePath = _pathPrefix + ".tolerance";
if (value < static_cast<float>(0.0))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0.0;";
}
if (value > static_cast<float>(0.5))
{
success = false;
msg << currentValuePath << ": must be less than or equal to 0.5;";
}
}
/* Thread_count */ {
const int64_t& value = m_Thread_count;
const std::string currentValuePath = _pathPrefix + ".threadCount";
if (value < 1ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 1;";
}
if (value > 64ll)
{
success = false;
msg << currentValuePath << ": must be less than or equal to 64;";
}
}
/* Unit_cell_dist_tolerance */ {
const float& value = m_Unit_cell_dist_tolerance;
const std::string currentValuePath = _pathPrefix + ".unitCellDistTolerance";
if (value < static_cast<float>(0.00010))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0.00010;";
}
if (value > static_cast<float>(0.2001))
{
success = false;
msg << currentValuePath << ": must be less than or equal to 0.2001;";
}
}
/* Viable_cell_min_spots */ {
const int64_t& value = m_Viable_cell_min_spots;
const std::string currentValuePath = _pathPrefix + ".viableCellMinSpots";
if (value < 5ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 5;";
}
}
return success;
}
bool Indexing_settings::operator==(const Indexing_settings& rhs) const
{
return
(getAlgorithm() == rhs.getAlgorithm())
&&
(getFftMaxUnitCellA() == rhs.getFftMaxUnitCellA())
&&
(getFftMinUnitCellA() == rhs.getFftMinUnitCellA())
&&
(getFftHighResolutionA() == rhs.getFftHighResolutionA())
&&
(getFftNumVectors() == rhs.getFftNumVectors())
&&
(getTolerance() == rhs.getTolerance())
&&
(getThreadCount() == rhs.getThreadCount())
&&
(getGeomRefinementAlgorithm() == rhs.getGeomRefinementAlgorithm())
&&
(getUnitCellDistTolerance() == rhs.getUnitCellDistTolerance())
&&
(getViableCellMinSpots() == rhs.getViableCellMinSpots())
&&
(isIndexIceRings() == rhs.isIndexIceRings())
;
}
bool Indexing_settings::operator!=(const Indexing_settings& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Indexing_settings& o)
{
j = nlohmann::json::object();
j["algorithm"] = o.m_Algorithm;
j["fft_max_unit_cell_A"] = o.m_Fft_max_unit_cell_A;
j["fft_min_unit_cell_A"] = o.m_Fft_min_unit_cell_A;
j["fft_high_resolution_A"] = o.m_Fft_high_resolution_A;
j["fft_num_vectors"] = o.m_Fft_num_vectors;
j["tolerance"] = o.m_Tolerance;
j["thread_count"] = o.m_Thread_count;
j["geom_refinement_algorithm"] = o.m_Geom_refinement_algorithm;
j["unit_cell_dist_tolerance"] = o.m_Unit_cell_dist_tolerance;
j["viable_cell_min_spots"] = o.m_Viable_cell_min_spots;
j["index_ice_rings"] = o.m_Index_ice_rings;
}
void from_json(const nlohmann::json& j, Indexing_settings& o)
{
j.at("algorithm").get_to(o.m_Algorithm);
j.at("fft_max_unit_cell_A").get_to(o.m_Fft_max_unit_cell_A);
j.at("fft_min_unit_cell_A").get_to(o.m_Fft_min_unit_cell_A);
j.at("fft_high_resolution_A").get_to(o.m_Fft_high_resolution_A);
j.at("fft_num_vectors").get_to(o.m_Fft_num_vectors);
j.at("tolerance").get_to(o.m_Tolerance);
j.at("thread_count").get_to(o.m_Thread_count);
j.at("geom_refinement_algorithm").get_to(o.m_Geom_refinement_algorithm);
j.at("unit_cell_dist_tolerance").get_to(o.m_Unit_cell_dist_tolerance);
j.at("viable_cell_min_spots").get_to(o.m_Viable_cell_min_spots);
j.at("index_ice_rings").get_to(o.m_Index_ice_rings);
}
org::openapitools::server::model::Indexing_algorithm Indexing_settings::getAlgorithm() const
{
return m_Algorithm;
}
void Indexing_settings::setAlgorithm(org::openapitools::server::model::Indexing_algorithm const& value)
{
m_Algorithm = value;
}
float Indexing_settings::getFftMaxUnitCellA() const
{
return m_Fft_max_unit_cell_A;
}
void Indexing_settings::setFftMaxUnitCellA(float const value)
{
m_Fft_max_unit_cell_A = value;
}
float Indexing_settings::getFftMinUnitCellA() const
{
return m_Fft_min_unit_cell_A;
}
void Indexing_settings::setFftMinUnitCellA(float const value)
{
m_Fft_min_unit_cell_A = value;
}
float Indexing_settings::getFftHighResolutionA() const
{
return m_Fft_high_resolution_A;
}
void Indexing_settings::setFftHighResolutionA(float const value)
{
m_Fft_high_resolution_A = value;
}
int64_t Indexing_settings::getFftNumVectors() const
{
return m_Fft_num_vectors;
}
void Indexing_settings::setFftNumVectors(int64_t const value)
{
m_Fft_num_vectors = value;
}
float Indexing_settings::getTolerance() const
{
return m_Tolerance;
}
void Indexing_settings::setTolerance(float const value)
{
m_Tolerance = value;
}
int64_t Indexing_settings::getThreadCount() const
{
return m_Thread_count;
}
void Indexing_settings::setThreadCount(int64_t const value)
{
m_Thread_count = value;
}
org::openapitools::server::model::Geom_refinement_algorithm Indexing_settings::getGeomRefinementAlgorithm() const
{
return m_Geom_refinement_algorithm;
}
void Indexing_settings::setGeomRefinementAlgorithm(org::openapitools::server::model::Geom_refinement_algorithm const& value)
{
m_Geom_refinement_algorithm = value;
}
float Indexing_settings::getUnitCellDistTolerance() const
{
return m_Unit_cell_dist_tolerance;
}
void Indexing_settings::setUnitCellDistTolerance(float const value)
{
m_Unit_cell_dist_tolerance = value;
}
int64_t Indexing_settings::getViableCellMinSpots() const
{
return m_Viable_cell_min_spots;
}
void Indexing_settings::setViableCellMinSpots(int64_t const value)
{
m_Viable_cell_min_spots = value;
}
bool Indexing_settings::isIndexIceRings() const
{
return m_Index_ice_rings;
}
void Indexing_settings::setIndexIceRings(bool const value)
{
m_Index_ice_rings = value;
}
} // namespace org::openapitools::server::model