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

#include <jsondef.h>

Collaboration diagram for trianglestruc:

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

uint8_t external = 1
 External facing sides. More...
 
Vector com
 center of mass More...
 
Vector normal
 outward facing normal More...
 
Vector shove
 Contribution of triangle to linear forces. More...
 
Vector twist
 Contribution of triangle to angular forces. More...
 
uint16_t pidx = 0
 Index to parent piece. More...
 
uint16_t tidx [3] = {0}
 
float heat = 0.f
 Energy content in Joules. More...
 
float hcap = 900.f
 Heat Capacity in Joules / (Kg Kelvin) More...
 
float emi = .88f
 Emissivity: 0-1. More...
 
float abs = .18f
 Absorptivity: 0-1. More...
 
float iemi = .88f
 Internal Emissivity: 0-1. More...
 
float iabs = .88f
 Internal Absorptivity: 0-1. More...
 
float mass = 1.f
 mass in Kg More...
 
float temp = 0.f
 Temperature in Kelvin. More...
 
float area = 0.f
 Area. More...
 
float depth = 0.f
 Depth. More...
 
float perimeter = 0.f
 perimeter More...
 
float irradiation = 0.f
 Insolation in Watts/sq m. More...
 
float pcell = 0.f
 Solar cell coverage. More...
 
float ecellbase = .25f
 Solar cell base efficiency. More...
 
float ecellslope = 0.f
 Solar cell efficiency with temp. More...
 
float vcell = 10.
 Nominal voltage of Solar cell. More...
 
float power = 0.f
 Power generated in watts. More...
 
float volt = 0.f
 Voltage generated in volts. More...
 
float amp = 0.f
 Current generated in amps. More...
 
vector< vector< uint16_t > > triangleindex
 

Detailed Description

Finite Triangle Element Holds minimum information necessary to use smallest possible triangular element of a larger piece.

Member Function Documentation

json11::Json trianglestruc::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
3334  {
3335  vector<uint16_t> v_tidx = vector<uint16_t>(tidx, tidx+sizeof(tidx)/sizeof(tidx[0]));
3336  return json11::Json::object {
3337  { "external" , external },
3338  { "com" , com },
3339  { "normal" , normal },
3340  { "shove" , shove },
3341  { "twist" , twist },
3342  { "pidx" , pidx },
3343  { "tidx" , v_tidx },
3344  { "heat" , heat },
3345  { "hcap" , hcap },
3346  { "emi" , emi },
3347  { "abs" , abs },
3348  { "iemi" , iemi },
3349  { "iabs" , iabs },
3350  { "mass" , mass },
3351  { "temp" , temp },
3352  { "area" , area },
3353  { "depth" , depth },
3354  { "perimeter" , perimeter },
3355  { "irradiation" , irradiation },
3356  { "pcell" , pcell },
3357  { "ecellbase" , ecellbase },
3358  { "ecellslope" , ecellslope },
3359  { "triangleindex" , triangleindex }
3360  };
3361  }
std::map< std::string, Json > object
Definition: json11.hpp:88
Vector twist
Contribution of triangle to angular forces.
Definition: jsondef.h:3286
float perimeter
perimeter
Definition: jsondef.h:3311
uint16_t tidx[3]
Definition: jsondef.h:3289
float mass
mass in Kg
Definition: jsondef.h:3303
float area
Area.
Definition: jsondef.h:3307
Vector shove
Contribution of triangle to linear forces.
Definition: jsondef.h:3284
float pcell
Solar cell coverage.
Definition: jsondef.h:3315
uint8_t external
External facing sides.
Definition: jsondef.h:3278
float abs
Absorptivity: 0-1.
Definition: jsondef.h:3297
float depth
Depth.
Definition: jsondef.h:3309
float iabs
Internal Absorptivity: 0-1.
Definition: jsondef.h:3301
vector< vector< uint16_t > > triangleindex
Definition: jsondef.h:3328
float ecellbase
Solar cell base efficiency.
Definition: jsondef.h:3317
float iemi
Internal Emissivity: 0-1.
Definition: jsondef.h:3299
float emi
Emissivity: 0-1.
Definition: jsondef.h:3295
Vector com
center of mass
Definition: jsondef.h:3280
Vector normal
outward facing normal
Definition: jsondef.h:3282
uint16_t pidx
Index to parent piece.
Definition: jsondef.h:3288
float heat
Energy content in Joules.
Definition: jsondef.h:3291
float irradiation
Insolation in Watts/sq m.
Definition: jsondef.h:3313
float hcap
Heat Capacity in Joules / (Kg Kelvin)
Definition: jsondef.h:3293
float temp
Temperature in Kelvin.
Definition: jsondef.h:3305
float ecellslope
Solar cell efficiency with temp.
Definition: jsondef.h:3319
void trianglestruc::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
3369  {
3370  string error;
3371  json11::Json parsed = json11::Json::parse(s,error);
3372  if(error.empty()) {
3373  if(!parsed["external"].is_null()) { external = parsed["external"].int_value(); }
3374  if(!parsed["com"].is_null()) { com.from_json(parsed["com"].dump()); }
3375  if(!parsed["normal"].is_null()) { normal.from_json(parsed["normal"].dump()); }
3376  if(!parsed["shove"].is_null()) { shove.from_json(parsed["shove"].dump()); }
3377  if(!parsed["twist"].is_null()) { twist.from_json(parsed["twist"].dump()); }
3378  if(!parsed["pidx"].is_null()) { pidx = parsed["pidx"].int_value(); }
3379 
3380  // Array
3381  if(!parsed["heat"].is_null()) { heat = parsed["heat"].number_value(); }
3382  if(!parsed["hcap"].is_null()) { hcap = parsed["hcap"].number_value(); }
3383  if(!parsed["emi"].is_null()) { emi = parsed["emi"].number_value(); }
3384  if(!parsed["abs"].is_null()) { abs = parsed["abs"].number_value(); }
3385  if(!parsed["iemi"].is_null()) { emi = parsed["iemi"].number_value(); }
3386  if(!parsed["iabs"].is_null()) { abs = parsed["iabs"].number_value(); }
3387  if(!parsed["mass"].is_null()) { mass = parsed["mass"].number_value(); }
3388  if(!parsed["temp"].is_null()) { temp = parsed["temp"].number_value(); }
3389  if(!parsed["area"].is_null()) { area = parsed["area"].number_value(); }
3390  if(!parsed["perimeter"].is_null()) { perimeter = parsed["perimeter"].number_value(); }
3391  if(!parsed["irradiation"].is_null()) { irradiation = parsed["irradiation"].number_value(); }
3392  if(!parsed["pcell"].is_null()) { pcell = parsed["pcell"].number_value(); }
3393  if(!parsed["ecellbase"].is_null()) { ecellbase = parsed["ecellbase"].number_value(); }
3394  if(!parsed["ecellslope"].is_null()) { ecellslope = parsed["ecellslope"].number_value(); }
3395  for(size_t i = 0; i < triangleindex.size(); ++i) {
3396  for(size_t j = 0; j < triangleindex[i].size(); ++j) {
3397  if(!parsed["triangleindex"][i][j].is_null()) { triangleindex[i][j] = parsed["triangleindex"][i][j].number_value(); }
3398  }
3399  }
3400  } else {
3401  cerr<<"ERROR: <"<<error<<">"<<endl;
3402  }
3403  return;
3404  }
Vector twist
Contribution of triangle to angular forces.
Definition: jsondef.h:3286
Definition: json11.hpp:79
float perimeter
perimeter
Definition: jsondef.h:3311
int i
Definition: rw_test.cpp:37
float mass
mass in Kg
Definition: jsondef.h:3303
float area
Area.
Definition: jsondef.h:3307
Vector shove
Contribution of triangle to linear forces.
Definition: jsondef.h:3284
float pcell
Solar cell coverage.
Definition: jsondef.h:3315
uint8_t external
External facing sides.
Definition: jsondef.h:3278
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:783
float abs
Absorptivity: 0-1.
Definition: jsondef.h:3297
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
static void dump(NullStruct, string &out)
Definition: json11.cpp:53
vector< vector< uint16_t > > triangleindex
Definition: jsondef.h:3328
float ecellbase
Solar cell base efficiency.
Definition: jsondef.h:3317
float emi
Emissivity: 0-1.
Definition: jsondef.h:3295
Vector com
center of mass
Definition: jsondef.h:3280
Vector normal
outward facing normal
Definition: jsondef.h:3282
uint16_t pidx
Index to parent piece.
Definition: jsondef.h:3288
float heat
Energy content in Joules.
Definition: jsondef.h:3291
float irradiation
Insolation in Watts/sq m.
Definition: jsondef.h:3313
float hcap
Heat Capacity in Joules / (Kg Kelvin)
Definition: jsondef.h:3293
float temp
Temperature in Kelvin.
Definition: jsondef.h:3305
int int_value() const
Definition: json11.cpp:281
float ecellslope
Solar cell efficiency with temp.
Definition: jsondef.h:3319
double number_value() const
Definition: json11.cpp:280

Member Data Documentation

uint8_t trianglestruc::external = 1

External facing sides.

Vector trianglestruc::com

center of mass

Vector trianglestruc::normal

outward facing normal

Vector trianglestruc::shove

Contribution of triangle to linear forces.

Vector trianglestruc::twist

Contribution of triangle to angular forces.

uint16_t trianglestruc::pidx = 0

Index to parent piece.

uint16_t trianglestruc::tidx[3] = {0}
float trianglestruc::heat = 0.f

Energy content in Joules.

float trianglestruc::hcap = 900.f

Heat Capacity in Joules / (Kg Kelvin)

float trianglestruc::emi = .88f

Emissivity: 0-1.

float trianglestruc::abs = .18f

Absorptivity: 0-1.

float trianglestruc::iemi = .88f

Internal Emissivity: 0-1.

float trianglestruc::iabs = .88f

Internal Absorptivity: 0-1.

float trianglestruc::mass = 1.f

mass in Kg

float trianglestruc::temp = 0.f

Temperature in Kelvin.

float trianglestruc::area = 0.f

Area.

float trianglestruc::depth = 0.f

Depth.

float trianglestruc::perimeter = 0.f

perimeter

float trianglestruc::irradiation = 0.f

Insolation in Watts/sq m.

float trianglestruc::pcell = 0.f

Solar cell coverage.

float trianglestruc::ecellbase = .25f

Solar cell base efficiency.

float trianglestruc::ecellslope = 0.f

Solar cell efficiency with temp.

float trianglestruc::vcell = 10.

Nominal voltage of Solar cell.

float trianglestruc::power = 0.f

Power generated in watts.

float trianglestruc::volt = 0.f

Voltage generated in volts.

float trianglestruc::amp = 0.f

Current generated in amps.

vector<vector<uint16_t> > trianglestruc::triangleindex

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