Commit 730d2bb9 authored by Matteo Quintiliani's avatar Matteo Quintiliani
Browse files

added parameters n_channel and n_usec to sendAddTimeSeriesChannel()


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@928 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent e8b8234f
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Istituto Nazionale di Geofisica e Vulcanologia - Italy * Istituto Nazionale di Geofisica e Vulcanologia - Italy
* quintiliani@ingv.it * quintiliani@ingv.it
* *
* $Id: nmxp.h,v 1.46 2008-03-11 11:01:12 mtheo Exp $ * $Id: nmxp.h,v 1.47 2008-03-18 15:19:37 mtheo Exp $
* *
*/ */
...@@ -1073,12 +1073,14 @@ int nmxp_receiveChannelList(int isock, NMXP_CHAN_LIST **pchannelList); ...@@ -1073,12 +1073,14 @@ int nmxp_receiveChannelList(int isock, NMXP_CHAN_LIST **pchannelList);
* 0 Uncompressed packets. * 0 Uncompressed packets.
* 0 < out_format, requested output sample rate. * 0 < out_format, requested output sample rate.
* \param buffer_flag Server will send or not buffered packets. * \param buffer_flag Server will send or not buffered packets.
* \param n_channel number of channels to add any time
* \param n_usec frequency to add remaining channels (microseconds)
* *
* \retval SOCKET_OK on success * \retval SOCKET_OK on success
* \retval SOCKET_ERROR on error * \retval SOCKET_ERROR on error
* *
*/ */
int nmxp_sendAddTimeSeriesChannel(int isock, NMXP_CHAN_LIST_NET *channelList, int32_t shortTermCompletion, int32_t out_format, NMXP_BUFFER_FLAG buffer_flag); int nmxp_sendAddTimeSeriesChannel(int isock, NMXP_CHAN_LIST_NET *channelList, int32_t shortTermCompletion, int32_t out_format, NMXP_BUFFER_FLAG buffer_flag, const int n_channel, const int n_usec);
/*! \brief Receive Compressed or Decompressed Data message from a socket and launch func_processData() on the extracted data /*! \brief Receive Compressed or Decompressed Data message from a socket and launch func_processData() on the extracted data
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Istituto Nazionale di Geofisica e Vulcanologia - Italy * Istituto Nazionale di Geofisica e Vulcanologia - Italy
* quintiliani@ingv.it * quintiliani@ingv.it
* *
* $Id: nmxp.c,v 1.73 2008-03-18 13:52:57 mtheo Exp $ * $Id: nmxp.c,v 1.74 2008-03-18 15:19:37 mtheo Exp $
* *
*/ */
...@@ -114,15 +114,11 @@ int nmxp_sendAddTimeSeriesChannel_raw(int isock, NMXP_CHAN_LIST_NET *channelList ...@@ -114,15 +114,11 @@ int nmxp_sendAddTimeSeriesChannel_raw(int isock, NMXP_CHAN_LIST_NET *channelList
return ret; return ret;
} }
int nmxp_sendAddTimeSeriesChannel(int isock, NMXP_CHAN_LIST_NET *channelList, int32_t shortTermCompletion, int32_t out_format, NMXP_BUFFER_FLAG buffer_flag) { int nmxp_sendAddTimeSeriesChannel(int isock, NMXP_CHAN_LIST_NET *channelList, int32_t shortTermCompletion, int32_t out_format, NMXP_BUFFER_FLAG buffer_flag, const int n_channel, const int n_usec) {
static int i = 0; static int i = 0;
static int first_time = 1; static int first_time = 1;
static struct timeval last_tp_now; static struct timeval last_tp_now;
/* Empiric constant values TODO */
const int n_channel = 9;
const int n_usec = 250000; /* 1/4 second */
int j; int j;
int ret = 0; int ret = 0;
NMXP_CHAN_LIST_NET split_channelList; NMXP_CHAN_LIST_NET split_channelList;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Istituto Nazionale di Geofisica e Vulcanologia - Italy * Istituto Nazionale di Geofisica e Vulcanologia - Italy
* quintiliani@ingv.it * quintiliani@ingv.it
* *
* $Id: nmxptool.c,v 1.150 2008-03-18 13:52:57 mtheo Exp $ * $Id: nmxptool.c,v 1.151 2008-03-18 15:19:37 mtheo Exp $
* *
*/ */
...@@ -143,6 +143,10 @@ int main (int argc, char **argv) { ...@@ -143,6 +143,10 @@ int main (int argc, char **argv) {
double default_start_time = 0.0; double default_start_time = 0.0;
char start_time_str[30], end_time_str[30], default_start_time_str[30]; char start_time_str[30], end_time_str[30], default_start_time_str[30];
/* Empiric constant values TODO */
const int n_channel = 9;
const int n_usec = 250000; /* 1/4 second */
NMXP_DATA_PROCESS *pd; NMXP_DATA_PROCESS *pd;
#ifndef HAVE_WINDOWS_H #ifndef HAVE_WINDOWS_H
...@@ -744,7 +748,7 @@ int main (int argc, char **argv) { ...@@ -744,7 +748,7 @@ int main (int argc, char **argv) {
/* PDS Step 5: Send AddChannels */ /* PDS Step 5: Send AddChannels */
/* Request Data */ /* Request Data */
nmxp_sendAddTimeSeriesChannel(naqssock, channelList_subset, params.stc, params.rate, (params.flag_buffered)? NMXP_BUFFER_YES : NMXP_BUFFER_NO); nmxp_sendAddTimeSeriesChannel(naqssock, channelList_subset, params.stc, params.rate, (params.flag_buffered)? NMXP_BUFFER_YES : NMXP_BUFFER_NO, n_channel, n_usec);
/* PDS Step 6: Repeat until finished: receive and handle packets */ /* PDS Step 6: Repeat until finished: receive and handle packets */
...@@ -950,7 +954,7 @@ int main (int argc, char **argv) { ...@@ -950,7 +954,7 @@ int main (int argc, char **argv) {
} }
#endif #endif
nmxp_sendAddTimeSeriesChannel(naqssock, channelList_subset, params.stc, params.rate, (params.flag_buffered)? NMXP_BUFFER_YES : NMXP_BUFFER_NO); nmxp_sendAddTimeSeriesChannel(naqssock, channelList_subset, params.stc, params.rate, (params.flag_buffered)? NMXP_BUFFER_YES : NMXP_BUFFER_NO, n_channel, n_usec);
} /* End main PDS loop */ } /* End main PDS loop */
......
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