COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
ssenstruc Struct Reference

Sun Sensor (SSEN) Sructure. More...

#include <jsondef.h>

Collaboration diagram for ssenstruc:

Public Member Functions

json11::Json to_json () const
 Convert class contents to JSON object. More...
 
void from_json (const string &s)
 Set class contents from JSON string. More...
 

Public Attributes

quaternion align
 Sensor alignment quaternion. More...
 
float qva = 0.f
 
float qvb = 0.f
 
float qvc = 0.f
 
float qvd = 0.f
 
float azimuth = 0.f
 
float elevation = 0.f
 

Detailed Description

Sun Sensor (SSEN) Sructure.

Member Function Documentation

json11::Json ssenstruc::to_json ( ) const
inline

Convert class contents to JSON object.

Returns a json11 JSON object of the class

Returns
A json11 JSON object containing every member variable within the class
1821  {
1822  return json11::Json::object {
1823  { "align" , align },
1824  { "qva", qva },
1825  { "qvb", qvb },
1826  { "qvc", qvc },
1827  { "qvd", qvd },
1828  { "azimuth", azimuth },
1829  { "elevation", elevation },
1830  };
1831  }
float qva
Definition: jsondef.h:1810
std::map< std::string, Json > object
Definition: json11.hpp:88
quaternion align
Sensor alignment quaternion.
Definition: jsondef.h:1809
float qvc
Definition: jsondef.h:1812
float qvb
Definition: jsondef.h:1811
float elevation
Definition: jsondef.h:1815
float qvd
Definition: jsondef.h:1813
float azimuth
Definition: jsondef.h:1814
void ssenstruc::from_json ( const string &  s)
inline

Set class contents from JSON string.

Parses the provided JSON-formatted string and sets the class data. String should be formatted like the string returned from to_json()

Parameters
sJSON-formatted string to set class contents to
Returns
n/a
1839  {
1840  string error;
1841  json11::Json parsed = json11::Json::parse(s,error);
1842  if(error.empty()) {
1843  if(!parsed["align"].is_null()) { align.from_json(parsed["align"].dump()); }
1844  if(!parsed["qva"].is_null()) { qva = parsed["qva"].number_value(); }
1845  if(!parsed["qvb"].is_null()) { qvb = parsed["qvb"].number_value(); }
1846  if(!parsed["qvc"].is_null()) { qvc = parsed["qvc"].number_value(); }
1847  if(!parsed["qvd"].is_null()) { qvd = parsed["qvd"].number_value(); }
1848  if(!parsed["azimuth"].is_null()) { azimuth = parsed["azimuth"].number_value(); }
1849  if(!parsed["elevation"].is_null()) { elevation = parsed["elevation"].number_value(); }
1850  } else {
1851  cerr<<"ERROR: <"<<error<<">"<<endl;
1852  }
1853  return;
1854  }
float qva
Definition: jsondef.h:1810
Definition: json11.hpp:79
quaternion align
Sensor alignment quaternion.
Definition: jsondef.h:1809
float qvc
Definition: jsondef.h:1812
float qvb
Definition: jsondef.h:1811
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
float elevation
Definition: jsondef.h:1815
static void dump(NullStruct, string &out)
Definition: json11.cpp:53
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:431
float qvd
Definition: jsondef.h:1813
float azimuth
Definition: jsondef.h:1814
double number_value() const
Definition: json11.cpp:280

Member Data Documentation

quaternion ssenstruc::align

Sensor alignment quaternion.

float ssenstruc::qva = 0.f
float ssenstruc::qvb = 0.f
float ssenstruc::qvc = 0.f
float ssenstruc::qvd = 0.f
float ssenstruc::azimuth = 0.f
float ssenstruc::elevation = 0.f

The documentation for this struct was generated from the following file: