Changeset 4632


Ignore:
Timestamp:
10/25/11 12:20:35 (10 years ago)
Author:
saurel
Message:

Minor change to add a default earthquake location to the message

Location:
trunk/src/grab_bag/trig2arc
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/grab_bag/trig2arc/hyp_trig_utils.c

    r4084 r4632  
    176176void write_hyp_header( STATRIG *statrig, char **outmsg_ptr) 
    177177{ 
     178        float   deg, min; 
     179        char    sign; 
    178180        char    trigger_date[18]; 
    179181        int     i; 
     
    182184        sprintf(*outmsg_ptr,"%14.14s%2.2s",trigger_date,trigger_date+15); 
    183185        *outmsg_ptr = *outmsg_ptr + 16; 
    184         for (i=0; i<120; i++) 
     186 
     187        deg = floor( fabs(UseLatitude) ); 
     188        min = ( fabs(UseLatitude) - deg ) * 60 * 100; 
     189        if (UseLatitude < 0) 
     190                sign = 'S'; 
     191        else 
     192                sign = ' '; 
     193        sprintf(*outmsg_ptr,"%-2.0f%c%4.0f",deg,sign,min); 
     194        *outmsg_ptr = *outmsg_ptr + 7; 
     195 
     196        deg = floor( fabs(UseLongitude) ); 
     197        min = ( fabs(UseLongitude) - deg ) * 60 * 100; 
     198        if (UseLongitude > 0) 
     199                sign = 'E'; 
     200        else 
     201                sign = ' '; 
     202        sprintf(*outmsg_ptr,"%3.0f%c%4.0f",deg,sign,min); 
     203        *outmsg_ptr = *outmsg_ptr + 8; 
     204 
     205        sprintf(*outmsg_ptr,"%5.0f",UseDepth*100); 
     206        *outmsg_ptr = *outmsg_ptr + 5; 
     207 
     208        for (i=0; i<100; i++) 
    185209                sprintf(*outmsg_ptr+i," "); 
    186210        *outmsg_ptr = *outmsg_ptr + i; 
  • trunk/src/grab_bag/trig2arc/trig2arc.c

    r4084 r4632  
    2323int  convert_trigmsg( char *, long *); 
    2424int  getNextLine (char**, char*); 
    25  
    26 /* Globals 
    27  *********/ 
    28 static SHM_INFO  InRegion;    /* shared memory region to use for input  */ 
    29 static SHM_INFO  OutRegion;   /* shared memory region to use for output */ 
    30 static pid_t     MyPid;       /* Our process id is sent with heartbeat  */ 
    31  
    32 /* Things to read or derive from configuration file 
    33  **************************************************/ 
    34 static int     LogSwitch;          /* 0 if no logfile should be written */ 
    35 static long    HeartbeatInt;       /* seconds between heartbeats        */ 
    36 static MSG_LOGO *GetLogo = NULL;   /* logo(s) to get from shared memory */ 
    37 static short   nLogo   = 0;        /* # logos we're configured to get   */ 
    38 static int     UseOriginalLogo=0;  /* 0=use trig2arc's own logo on output msgs   */ 
    39                                    /* non-zero=use original logos on output      */ 
    40                                    /*   NOTE: this requires that output go to    */ 
    41                                    /*   different transport ring than input      */ 
    42  
    43 /* Things to look up in the earthworm.h tables with getutil.c functions 
    44  **********************************************************************/ 
    45 static long          InRingKey;     /* key of transport ring for input   */ 
    46 static long          OutRingKey;    /* key of transport ring for output  */ 
    47 static unsigned char InstId;        /* local installation id             */ 
    48 static unsigned char MyModId;       /* Module Id for this program        */ 
    49 static unsigned char TypeHeartBeat; 
    50 static unsigned char TypeError; 
    51 static unsigned char TypeTrig; 
    52 static unsigned char TypeHyp2000Arc; 
    53  
    54 /* Error messages used by trig2arc 
    55  *********************************/ 
    56 #define  ERR_MISSGAP       0   /* sequence gap in transport ring         */ 
    57 #define  ERR_MISSLAP       1   /* missed messages in transport ring      */ 
    58 #define  ERR_TOOBIG        2   /* retreived msg too large for buffer     */ 
    59 #define  ERR_NOTRACK       3   /* msg retreived; tracking limit exceeded */ 
    60 static char  Text[MAXTXT];        /* string for log/error messages          */ 
    6125 
    6226 
     
    415379            { 
    416380                UseOriginalLogo = k_int(); 
     381            } 
     382 
     383  /*opt*/   else if( k_its("UseLatitude") ) 
     384            { 
     385                UseLatitude = k_val(); 
     386            } 
     387 
     388  /*opt*/   else if( k_its("UseLongitude") ) 
     389            { 
     390                UseLongitude = k_val(); 
     391            } 
     392 
     393  /*opt*/   else if( k_its("UseDepth") ) 
     394            { 
     395                UseDepth = k_val(); 
    417396            } 
    418397 
  • trunk/src/grab_bag/trig2arc/trig2arc.d

    r4084 r4632  
    2727                             # non-zero means apply the original logo to output 
    2828                             # message. 
     29 UseLatitude      14.5268 
     30 UseLongitude     -61.2354 
     31 UseDepth         25 
     32 
  • trunk/src/grab_bag/trig2arc/trig2arc.h

    r4084 r4632  
    5252static int     Debug = 0;          /* 0=no debug msgs, non-zero=debug   */ 
    5353 
     54/* Globals 
     55 *********/ 
     56static SHM_INFO  InRegion;    /* shared memory region to use for input  */ 
     57static SHM_INFO  OutRegion;   /* shared memory region to use for output */ 
     58static pid_t     MyPid;       /* Our process id is sent with heartbeat  */ 
     59 
     60/* Things to read or derive from configuration file 
     61 **************************************************/ 
     62static int     LogSwitch;          /* 0 if no logfile should be written */ 
     63static long    HeartbeatInt;       /* seconds between heartbeats        */ 
     64static MSG_LOGO *GetLogo = NULL;   /* logo(s) to get from shared memory */ 
     65static short   nLogo   = 0;        /* # logos we're configured to get   */ 
     66static int     UseOriginalLogo=0;  /* 0=use trig2arc's own logo on output msgs   */ 
     67                                   /* non-zero=use original logos on output      */ 
     68                                   /*   NOTE: this requires that output go to    */ 
     69                                   /*   different transport ring than input      */ 
     70static float  UseLatitude=0;       /* Event latitude in the hyp2000_arc message  */ 
     71static float  UseLongitude=0;      /* Event longitude in the hyp2000_arc message  */ 
     72static float  UseDepth=0;          /* Event depth in the hyp2000_arc message  */ 
     73 
     74/* Things to look up in the earthworm.h tables with getutil.c functions 
     75 **********************************************************************/ 
     76static long          InRingKey;     /* key of transport ring for input   */ 
     77static long          OutRingKey;    /* key of transport ring for output  */ 
     78static unsigned char InstId;        /* local installation id             */ 
     79static unsigned char MyModId;       /* Module Id for this program        */ 
     80static unsigned char TypeHeartBeat; 
     81static unsigned char TypeError; 
     82static unsigned char TypeTrig; 
     83static unsigned char TypeHyp2000Arc; 
     84 
     85/* Error messages used by trig2arc 
     86 *********************************/ 
     87#define  ERR_MISSGAP       0   /* sequence gap in transport ring         */ 
     88#define  ERR_MISSLAP       1   /* missed messages in transport ring      */ 
     89#define  ERR_TOOBIG        2   /* retreived msg too large for buffer     */ 
     90#define  ERR_NOTRACK       3   /* msg retreived; tracking limit exceeded */ 
     91static char  Text[MAXTXT];        /* string for log/error messages          */ 
     92 
    5493#endif 
Note: See TracChangeset for help on using the changeset viewer.