Commit 370f5a31 authored by Matteo Quintiliani's avatar Matteo Quintiliani

Added paramater ChannelFile


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@575 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent 3ea45b83
......@@ -35,6 +35,12 @@ DefaultNetworkCode IV # Default network code where in Chann
# STA can be '*', stands for all stations.
# CHAN can contain '?', stands for any character.
# Example: *.HH?,N1.STA2.??Z,STA3.?H?
# ChannelFile /home/ew/naqs1a.list.txt # State Channel file (It will be updated)
# Allow data continuity between program restarts
# and within available data buffered on NaqsServer.
# Do not use with Channel parameter below.
Channel ES.BOB.HH?
Channel MN.TIR.HH?
Channel MDI.HH?
......
......@@ -52,7 +52,8 @@ Nanometrics server and connection parameters:<br>
<a href="#MaxTolerableLatency">MaxTolerableLatency</a> optional<br>
<a href="#TimeoutRecv">TimeoutRecv</a> optional<br>
<a href="#DefaultNetworkCode">DefaultNetworkCode</a> optional<br>
<a href="#Channel">Channel</a> required<br>
<a href="#ChannelFile">ChannelFile</a> required or Channel<br>
<a href="#Channel">Channel</a> required or ChannelFile<br>
<br>
Output control:<br>
......@@ -83,6 +84,19 @@ Within channel code can appear character &#63; that stands for any characters.
<pre><br>Default: none<br>Example: Channel ES.BOB.HH?<br> Channel *.HHZ<br> Channel MN.TIR.HH?<br> Channel SALO.BH?</pre>
</blockquote>
<hr><!-- ADD HERE: all commands; below is a sample command blank: --><!-- command name as anchor inside quotes -->
<pre><a name="ChannelFile"><b>ChannelFile <font color="red">channel_state_file</font> ReadConfig nmxptool parameters<br></b><!-- command args ... --> <br></a></pre>
<blockquote><!-- command description goes here --> Specifies one or more streams
of data to be requested from the NmxpHost.
The <font color="red">streamkey</font> is the same for the <a href="#Channel">Channel</a>.
Allow data continuity between program restarts and within data buffered by the NaqsServer.
First time, the file is created by the user. nmxptool will update date and time of last sample received for each channel. DO NOT USE WITH <a href="#Channel">Channel</a>!
<pre><br>Default: none<br>Example: ChannelFile /home/ew/list_channels_naqs1.txt</br>
</br>Example of file created by the user the first time:<br />ES.BOB.HH?<br/>MN.TIR.HHZ
</br>Example of file updated by nmxptool:<br />ES.BOB.HHE 1970.001,00:00:00.0000 2007.353,13:30:36.8700<br />ES.BOB.HHN 1970.001,00:00:00.0000 2007.353,13:30:37.4800<br />ES.BOB.HHZ 1970.001,00:00:00.0000 2007.353,13:30:37.2799<br/>MN.TIR.HHZ 1970.001,00:00:00.0000 2007.353,13:30:34.5199
</pre>
</blockquote>
<hr><!-- ADD HERE: all commands; below is a sample command blank: --><!-- command name as anchor inside quotes -->
<pre><a name="DefaultNetworkCode"><b>DefaultNetworkCode <font color="red">network_code</font> ReadConfig nmxptool parameters<br></b><!-- command args ... --> <br></a></pre>
<blockquote><!-- command description goes here --> Specifies default <font color="red">network code</font>
......
......@@ -403,6 +403,10 @@ int nmxptool_ew_proc_configfile (char * configfile, NMXPTOOL_PARAMS *params) {
else if (k_its ("Channel")) {
if ( (str = k_str ()) ) {
if(params->statefile) {
nmxp_log(NMXP_LOG_ERR, NMXP_LOG_D_ANY, "Channels have been already defined inside channel state file!\n");
return EW_FAILURE;
}
if(!params->channels) {
#define MAXSIZECHANNELSTRING 8000
params->channels = (char *) malloc (MAXSIZECHANNELSTRING);
......@@ -415,6 +419,28 @@ int nmxptool_ew_proc_configfile (char * configfile, NMXPTOOL_PARAMS *params) {
}
else if (k_its ("ChannelFile")) {
if ( (str = k_str ()) ) {
params->flag_buffered = 1;
params->statefile = (char *) malloc(512 * sizeof(char));
strncpy(params->statefile, str, 512);
if(params->channels == NULL) {
params->channels = get_channel_list_argument_from_state_file(params->statefile);
if(params->channels) {
/* Do nothing */
} else {
nmxp_log(NMXP_LOG_NORM_NO, NMXP_LOG_D_ANY, "State file %s not found or unable to read!\n", params->statefile);
return EW_FAILURE;
}
} else {
nmxp_log(NMXP_LOG_ERR, NMXP_LOG_D_ANY, "Channels have been already defined inside main configuration file!\n");
return EW_FAILURE;
}
}
}
/* Unknown command */
else {
fprintf (stderr, "%s: <%s> Unknown command in <%s>.\n", PACKAGE_NAME,
......
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