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

Star Tracker (STT) Sructure. More...

#include <jsondef.h>

Collaboration diagram for sttstruc:

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 quaternion More...
 
quaternion att
 includes 0 and 1st order derivative More...
 
rvector omega
 
rvector alpha
 
uint16_t retcode = 0
 return code for More...
 
uint32_t status = 0
 

Detailed Description

Star Tracker (STT) Sructure.

Member Function Documentation

json11::Json sttstruc::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
2950  {
2951  return json11::Json::object {
2952  { "align" , align },
2953  { "att" , att },
2954  { "omega" , omega },
2955  { "alpha" , alpha },
2956  { "retcode", retcode },
2957  { "status" , static_cast<int>(status) }
2958  };
2959  }
std::map< std::string, Json > object
Definition: json11.hpp:88
uint16_t retcode
return code for
Definition: jsondef.h:2943
quaternion align
alignment quaternion
Definition: jsondef.h:2937
uint32_t status
Definition: jsondef.h:2944
rvector alpha
Definition: jsondef.h:2941
quaternion att
includes 0 and 1st order derivative
Definition: jsondef.h:2939
rvector omega
Definition: jsondef.h:2940
void sttstruc::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
2967  {
2968  string error;
2969  json11::Json parsed = json11::Json::parse(s,error);
2970  if(error.empty()) {
2971  if(!parsed["align"].is_null()) { align.from_json(parsed["align"].dump()); }
2972  if(!parsed["att"].is_null()) { att.from_json(parsed["att"].dump()); }
2973  if(!parsed["omega"].is_null()) { omega.from_json(parsed["omega"].dump()); }
2974  if(!parsed["alpha"].is_null()) { alpha.from_json(parsed["alpha"].dump()); }
2975  if(!parsed["retcode"].is_null()) { retcode = parsed["retcode"].int_value(); }
2976  if(!parsed["status"].is_null()) { status = parsed["status"].int_value(); }
2977  } else {
2978  cerr<<"ERROR: <"<<error<<">"<<endl;
2979  }
2980  return;
2981  }
Definition: json11.hpp:79
uint16_t retcode
return code for
Definition: jsondef.h:2943
quaternion align
alignment quaternion
Definition: jsondef.h:2937
uint32_t status
Definition: jsondef.h:2944
rvector alpha
Definition: jsondef.h:2941
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
static void dump(NullStruct, string &out)
Definition: json11.cpp:53
quaternion att
includes 0 and 1st order derivative
Definition: jsondef.h:2939
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:431
rvector omega
Definition: jsondef.h:2940
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:80
int int_value() const
Definition: json11.cpp:281

Member Data Documentation

quaternion sttstruc::align

alignment quaternion

quaternion sttstruc::att

includes 0 and 1st order derivative

rvector sttstruc::omega
rvector sttstruc::alpha
uint16_t sttstruc::retcode = 0

return code for

uint32_t sttstruc::status = 0

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