Changeset 6856
- Timestamp:
- 10/28/16 11:13:02 (3 years ago)
- Location:
- trunk/src/data_sources/tideweb2ew
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/data_sources/tideweb2ew/tideweb2ew.c
r6855 r6856 31 31 char MyModName[MAX_MOD_STR]; /* speak as this module name/id */ 32 32 33 static int Debug = 0;34 static int Granulate = 0;35 36 33 int err_exit; /* an tideweb2ew_die() error number */ 37 34 static unsigned char InstId = 255; … … 66 63 int LogFile; /* generate a logfile? */ 67 64 int LOG2LogFile; /* put LOG channels in logfile? */ 65 66 /* Optional config parameters 67 ****************************/ 68 static int Debug = 0; 69 static int Granulate = 0; 70 static double PWL_SCALE = 1; // Optional multiplier for PWL values 71 static double BWL_SCALE = 1; // Optional multiplier for BWL values 72 static char PWL_CHAN[10] = "UTZ"; // Optional Channel code for PWL TRACEBUF2s 73 static char BWL_CHAN[10] = "UTZ"; // Optional Channel code for BWL TRACEBUF2s 74 static char PWL_LOC[10] = "00"; // Optional Location code for PWL TRACEBUF2s 75 static char BWL_LOC[10] = "01"; // Optional Location code for BWL TRACEBUF2s 68 76 69 77 /* some globals for EW not settable in the .d file. */ … … 208 216 if ( reporting > 1 ) 209 217 logit("t", "%s: Secondary = %s\n", progname, tg.item[1].weblog ); 218 logit( "t", "%s: Granulate = %d\n", progname, Granulate ); 219 logit( "t", "%s: PWL_SCALE = %lf\n", progname, PWL_SCALE ); 220 logit( "t", "%s: BWL_SCALE = %lf\n", progname, BWL_SCALE ); 221 logit( "t", "%s: PWL_CHAN = '%s'\n", progname, PWL_CHAN ); 222 logit( "t", "%s: BWL_CHAN = '%s'\n", progname, BWL_CHAN ); 223 logit( "t", "%s: PWL_LOC = '%s'\n", progname, PWL_LOC ); 224 logit( "t", "%s: BWL_LOC = '%s'\n", progname, BWL_LOC ); 210 225 211 226 /* EARTHWORM init earthworm connection at this point, … … 471 486 strcpy(trace2_hdr->sta,trim(StationCode)); 472 487 strcpy(trace2_hdr->net,trim(NetworkCode)); 473 strcpy(trace2_hdr->chan,"UTZ");474 488 475 489 strcpy(trace2_hdr->datatype, "i4"); … … 487 501 trace2_hdr->endtime = trace2_hdr->starttime + 60; 488 502 503 tg_data->item[0].dataVal *= PWL_SCALE; 504 tg_data->item[1].dataVal *= BWL_SCALE; 505 489 506 if ( sendPrim ) { 490 strcpy(trace2_hdr->loc,"00"); 507 strcpy(trace2_hdr->chan,PWL_CHAN); 508 strcpy(trace2_hdr->loc,PWL_LOC); 491 509 sprintf(sncl, "%s_%s_%s_%s", trace2_hdr->sta,trace2_hdr->net,trace2_hdr->chan,trace2_hdr->loc); 492 510 myTracePtr[0] = (tg_data->item[0].dataVal*1000)+0.5; … … 504 522 } 505 523 if ( sendSec ) { 506 strcpy(trace2_hdr->loc,"01"); 524 strcpy(trace2_hdr->chan,BWL_CHAN); 525 strcpy(trace2_hdr->loc,BWL_LOC); 507 526 sprintf(sncl, "%s_%s_%s_%s", trace2_hdr->sta,trace2_hdr->net,trace2_hdr->chan,trace2_hdr->loc); 508 527 myTracePtr[0] = (tg_data->item[1].dataVal*1000)+0.5; … … 764 783 else if ( k_its( "Granulate" ) ) { 765 784 Granulate = 1; 785 } 786 else if ( k_its( "PWL_SCALE" ) ) { 787 PWL_SCALE = k_val(); 788 } 789 else if ( k_its( "BWL_SCALE" ) ) { 790 BWL_SCALE = k_val(); 791 } 792 else if ( k_its( "PWL_CHAN" ) ) { 793 if ( (str = k_str()) == NULL ) { 794 fprintf( stderr, "%s: Missing name in PWL_CHAN.\n", progname ); 795 return -1; 796 } else if ( strlen(str) > 3 ) { 797 fprintf( stderr, "%s: Name too long in PWL_CHAN.\n", progname ); 798 return -1; 799 } else { 800 strcpy( PWL_CHAN, str ); 801 } 802 } 803 else if ( k_its( "BWL_CHAN" ) ) { 804 if ( (str = k_str()) == NULL ) { 805 fprintf( stderr, "%s: Missing name in BWL_CHAN.\n", progname ); 806 return -1; 807 } else if ( strlen(str) > 3 ) { 808 fprintf( stderr, "%s: Name too long in BWL_CHAN.\n", progname ); 809 return -1; 810 } else { 811 strcpy( BWL_CHAN, str ); 812 } 813 } 814 else if ( k_its( "PWL_LOC" ) ) { 815 if ( (str = k_str()) == NULL ) { 816 fprintf( stderr, "%s: Missing name in PWL_LOC.\n", progname ); 817 return -1; 818 } else if ( strlen(str) > 2 ) { 819 fprintf( stderr, "%s: Name too long in PWL_LOC.\n", progname ); 820 return -1; 821 } else { 822 strcpy( PWL_LOC, str ); 823 } 824 } 825 else if ( k_its( "BWL_LOC" ) ) { 826 if ( (str = k_str()) == NULL ) { 827 fprintf( stderr, "%s: Missing name in BWL_LOC.\n", progname ); 828 return -1; 829 } else if ( strlen(str) > 2 ) { 830 fprintf( stderr, "%s: Name too long in BWL_LOC.\n", progname ); 831 return -1; 832 } else { 833 strcpy( BWL_LOC, str ); 834 } 766 835 } 767 836 else if ( k_its( "Debug" ) ) { … … 860 929 } 861 930 numCodes = reporting; 931 862 932 return 0; 863 933 } -
trunk/src/data_sources/tideweb2ew/tideweb2ew.d
r6803 r6856 52 52 # If not present, assumed to be BWL unless PrimaryCode was specified 53 53 SecondaryCode BWL2 54 55 # PWL_SCALE -1 # Optional multiplier for PWL values; default is 1 56 # BWL_SCALE -1 # Optional multiplier for BWL values; default is 1 57 # PWL_CHAN ABC # Optional Channel code for PWL TRACEBUF2s; default is UTZ 58 # BWL_CHAN ABC # Optional Channel code for BWL TRACEBUF2s; default is UTZ 59 # PWL_LOC 99 # Optional Location code for PWL TRACEBUF2s; default is 00 60 # BWL_LOC 98 # Optional Location code for BWL TRACEBUF2s; default is 01
Note: See TracChangeset
for help on using the changeset viewer.