Changeset 68


Ignore:
Timestamp:
10/30/2008 11:09:34 PM (14 years ago)
Author:
marcus
Message:

r53 | svn | 2008-10-21 09:13:49 +0200 (Di, 21 Okt 2008) | 1 line

implemented special channels (++) with translation tables

Location:
SH_SHM/trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • SH_SHM/trunk/errors/ERR_5900.MSG

    r16 r68  
    22!      ============ 
    33! 
    4 ! version 2, 24-Aug-94 
     4! version 3, 20-Oct-2008 
    55! 
    66! error messages of module cblib4.h 
     
    1111*** CL4-03 negative phase difference *** 
    1212*** CL4-04 no phase pairs found *** 
     13*** CL4-05 no reference location *** 
     14*** CL4-06 error in get_geo *** 
     15*** CL4-07 string overflow *** 
     16*** CL4-08 error opening output file *** 
     17*** CL4-09 error opening input file *** 
     18*** CL4-10 illegal reference station number *** 
     19*** CL4-11 filter mismatch *** 
     20*** CL4-12 no dummy phase allowed *** 
     21*** CL4-13 illegal sample index *** 
     22*** CL4-14 illegal order of markers *** 
     23*** CL4-15 no drag window *** 
     24*** CL4-16 unfiltered traces required *** 
     25*** CL4-17 no beam trace found *** 
     26*** CL4-18 too less traces *** 
     27*** CL4-19 no environment defined *** 
     28*** CL4-20 illegal DRM id *** 
     29*** CL4-21 no private AutoDRM setup *** 
     30*** CL4-22 illegal read length *** 
  • SH_SHM/trunk/source/globalparams.c

    r64 r68  
    33 *      ============== 
    44 * 
    5  * $Revision: 49 $, $Date: 2008-10-14 22:36:40 +0200 (Di, 14 Okt 2008) $ 
     5 * $Revision: 53 $, $Date: 2008-10-21 09:13:49 +0200 (Di, 21 Okt 2008) $ 
    66 * 
    77 * Management of global parameters 
     
    425425        "filter_lookup_table", 
    426426        "sensitivity_file", 
     427        "channel_translation", 
    427428        "defpath_filter", 
    428429        "defpath_command", 
     
    435436        {NULL,"default",7},            /* filter_lookup_table */ 
    436437        {NULL,"default",7},            /* sensitivity_file */ 
     438        {NULL,"default",7},            /* channel_translation */ 
    437439        {NULL,"default",7},            /* defpath_filter */ 
    438440        {NULL,"default",7},            /* defpath_command */ 
     
    618620                        strcat( gpv_l_glob[cGpL_sensitivity_file].string, "sensitivities.txt" ); 
    619621                        gpv_l_glob[cGpL_sensitivity_file].strlth = i+17; 
     622                } /*endif*/ 
     623        } /*endif*/ 
     624        if  (strcmp(gpv_l_glob[cGpL_channel_translation].string,"default") == 0)  { 
     625                cptr = (char *)getenv( "SH_INPUTS" ); 
     626                if  (cptr != NULL)  { 
     627                        i = strlen( cptr ); 
     628                        /*free( gpv_l_glob[cGpL_channel_translation].string );*/ 
     629                        gpv_l_glob[cGpL_channel_translation].string = 
     630                                (char *)malloc( (int)sizeof(char)*(i+14) ); 
     631                        strcpy( gpv_l_glob[cGpL_channel_translation].string, cptr ); 
     632                        strcat( gpv_l_glob[cGpL_channel_translation].string, "chantrans.txt" ); 
     633                        gpv_l_glob[cGpL_channel_translation].strlth = i+13; 
    620634                } /*endif*/ 
    621635        } /*endif*/ 
  • SH_SHM/trunk/source/globalparams.h

    r64 r68  
    33 *      ============== 
    44 * 
    5  * $Revision: 49 $, $Date: 2008-10-14 22:36:40 +0200 (Di, 14 Okt 2008) $ 
     5 * $Revision: 53 $, $Date: 2008-10-21 09:13:49 +0200 (Di, 21 Okt 2008) $ 
    66 * 
    77 * Management of global parameters 
     
    252252        cGpL_filter_lookup_table, 
    253253        cGpL_sensitivity_file, 
     254        cGpL_channel_translation, 
    254255        cGpL_defpath_filter, 
    255256        cGpL_defpath_command, 
  • SH_SHM/trunk/source/motif/mfexec.c

    r67 r68  
    33 *      ======== 
    44 * 
    5  * $Revision: 52 $, $Date: 2008-10-17 12:57:15 +0200 (Fr, 17 Okt 2008) $ 
     5 * $Revision: 53 $, $Date: 2008-10-21 09:13:49 +0200 (Di, 21 Okt 2008) $ 
    66 * 
    77 * execution of SH commands 
     
    207207                exit( 1 ); 
    208208        } /*endif*/ 
     209        ut_cap( statlist ); 
    209210        if  (*statlist != '\0') 
    210211                mx_remove_double_elements( statlist ); 
     
    13851386                } /*endif*/ 
    13861387        } /*endfor*/ 
    1387  
    1388 #ifdef XXX 
    1389         /* check buttons */ 
    1390         if  (XmToggleButtonGetState(w[k_widget_read_grsn_1hz]))  { 
    1391                 strcpy( rg->chanstr[rg->channum], "LH" ); 
    1392                 (rg->channum)++; 
    1393         } /*endif*/ 
    1394         if  (XmToggleButtonGetState(w[k_widget_read_grsn_20hz]))  { 
    1395                 strcpy( rg->chanstr[rg->channum], "BH" ); 
    1396                 (rg->channum)++; 
    1397         } /*endif*/ 
    1398         if  (XmToggleButtonGetState(w[k_widget_read_grsn_80hz]))  { 
    1399                 strcpy( rg->chanstr[rg->channum], "HH" ); 
    1400                 (rg->channum)++; 
    1401         } /*endif*/ 
    1402         if  (XmToggleButtonGetState(w[k_widget_read_grsn_edit_hz]))  { 
    1403                 str = cu_get_string( w[k_widget_read_grsn_hz_text] ); 
    1404                 if  (strlen(str) <= MXC_CHANLTH && strlen(str) > 0)  { 
    1405                         strcpy( rg->chanstr[rg->channum], str ); 
    1406                 } else { 
    1407                         printf( "*SHM: illegal channel string %s\n", str ); 
    1408                 } /*endif*/ 
    1409                 (rg->channum)++; 
    1410         } /*endif*/ 
    1411 #endif 
    14121388 
    14131389} /* end of mx_get_chanlist */ 
  • SH_SHM/trunk/source/seed_io/seed_lib.c

    r48 r68  
    33 *      ========== 
    44 * 
    5  * $Revision: 33 $, $Date: 2008-05-19 20:03:26 +0200 (Mo, 19 Mai 2008) $ 
     5 * $Revision: 53 $, $Date: 2008-10-21 09:13:49 +0200 (Di, 21 Okt 2008) $ 
    66 * 
    77 * SEED library 
     
    41784178 
    41794179 
     4180void SeedTranslateChan( char station[], char inchan[], char outchan[] ) 
     4181 
     4182/* Translates channel name, e.g. '++' depending on station name 
     4183 * 
     4184 * parameters of routine 
     4185 * char       station[];    input; station name, e.g. 'bfo' 
     4186 * char       inchan[];     input; channel name (length 2+term), e.g. '++' 
     4187 * char       outchan[];    output; translated name (length 2 + term) 
     4188 */ 
     4189{ 
     4190        /* local variables */ 
     4191        int      pathcnt;                      /* path counter (to transl. files) */ 
     4192        char     *transpath;                   /* name of translation file */ 
     4193        FILE     *fp;                          /* pointer to file */ 
     4194        char     fstr[cBcLineLth+1];           /* station+chan name */ 
     4195        int      fstrlen;                      /* length of fstr */ 
     4196        char     dstr[cBcLineLth+1];           /* default station+chan name */ 
     4197        int      dstrlen;                      /* length of dstr */ 
     4198        char     line[cBcLineLth+1];           /* current line of file */ 
     4199        char     *cptr;                        /* moving pointer */ 
     4200        char     defchan[cBcShortStrLth+1];    /* default channel */ 
     4201        TSyBoolean default_found;              /* default string found */ 
     4202 
     4203        /* executable code */ 
     4204 
     4205        strcpy( outchan, inchan ); 
     4206        default_found = FALSE; 
     4207 
     4208        /* skip this of no special channel given */ 
     4209        if  (strcmp(inchan,"++") != 0) 
     4210                return; 
     4211 
     4212        /* prepare search strings */ 
     4213        if  (strlen(station)+3 > cBcLineLth)  { 
     4214                printf( "*Seed: station name too long.  Cannot translate chan\n" ); 
     4215                return; 
     4216        } /*endif*/ 
     4217        /* get string to search in file (station-inchan) */ 
     4218        sprintf( fstr, "%s-%s", station, inchan ); 
     4219        ut_uncap( fstr ); 
     4220        fstrlen = strlen( fstr ); 
     4221        /* default setting is also needed (*-inchan) */ 
     4222        sprintf( dstr, "*-%s", inchan ); 
     4223        ut_uncap( dstr ); 
     4224        dstrlen = strlen( dstr ); 
     4225 
     4226        for  (pathcnt=0;;pathcnt++)  { 
     4227                transpath = GpGetStringElem( cGpL_channel_translation, pathcnt ); 
     4228                if  (transpath == NULL)  break; 
     4229                fp = fopen( transpath, "r" ); 
     4230                if  (fp == NULL) 
     4231                        continue; 
     4232                while (fgets(line,cBcLineLth,fp) != NULL)  { 
     4233                        if  (strncmp(line,fstr,fstrlen) == 0)  { 
     4234                                /* found entry for this station, read it and return */ 
     4235                                cptr = line+fstrlen; 
     4236                                while  (*cptr == ' ' || *cptr == ':') 
     4237                                        cptr++; 
     4238                                outchan[0] = (cptr[0] > ' ') ? cptr[0] : '\0'; 
     4239                                outchan[1] = (cptr[1] > ' ') ? cptr[1] : '\0'; 
     4240                                outchan[2] = '\0'; 
     4241                                fclose( fp ); 
     4242                                return; 
     4243                        }  else if  (strncmp(line,dstr,dstrlen) == 0)  { 
     4244                                /* found at least a default entry, save this */ 
     4245                                cptr = line+dstrlen; 
     4246                                while  (*cptr == ' ' || *cptr == ':') 
     4247                                        cptr++; 
     4248                                defchan[0] = (cptr[0] > ' ') ? cptr[0] : '\0'; 
     4249                                defchan[1] = (cptr[1] > ' ') ? cptr[1] : '\0'; 
     4250                                defchan[2] = '\0'; 
     4251                                default_found = TRUE; 
     4252                        } /*endif*/ 
     4253                } /*endwhile*/ 
     4254                fclose( fp ); 
     4255        } /*endif*/ 
     4256 
     4257        if  (default_found) 
     4258                strcpy( outchan, defchan ); 
     4259 
     4260} /* end of SeedTranslateChan */ 
     4261 
     4262 
     4263 
     4264/*---------------------------------------------------------------------*/ 
     4265 
     4266 
     4267 
    41804268/* FORTRAN interface routine */ 
    41814269 
  • SH_SHM/trunk/source/seed_io/seed_lib.h

    r16 r68  
    33 *      ========== 
    44 * 
    5  * version 26, 21-Dec-2006 
     5 * $Revision: 53 $, $Date: 2008-10-21 09:13:49 +0200 (Di, 21 Okt 2008) $ 
    66 * 
    77 * header file of module seed_lib.c 
     
    640640 
    641641/*---------------------------------------------------------------------*/ 
     642 
     643 
     644void SeedTranslateChan( char station[], char inchan[], char outchan[] ); 
     645 
     646/* Translates channel name, e.g. '++' depending on station name 
     647 * 
     648 * parameters of routine 
     649 * char       station[];    input; station name, e.g. 'bfo' 
     650 * char       inchan[];     input; channel name (length 2+term), e.g. '++' 
     651 * char       outchan[];    output; translated name (length 2 + term) 
     652 */ 
     653 
     654 
     655/*---------------------------------------------------------------------*/ 
  • SH_SHM/trunk/source/shmenuio.c

    r16 r68  
    12841284        char     cmpl[BC_SHORTSTRLTH+1];   /* component list */ 
    12851285        char     stream[BC_SHORTSTRLTH+1]; /* stream name */ 
     1286        char     tstream[cBcShortStrLth+1];/* translated stream name (from '++') */ 
    12861287        char     stream_str[BC_LINELTH+1]; /* complete stream name */ 
    12871288        float    dt;                       /* sample distance in sec */ 
     
    14261427                *tstart = '\0'; 
    14271428                for  (s=0; s<statno; s++)  { 
     1429                        SeedTranslateChan( stations[s], stream, tstream ); 
    14281430                        for  (c=0; c<cmpno; c++)  { 
    1429                                 if  (cmpl[c] == 'N' || cmpl[c] == 'E')  { 
    1430                                         /*if  (strcmp(stations[s],"GRA2") == 0)  continue;*/ 
    1431                                         /*if  (strcmp(stations[s],"GRA3") == 0)  continue;*/ 
    1432                                         /*if  (strcmp(stations[s],"GRA4") == 0)  continue;*/ 
    1433                                         /*if  (strcmp(stations[s],"GRB2") == 0)  continue;*/ 
    1434                                         /*if  (strcmp(stations[s],"GRB3") == 0)  continue;*/ 
    1435                                         /*if  (strcmp(stations[s],"GRB4") == 0)  continue;*/ 
    1436                                         /*if  (strcmp(stations[s],"GRB5") == 0)  continue;*/ 
    1437                                         /*if  (strcmp(stations[s],"GRC2") == 0)  continue;*/ 
    1438                                         /*if  (strcmp(stations[s],"GRC3") == 0)  continue;*/ 
    1439                                         /*if  (strcmp(stations[s],"GRC4") == 0)  continue;*/ 
    1440                                 } /*endif*/ 
    1441                                 sprintf( stream_str, "%s-%s-%c", stations[s], stream, cmpl[c] ); 
     1431                                sprintf( stream_str, "%s-%s-%c", stations[s], tstream, cmpl[c] ); 
    14421432                                SeedGetTimeSpan( sfdcfile, stream_str, msg, act_start, status ); 
    14431433                                if  (*act_start == '\0')  {*status = BC_NOERROR; continue;} 
     
    14601450        last_dt = 0.0; 
    14611451        for  (s=0; s<statno; s++)  { 
     1452                SeedTranslateChan( stations[s], stream, tstream ); 
    14621453                for  (c=0; c<cmpno; c++)  { 
    1463                         if  (cmpl[c] == 'N' || cmpl[c] == 'E')  { 
    1464                                 /*if  (strcmp(stations[s],"GRA2") == 0)  continue;*/ 
    1465                                 /*if  (strcmp(stations[s],"GRA3") == 0)  continue;*/ 
    1466                                 /*if  (strcmp(stations[s],"GRA4") == 0)  continue;*/ 
    1467                                 /*if  (strcmp(stations[s],"GRB2") == 0)  continue;*/ 
    1468                                 /*if  (strcmp(stations[s],"GRB3") == 0)  continue;*/ 
    1469                                 /*if  (strcmp(stations[s],"GRB4") == 0)  continue;*/ 
    1470                                 /*if  (strcmp(stations[s],"GRB5") == 0)  continue;*/ 
    1471                                 /*if  (strcmp(stations[s],"GRC2") == 0)  continue;*/ 
    1472                                 /*if  (strcmp(stations[s],"GRC3") == 0)  continue;*/ 
    1473                                 /*if  (strcmp(stations[s],"GRC4") == 0)  continue;*/ 
    1474                         } /*endif*/ 
    1475                         sprintf( stream_str, "%s-%s-%c", stations[s], stream, cmpl[c] ); 
     1454                        sprintf( stream_str, "%s-%s-%c", stations[s], tstream, cmpl[c] ); 
    14761455                        /* build sfd-name if reading from jukebox */ 
    14771456                        if  (read_jukebox || autoread)  { 
Note: See TracChangeset for help on using the changeset viewer.