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

In units for the SGP4 propogator (not NORAD TLE itself). More...

#include <convertdef.h>

Collaboration diagram for tlestruc:

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.
 
char name [25] = ""
 
uint16_t snumber = 0
 
char id [9] = ""
 
double bstar = 0.
 Drag (1/Earth radii) More...
 
double i = 0.
 Inclination (radians) More...
 
double raan = 0.
 Right ascension of ascending node (radians) More...
 
double e = 0.
 Eccentricity (unitless) More...
 
double ap = 0.
 Argument of perigee (radians) More...
 
double ma = 0.
 Mean anomaly (radians) More...
 
double mm = 0.
 Mean motion (radians / minute) More...
 
uint32_t orbit = 0
 

Detailed Description

In units for the SGP4 propogator (not NORAD TLE itself).

Member Function Documentation

json11::Json tlestruc::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
949  {
950  return json11::Json::object {
951  { "utc" , utc },
952  { "name" , name },
953  { "snumber" , snumber },
954  { "id" , id },
955  { "bstar" , bstar },
956  { "i" , i },
957  { "raan" , raan },
958  { "e" , e },
959  { "ap" , ap },
960  { "ma" , ma },
961  { "mm" , mm },
962  { "orbit" , static_cast<int>(orbit) }
963  };
964  }
std::map< std::string, Json > object
Definition: json11.hpp:88
double mm
Mean motion (radians / minute)
Definition: convertdef.h:942
double raan
Right ascension of ascending node (radians)
Definition: convertdef.h:934
uint32_t orbit
Definition: convertdef.h:943
char name[25]
Definition: convertdef.h:925
double ap
Argument of perigee (radians)
Definition: convertdef.h:938
double e
Eccentricity (unitless)
Definition: convertdef.h:936
double ma
Mean anomaly (radians)
Definition: convertdef.h:940
double utc
Definition: convertdef.h:923
double i
Inclination (radians)
Definition: convertdef.h:932
double bstar
Drag (1/Earth radii)
Definition: convertdef.h:930
uint16_t snumber
Definition: convertdef.h:926
void tlestruc::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
972  {
973  string error;
974  json11::Json parsed = json11::Json::parse(js,error);
975  if(error.empty()) {
976  if(!parsed["utc"].is_null()) utc = parsed["utc"].number_value();
977  if(!parsed["name"].is_null()) strcpy(name, parsed["name"].string_value().c_str());
978  if(!parsed["snumber"].is_null()) snumber = parsed["snumber"].int_value();
979  if(!parsed["id"].is_null()) strcpy(id, parsed["id"].string_value().c_str());
980  if(!parsed["bstar"].is_null()) bstar = parsed["bstar"].number_value();
981  if(!parsed["i"].is_null()) i = parsed["i"].number_value();
982  if(!parsed["raan"].is_null()) raan = parsed["raan"].number_value();
983  if(!parsed["e"].is_null()) e = parsed["e"].number_value();
984  if(!parsed["ap"].is_null()) ap = parsed["ap"].number_value();
985  if(!parsed["ma"].is_null()) ma = parsed["ma"].number_value();
986  if(!parsed["mm"].is_null()) mm = parsed["mm"].number_value();
987  if(!parsed["orbit"].is_null()) orbit = parsed["orbit"].int_value();
988  } else {
989  cerr<<"ERROR = "<<error<<endl;
990  }
991  return;
992  }
Definition: json11.hpp:79
double mm
Mean motion (radians / minute)
Definition: convertdef.h:942
double raan
Right ascension of ascending node (radians)
Definition: convertdef.h:934
uint32_t orbit
Definition: convertdef.h:943
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
char name[25]
Definition: convertdef.h:925
double ap
Argument of perigee (radians)
Definition: convertdef.h:938
double e
Eccentricity (unitless)
Definition: convertdef.h:936
double ma
Mean anomaly (radians)
Definition: convertdef.h:940
double utc
Definition: convertdef.h:923
double i
Inclination (radians)
Definition: convertdef.h:932
double bstar
Drag (1/Earth radii)
Definition: convertdef.h:930
uint16_t snumber
Definition: convertdef.h:926

Member Data Documentation

double tlestruc::utc = 0.
char tlestruc::name[25] = ""
uint16_t tlestruc::snumber = 0
char tlestruc::id[9] = ""
double tlestruc::bstar = 0.

Drag (1/Earth radii)

double tlestruc::i = 0.

Inclination (radians)

double tlestruc::raan = 0.

Right ascension of ascending node (radians)

double tlestruc::e = 0.

Eccentricity (unitless)

double tlestruc::ap = 0.

Argument of perigee (radians)

double tlestruc::ma = 0.

Mean anomaly (radians)

double tlestruc::mm = 0.

Mean motion (radians / minute)

uint32_t tlestruc::orbit = 0

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