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

#include <jsondef.h>

Collaboration diagram for nodestruc:

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

char name [40+1] = ""
 Node Name. More...
 
char lastevent [40+1] = ""
 Last event. More...
 
double lasteventutc = 0.
 Last event UTC. More...
 
uint16_t type = 0
 Node Type as listed in NODE_TYPE. More...
 
uint16_t state = 0
 Operational state. More...
 
uint16_t vertex_cnt = 0
 
uint16_t normal_cnt = 0
 
uint16_t face_cnt = 0
 
uint16_t piece_cnt = 0
 
uint16_t device_cnt = 0
 
uint16_t port_cnt = 0
 
uint16_t agent_cnt = 0
 
uint16_t event_cnt = 0
 
uint16_t target_cnt = 0
 
uint16_t user_cnt = 0
 
uint16_t tle_cnt = 0
 
uint16_t flags = 0
 
int16_t powmode = 0
 
uint32_t downtime = 0
 Seconds Node will be down. More...
 
float azfrom = 0.f
 Alt/Az/Range info. More...
 
float elfrom = 0.f
 
float azto = 0.f
 
float elto = 0.f
 
float range = 0.f
 
double utcoffset = 0.
 MJD Offset between system UT and simulated UT. More...
 
double utc = 0.
 Overall Node time. More...
 
double utcstart = 0.
 Mission start time. More...
 
locstruc loc
 Location structure. More...
 
physicsstruc phys
 

Detailed Description

Node Structure Structure for storing all information about a Node that never changes, or only changes slowly. The information for initializing this should be in node.ini.

Member Function Documentation

json11::Json nodestruc::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
3603  {
3604  return json11::Json::object {
3605  { "name" , name },
3606  { "lastevent" , lastevent },
3607  { "lasteventutc" , lasteventutc },
3608  { "type" , type },
3609  { "state" , state },
3610 
3611  { "vertex_cnt" , vertex_cnt },
3612  { "normal_cnt" , normal_cnt },
3613  { "face_cnt" , face_cnt },
3614  { "piece_cnt" , piece_cnt },
3615  { "device_cnt" , device_cnt },
3616  { "port_cnt" , port_cnt },
3617  { "agent_cnt" , agent_cnt },
3618  { "event_cnt" , event_cnt },
3619  { "target_cnt" , target_cnt },
3620  { "user_cnt" , user_cnt },
3621  { "tle_cnt" , tle_cnt },
3622 
3623  { "flags" , flags },
3624  { "powmode" , powmode },
3625  { "downtime" , static_cast<int>(downtime) },
3626  { "azfrom" , azfrom },
3627  { "elfrom" , elfrom },
3628  { "azto" , azto },
3629  { "elto" , elto },
3630  { "range" , range },
3631  { "utcoffset" , utcoffset },
3632  { "utc" , utc },
3633  { "utcstart" , utcstart },
3634  { "loc" , loc },
3635  { "phys" , phys }
3636  };
3637  }
uint16_t target_cnt
Definition: jsondef.h:3575
uint16_t agent_cnt
Definition: jsondef.h:3573
std::map< std::string, Json > object
Definition: json11.hpp:88
int16_t powmode
Definition: jsondef.h:3580
uint16_t device_cnt
Definition: jsondef.h:3571
uint16_t normal_cnt
Definition: jsondef.h:3568
uint16_t event_cnt
Definition: jsondef.h:3574
uint16_t piece_cnt
Definition: jsondef.h:3570
float range
Definition: jsondef.h:3588
char lastevent[40+1]
Last event.
Definition: jsondef.h:3558
double utc
Overall Node time.
Definition: jsondef.h:3592
uint16_t flags
Definition: jsondef.h:3579
uint16_t port_cnt
Definition: jsondef.h:3572
double utcoffset
MJD Offset between system UT and simulated UT.
Definition: jsondef.h:3590
uint32_t downtime
Seconds Node will be down.
Definition: jsondef.h:3582
uint16_t user_cnt
Definition: jsondef.h:3576
char name[40+1]
Node Name.
Definition: jsondef.h:3556
uint16_t state
Operational state.
Definition: jsondef.h:3564
double utcstart
Mission start time.
Definition: jsondef.h:3594
double lasteventutc
Last event UTC.
Definition: jsondef.h:3560
uint16_t tle_cnt
Definition: jsondef.h:3577
locstruc loc
Location structure.
Definition: jsondef.h:3596
uint16_t vertex_cnt
Definition: jsondef.h:3567
float elto
Definition: jsondef.h:3587
uint16_t face_cnt
Definition: jsondef.h:3569
float azfrom
Alt/Az/Range info.
Definition: jsondef.h:3584
float azto
Definition: jsondef.h:3586
uint16_t type
Node Type as listed in NODE_TYPE.
Definition: jsondef.h:3562
physicsstruc phys
Definition: jsondef.h:3597
float elfrom
Definition: jsondef.h:3585
void nodestruc::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
3645  {
3646  string error;
3647  json11::Json parsed = json11::Json::parse(js,error);
3648  if(error.empty()) {
3649  if(!parsed["name"].is_null()) { strcpy(name, parsed["name"].string_value().c_str()); }
3650  if(!parsed["lastevent"].is_null()) { strcpy(lastevent, parsed["lastevent"].string_value().c_str()); }
3651  if(!parsed["lasteventutc"].is_null()) { lasteventutc = parsed["lasteventutc"].number_value(); }
3652  if(!parsed["type"].is_null()) { type = parsed["type"].int_value(); }
3653  if(!parsed["state"].is_null()) { state = parsed["state"].int_value(); }
3654 
3655  if(!parsed["vertex_cnt"].is_null()) { vertex_cnt = parsed["vertex_cnt"].int_value(); }
3656  if(!parsed["normal_cnt"].is_null()) { normal_cnt = parsed["normal_cnt"].int_value(); }
3657  if(!parsed["face_cnt"].is_null()) { face_cnt = parsed["face_cnt"].int_value(); }
3658  if(!parsed["piece_cnt"].is_null()) { piece_cnt = parsed["piece_cnt"].int_value(); }
3659  if(!parsed["device_cnt"].is_null()) { device_cnt = parsed["device_cnt"].int_value(); }
3660  if(!parsed["port_cnt"].is_null()) { port_cnt = parsed["port_cnt"].int_value(); }
3661  if(!parsed["agent_cnt"].is_null()) { agent_cnt = parsed["agent_cnt"].int_value(); }
3662  if(!parsed["event_cnt"].is_null()) { event_cnt = parsed["event_cnt"].int_value(); }
3663  if(!parsed["target_cnt"].is_null()) { target_cnt = parsed["target_cnt"].int_value(); }
3664  if(!parsed["user_cnt"].is_null()) { user_cnt = parsed["user_cnt"].int_value(); }
3665  if(!parsed["tle_cnt"].is_null()) { tle_cnt = parsed["tle_cnt"].int_value(); }
3666 
3667  if(!parsed["flags"].is_null()) { flags = parsed["flags"].int_value(); }
3668  if(!parsed["powmode"].is_null()) { powmode = parsed["powmode"].int_value(); }
3669  if(!parsed["downtime"].is_null()) { downtime = parsed["downtime"].int_value(); }
3670  if(!parsed["azfrom"].is_null()) { azfrom = parsed["azfrom"].number_value(); }
3671  if(!parsed["elfrom"].is_null()) { elfrom = parsed["elfrom"].number_value(); }
3672  if(!parsed["azto"].is_null()) { azto = parsed["azto"].number_value(); }
3673  if(!parsed["elto"].is_null()) { elto = parsed["elto"].number_value(); }
3674  if(!parsed["range"].is_null()) { range = parsed["range"].number_value(); }
3675  if(!parsed["utcoffset"].is_null()) { utc = parsed["utcoffset"].number_value(); }
3676  if(!parsed["utc"].is_null()) { utc = parsed["utc"].number_value(); }
3677  if(!parsed["utcstart"].is_null()) { utc = parsed["utcstart"].number_value(); }
3678  if(!parsed["loc"].is_null()) { loc.from_json(parsed["loc"].dump()); }
3679  if(!parsed["phys"].is_null()) { phys.from_json(parsed["phys"].dump()); }
3680  } else {
3681  cerr<<"ERROR = "<<error<<endl;
3682  }
3683  return;
3684  }
uint16_t target_cnt
Definition: jsondef.h:3575
uint16_t agent_cnt
Definition: jsondef.h:3573
int16_t powmode
Definition: jsondef.h:3580
uint16_t device_cnt
Definition: jsondef.h:3571
Definition: json11.hpp:79
uint16_t normal_cnt
Definition: jsondef.h:3568
uint16_t event_cnt
Definition: jsondef.h:3574
uint16_t piece_cnt
Definition: jsondef.h:3570
float range
Definition: jsondef.h:3588
char lastevent[40+1]
Last event.
Definition: jsondef.h:3558
double utc
Overall Node time.
Definition: jsondef.h:3592
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:903
uint16_t flags
Definition: jsondef.h:3579
uint16_t port_cnt
Definition: jsondef.h:3572
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
uint32_t downtime
Seconds Node will be down.
Definition: jsondef.h:3582
static void dump(NullStruct, string &out)
Definition: json11.cpp:53
uint16_t user_cnt
Definition: jsondef.h:3576
void from_json(const string &js)
Set class contents from JSON string.
Definition: jsondef.h:3501
char name[40+1]
Node Name.
Definition: jsondef.h:3556
uint16_t state
Operational state.
Definition: jsondef.h:3564
double lasteventutc
Last event UTC.
Definition: jsondef.h:3560
uint16_t tle_cnt
Definition: jsondef.h:3577
locstruc loc
Location structure.
Definition: jsondef.h:3596
uint16_t vertex_cnt
Definition: jsondef.h:3567
float elto
Definition: jsondef.h:3587
uint16_t face_cnt
Definition: jsondef.h:3569
float azfrom
Alt/Az/Range info.
Definition: jsondef.h:3584
float azto
Definition: jsondef.h:3586
uint16_t type
Node Type as listed in NODE_TYPE.
Definition: jsondef.h:3562
int int_value() const
Definition: json11.cpp:281
physicsstruc phys
Definition: jsondef.h:3597
float elfrom
Definition: jsondef.h:3585
double number_value() const
Definition: json11.cpp:280

Member Data Documentation

char nodestruc::name[40+1] = ""

Node Name.

char nodestruc::lastevent[40+1] = ""

Last event.

double nodestruc::lasteventutc = 0.

Last event UTC.

uint16_t nodestruc::type = 0

Node Type as listed in NODE_TYPE.

uint16_t nodestruc::state = 0

Operational state.

uint16_t nodestruc::vertex_cnt = 0
uint16_t nodestruc::normal_cnt = 0
uint16_t nodestruc::face_cnt = 0
uint16_t nodestruc::piece_cnt = 0
uint16_t nodestruc::device_cnt = 0
uint16_t nodestruc::port_cnt = 0
uint16_t nodestruc::agent_cnt = 0
uint16_t nodestruc::event_cnt = 0
uint16_t nodestruc::target_cnt = 0
uint16_t nodestruc::user_cnt = 0
uint16_t nodestruc::tle_cnt = 0
uint16_t nodestruc::flags = 0
int16_t nodestruc::powmode = 0
uint32_t nodestruc::downtime = 0

Seconds Node will be down.

float nodestruc::azfrom = 0.f

Alt/Az/Range info.

float nodestruc::elfrom = 0.f
float nodestruc::azto = 0.f
float nodestruc::elto = 0.f
float nodestruc::range = 0.f
double nodestruc::utcoffset = 0.

MJD Offset between system UT and simulated UT.

double nodestruc::utc = 0.

Overall Node time.

double nodestruc::utcstart = 0.

Mission start time.

locstruc nodestruc::loc

Location structure.

physicsstruc nodestruc::phys

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