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

Antenna information. More...

#include <jsondef.h>

Collaboration diagram for antstruc:

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
 Alignment. More...
 
float azim = 0.f
 Azimuth;. More...
 
float elev = 0.f
 Elevation. More...
 
float minelev = 0.f
 Minimum elevation. More...
 
float maxelev = 0.f
 Maximum elevation. More...
 
float minazim = 0.f
 Minimum azimuth. More...
 
float maxazim = 0.f
 Maximum azimuth. More...
 
float threshelev = 0.f
 Elevation threshold. More...
 

Detailed Description

Antenna information.

This structure holds the information concerning antennas.

Member Function Documentation

json11::Json antstruc::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
2274  {
2275  return json11::Json::object {
2276  { "align" , align },
2277  { "azim" , azim },
2278  { "elev" , elev },
2279  { "minelev" , minelev },
2280  { "maxelev" , maxelev },
2281  { "minazim" , minazim },
2282  { "maxazim" , maxazim },
2283  { "threshelev" , threshelev }
2284  };
2285  }
std::map< std::string, Json > object
Definition: json11.hpp:88
float minazim
Minimum azimuth.
Definition: jsondef.h:2264
float minelev
Minimum elevation.
Definition: jsondef.h:2260
float elev
Elevation.
Definition: jsondef.h:2258
float maxelev
Maximum elevation.
Definition: jsondef.h:2262
float azim
Azimuth;.
Definition: jsondef.h:2256
float threshelev
Elevation threshold.
Definition: jsondef.h:2268
float maxazim
Maximum azimuth.
Definition: jsondef.h:2266
quaternion align
Alignment.
Definition: jsondef.h:2254
void antstruc::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
2293  {
2294  string error;
2295  json11::Json parsed = json11::Json::parse(s,error);
2296  if(error.empty()) {
2297  if(!parsed["align"].is_null()) { align.from_json(parsed["align"].dump()); }
2298  if(!parsed["azim"].is_null()) { azim = parsed["azim"].number_value(); }
2299  if(!parsed["elev"].is_null()) { elev = parsed["elev"].number_value(); }
2300  if(!parsed["minelev"].is_null()) { minelev = parsed["minelev"].number_value(); }
2301  if(!parsed["maxelev"].is_null()) { maxelev = parsed["maxelev"].number_value(); }
2302  if(!parsed["minazim"].is_null()) { minazim = parsed["minazim"].number_value(); }
2303  if(!parsed["maxazim"].is_null()) { maxazim = parsed["maxazim"].number_value(); }
2304  if(!parsed["threshelev"].is_null()) { threshelev = parsed["threshelev"].number_value(); }
2305  } else {
2306  cerr<<"ERROR: <"<<error<<">"<<endl;
2307  }
2308  return;
2309  }
Definition: json11.hpp:79
float minazim
Minimum azimuth.
Definition: jsondef.h:2264
float minelev
Minimum elevation.
Definition: jsondef.h:2260
float elev
Elevation.
Definition: jsondef.h:2258
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
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 maxelev
Maximum elevation.
Definition: jsondef.h:2262
float azim
Azimuth;.
Definition: jsondef.h:2256
float threshelev
Elevation threshold.
Definition: jsondef.h:2268
float maxazim
Maximum azimuth.
Definition: jsondef.h:2266
quaternion align
Alignment.
Definition: jsondef.h:2254
double number_value() const
Definition: json11.cpp:280

Member Data Documentation

quaternion antstruc::align

Alignment.

float antstruc::azim = 0.f

Azimuth;.

float antstruc::elev = 0.f

Elevation.

float antstruc::minelev = 0.f

Minimum elevation.

float antstruc::maxelev = 0.f

Maximum elevation.

float antstruc::minazim = 0.f

Minimum azimuth.

float antstruc::maxazim = 0.f

Maximum azimuth.

float antstruc::threshelev = 0.f

Elevation threshold.


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