65 string request_name =
"identify_yourself";
69 string agent_target =
"agent_002";
74 cout<<
"A agent "<<agent_target<<
" beatstruc:"<<endl;
75 cout<<agent_target_heartbeat;
90 cout<<
"Longest Ever UTC = <"<<
agent->
cinfo->
get_value<
double>(
"Longest Ever UTC")<<
">"<<endl;
97 cout<<
"Old User Data = <"<<
agent->
cinfo->
get_json<vector<userstruc>>(
"My Favorite Users")<<
">"<<endl;
99 string raw =
"{\"My Favorite Users\": [{\"cpu\": \"\", \"name\": \"\", \"node\": \"\", \"tool\": \"\"},{\"cpu\": \"cpu2\", \"name\": \"name2\", \"node\": \"node2\", \"tool\": \"tool2\"}]}";
102 cout<<
"New User Data = <"<<
agent->
cinfo->
get_json<vector<userstruc>>(
"My Favorite Users")<<
">"<<endl;
149 cout<<
"Okay, that co-ord transformation works!"<<endl<<endl;
151 cout<<
"Now to try to get the orbis of ISS..."<<endl;
168 double N = 15.49226224;
172 c->
n = (2.0*M_PI*N / 86400);
173 c->
a = pow(c->
mu, 1.0/3.0) / pow(c->
n, 2.0/3.0);
174 cout<<
"calculated a from TLE = "<<c->
a<<endl;
176 c->
T = ( 2.0 * M_PI ) / c->
n;
177 cout<<
"calculated T (in seconds) = "<<c->
T<<endl;
182 c->
O = 133.1544 * (M_PI/180.0);
184 c->
i = 51.6435 * (M_PI/180.0);
186 c->
w = 148.6515 * (M_PI/180.0);
uint16_t debug_level
Flag for level of debugging, keep it public so that it can be controlled from the outside...
Definition: agentclass.h:362
double P_vel_t
Definition: jsondef.h:4377
string get_json(const string &s)
Gets a JSON-formatted string of the data associated with the provided name in Namespace 2...
Definition: jsondef.h:7281
double R_1_1
Definition: jsondef.h:4394
double I_vel_t
Definition: jsondef.h:4420
void add_name(const string &s, void *v, string t)
Adds a name, memory location, and datatype to Namespace 2.0.
Definition: jsondef.h:4611
string get_json_pretty(const string &s)
Definition: jsondef.h:7589
double K_vel_t
Definition: jsondef.h:4422
Definition: jsondef.h:923
double Q_vel_t
Definition: jsondef.h:4378
T get_value(const string &s) const
Gets the value of the data associated with the provided name in Namespace 2.0.
Definition: jsondef.h:6792
double W_pos_t
Definition: jsondef.h:4374
double J_pos_t
Definition: jsondef.h:4418
double R_1_0
Definition: jsondef.h:4390
double R_2_2
Definition: jsondef.h:4399
double utc
Master time for location, in Modified Julian Day.
Definition: convertdef.h:879
double O
Definition: jsondef.h:4336
double K_pos_t
Definition: jsondef.h:4419
Definition: jsondef.h:1199
double W_vel_t
Definition: jsondef.h:4379
string node_name
Definition: agent_001.cpp:46
nodestruc node
Structure for summary information in node.
Definition: jsondef.h:4220
string cosmos_error_string(int32_t cosmos_errno)
Definition: cosmos-errno.cpp:45
uint16_t running()
Check if we're supposed to be running.
Definition: agentclass.cpp:391
void set_PQW_from_IJK()
Definition: jsondef.h:4464
double R_0_0
Definition: jsondef.h:4389
int32_t sample_agent_request_function(string &request, string &response, Agent *cdata)
Definition: agent_001.cpp:230
double R_1_2
Definition: jsondef.h:4398
int32_t add_request(string token, external_request_function function, string synopsis="", string description="")
Add internal request to Agent request list with description and synopsis.
Definition: agentclass.cpp:312
static Agent * agent
ensure the Agent constructor creates only one instance per process
Definition: agent_001.cpp:45
Definition: agentclass.h:139
double R_0_1
Definition: jsondef.h:4393
double Q_pos_t
Definition: jsondef.h:4373
locstruc loc
Location structure.
Definition: jsondef.h:3596
double J_vel_t
Definition: jsondef.h:4421
vector< userstruc > user
Single entry vector for user information.
Definition: jsondef.h:4256
string node_agent_name
Definition: agent_001.cpp:48
double mu
Definition: jsondef.h:4350
double P_pos_t
Definition: jsondef.h:4372
int32_t last_error()
Definition: agentclass.cpp:414
double T
Definition: jsondef.h:4356
double w
Definition: jsondef.h:4338
beatstruc find_agent(string node, string agent, double waitsec=0.)
Find agent.
Definition: agentclass.cpp:559
string agent_name
Definition: agent_001.cpp:47
double R_2_1
Definition: jsondef.h:4395
void set_json(const string &json)
Sets the data in Namespace 2.0 with a JSON-formatted string.
Definition: jsondef.h:6822
void set_up_rotation_matrix()
Definition: jsondef.h:4401
cosmosstruc * cinfo
Definition: agentclass.h:346
double n
Definition: jsondef.h:4353
double I_pos_t
Definition: jsondef.h:4417
double R_0_2
Definition: jsondef.h:4397
void set_value(const string &s, const T &value) const
Sets the value of the data associated with the provided name in Namespace 2.0.
Definition: jsondef.h:6808
Definition: jsondef.h:4199
double a
Definition: jsondef.h:4320
double R_2_0
Definition: jsondef.h:4391
void set_IJK_from_PQW()
Definition: jsondef.h:4451
double i
Definition: jsondef.h:4334
double e
Definition: jsondef.h:4322