282 lines
7.0 KiB
C++
282 lines
7.0 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.43
|
|
* 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 "Grid_scan_result.h"
|
|
#include "Helpers.h"
|
|
|
|
#include <sstream>
|
|
|
|
namespace org::openapitools::server::model
|
|
{
|
|
|
|
Grid_scan_result::Grid_scan_result()
|
|
{
|
|
|
|
}
|
|
|
|
void Grid_scan_result::validate() const
|
|
{
|
|
std::stringstream msg;
|
|
if (!validate(msg))
|
|
{
|
|
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
|
}
|
|
}
|
|
|
|
bool Grid_scan_result::validate(std::stringstream& msg) const
|
|
{
|
|
return validate(msg, "");
|
|
}
|
|
|
|
bool Grid_scan_result::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
|
{
|
|
bool success = true;
|
|
const std::string _pathPrefix = pathPrefix.empty() ? "Grid_scan_result" : pathPrefix;
|
|
|
|
|
|
|
|
/* Det_img */ {
|
|
const std::vector<int64_t>& value = m_Det_img;
|
|
const std::string currentValuePath = _pathPrefix + ".detImg";
|
|
|
|
|
|
{ // Recursive validation of array elements
|
|
const std::string oldValuePath = currentValuePath;
|
|
int i = 0;
|
|
for (const int64_t& value : value)
|
|
{
|
|
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
|
|
|
|
|
|
|
i++;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Bkg_estimate */ {
|
|
const std::vector<float>& value = m_Bkg_estimate;
|
|
const std::string currentValuePath = _pathPrefix + ".bkgEstimate";
|
|
|
|
|
|
{ // Recursive validation of array elements
|
|
const std::string oldValuePath = currentValuePath;
|
|
int i = 0;
|
|
for (const float& value : value)
|
|
{
|
|
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
|
|
|
|
|
|
|
i++;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Spot_count */ {
|
|
const std::vector<int64_t>& value = m_Spot_count;
|
|
const std::string currentValuePath = _pathPrefix + ".spotCount";
|
|
|
|
|
|
{ // Recursive validation of array elements
|
|
const std::string oldValuePath = currentValuePath;
|
|
int i = 0;
|
|
for (const int64_t& value : value)
|
|
{
|
|
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
|
|
|
|
|
|
|
i++;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Indexed_lattices */ {
|
|
const std::vector<int64_t>& value = m_Indexed_lattices;
|
|
const std::string currentValuePath = _pathPrefix + ".indexedLattices";
|
|
|
|
|
|
{ // Recursive validation of array elements
|
|
const std::string oldValuePath = currentValuePath;
|
|
int i = 0;
|
|
for (const int64_t& value : value)
|
|
{
|
|
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
|
|
|
|
|
|
|
i++;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* Mosaicity */ {
|
|
const std::vector<float>& value = m_Mosaicity;
|
|
const std::string currentValuePath = _pathPrefix + ".mosaicity";
|
|
|
|
|
|
{ // Recursive validation of array elements
|
|
const std::string oldValuePath = currentValuePath;
|
|
int i = 0;
|
|
for (const float& value : value)
|
|
{
|
|
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
|
|
|
|
|
|
|
i++;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* B_factor */ {
|
|
const std::vector<float>& value = m_B_factor;
|
|
const std::string currentValuePath = _pathPrefix + ".bFactor";
|
|
|
|
|
|
{ // Recursive validation of array elements
|
|
const std::string oldValuePath = currentValuePath;
|
|
int i = 0;
|
|
for (const float& value : value)
|
|
{
|
|
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
|
|
|
|
|
|
|
i++;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
return success;
|
|
}
|
|
|
|
bool Grid_scan_result::operator==(const Grid_scan_result& rhs) const
|
|
{
|
|
return
|
|
|
|
|
|
(getDetImg() == rhs.getDetImg())
|
|
&&
|
|
|
|
(getBkgEstimate() == rhs.getBkgEstimate())
|
|
&&
|
|
|
|
(getSpotCount() == rhs.getSpotCount())
|
|
&&
|
|
|
|
(getIndexedLattices() == rhs.getIndexedLattices())
|
|
&&
|
|
|
|
(getMosaicity() == rhs.getMosaicity())
|
|
&&
|
|
|
|
(getBFactor() == rhs.getBFactor())
|
|
|
|
|
|
;
|
|
}
|
|
|
|
bool Grid_scan_result::operator!=(const Grid_scan_result& rhs) const
|
|
{
|
|
return !(*this == rhs);
|
|
}
|
|
|
|
void to_json(nlohmann::json& j, const Grid_scan_result& o)
|
|
{
|
|
j = nlohmann::json::object();
|
|
j["det_img"] = o.m_Det_img;
|
|
j["bkg_estimate"] = o.m_Bkg_estimate;
|
|
j["spot_count"] = o.m_Spot_count;
|
|
j["indexed_lattices"] = o.m_Indexed_lattices;
|
|
j["mosaicity"] = o.m_Mosaicity;
|
|
j["b_factor"] = o.m_B_factor;
|
|
|
|
}
|
|
|
|
void from_json(const nlohmann::json& j, Grid_scan_result& o)
|
|
{
|
|
j.at("det_img").get_to(o.m_Det_img);
|
|
j.at("bkg_estimate").get_to(o.m_Bkg_estimate);
|
|
j.at("spot_count").get_to(o.m_Spot_count);
|
|
j.at("indexed_lattices").get_to(o.m_Indexed_lattices);
|
|
j.at("mosaicity").get_to(o.m_Mosaicity);
|
|
j.at("b_factor").get_to(o.m_B_factor);
|
|
|
|
}
|
|
|
|
std::vector<int64_t> Grid_scan_result::getDetImg() const
|
|
{
|
|
return m_Det_img;
|
|
}
|
|
void Grid_scan_result::setDetImg(std::vector<int64_t> const value)
|
|
{
|
|
m_Det_img = value;
|
|
}
|
|
std::vector<float> Grid_scan_result::getBkgEstimate() const
|
|
{
|
|
return m_Bkg_estimate;
|
|
}
|
|
void Grid_scan_result::setBkgEstimate(std::vector<float> const value)
|
|
{
|
|
m_Bkg_estimate = value;
|
|
}
|
|
std::vector<int64_t> Grid_scan_result::getSpotCount() const
|
|
{
|
|
return m_Spot_count;
|
|
}
|
|
void Grid_scan_result::setSpotCount(std::vector<int64_t> const value)
|
|
{
|
|
m_Spot_count = value;
|
|
}
|
|
std::vector<int64_t> Grid_scan_result::getIndexedLattices() const
|
|
{
|
|
return m_Indexed_lattices;
|
|
}
|
|
void Grid_scan_result::setIndexedLattices(std::vector<int64_t> const value)
|
|
{
|
|
m_Indexed_lattices = value;
|
|
}
|
|
std::vector<float> Grid_scan_result::getMosaicity() const
|
|
{
|
|
return m_Mosaicity;
|
|
}
|
|
void Grid_scan_result::setMosaicity(std::vector<float> const value)
|
|
{
|
|
m_Mosaicity = value;
|
|
}
|
|
std::vector<float> Grid_scan_result::getBFactor() const
|
|
{
|
|
return m_B_factor;
|
|
}
|
|
void Grid_scan_result::setBFactor(std::vector<float> const value)
|
|
{
|
|
m_B_factor = value;
|
|
}
|
|
|
|
|
|
} // namespace org::openapitools::server::model
|
|
|