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

Thruster (THST) dynamic structure. More...

#include <jsondef.h>

Collaboration diagram for thststruc:

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
 Flow. More...
 
float flw = 0.f
 Specific Impulse in dynes per kg per second. More...
 
float isp = 0.f
 Rotation of thrust vector (+z) in to node frame. More...
 

Detailed Description

Thruster (THST) dynamic structure.

Member Function Documentation

json11::Json thststruc::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
2811  {
2812  return json11::Json::object {
2813  { "align" , align },
2814  { "flw" , flw },
2815  { "isp" , isp }
2816  };
2817  }
std::map< std::string, Json > object
Definition: json11.hpp:88
float isp
Rotation of thrust vector (+z) in to node frame.
Definition: jsondef.h:2805
float flw
Specific Impulse in dynes per kg per second.
Definition: jsondef.h:2803
quaternion align
Flow.
Definition: jsondef.h:2801
void thststruc::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
2825  {
2826  string error;
2827  json11::Json parsed = json11::Json::parse(s,error);
2828  if(error.empty()) {
2829  if(!parsed["align"].is_null()) { align.from_json(parsed["align"].dump()); }
2830  if(!parsed["flw"].is_null()) { flw = parsed["flw"].number_value(); }
2831  if(!parsed["isp"].is_null()) { isp = parsed["isp"].number_value(); }
2832  } else {
2833  cerr<<"ERROR: <"<<error<<">"<<endl;
2834  }
2835  return;
2836  }
Definition: json11.hpp:79
float isp
Rotation of thrust vector (+z) in to node frame.
Definition: jsondef.h:2805
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 flw
Specific Impulse in dynes per kg per second.
Definition: jsondef.h:2803
quaternion align
Flow.
Definition: jsondef.h:2801
double number_value() const
Definition: json11.cpp:280

Member Data Documentation

quaternion thststruc::align

Flow.

float thststruc::flw = 0.f

Specific Impulse in dynes per kg per second.

float thststruc::isp = 0.f

Rotation of thrust vector (+z) in to node frame.


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