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

Direction Cosine Matrix Attitude. More...

#include <convertdef.h>

Collaboration diagram for dcmatt:

Public Member Functions

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

Public Attributes

double utc = 0.
 
rmatrix s
 0th derivative More...
 
rvector v
 1st derivative More...
 
rvector a
 2nd derivative More...
 

Detailed Description

Direction Cosine Matrix Attitude.

Full attitude structure (0th, 1st and 2nd derivative), using a Direction Cosine Matrix to present the 0th derivative.

Member Function Documentation

json11::Json dcmatt::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
437  {
438  return json11::Json::object {
439  { "utc" , utc },
440  //{ "s", s },
441  { "v", v },
442  { "a", a }
443  };
444  }
rvector a
2nd derivative
Definition: convertdef.h:431
std::map< std::string, Json > object
Definition: json11.hpp:88
double utc
Definition: convertdef.h:425
rvector v
1st derivative
Definition: convertdef.h:429
void dcmatt::from_json ( const string &  js)
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
452  {
453  string error;
454  json11::Json parsed = json11::Json::parse(js,error);
455  if(error.empty()) {
456  if(!parsed["utc"].is_null()) utc = parsed["utc"].number_value();
457  //if(!parsed["s"].is_null()) s.from_json(parsed["s"].dump());
458  if(!parsed["v"].is_null()) v.from_json(parsed["v"].dump());
459  if(!parsed["a"].is_null()) a.from_json(parsed["a"].dump());
460  } else {
461  cerr<<"ERROR = "<<error<<endl;
462  }
463  return;
464  }
rvector a
2nd derivative
Definition: convertdef.h:431
Definition: json11.hpp:79
double utc
Definition: convertdef.h:425
void dump(std::string &out) const
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
rvector v
1st derivative
Definition: convertdef.h:429
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:80

Member Data Documentation

double dcmatt::utc = 0.
rmatrix dcmatt::s

0th derivative

rvector dcmatt::v

1st derivative

rvector dcmatt::a

2nd derivative


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