Commit 7806872c authored by Matteo Quintiliani's avatar Matteo Quintiliani

Added flag for loggin data


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@132 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent d2bfea60
......@@ -279,7 +279,9 @@ int main (int argc, char **argv) {
pd = nmxp_processCompressedData(buffer, length, channelList_subset);
/* Log contents of last packet */
nmxp_data_log(pd);
if(params.flag_logdata) {
nmxp_data_log(pd);
}
/* Management of gaps */
cur_chan = nmxp_chan_lookupKeyIndex(pd->key, channelList_subset);
......@@ -429,7 +431,9 @@ int main (int argc, char **argv) {
pd = nmxp_receiveData(naqssock, channelList_subset);
/* Log contents of last packet */
nmxp_data_log(pd);
if(params.flag_logdata) {
nmxp_data_log(pd);
}
/* Management of gaps */
cur_chan = nmxp_chan_lookupKeyIndex(pd->key, channelList_subset);
......
......@@ -27,6 +27,7 @@ const NMXPTOOL_PARAMS NMXPTOOL_PARAMS_DEFAULT =
0,
0,
0,
0,
0
};
......@@ -74,6 +75,7 @@ Optional arguments:\n\
\n\
Flags:\n\
-v, --verbose Be verbose.\n\
-d, --logdata Log nanometrics data.\n\
-b, --buffered Receive recent packets into the past. ONLY PDS.\n\
-l, --listchannels Output list of channel available on NaqsServer.\n",
DEFAULT_PORT_PDS,
......@@ -138,6 +140,7 @@ int nmxptool_getopt_long(int argc, char **argv, NMXPTOOL_PARAMS *params)
{"password", required_argument, 0, 'p'},
/* Following are flags */
{"verbose", no_argument, 0, 'v'},
{"logdata", no_argument, 0, 'd'},
{"buffered", no_argument, 0, 'b'},
{"listchannels", no_argument, 0, 'l'},
#ifdef HAVE_LIBMSEED
......@@ -172,7 +175,7 @@ int nmxptool_getopt_long(int argc, char **argv, NMXPTOOL_PARAMS *params)
/* init params */
memcpy(params, &NMXPTOOL_PARAMS_DEFAULT, sizeof(NMXPTOOL_PARAMS_DEFAULT));
char optstr[100] = "H:P:D:C:N:L:S:R:s:e:u:p:vblwh";
char optstr[100] = "H:P:D:C:N:L:S:R:s:e:u:p:vdblwh";
#ifdef HAVE_LIBMSEED
strcat(optstr, "m");
......@@ -263,6 +266,10 @@ int nmxptool_getopt_long(int argc, char **argv, NMXPTOOL_PARAMS *params)
params->flag_verbose = 1;
break;
case 'd':
params->flag_logdata = 1;
break;
case 'b':
params->flag_buffered = 1;
break;
......
......@@ -31,6 +31,7 @@ typedef struct {
int flag_writefile;
int flag_writeseedlink;
int flag_buffered;
int flag_logdata;
} NMXPTOOL_PARAMS;
/*! \brief Print the usage of paramters */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment