Ticket #335 (new wishlist)

Opened 6 years ago

Last modified 6 years ago

multiple definitions of STATRIG

Reported by: baker Owned by: somebody
Priority: minor Milestone: All Platforms
Component: carlsubtrig Version: 7.7
Keywords: Cc:

Description

There are four places where typedef struct ... STATRIG is defined:

src/archiving/cont_trig/cont_trig.h:

  /* 	A station trigger structure					*/
typedef struct _STATRIG
{
  double	onTime;		/* When the station eta first went 	*/
				/*   above zero				*/
  double	offTime;	/* When station eta <= 0		*/
				/*   0.0 if station eta currently > 0	*/
  double	onEta;		/* Station eta when first above 0	*/
  long		sequence;	/* sequence number (from CarlStaTrig)	*/
} STATRIG;

src/grab_bag/trig2arc/trig2arc.h:

typedef struct
{
    char    sta[TRACE2_STA_LEN];
    char    chan[TRACE2_CHAN_LEN];
    char    net[TRACE2_NET_LEN];
    char    loc[TRACE2_LOC_LEN];
    double  Sta_time;       /* Station trigger time as sec since 1600 */
    int     duration;
    int	    Id;
} STATRIG;

src/seismic_processing/carlsubtrig/carlsubtrig.h:

  /* 	A station trigger structure					*/
typedef struct _STATRIG
{
  double	onTime;		/* When the station eta first went 	*/
				/*   above zero				*/
  double	offTime;	/* When station eta <= 0		*/
				/*   0.0 if station eta currently > 0	*/
  double	onEta;		/* Station eta when first above 0	*/
  long		sequence;	/* sequence number (from CarlStaTrig)	*/
} STATRIG;

src/seismic_processing/statrigfilter/statrigfilter.c:

/* Structures for holding station trigger info
 *********************************************/
typedef struct _STATRIG {
   char          site[TRACE2_STA_LEN];
   char          cmp[TRACE2_CHAN_LEN];
   char          net[TRACE2_NET_LEN];
   char          loc[TRACE2_LOC_LEN];
   double        ton;              /* trigger "on" time                  */
   double        toff;             /* trigger "off" time (0 while "on")  */
   double        onEta;            /* eta when the trigger went on       */ 
   long          seq;              /* trigger sequence number            */
} STATRIG;

This makes it very difficult to debug code. They should be reconciled or renamed.

Change History

comment:1 Changed 6 years ago by paulf

Not going to fix this one right now as this is an improvement that will be pretty involved as each uses different information (yes, they should be common'ized but that can wait for someone to revisit all of the carl/trig programs).

Note: See TracTickets for help on using tickets.