108 #define DATA_LOG_TYPE_SOH 0 109 #define DATA_LOG_TYPE_EVENT 1 110 #define DATA_LOG_TYPE_BEACON 2 111 #define DATA_LOG_TYPE_PROGRAM 3 // to log program status information while running 128 void log_write(
string node,
int type,
double utc,
const char* data,
string directory=
"temp");
131 void log_write(
string node,
string agent,
double utc,
string extra,
string type,
string record,
string location=
"temp");
147 FILE*
data_open(
string path,
const char *mode);
148 int32_t
data_name_date(
string node,
string filename, uint16_t &year, uint16_t &jday, uint32_t &seconds);
166 int32_t
data_execute(
string cmd,
string& result,
string shell=
"");
178 int32_t
setEnv(
string var,
string path);
string name
Definition: datalib.h:117
double findfirstday(string name)
Find first day in archive.
Definition: datalib.cpp:1754
off_t size
Definition: datalib.h:120
uint16_t year
Definition: datalib.h:121
uint32_t seconds
Definition: datalib.h:123
int32_t set_cosmosroot(string name, bool create_flag)
Set Root Directory.
Definition: datalib.cpp:1064
string data_name(string node, double mjd, string extra, string type)
Create data file name.
Definition: datalib.cpp:685
FILE * data_open(string path, const char *mode)
Open file from path.
Definition: datalib.cpp:1019
string node
Definition: datalib.h:115
int32_t set_cosmosnodes(string name, bool create_flag)
Set Nodes Directory.
Definition: datalib.cpp:1445
int32_t setEnvCosmosNodes(string path)
Set Environment Variable for COSMOS nodes.
Definition: datalib.cpp:1383
void log_move(string oldpath, string newpath, bool compress)
Move log file - path version.
Definition: datalib.cpp:200
int32_t data_load_archive(string node, string agent, double utcbegin, double utcend, string type, vector< string > &result)
Load data from archive.
Definition: datalib.cpp:1616
vector< filestruc > data_list_archive(string node, string agent, double utc, string type)
Get a list of files in a Node archive.
Definition: datalib.cpp:385
string data_name_path(string node, string location, string agent, double mjd, string name)
Create data file path.
Definition: datalib.cpp:954
vector< filestruc > data_list_files(string directory)
Get list of files in a directory, directly.
Definition: datalib.cpp:461
double utc
Definition: datalib.h:124
int32_t data_get_nodes(vector< cosmosstruc > &node)
Get vector of Node structures.
Definition: datalib.cpp:636
int32_t set_cosmosresources(string name, bool create_flag)
Set Resources Directory.
Definition: datalib.cpp:1248
string data_base_path(string node, string location, string agent, string filename)
Create data file path.
Definition: datalib.cpp:767
static vector< eventstruc > events
Definition: propagator_simple.cpp:64
vector< string > data_list_nodes()
Get list of Nodes, directly.
Definition: datalib.cpp:583
off_t data_size(string path)
Definition: datalib.cpp:1932
string get_cosmosnodes(bool create_flag)
Return COSMOS Nodes Directory.
Definition: datalib.cpp:1532
double findlastday(string name)
Find last day in archive.
Definition: datalib.cpp:1679
int32_t data_execute(string cmd, string &result, string shell)
Definition: datalib.cpp:1947
Definition: datalib.h:113
string get_cosmosresources(bool create_flag)
Return COSMOS Resources Directory.
Definition: datalib.cpp:1337
string data_type_path(string node, string location, string agent, double mjd, string type)
Create data file path.
Definition: datalib.cpp:910
int32_t setEnv(string var, string path)
Set Environment Variable for COSMOS.
Definition: datalib.cpp:1393
bool data_isfile(string path, off_t size)
Definition: datalib.cpp:1895
string path
Definition: datalib.h:119
std::vector< cosmosstruc > nodes
Definition: agent_data-2-0.cpp:57
static Agent * agent
ensure the Agent constructor creates only one instance per process
Definition: agent_001.cpp:45
bool data_isdir(string path)
Definition: datalib.cpp:1865
JSON Support definitions.
Headers and definitions common to all COSMOS.
string name
Definition: cubesat2obj.cpp:6
Full COSMOS Event structure.
Definition: jsondef.h:1093
double mjd
Definition: udp_send.cpp:41
timelib include file A library providing functions for handling various types of time.
uint16_t jday
Definition: datalib.h:122
double data_ctime(string path)
Definition: datalib.cpp:1910
int32_t kml_write(cosmosstruc *cinfo)
Add to KML path.
Definition: datalib.cpp:1828
void log_write(string node, string agent, double utc, string extra, string type, string record, string location)
Write log entry - full.
Definition: datalib.cpp:75
string get_nodedir(string node, bool create_flag)
Get Current Node Directory.
Definition: datalib.cpp:1572
string data_archive_path(string node, string agent, double mjd)
Definition: datalib.cpp:871
string agent
Definition: datalib.h:116
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
Definition: compress.c:62
string get_cosmosroot(bool create_flag)
Return COSMOS Root Directory.
Definition: datalib.cpp:1209
int32_t setEnvCosmos(string path)
Definition: datalib.cpp:1427
bool data_ischardev(string path)
Definition: datalib.cpp:1880
string log_read(gzFile &file, int num)
log_reads Loop until the newline character is seen. Append it to a string and return the line once th...
Definition: datalib.cpp:357
int32_t setEnvCosmosResources(string path)
Set Environment Variable for COSMOS resources.
Definition: datalib.cpp:1373
string data_resource_path(string name)
Create resource file path.
Definition: datalib.cpp:983
static string node
Definition: agent_monitor.cpp:126
Definition: jsondef.h:4199
int32_t data_name_date(string node, string filename, uint16_t &year, uint16_t &jday, uint32_t &seconds)
Get date from file name.
Definition: datalib.cpp:722
int check_events(eventstruc *events, int max, cosmosstruc *data)
vector< double > data_list_archive_days(string node, string agent)
Get a list of days in a Node archive.
Definition: datalib.cpp:303
string type
Definition: datalib.h:118
bool data_exists(string &path)
Check existence of path.
Definition: datalib.cpp:1003