Changeset 8159


Ignore:
Timestamp:
06/16/20 08:34:55 (3 weeks ago)
Author:
paulf
Message:

new slink2ew version with MaxLatency? as an optional parameter, version 3.1

Location:
trunk/src/data_exchange/slink2ew
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/data_exchange/slink2ew/ChangeLog

    r7606 r8159  
     12020.06.15: Version 3.1 
     2         - Added in the MaxLatency parameter as implemented by Stuart Weinstein at PTWC 
     3 
    142018.04.18: version 3.0 
    25         - Upgraded libslink to handle IPv6 
  • trunk/src/data_exchange/slink2ew/slink2ew.c

    r7606 r8159  
    7272long  mseedRingKey;                    /* Key to output shared memory region   */ 
    7373SHM_INFO *mregionOutP, mregionOut;          /* Shared memory region (mseedRing)         */ 
     74double        MaxLatency=0.0;           /* new max latency test, to prevent old data floods */ 
    7475 
    7576 
     
    267268  int len; 
    268269  void *samples; 
     270  double now, latency; 
     271  time_t  t; 
     272  struct tm  *gm; 
    269273 
    270274  /* Sanity check for miniSEED record */ 
     
    292296  if ( !writemseed ) 
    293297    { 
     298      t = time(NULL); 
     299      gm = gmtime(&t); 
     300      now = (double) t; 
     301 
    294302      /* Parse miniSEED record */ 
    295303      if ( msr_parse (msrecord, slRecordSize, &msr, slRecordSize, 1, 0) ) 
     
    311319       
    312320      memset (&tbuf, 0, sizeof(TRACE2_HEADER)); 
     321      latency =  now - tbuf.trh2.starttime; 
    313322 
    314323      /* Log packet details if the verbosity is high */ 
    315324      if ( verbose > 1 ) 
    316325        msr_print (msr, verbose - 1); 
     326 
     327      if ( !MaxLatency || (latency  < MaxLatency) ) { 
    317328 
    318329      /* Create a TRACEBUF2 message */ 
     
    388399          return EW_FAILURE; 
    389400        } 
    390     } 
     401    } else { 
     402          logit("et", "slink2ew: Latent Packet for %5s.%3s.%2s.%2s %lf secs\n", 
     403                tbuf.trh2.sta,tbuf.trh2.chan,tbuf.trh2.net,tbuf.trh2.loc,latency); 
     404    } 
     405    }  
    391406 
    392407  return EW_SUCCESS; 
     
    880895                } 
    881896            } 
     897        /* optional setting to reject packets for EW with latency greater than this value */ 
     898          else if ( k_its ("MaxLatency")) 
     899            { 
     900              if ( (str = k_str ()) ) 
     901                { 
     902                  MaxLatency  = (double)  atoi (str) ; 
     903                } 
     904              if ( !str || MaxLatency < 0 ) 
     905                { 
     906                  fprintf(stderr, "MaxLatency is unspecified or negative, quiting\n"); 
     907                  return EW_FAILURE; 
     908                } 
     909           } 
    882910 
    883911          /* Unknown command */ 
  • trunk/src/data_exchange/slink2ew/slink2ew.d

    r6896 r8159  
    126126# the ring.  In other words, requesting any records in addition to 
    127127# data records is a waste. 
     128 
     129# Optional setting - OFF if not set (accept any latent packets) 
     130# MaxLatency NSECS   # reject any mseed packet from being written to EW that is 
     131#                    # latent by NSECS (double) (as computed from packet start time) 
  • trunk/src/data_exchange/slink2ew/slink2ew.h

    r7606 r8159  
    55#define __SLINK2EW__ 
    66 
    7 #define VERSION "3.0" 
     7#define VERSION "3.1" 
    88 
    99#define MAXMESSAGELEN   160     /* Maximum length of a status or error  */ 
Note: See TracChangeset for help on using the changeset viewer.