39 FILE *
fp = fopen((
"/cosmos/nodes/" + agent->
nodeName +
"/last_date").c_str(),
"r");
46 fp = fopen((
"/cosmos/nodes/" + agent->
nodeName +
"/last_offset").c_str(),
"r");
49 fscanf(fp,
"%d", &offset);
56 printf(
"Initialized time from file: Delta %f Offset %d\n", delta, offset);
69 printf(
"Initialized time from server: Delta %f Offset %f\n", delta, offset*86400.);
73 printf(
"Failed to find time server\n");
int32_t dom
Definition: timelib.h:110
Definition: eci2kep_test.cpp:33
static double delta
Definition: agent_exec-2-0.cpp:141
string nodeName
Definition: agentclass.h:367
int iretn
Definition: rw_test.cpp:37
int32_t hour
Definition: timelib.h:112
static double epsilon
Definition: agent_exec-2-0.cpp:140
Definition: timelib.h:106
int32_t get_agent_time(double &agent_time, double &epsilon, double &delta, string agent, string node="any", double wait_sec=2.)
Definition: agentclass.cpp:2711
double set_local_clock(double utc_to)
Definition: timelib.cpp:1626
int32_t month
Definition: timelib.h:109
static Agent * agent
ensure the Agent constructor creates only one instance per process
Definition: agent_001.cpp:45
Definition: agentclass.h:139
double cal2mjd(int32_t year, int32_t month, int32_t day, int32_t hour, int32_t minute, int32_t second, int32_t nsecond)
Calendar representation to Modified Julian Day - full.
Definition: timelib.cpp:294
int32_t minute
Definition: timelib.h:113
double currentmjd(double offset)
Current UTC in Modified Julian Days.
Definition: timelib.cpp:65
int32_t year
Definition: timelib.h:108
FILE * fp
Definition: rw_test.cpp:38
int32_t second
Definition: timelib.h:114
unsigned offset
Definition: inflate.h:102