104 int32_t
iretn, sleept;
111 printf(
"Usage: agent_node node\n");
144 printf(
"Couldn't find Node directory %s\n",argv[1]);
169 printf(
"Loaded day %f\n",
lastday);
176 printf(
"Loaded events\n");
181 printf(
"Loaded Ephemeris\n");
196 agent->
set_sohstring((
char *)
"{\"node_utc\",\"node_name\",\"node_type\",\"node_loc_pos_eci\",\"node_loc_att_icrf\"}");
205 agent->
set_sohstring((
char *)
"{\"node_utc\",\"node_name\",\"node_type\",\"node_loc_pos_geod\",\"node_loc_att_topo\"}");
243 sleept = (int)((nextmjd-
currentmjd(0.))*86400000000.);
244 if (sleept < 0) sleept = 0;
245 COSMOS_USLEEP(sleept);
int32_t request_loadmjd(string &request, string &response, Agent *)
Load a given day's data.
Definition: agent_node.cpp:396
int32_t request_indexes(string &request, string &response, Agent *)
Returns the current record of both event and telemetry data.
Definition: agent_node.cpp:460
int32_t request_days(string &request, string &response, Agent *)
Tells first and last day in archive.
Definition: agent_node.cpp:420
uint16_t target_cnt
Definition: jsondef.h:3575
int32_t request_counts(string &request, string &response, Agent *)
Gives the number of event and telemetry records.
Definition: agent_node.cpp:411
double findfirstday(string name)
Find first day in archive.
Definition: datalib.cpp:1754
double utc
Definition: convertdef.h:261
std::vector< eventstruc > eventdict
Definition: agent_node.cpp:75
#define JSON_ERROR_NOJMAP
Definition: cosmos-errno.h:93
double utc
UTC of Position.
Definition: convertdef.h:161
int i
Definition: rw_test.cpp:37
int32_t json_parse(string jstring, cosmosstruc *cinfo)
Parse JSON using Name Space.
Definition: jsonlib.cpp:4799
void loadephemeris()
Load Event templates.
Definition: agent_node.cpp:281
const char * json_of_table(string &jstring, vector< jsonentry * > table, cosmosstruc *cinfo)
Create JSON stream from entries.
Definition: jsonlib.cpp:8733
void simulate_hardware(cosmosstruc *cinfo, vector< locstruc > &locvec)
Simulate Hardware data - multiple.
Definition: physicslib.cpp:937
int32_t update_target(cosmosstruc *cinfo)
Update Track list.
Definition: jsonlib.cpp:11262
#define MAXEPHEM
Definition: agent_node.cpp:44
int32_t request_getnode(string &request, string &response, Agent *)
Returns the current node.ini.
Definition: agent_node.cpp:536
int iretn
Definition: rw_test.cpp:37
void gauss_jackson_init_eci(gj_handle &gjh, uint32_t order, int32_t mode, double dt, double utc, cartpos ipos, qatt iatt, physicsstruc &physics, locstruc &loc)
Initialize Gauss-Jackson orbit using ECI state vector.
Definition: physicslib.cpp:2479
double utc
Master time for location, in Modified Julian Day.
Definition: convertdef.h:879
int32_t set_sohstring(string list)
Set Limited SOH string.
Definition: agentclass.cpp:641
Definition: cosmos-defs.h:91
quaternion q_fmult(rvector r1, quaternion q2)
rvector quaternion multiply
Definition: vector.cpp:1079
nodestruc node
Structure for summary information in node.
Definition: jsondef.h:4220
double findlastday(string name)
Find last day in archive.
Definition: datalib.cpp:1679
uint16_t running()
Check if we're supposed to be running.
Definition: agentclass.cpp:391
Definition: cosmos-defs.h:90
rvector s
Location.
Definition: convertdef.h:163
int32_t post(messstruc mess)
Post a Cosmos::Agent::messstruc.
Definition: agentclass.cpp:2074
double firstday
Definition: agent_node.cpp:84
std::string myjstring
Definition: agent_node.cpp:53
attstruc att
attstruc for this time.
Definition: convertdef.h:883
double utcoffset
MJD Offset between system UT and simulated UT.
Definition: jsondef.h:3590
double newlastday
Definition: agent_node.cpp:84
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
char name[40+1]
Node Name.
Definition: jsondef.h:3556
Definition: agentclass.h:139
quaternion q_change_around_z(double angle)
Rotation quaternion for Z axis.
Definition: vector.cpp:1461
qatt icrf
Definition: convertdef.h:830
locstruc loc
Location structure.
Definition: jsondef.h:3596
size_t load_dictionary(vector< eventstruc > &dict, cosmosstruc *cinfo, const char *file)
Load Event Dictionary.
Definition: jsonlib.cpp:11313
int32_t request_getmjd(string &request, string &response, Agent *)
Returns the day that is loaded.
Definition: agent_node.cpp:469
double h
Height in meters.
Definition: vector.h:229
vector< locstruc > gauss_jackson_propagate(gj_handle &gjh, physicsstruc &physics, locstruc &loc, double tomjd)
Definition: physicslib.cpp:2871
std::vector< eventstruc > commanddict
Definition: agent_node.cpp:76
std::vector< std::string > event
Definition: agent_node.cpp:62
gj_handle gjh
Definition: agent_node.cpp:80
double lon
Longitude in radians.
Definition: vector.h:227
int32_t pos_geod(locstruc *loc)
Set Geodetic position.
Definition: convertlib.cpp:576
Definition: cosmos-defs.h:94
double currentmjd(double offset)
Current UTC in Modified Julian Days.
Definition: timelib.cpp:65
Definition: cosmos-defs.h:92
string get_nodedir(string node, bool create_flag)
Get Current Node Directory.
Definition: datalib.cpp:1572
posstruc pos
posstruc for this time.
Definition: convertdef.h:881
uint32_t pass
pass indicator: allows synchronization with other attitude and position values.
Definition: convertdef.h:485
gvector s
Position vector.
Definition: convertdef.h:263
double lat
Latitude in radians.
Definition: vector.h:225
qatt topo
Definition: convertdef.h:826
const char * json_of_list(string &jstring, string list, cosmosstruc *cinfo)
Create JSON stream from list.
Definition: jsonlib.cpp:8714
void hardware_init_eci(cosmosstruc *cinfo, locstruc &loc)
Initialize Hardware.
Definition: physicslib.cpp:877
vector< agentstruc > agent
Single entry vector for agent information.
Definition: jsondef.h:4247
quaternion s
0th derivative: Quaternion
Definition: convertdef.h:479
double col[3]
Definition: vector.h:55
cosmosstruc * cinfo
Definition: agentclass.h:346
cartpos eci
Definition: convertdef.h:737
int32_t request_next(string &request, string &response, Agent *)
Gets next event, telemetry or data dictionary record entry.
Definition: agent_node.cpp:478
quaternion q_eye()
Identity quaternion.
Definition: vector.cpp:1310
Agent * agent
Definition: agent_node.cpp:78
geoidpos geod
Definition: convertdef.h:741
vector< jsonentry * > sohtable
State of Health element vector.
Definition: agentclass.h:156
double loadmjd(double mjd)
Load a days worth of telemetry from disk.
Definition: agent_node.cpp:341
uint32_t pass
pass indicator: allows synchronization with other attitude and position values.
Definition: convertdef.h:269
double mjd
Definition: agent_node.cpp:57
Definition: cosmos-defs.h:93
vector< targetstruc > target
Vector of all targets known to node.
Definition: jsondef.h:4253
std::vector< std::string > telem
Definition: agent_node.cpp:60
quaternion q_change_around_x(double angle)
Rotation quaternion for X axis.
Definition: vector.cpp:1410
uint16_t type
Node Type as listed in NODE_TYPE.
Definition: jsondef.h:3562
int32_t att_topo(locstruc *loc)
Definition: convertlib.cpp:2252
physicsstruc phys
Definition: jsondef.h:3597
int32_t request_rewind(string &request, string &response, Agent *)
Goes to the first record for either events or telemetry for the loaded day.
Definition: agent_node.cpp:429
cachestruc cache[3+3+1]
Definition: agent_node.cpp:65
double lastday
Definition: agent_node.cpp:84