diff Makefile /oasis/src/Makefile 27c27 < argfile.c argfilter.c sendoasis.c gf.c --- > argfile.c argfilter.c sendoasis.c gf.c tstring.c 87c87 < extract : extract.o file.o range.o atlas.o ctd.o no3.o spec.o ac9.o gf.o --- > extract : extract.o file.o range.o atlas.o ctd.o no3.o spec.o ac9.o gf.o tstring.o 90c90 < no3.o spec.o ac9.o gf.o $(LIBS) --- > no3.o spec.o ac9.o gf.o tstring.o $(LIBS) 97,99c97,104 < decodeb : decodeb.o < $(RM) decodeb < $(LD) -o decodeb $(LDFLAGS) decodeb.o --- > decode12 : decode12.o file.o atlas.o ctd.o no3.o spec.o ac9.o gf.o > $(RM) decode12 > $(LD) -o decode12 $(LDFLAGS) decode12.o file.o atlas.o ctd.o no3.o \ > spec.o ac9.o gf.o $(LIBS) > > showmoor : showmoor.o > $(RM) showmoor > $(LD) -o showmoor $(LDFLAGS) showmoor.o $(LIBS) diff ac9.c /oasis/src/ac9.c diff argextract.c /oasis/src/argextract.c 420a421,476 > /* Function : printChem4 */ > /* Purpose : Print data from Chem message (rev 4 format) */ > /* Inputs : File day, Chem message ptr */ > /* Outputs : None */ > /************************************************************************/ > Void > printChem4( Flt64 day, Chem4Msg *msgp ) > { > Reg Byte *p; > Int32 co2; > Nat16 ipitch, iroll, itemp, idepth; > Nat32 i; > > p = msgp->ch_pco2; > > for ( i = 0; i < CHEM_SAMPLES; i+=2 ) > { > co2 = *p++ << 4; > co2 |= ((*p >> 4) & 0x0f); > if ( co2 & 0x800 ) > co2 |= 0xfffff000; /* Sign extend */ > print_sensor( CO2_FILE, "%8.4f %4d\n", day + CHEM_TIME(i), co2 ); > > co2 = ((*p++ & 0x0f) << 8); > co2 |= *p++; > if ( co2 & 0x800 ) > co2 |= 0xfffff000; /* Sign extend */ > print_sensor( CO2_FILE, "%8.4f %4d\n", day + CHEM_TIME(i+1), co2 ); > } > > ipitch = getIntelword( (Byte *)&msgp->ch_prr_pitch ); > iroll = getIntelword( (Byte *)&msgp->ch_prr_roll ); > itemp = getIntelword( (Byte *)&msgp->ch_prr_temp ); > idepth = getIntelword( (Byte *)&msgp->ch_prr_depth ); > > print_sensor( SPEC_MISC_FILE, "%8.4f %6.1f %6.1f %7.2f %7.2f", day, > decode_prr_chan(ipitch, &spec_cal.spc_cal[0][10]), > decode_prr_chan(iroll, &spec_cal.spc_cal[0][11]), > decode_prr_chan(itemp, &spec_cal.spc_cal[2][8]), > decode_prr_chan(idepth, &spec_cal.spc_cal[2][9]) ); > > ipitch = getIntelword( (Byte *)&msgp->ch_prr_pitch1230 ); > iroll = getIntelword( (Byte *)&msgp->ch_prr_roll1230 ); > itemp = getIntelword( (Byte *)&msgp->ch_prr_temp1230 ); > idepth = getIntelword( (Byte *)&msgp->ch_prr_depth1230 ); > > print_sensor( SPEC_MISC_FILE, " %6.1f %6.1f %7.2f %7.2f\n", > decode_prr_chan(ipitch, &spec_cal.spc_cal[0][10]), > decode_prr_chan(iroll, &spec_cal.spc_cal[0][11]), > decode_prr_chan(itemp, &spec_cal.spc_cal[2][8]), > decode_prr_chan(idepth, &spec_cal.spc_cal[2][9]) ); > > } /* printChem4() */ > > > /************************************************************************/ 476c532 < Int32 luAdr, Int32 luChan ) --- > Int32 luAdr, Int32 edChan, Int32 luChan ) 490c546 < ed = decode_prr_chan( ival, &spec_cal.spc_cal[edAdr][i] ); --- > ed = decode_prr_chan( ival, &spec_cal.spc_cal[edAdr][i+edChan] ); 510,543d565 < /* Function : printSpecRev2 */ < /* Purpose : Print a PRR Spectro message (Rev 1/2) */ < /* Inputs : File number, File day, Spectro message ptr, */ < /* Address tags for Ed, Lu chans, Fluorometer value */ < /* Outputs : None */ < /************************************************************************/ < Void < printSpecRev2( Nat32 filenum, Flt64 day, SpecMsg *msgp, Int32 edAdr, < Int32 luAdr, Int32 luChan, Flt64 fluor ) < { < printSpec( filenum, day, msgp, edAdr, luAdr, luChan ); < print_sensor( filenum, "%9.5f\n", fluor ); < < } /* printSpecRev2() */ < < < /************************************************************************/ < /* Function : printSpecRev3 */ < /* Purpose : Print a PRR Spectro message (Rev 3) */ < /* Inputs : File number, File day, Spectro message ptr, */ < /* Address tags for Ed, Lu chans, Number of addrs or errs*/ < /* Outputs : None */ < /************************************************************************/ < Void < printSpecRev3( Nat32 filenum, Flt64 day, SpecMsg *msgp, Int32 edAdr, < Int32 luAdr, Int32 luChan, Nat32 extra ) < { < printSpec( filenum, day, msgp, edAdr, luAdr, luChan ); < print_sensor( filenum, "%u\n", extra ); < < } /* printSpecRev3() */ < < < /************************************************************************/ 713a736,801 > /* Function : printMiscRev4 */ > /* Purpose : Print Miscellaneous message buffer (Rev 4) */ > /* Inputs : File day, Misc msg ptr */ > /* Outputs : None */ > /************************************************************************/ > Void > printMiscRev4( Flt64 day, Misc4Msg *msgp ) > { > Nat32 val, index, index20m; > Reg Byte *fluorp; > Int32 co2; > Flt64 flt1, flt2, flt3; > > val = getIntelword( (Byte *)&msgp->ms_pco2 ); > co2 = val & 0xfff; > if ( co2 & 0x800 ) > co2 |= ~0xfff; /* Sign extend */ > > print_sensor( CO2_CAL_FILE, "%8.4f %3d %02d00\n", > day, co2, 3 * ((val >> 12) & 7) ); > > val = getIntellong( (Byte *)&msgp->ms_oasis ); > flt1 = (((analog[TEMP_CHAN].a * (Flt32)(val & 0x3ff)) + > analog[TEMP_CHAN].b) * analog[TEMP_CHAN].c) + analog[TEMP_CHAN].d; > flt2 = ((analog[OBATT_CHAN].a * (Flt32)((val >> 10) & 0x3ff)) + > analog[OBATT_CHAN].b) * analog[OBATT_CHAN].c; > flt3 = ((analog[ABATT_CHAN].a * (Flt32)((val >> 20) & 0x3ff)) + > analog[ABATT_CHAN].b) * analog[ABATT_CHAN].c; > > print_sensor( OASIS_FILE, "%8.4f %5.2f %8.2f %8.2f\n", > day, flt1, flt2, flt3 ); > > fluorp= msgp->fl_0m; > for ( index = index20m = 0; index < CHEM_SAMPLES; index++ ) > { > if ( index & 1 ) > { > val = (*fluorp++ & 0x0f) << 8; > val |= *fluorp++; > } > else > { > val = *fluorp++ << 4; > val |= ((*fluorp >> 4) & 0x0f); > } > > flt1 = (((analog[FLUOR_CHAN].a * (Flt64)(val>>2)) + > analog[FLUOR_CHAN].b) * analog[FLUOR_CHAN].c) + > analog[FLUOR_CHAN].d; > print_sensor( WETSTAR_FILE, "%8.4f %6.3f", day + CHEM_TIME(index), > flt1 ); > if ( (index != 1) && (index != 7) ) > { > val = getIntelword( (Byte *)&msgp->fl_20m[index20m] ); > flt1 = decode_prr_chan(val, &spec_cal.spc_cal[2][11]); > if ( flt1 < 20.0 ) > print_sensor( WETSTAR_FILE, " %6.3f", flt1 ); > index20m++; > } > print_sensor( WETSTAR_FILE, "\n" ); > } > > } /* printMiscRev4() */ > > > /************************************************************************/ 840,841c928,930 < printSpecRev2( SPEC_NOON_FILE, fdate, &msgp->msg.spec0m, < SPEC_0M_ED, SPEC_0M_LU, SPEC_NOON_LU_CHAN, fluor ); --- > printSpec( SPEC_NOON_FILE, fdate, &msgp->msg.spec0m, > SPEC_0M_ED, SPEC_0M_LU, 0, SPEC_NOON_LU_CHAN ); > print_sensor( SPEC_NOON_FILE, "%9.5f\n", fluor ); 849,850c938,940 < printSpecRev2( SPEC_1030_FILE, fdate, &msgp->msg.spec0m_1030, < SPEC_0M_ED, SPEC_0M_LU, SPEC_AM_LU_CHAN, fluor ); --- > printSpec( SPEC_1030_FILE, fdate, &msgp->msg.spec0m_1030, > SPEC_0M_ED, SPEC_0M_LU, 0, SPEC_AM_LU_CHAN ); > print_sensor( SPEC_1030_FILE, "%9.5f\n", fluor ); 860,861c950,952 < printSpecRev2( SPEC_20_FILE, fdate, &msgp->msg.spec20m, < SPEC_20M_ED, SPEC_20M_LU, 0, fluor ); --- > printSpec( SPEC_20_FILE, fdate, &msgp->msg.spec20m, > SPEC_20M_ED, SPEC_20M_LU, 0, 0 ); > print_sensor( SPEC_20_FILE, "%9.5f\n", fluor ); 887,888c978,979 < /* Function : printOneMsgRev3 */ < /* Purpose : Print one received ARGOS message in Rev 3 format */ --- > /* Function : printOneMsgRev3_4 */ > /* Purpose : Print one received ARGOS message in Rev 3 or 4 format */ 893c984 < printOneMsgRev3( ArgosInMsg *msgp ) --- > printOneMsgRev3_4( ArgosInMsg *msgp, Int32 rev ) 896c987 < Nat16 ival; --- > Nat16 misc, val; 899a991,996 > if ( (rev != 3) && (rev != 4) ) > { > print_error("Internal error - wrong message revision\n"); > return; > } > 912,914c1009,1016 < printChem( fdate, &msgp->msg.chem ); < printNO3( NO3_0_FILE, fdate, &msgp->msg.chem.ch_no3 ); < printTemp( TEMP0_FILE, fdate, &msgp->msg.chem.ch_no3 ); --- > if ( rev == 3 ) > { > printChem( fdate, &msgp->msg.chem ); > printNO3( NO3_0_FILE, fdate, &msgp->msg.chem.ch_no3 ); > printTemp( TEMP0_FILE, fdate, &msgp->msg.chem.ch_no3 ); > } > else > printChem4( fdate, &msgp->msg.chem4 ); 918,920c1020,1023 < ival = getIntelword( (Byte *)&msgp->msg.spec0m.sp_misc ); < printSpecRev3( SPEC_NOON_FILE, fdate, &msgp->msg.spec0m, < SPEC_0M_ED, SPEC_0M_LU, SPEC_NOON_LU_CHAN, ival ); --- > misc = getIntelword( (Byte *)&msgp->msg.spec0m.sp_misc ); > printSpec( SPEC_NOON_FILE, fdate, &msgp->msg.spec0m, > SPEC_0M_ED, SPEC_0M_LU, 0, SPEC_NOON_LU_CHAN ); > print_sensor( SPEC_NOON_FILE, "%u\n", misc ); 924,926c1027,1031 < ival = getIntelword( (Byte *)&msgp->msg.spec0m.sp_misc ); < printSpecRev3( SPEC_0M_1230_FILE, fdate, &msgp->msg.spec0m_1230, < SPEC_0M_ED, SPEC_0M_LU, SPEC_1230_LU_CHAN, ival ); --- > misc = getIntelword( (Byte *)&msgp->msg.spec0m.sp_misc ); > printSpec( SPEC_0M_1230_FILE, fdate, &msgp->msg.spec0m_1230, > SPEC_0M_ED, SPEC_0M_LU, 0, > ((rev == 3) ? SPEC_1230_LU_CHAN : SPEC_1230_LU_CHAN_REV4) ); > print_sensor( SPEC_0M_1230_FILE, "%u\n", misc ); 930,932c1035,1050 < ival = getIntelword( (Byte *)&msgp->msg.spec0m.sp_misc ); < printSpecRev3( SPEC_20_FILE, fdate, &msgp->msg.spec20m, < SPEC_20M_ED, SPEC_20M_LU, 0, ival ); --- > misc = getIntelword( (Byte *)&msgp->msg.spec0m.sp_misc ); > printSpec( SPEC_20_FILE, fdate, &msgp->msg.spec20m, > SPEC_20M_ED, SPEC_20M_LU, 0, 0 ); > if ( rev == 3 ) > print_sensor( SPEC_20_FILE, "%u\n", misc ); > else > { > print_sensor( SPEC_20_FILE, "\n" ); > #if SPEC_VOLTS > print_sensor( MCP_FILE, "%8.4f 10 %9.5f\n", fdate, > decode_prr_chan(misc, NULL)); > #else > print_sensor( MCP_FILE, "%8.4f 10 %9.5f\n", fdate, > decode_prr_chan(misc, &spec_cal.spc_cal[2][10])); > #endif > } 936,938c1054,1069 < ival = getIntelword( (Byte *)&msgp->msg.spec0m.sp_misc ); < printSpecRev3( SPEC_20M_1230_FILE, fdate, &msgp->msg.spec20m, < SPEC_20M_ED, SPEC_20M_LU, 0, ival ); --- > misc = getIntelword( (Byte *)&msgp->msg.spec0m.sp_misc ); > printSpec( SPEC_20M_1230_FILE, fdate, &msgp->msg.spec20m, > SPEC_20M_ED, SPEC_20M_LU, 0, 0 ); > if ( rev == 3 ) > print_sensor( SPEC_20M_1230_FILE, "%u\n", misc ); > else > { > print_sensor( SPEC_20M_1230_FILE, "\n" ); > #if SPEC_VOLTS > print_sensor( MCP_FILE, "%8.4f 30 %9.5f\n", fdate, > decode_prr_chan(misc, NULL)); > #else > print_sensor( MCP_FILE, "%8.4f 30 %9.5f\n", fdate, > decode_prr_chan(misc, &spec_cal.spc_cal[2][14])); > #endif > } 942,944c1073,1075 < ival = getIntelword( (Byte *)&msgp->msg.spec0m.sp_misc ); < printSpecRev3( SPEC_0M_DARK_FILE, fdate, &msgp->msg.spec0m, < SPEC_0M_ED, SPEC_0M_LU, SPEC_NOON_LU_CHAN, ival ); --- > printSpec( SPEC_0M_DARK_FILE, fdate, &msgp->msg.spec0m, > SPEC_0M_ED, SPEC_0M_LU, 0, SPEC_NOON_LU_CHAN ); > print_sensor( SPEC_0M_DARK_FILE, "\n" ); 948,950c1079,1081 < ival = getIntelword( (Byte *)&msgp->msg.spec0m.sp_misc ); < printSpecRev3( SPEC_20M_DARK_FILE, fdate, &msgp->msg.spec20m, < SPEC_20M_ED, SPEC_20M_LU, 0, ival ); --- > printSpec( SPEC_20M_DARK_FILE, fdate, &msgp->msg.spec20m, > SPEC_20M_ED, SPEC_20M_LU, 0, 0 ); > print_sensor( SPEC_20M_DARK_FILE, "\n" ); 952a1084,1089 > case SAT1: > printSpec( SAT1_FILE, fdate, &msgp->msg.sat1, > SAT1_ED, SAT1_LU, SAT1_ED_CHAN, SAT1_LU_CHAN ); > print_sensor( SAT1_FILE, "\n" ); > break; > 966c1103 < ival = getIntelword( (Byte *)&msgp->msg.shutter.sh_satDark[i] ); --- > val = getIntelword( (Byte *)&msgp->msg.shutter.sh_satDark[i] ); 968c1105 < lu = decode_prr_chan( ival, NULL ); --- > lu = decode_prr_chan( val, NULL ); 970c1107 < lu = decode_prr_chan( ival, --- > lu = decode_prr_chan( val, 975a1113,1121 > > if ( rev == 4 ) > { > val = getIntelword( (Byte *)&msgp->msg.shutter.sh_ctd_temp ); > misc = getIntelword( (Byte *)&msgp->msg.shutter.sh_ctd_cond ); > print_sensor( TEMP0_FILE, "%8.4f %7.3f %8.4f\n", fdate, > ((double)val) / 1000., ((double)misc) / 10000.); > } > 979c1125,1128 < printMiscRev3( fdate, &msgp->msg.misc3 ); --- > if ( rev == 3 ) > printMiscRev3( fdate, &msgp->msg.misc3 ); > else > printMiscRev4( fdate, &msgp->msg.misc4 ); 989c1138 < } /* printOneMsgRev3() */ --- > } /* printOneMsgRev3_4() */ 1009c1158,1162 < printOneMsgRev3( msgp ); --- > printOneMsgRev3_4( msgp, 3 ); > break; > > case 4: > printOneMsgRev3_4( msgp, 4 ); diff argfile.c /oasis/src/argfile.c 108c108 < {NULLF, "sat1.dark"} --- > {NULLF, "sat1.dark"}, {NULLF, "sat1"}, {NULLF, "spec.misc"}, diff argfilter.c /oasis/src/argfilter.c 35a36,41 > typedef enum /********************************/ > { /* Type of input */ > SVC_ARGOS, /* From Serivce Argos */ > RCVR_DIAG, /* Local receiver, diagnostic mode*/ > ALPHA_OMEGA /* Alpha-Omega receiver */ > } InputMode; /********************************/ 36a43 > 44c51 < MLocal MBool diagInput = FALSE; --- > MLocal InputMode inputMode = SVC_ARGOS; 107,108c114,115 < < if ( diagInput ) --- > > switch( inputMode ) 109a117 > case RCVR_DIAG: 114,116c122,124 < } < else < { --- > break; > > case SVC_ARGOS: 118,119c126,127 < &unused[0], &unused[1], &unused[2], &unused[3], < &unused[4], &unused[5]) >= 6 ) --- > &unused[0], &unused[1], &unused[2], &unused[3], > &unused[4], &unused[5]) >= 6 ) 126a135 > 128a138,144 > currentPttNum = pttNum; > break; > > case ALPHA_OMEGA: > if ( sscanf(buffer, " %d/%d/%d %d:%d:%d %d", > &month, &day, &year, &unused[3], > &unused[4], &unused[5], &pttNum) == 7 ) 129a146 > break; 201c218 < fprintf(stderr, "-d means input is from PTT receiver in diagnostic mode\n"); --- > fprintf(stderr, "-d means input is from Telonics receiver in diagnostic mode\n"); 202a220 > fprintf(stderr, "-o means input is from Alpha-Omega receiver\n"); 221c239 < while ( (c = getopt(argc, argv, "a:b:dn:")) != EOF ) --- > while ( (c = getopt(argc, argv, "a:b:dn:o")) != EOF ) 245c263 < diagInput = TRUE; --- > inputMode = RCVR_DIAG; 250a269,272 > break; > > case 'o': > inputMode = ALPHA_OMEGA; diff argos.c /oasis/src/argos.c 55c55,56 < RCVR_DIAG /* Local receiver, diagnostic mode*/ --- > RCVR_DIAG, /* Local receiver, diagnostic mode*/ > ALPHA_OMEGA /* Alpha-Omega receiver */ 99a101 > MLocal Int32 gmt_offset = 0; 112c114 < MLocal char *msgNamesRev3[] = --- > MLocal char *msgNamesRev3_4[] = 115c117 < "Midnight 0m Spectro", "Midnight 20m Spectro" }; --- > "Midnight 0m Spectro", "Midnight 20m Spectro", "Satlantic 1" }; 176c178 < fprintf( stderr, "Usage: %s [-b] [-c cfg_file] [-i msgnum] [-d] [-n]\n" ); --- > fprintf( stderr, "Usage: %s [-b] [-c cfg_file] [-i msgnum] [-d] [-n] [-a] [-g gmt_offset]\n" ); 180,181c182,184 < fprintf( stderr, "-d is for a local receiver in diagnostic mode\n" ); < fprintf( stderr, "-n is for a local receiver in normal mode\n" ); --- > fprintf( stderr, "-d is for a Telonics receiver in diagnostic mode\n" ); > fprintf( stderr, "-n is for a Telonics receiver in normal mode\n" ); > fprintf( stderr, "-a is for an Alpha-Omega receiver\n" ); 182a186 > fprintf( stderr, "-g specifies the offset from GMT in hours for receiver\n"); 184c188 < fprintf( stderr, "default is for local receiver in diagnostic mode\n" ); --- > fprintf( stderr, "default is for Telonics receiver in diagnostic mode\n" ); 202a207,208 > putenv( "TZ=GMT0" ); > 206c212 < while ( (c = getopt(argc, argv, "bc:dei:n")) != EOF ) --- > while ( (c = getopt(argc, argv, "abc:dei:g:n")) != EOF ) 208a215,218 > case 'a': > inputMode = ALPHA_OMEGA; > break; > 224a235,238 > case 'g': > gmt_offset = atoi(optarg); > break; > 420a435,471 > /* Function : getAlphaOmegaMsg */ > /* Purpose : Get an ARGOS message in Alpha-Omega Receiver format */ > /* Inputs : FILE ptr, Buffer ptr, message ptr for return message */ > /* Outputs : Message return code */ > /* Comment : Assumes A-O rcvr in byte format, which is not default */ > /************************************************************************/ > MsgRtn > getAlphaOmegaMsg( FILE *fp, char *buffer, ByteMsg *msgp, struct tm *tmPtr ) > { > Nat32 pttNum, i, dat[32]; > > if ( getLine(fp, buffer) == END_OF_FILE ) > return( END_OF_FILE ); > > if ( sscanf(buffer, " %d/%d/%d %d:%d:%d %d %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x", > &tmPtr->tm_mon, &tmPtr->tm_mday, &tmPtr->tm_year, > &tmPtr->tm_hour, &tmPtr->tm_min, &tmPtr->tm_sec, &pttNum, > &dat[0], &dat[1], &dat[2], &dat[3], &dat[4], &dat[5], > &dat[6], &dat[7], &dat[8], &dat[9], &dat[10], &dat[11], > &dat[12], &dat[13], &dat[14], &dat[15], &dat[16], &dat[17], > &dat[18], &dat[19], &dat[20], &dat[21], &dat[22], &dat[23], > &dat[24], &dat[25], &dat[26], &dat[27], &dat[28], &dat[29], > &dat[30], &dat[31]) < 39 ) > return( BAD_MSG ); > > tmPtr->tm_year -= 1900; > tmPtr->tm_mon -= 1; > > for ( i = 0; i < 32; i++ ) > msgp->by_data[i] = (Byte)dat[i]; > > return( MSG_OK ); > > } /* getAlhpaOmegaMsg() */ > > > /************************************************************************/ 501a553,556 > case ALPHA_OMEGA: > state = getAlphaOmegaMsg( fp, buffer, &msg.rawb, &msgTime ); > break; > 508a564 > msg_time_t -= 3600 * gmt_offset; 572d627 < 628a684,789 > /* Function : printWetstarRev4 */ > /* Purpose : Print a Wetstar buffer */ > /* Inputs : Fluor message ptr */ > /* Outputs : None */ > /************************************************************************/ > Void > printWetstarRev4( Misc4Msg *fp ) > { > Nat32 i, val1, val2; > Reg Byte *p; > Reg Nat16 *wp; > Flt64 flt1, flt2; > > printf(" 0m Wetstar "); > p = fp->fl_0m; > > for ( i = 0; i < CHEM_SAMPLES/2; i++ ) > { > val1 = *p++ << 4; > val1 |= ((*p >> 4) & 0x0f); > val2 = ((*p++ & 0x0f) << 8); > val2 |= *p++; > flt1 = (((analog[FLUOR_CHAN].a * (Flt32)(val1 >> 2)) + > analog[FLUOR_CHAN].b) * analog[FLUOR_CHAN].c) + > analog[FLUOR_CHAN].d; > flt2 = (((analog[FLUOR_CHAN].a * (Flt32)(val2 >> 2)) + > analog[FLUOR_CHAN].b) * analog[FLUOR_CHAN].c) + > analog[FLUOR_CHAN].d; > printf( "%6.3f %6.3f ", flt1, flt2 ); > } > > printf("\n20m Wetstar "); > > for ( i = 0; i < FLUOR20_WORDS; i++ ) > { > val1 = getIntelword( (Byte *)&fp->fl_20m[i] ); > flt1 = decode_prr_chan(val1, &spec_cal.spc_cal[2][11]); > if ( flt1 < 20.0 ) > printf( "%6.3f ", flt1 ); > else > printf(" Error "); > } > > printf("\n"); > > } /* printWetstarRev4() */ > > > /************************************************************************/ > /* Function : printChem4Msg */ > /* Purpose : Print the miscellaneous portion of the Chem msg for rev 4*/ > /* Inputs : Chem4 message ptr */ > /* Outputs : None */ > /************************************************************************/ > Void > printChem4Msg( Chem4Msg *cp ) > { > Reg Byte *p; > Nat16 ipitch, iroll, itemp, idepth; > Nat32 i; > Int32 val1, val2; > > printf("CO2 "); > p = cp->ch_pco2; > > for ( i = 0; i < CHEM_SAMPLES/2; i++ ) > { > val1 = *p++ << 4; > val1 |= ((*p >> 4) & 0x0f); > if ( val1 & 0x800 ) > val1 |= 0xfffff000; /* Sign extend */ > val2 = ((*p++ & 0x0f) << 8); > val2 |= *p++; > if ( val2 & 0x800 ) > val2 |= 0xfffff000; /* Sign extend */ > printf( "%03d %03d ", val1, val2 ); > } > > printf("\nNoon PRR pitch, roll, temp, depth: "); > ipitch = getIntelword( (Byte *)&cp->ch_prr_pitch ); > iroll = getIntelword( (Byte *)&cp->ch_prr_roll ); > itemp = getIntelword( (Byte *)&cp->ch_prr_temp ); > idepth = getIntelword( (Byte *)&cp->ch_prr_depth ); > > printf("%6.1f %6.1f %7.2f %7.2f\n", > decode_prr_chan(ipitch, &spec_cal.spc_cal[0][10]), > decode_prr_chan(iroll, &spec_cal.spc_cal[0][11]), > decode_prr_chan(itemp, &spec_cal.spc_cal[2][8]), > decode_prr_chan(idepth, &spec_cal.spc_cal[2][9]) ); > > printf("1230PM PRR pitch, roll, temp, depth: "); > ipitch = getIntelword( (Byte *)&cp->ch_prr_pitch1230 ); > iroll = getIntelword( (Byte *)&cp->ch_prr_roll1230 ); > itemp = getIntelword( (Byte *)&cp->ch_prr_temp1230 ); > idepth = getIntelword( (Byte *)&cp->ch_prr_depth1230 ); > > printf("%6.1f %6.1f %7.2f %7.2f\n", > decode_prr_chan(ipitch, &spec_cal.spc_cal[0][10]), > decode_prr_chan(iroll, &spec_cal.spc_cal[0][11]), > decode_prr_chan(itemp, &spec_cal.spc_cal[2][8]), > decode_prr_chan(idepth, &spec_cal.spc_cal[2][9]) ); > > } /* printChem4Msg() */ > > > /************************************************************************/ 635c796 < printSpec( SpecMsg *msgp, Int32 edAdr, Int32 luAdr, Int32 luChan ) --- > printSpec( SpecMsg *msgp, Int32 edAdr, Int32 luAdr, Int32 edChan, Int32 luChan ) 644c805 < printf("%-5.5s %9.5f ", spec_cal.spc_cal[edAdr][i].name, --- > printf("%-5.5s %9.5f ", spec_cal.spc_cal[edAdr][i+edChan].name, 647,648c808,809 < printf("%-5.5s %9.5f ", spec_cal.spc_cal[edAdr][i].name, < decode_prr_chan(ival, &spec_cal.spc_cal[edAdr][i])); --- > printf("%-5.5s %9.5f ", spec_cal.spc_cal[edAdr][i+edChan].name, > decode_prr_chan(ival, &spec_cal.spc_cal[edAdr][i+edChan])); 831c992 < printSpec( &msgp->msg.spec0m, SPEC_0M_ED, SPEC_0M_LU, --- > printSpec( &msgp->msg.spec0m, SPEC_0M_ED, SPEC_0M_LU, 0, 841c1002 < printSpec( &msgp->msg.spec0m_1030, SPEC_0M_ED, SPEC_0M_LU, --- > printSpec( &msgp->msg.spec0m_1030, SPEC_0M_ED, SPEC_0M_LU, 0, 851c1012 < printSpec( &msgp->msg.spec20m, SPEC_20M_ED, SPEC_20M_LU, 0 ); --- > printSpec( &msgp->msg.spec20m, SPEC_20M_ED, SPEC_20M_LU, 0, 0 ); 942,943c1103,1104 < /* Function : printOneMsgRev3 */ < /* Purpose : Print one received ARGOS message in Rev 3 format */ --- > /* Function : printOneMsgRev3_4 */ > /* Purpose : Print one received ARGOS message in Rev 3 or 4 format */ 948c1109 < printOneMsgRev3( ArgosInMsg *msgp ) --- > printOneMsgRev3_4( ArgosInMsg *msgp, Int32 rev ) 950c1111,1112 < Nat32 i, msgType, lval; --- > Int32 msgType; > Nat32 i, lval; 955a1118,1123 > if ( (rev != 3) && (rev != 4) ) > { > printf("Internal error - wrong message revision\n"); > return; > } > 968c1136 < if ( msgType >= NUM_MSG_TYPES_REV3 ) --- > if ( msgType >= ((rev == 3) ? NUM_MSG_TYPES_REV3 : NUM_MSG_TYPES_REV4) ) 978c1146 < printf("%s Msg rcvd %d times from ", msgNamesRev3[msgType], msgp->msg_cnt); --- > printf("%s Msg rcvd %d times from ", msgNamesRev3_4[msgType], msgp->msg_cnt); 998,1001c1166 < printf("CO2 "); < msbs = getIntelword( (Byte *)&msgp->msg.chem.ch_pco2_msbs ); < < for ( i = 0; i < CHEM_SAMPLES; i++ ) --- > if ( rev == 3 ) 1003,1006c1168,1179 < co2 = msgp->msg.chem.ch_pco2[i] | (((msbs >> (i + i)) & 3) << 8); < if ( co2 & 0x200 ) < co2 |= 0xfc00; /* Sign extend */ < printf( "%03d ", co2 ); --- > printf("CO2 "); > msbs = getIntelword( (Byte *)&msgp->msg.chem.ch_pco2_msbs ); > for ( i = 0; i < CHEM_SAMPLES; i++ ) > { > co2 = > msgp->msg.chem.ch_pco2[i] | (((msbs >> (i + i)) & 3) << 8); > if ( co2 & 0x200 ) > co2 |= 0xfc00; /* Sign extend */ > printf( "%03d ", co2 ); > } > printf( "\n" ); > printNO3( &msgp->msg.chem.ch_no3 ); 1008,1009c1181,1182 < printf( "\n" ); < printNO3( &msgp->msg.chem.ch_no3 ); --- > else > printChem4Msg( &msgp->msg.chem4 ); 1013c1186 < printSpec( &msgp->msg.spec0m, SPEC_0M_ED, SPEC_0M_LU, --- > printSpec( &msgp->msg.spec0m, SPEC_0M_ED, SPEC_0M_LU, 0, 1020,1021c1193,1194 < printSpec( &msgp->msg.spec0m_1230, SPEC_0M_ED, SPEC_0M_LU, < SPEC_1230_LU_CHAN ); --- > printSpec( &msgp->msg.spec0m_1230, SPEC_0M_ED, SPEC_0M_LU, 0, > ((rev == 3) ? SPEC_1230_LU_CHAN : SPEC_1230_LU_CHAN_REV4) ); 1027c1200 < printSpec( &msgp->msg.spec20m, SPEC_20M_ED, SPEC_20M_LU, 0 ); --- > printSpec( &msgp->msg.spec20m, SPEC_20M_ED, SPEC_20M_LU, 0, 0 ); 1029c1202,1210 < printf( "Err cnt %d\n", misc ); --- > if ( rev == 3 ) > printf( "Err cnt %d\n", misc ); > else > #if SPEC_VOLTS > printf("10m MCP %9.5f\n", decode_prr_chan(misc, NULL)); > #else > printf("10m MCP %9.5f\n", > decode_prr_chan(misc, &spec_cal.spc_cal[2][10])); > #endif 1033c1214 < printSpec( &msgp->msg.spec20m, SPEC_20M_ED, SPEC_20M_LU, 0 ); --- > printSpec( &msgp->msg.spec20m, SPEC_20M_ED, SPEC_20M_LU, 0, 0 ); 1035c1216,1224 < printf( "Total chans %d\n", misc ); --- > if ( rev == 3 ) > printf( "Total chans %d\n", misc ); > else > #if SPEC_VOLTS > printf("Noon 30m MCP %9.5f\n", decode_prr_chan(misc, NULL)); > #else > printf("Noon 30m MCP %9.5f\n", > decode_prr_chan(misc, &spec_cal.spc_cal[2][14])); > #endif 1039c1228 < printSpec( &msgp->msg.spec0m, SPEC_0M_ED, SPEC_0M_LU, --- > printSpec( &msgp->msg.spec0m, SPEC_0M_ED, SPEC_0M_LU, 0, 1045c1234 < printSpec( &msgp->msg.spec20m, SPEC_20M_ED, SPEC_20M_LU, 0 ); --- > printSpec( &msgp->msg.spec20m, SPEC_20M_ED, SPEC_20M_LU, 0, 0 ); 1048a1238,1243 > case SAT1: > printSpec( &msgp->msg.sat1, SAT1_ED, SAT1_LU, > SAT1_ED_CHAN, SAT1_LU_CHAN ); > printf( "\n" ); > break; > 1051,1055c1246,1261 < co2 = val & 0x3ff; < if ( co2 & 0x200 ) /* Sign extend */ < co2 |= 0xfc00; < printf( "CO2 Calibr %3d at %02d00 local\n", co2, < ((val >> 10) & 7) * 3 ); --- > if ( rev == 3 ) > { > co2 = val & 0x3ff; > if ( co2 & 0x200 ) /* Sign extend */ > co2 |= 0xfc00; > misc = (val >> 10) & 7; > } > else > { > co2 = val & 0xfff; > if ( co2 & 0x800 ) /* Sign extend */ > co2 |= 0xf000; > misc = (val >> 12) & 7; > } > > printf( "CO2 Calibr %3d at %02d00 local\n", co2, 3 * misc ); 1069,1070c1275,1278 < mcp10 = getIntelword( (Byte *)&msgp->msg.misc3.ms_mcp10 ); < mcp30 = getIntelword( (Byte *)&msgp->msg.misc3.ms_mcp30 ); --- > if ( rev == 3 ) > { > mcp10 = getIntelword( (Byte *)&msgp->msg.misc3.ms_mcp10 ); > mcp30 = getIntelword( (Byte *)&msgp->msg.misc3.ms_mcp30 ); 1072,1073c1280,1281 < printf("10m MCP %9.5f 30m MCP %9.5f\n", < decode_prr_chan(mcp10, NULL), decode_prr_chan(mcp30, NULL)); --- > printf("10m MCP %9.5f 30m MCP %9.5f\n", > decode_prr_chan(mcp10, NULL), decode_prr_chan(mcp30, NULL)); 1075,1077c1283,1285 < printf("10m MCP %9.5f 30m MCP %9.5f\n", < decode_prr_chan(mcp10, &spec_cal.spc_cal[2][10]), < decode_prr_chan(mcp30, &spec_cal.spc_cal[2][11])); --- > printf("10m MCP %9.5f 30m MCP %9.5f\n", > decode_prr_chan(mcp10, &spec_cal.spc_cal[2][10]), > decode_prr_chan(mcp30, &spec_cal.spc_cal[2][11])); 1079c1287,1290 < printWetstar( &msgp->msg.misc3.ms_wetstar ); --- > printWetstar( &msgp->msg.misc3.ms_wetstar ); > } > else > printWetstarRev4( &msgp->msg.misc4 ); 1109a1321,1328 > if ( rev == 4 ) > { > val = getIntelword( (Byte *)&msgp->msg.shutter.sh_ctd_temp ); > misc = getIntelword( (Byte *)&msgp->msg.shutter.sh_ctd_cond ); > printf("Noon CTD Temp %7.3f Conductivity %8.4f\n", > ((double)val) / 1000., ((double)misc) / 10000.); > } > 1118c1337 < } /* printOneMsgRev3() */ --- > } /* printOneMsgRev3_4() */ 1138c1357,1361 < printOneMsgRev3( msgp ); --- > printOneMsgRev3_4( msgp, 3 ); > break; > > case 4: > printOneMsgRev3_4( msgp, 4 ); diff atlas.c /oasis/src/atlas.c diff chktmp.c /oasis/src/chktmp.c 14c14 < * Revision 1.0 92/08/06 15:28:05 15:28:05 hebo --- > * Revision 1.0 92/08/06 15:28:05 15:28:05 hebo (Bob Herlien) diff ctd.c /oasis/src/ctd.c diff decode.c /oasis/src/decode.c 83c83 < Extern Int32 getDataLine( Byte *buf, Int len, FILE *fd, FileType ftype ); --- > Extern Int32 getRecHdr( Byte *buf, Int len, FILE *fd, FileType ftype ); 158c158 < "GF" }; --- > "GF", "MicroCat", "GPS" }; 180a181 > Status print_gps_type3( Int len ); 261c262 < while ( (cc = getDataLine(buffer, sizeof(buffer), fd, fileType)) != EOF ) --- > while ( (cc = getRecHdr(buffer, sizeof(buffer), fd, fileType)) != EOF ) 300,301c301,302 < printf("Record too long in %s, block %d record %d. Truncating.\n", < filename, blknum, hdr.log_nmbr); --- > printf("Record too long in %s, record %d. Truncating.\n", > filename, hdr.log_nmbr); 416a418,421 > case GPS_TYPE3: > print_gps_type3( len ); > break; > 451a457 > case H2O_PUMP: 458,461d463 < case H2O_PUMP: < printf("\n"); < break; < 482a485,488 > case MICROCAT: > print_ascii(len, FALSE, TRUE); > break; > 611c617 < "Usage: %s [-c cfg_file] [-i instrument] [-g[offset]] [-h] [-l] [-n]\n", s ); --- > "Usage: %s [-b] [-c cfg_file] [-i instrument] [-g[offset]] [-h] [-l] [-n] [-r]\n", s ); 644a651 > fileType = FT_BIN; 909a917,978 > /* Function : print_gps_type3 */ > /* Purpose : Print buffer as GPS data */ > /* Inputs : Length of buffer */ > /* Outputs : OK or SIZE_ERR */ > /************************************************************************/ > Status > print_gps_type3( Int len ) > { > Int32 lat, lon; > Nat32 var; > Nat16 fmt, samples, totTime, diffSamples, hdop, status; > char lathem, lonhem; > > if ( (fmt = getIntelword(buffer)) != 1 ) > { > printf("Unknown GPS format %d\n", fmt); > return( FMT_ERR ); > } > > if ( len != 24 ) > { > printf("Bad GPS record size, was %d, should be 24\n",len); > return( SIZE_ERR ); > } > > samples = getIntelword(&buffer[2]); > lat = getIntellong(&buffer[4]); > lon = getIntellong(&buffer[8]); > var = getIntellong(&buffer[12]); > totTime = getIntelword(&buffer[16]); > diffSamples = getIntelword(&buffer[18]); > hdop = getIntelword(&buffer[20]); > status = getIntelword(&buffer[22]); > > lathem = 'N'; > lonhem = 'W'; > > if ( lat < 0 ) > { > lat = -lat; > lathem = 'S'; > } > > if ( lon < 0 ) > { > lon = -lon; > lonhem = 'W'; > } > > printf("%3d:%02d.%04d%c %3d:%02d.%03d%c StdDev %.2f Samp %d\n", > (int)(lat/600000), (int)((lat/10000)%60), (int)(lat%10000), lathem, > (int)(lon/600000), (int)((lon/10000)%60), (int)(lon%10000), lonhem, > sqrt((double)var), samples); > printf(" On Time %d Diff %d HDOP %.1f Temp %d Stat %04x\n", > totTime, diffSamples, 0.1*hdop, (status>>8) & 0xff, status & 0xff); > > return( OK ); > > } /* print_gps_type3() */ > > > /************************************************************************/ 1208a1278,1291 > > > /************************************************************************/ > /* Function : read_tstring_cfg */ > /* Purpose : Just here to satisfy linker (only needed for extract) */ > /* Inputs : Ptr to tstring cfg file name ptr */ > /* Outputs : OK or ERROR */ > /************************************************************************/ > Status > read_tstring_cfg( char *fileName, TStringCfg *tCfgp ) > { > return( OK ); > > } /* read_tstring_cfg() */ diff extract.c /oasis/src/extract.c 80c80 < Extern Int32 getDataLine( Byte *buf, Int len, FILE *fd, FileType ftype ); --- > Extern Int32 getRecHdr( Byte *buf, Int len, FILE *fd, FileType ftype ); 107a108,110 > Extern double ctd_salinity(double c, double t, double p); > Extern Status print_tstring( Int sensor, Byte *buffer, Int len, > TStringCfg *tCfgp ); 124a128 > Extern TStringCfg tstringCfg[]; /* Tstring configuration */ 133a138 > Global double dtime; /* Time in double precision format */ 141d145 < MLocal double dtime; /* Time in double precision format */ 157c161 < "GF" }; --- > "GF", "MicroCat", "GPS" }; 174a179 > Void print_gps_type3( Int len ); 182c187 < Void print_tstring( Int sensor, Int len ); --- > Void print_metsys( Int sensor, Int len ); 260c265 < while ( (cc = getDataLine(buffer, sizeof(buffer), fd, fileType)) != EOF ) --- > while ( (cc = getRecHdr(buffer, sizeof(buffer), fd, fileType)) != EOF ) 403a409,412 > > case GPS_TYPE3: > print_gps_type3( len ); > break; 445c454 < print_ascii(METSYS, len, TRUE, FALSE); --- > print_metsys(METSYS, len); 449c458 < print_tstring(TSTRING, len); --- > print_tstring( TSTRING, buffer, len, tstringCfg ); 455a465,468 > case MICROCAT: > print_ascii(MICROCAT, len, FALSE, TRUE); > break; > 499c512 < "Usage: %s [-c cfg_file] [-f rcd_file] [-h] [-i instrument] [-n] [-r]\n", --- > "Usage: %s [-b] [-c cfg_file] [-f rcd_file] [-h] [-i instrument] [-n] [-r]\n", 504a518 > fprintf( stderr, "b interprets data as binary file (default is uuencode)\n" ); 526c540 < while ( (i = getopt(argc, argv, "c:f:hi:nr")) != EOF ) --- > while ( (i = getopt(argc, argv, "bc:f:hi:nr")) != EOF ) 528a543,546 > case 'b': > fileType = FT_BIN; > break; > 799a818,853 > /* Function : print_gps_type3 */ > /* Purpose : Print buffer as GPS data */ > /* Inputs : Length of buffer */ > /* Outputs : None */ > /************************************************************************/ > Void > print_gps_type3( Int len ) > { > Int32 lat, lon; > Nat32 var; > Nat16 fmt, samples, totTime, diffSamples, hdop, status; > > if ( (fmt = getIntelword(buffer)) != 1 ) > sensor_error( GPS, FMT_ERR ); > > if ( len != 24 ) > sensor_error( GPS, SIZE_ERR ); > > samples = getIntelword(&buffer[2]); > lat = getIntellong(&buffer[4]); > lon = getIntellong(&buffer[8]); > var = getIntellong(&buffer[12]); > totTime = getIntelword(&buffer[16]); > diffSamples = getIntelword(&buffer[18]); > hdop = getIntelword(&buffer[20]); > status = getIntelword(&buffer[22]); > > print_sensor(GPS, "%9.5f %10.5f %10.5f %5.2f %3d %3d %3d %4.1f %d %02x\n", > dtime, (double)lat/600000.0, (double)lon/600000.0, > sqrt((double)var), samples, totTime, diffSamples, > 0.1*hdop, (status>>8) & 0xff, status & 0xff); > > } /* print_gps_type3() */ > > > /************************************************************************/ 1026a1081,1177 > /* Function : print_metsys */ > /* Purpose : Print data stream as ascii stream */ > /* Inputs : Sensor, Length, Boolean to strip CR & LF */ > /* Outputs : None */ > /************************************************************************/ > Void > print_metsys( Int sensor, Int len) > { > char *p; > char *metsys_string[22]; > int i = 0; > int hrmin; > double variation = 15.1; > Metsys metsys; > > buffer[len] = '\0'; > > metsys_string[i] = strtok(buffer, "+- "); > > while ((p = strtok(NULL, "+- ")) != NULL) > { > i++; > metsys_string[i] = p; > > switch(i) > { > case 1: > metsys.arr_type = atoi(metsys_string[i]); > break; > > case 3: > metsys.day = atoi(metsys_string[i]); > break; > > case 5: > hrmin = atoi(metsys_string[i]); > metsys.hr = hrmin / 100; > metsys.min = hrmin % 100; > break; > > case 7: > metsys.batt_volt = atof(metsys_string[i]); > break; > > case 9: > metsys.air = atof(metsys_string[i]); > break; > > case 11: > metsys.rh = atof(metsys_string[i]); > break; > > case 13: > metsys.baro_press = atof(metsys_string[i]); > break; > > case 15: > metsys.windspd = atof(metsys_string[i]); > break; > > case 17: > metsys.winddir = atof(metsys_string[i]); > break; > > case 19: > metsys.buoy_heading = atof(metsys_string[i]); > break; > > case 21: > metsys.rel_winddir = atof(metsys_string[i]); > break; > } > } > > if ( (metsys.arr_type == 303) || (metsys.arr_type == 304) ) > { > metsys.winddir = metsys.winddir + variation; > while ( metsys.winddir >= 360.0 ) > metsys.winddir -= 360.0; > metsys.baro_press += 800; > } > > metsys.windu = -metsys.windspd*sin(metsys.winddir*PI/180.0); > metsys.windv = -metsys.windspd*cos(metsys.winddir*PI/180.0); > > print_sensor(sensor, "%9.5f %d %d %d %d %6.2f %6.2f %5.1f %6.1f %7.3f %6.2f %6.2f %6.2f %6.2f %6.2f\n", > dtime, metsys.arr_type, metsys.day, metsys.hr, metsys.min, > metsys.batt_volt, metsys.air, metsys.rh, metsys.baro_press, > metsys.windspd, metsys.winddir, metsys.windu, metsys.windv, > metsys.buoy_heading, metsys.rel_winddir); > > } /* print_metsys() */ > > > #if 0 /* Old way of doing it. New way is in tstring.c */ > > /************************************************************************/ 1058a1210,1211 > > #endif diff file.c /oasis/src/file.c 96a97 > Extern Status read_tstring_cfg( char *fileName, TStringCfg *tCfgp ); 127a129 > Global TStringCfg tstringCfg; /* Tstring configuration */ 157c159,160 < {NULLF, 0, "tstring"}, {NULLF, 0, "gf"} --- > {NULLF, 0, "tstring"}, {NULLF, 0, "gf"}, {NULLF, 0, "microcat"}, > {NULLF, 0, "gps"} 176a180 > { "tstring", read_tstring_cfg, (Void *)&tstringCfg, FALSE }, 308a313,320 > if ( ftype == FT_BIN ) > { > uulen = fread(buf, 1, len, fd); > if ( uulen < len ) > return( EOF ); > return( uulen ); > } > 378a391,415 > > > /************************************************************************/ > /* Function : getRecaHdr */ > /* Purpose : Read enough data to get Record Header */ > /* Inputs : Buffer for resulting data, size of buffer, FILE ptr */ > /* Outputs : Number characters read, 0 if error, or EOF */ > /************************************************************************/ > Int32 > getRecHdr( Byte *buf, Int len, FILE *fd, FileType ftype ) > { > Int32 c; > > if ( ftype == FT_BIN ) > { > while( (c = fgetc(fd)) != LOG_SYNC ) > if ( c == EOF ) > return( EOF ); > > return( getDataLine(buf, HDR_SIZE, fd, ftype) ); > } > > return( getDataLine(buf, len, fd, ftype) ); > > } /* getRecHdr() */ diff getoasis.c /oasis/src/getoasis.c diff gf.c /oasis/src/gf.c diff gps.c /oasis/src/gps.c 15c15 < * Revision 1.1 92/02/26 10:15:24 10:15:24 hebo --- > * Revision 1.1 92/02/26 10:15:24 10:15:24 hebo (Bob Herlien) diff m1.c /oasis/src/m1.c 4,5c4,5 < /* $Header: m1.c,v 2.2 94/01/17 11:09:53 hebo Exp $ */ < /* Summary : Program to print meteorological readings from OASIS data files*/ --- > /* $Header: m1.c,v 1.1 94/01/17 11:09:55 hebo Exp $ */ > /* Summary : Program to print meteorological readings from OASIS M1 mooring*/ 9,10c9,10 < /* $Revision: 2.2 $ */ < /* Created : 02/10/92 */ --- > /* $Revision: 1.1 $ */ > /* Created : 09/24/92 */ 15c15 < * Revision 2.2 94/01/17 11:09:53 11:09:53 hebo --- > * Revision 1.1 94/01/17 11:09:55 11:09:55 hebo 18,39c18 < * Revision 2.1 92/09/04 17:06:15 17:06:15 hebo (Bob Herlien) < * Deleted ATLAS SST due to bad sensor, added GPS < * < * Revision 2.0 92/09/01 14:23:17 14:23:17 hebo (Bob Herlien) < * August 1992 Deployment. < * < * Revision 1.5 92/06/15 09:08:25 09:08:25 hebo (Bob Herlien) < * Changed for 10 minute CTD sampling < * < * Revision 1.4 92/03/26 16:47:25 16:47:25 hebo (Bob Herlien) < * Changed to print local time. < * < * Revision 1.3 92/03/23 09:48:54 09:48:54 hebo (Bob Herlien) < * Output ATLAS, CTD on same line if time difference <= 5 minutes. < * < * Revision 1.2 92/03/20 16:15:24 16:15:24 hebo (Bob Herlien) < * Added salinity, CTD temp < * < * Revision 1.1 92/03/17 16:13:15 16:13:15 hebo (Bob Herlien) < * Displays OASIS time (not ATLAS), actual date (not julian day) < * < * Revision 1.0 92/02/25 10:47:00 10:47:00 hebo (Bob Herlien) --- > * Revision 1.0 92/09/24 10:29:53 10:29:53 hebo (Bob Herlien) 40a20 > * 46,47c26,27 < #include /* MBARI type definitions */ < #include /* MBARI constants */ --- > #include /* MBARI type definitions */ > #include /* MBARI constants */ 54c34 < #define ALINELEN 170 /* Approx length of one ATLAS record*/ --- > #define MLINELEN 95 /* Approx length of one METSYS record*/ 56c36 < #define GLINELEN 50 /* Approx length of one GPS record */ --- > #define GLINELEN 52 /* Approx length of one GPS record */ 58,61c38,40 < #define NRECS 150 /* Max # ATLAS records displayed */ < #define DFLT_RECS 21 /* Default # ATLAS records displayed*/ < #define NFIELDS 21 /* # fields in ATLAS record */ < #define MS_TO_KTS 1.9438 /* Conversion of m/s to knots */ --- > #define NRECS 150 /* Max # records displayed */ > #define DFLT_RECS 20 /* Default # records displayed */ > #define NFIELDS 15 /* # fields in METSYS record */ 65a45,63 > typedef struct /************************************/ > { /* Struct for decoded Metsys data */ > double met_time; /* OASIS Date/time */ > Int32 met_format; /* Format code */ > Int32 met_jday; /* Julian day from metsys */ > Int32 met_hour; /* Hour of day reported by metsys */ > Int32 met_min; /* Minute of hour reported by metsys*/ > double met_battery; /* Metsys battery voltage */ > double met_temp; /* Air Temperature */ > double met_humid; /* Humidity */ > double met_barometer; /* Barometric pressure minus 800 */ > double met_windspeed; /* Wind speed in knots */ > double met_winddir; /* Wind direction from */ > double met_windu; /* Wind U vector */ > double met_windv; /* Wind V vector */ > double met_buoy_head; /* Buoy heading */ > double met_windvane; /* Wind vane offset from heading */ > } MetDecode; /************************************/ > 87c85 < Global AtlasDecode atlrecs[NRECS]; /* ATLAS records */ --- > Global MetDecode metrecs[NRECS]; /* METSYS records */ 90c88 < Global char atlas_file[NAMESIZE]; /* Name of ATLAS data file */ --- > Global char metsys_file[NAMESIZE]; /* Name of MetSys data file */ 93,95c91,93 < Global char *atlas_dir = "/usr/local/oasis/M1/atlas"; < Global char *ctd_dir = "/usr/local/oasis/M1/ctd"; < Global char *gps_dir = "/usr/local/oasis/M1/gps"; --- > Global char *metsys_dir = "/oasis/m1/metsys"; > Global char *ctd_dir = "/oasis/m1/ctd"; > Global char *gps_dir = "/oasis/m1/gps"; 149c147 < time_t curtime, basetime, atm, ctm, gtm; --- > time_t curtime, basetime, mtm, ctm, gtm; 151,153c149,151 < Int i, j, k, itime, arecs, crecs, grecs, n, year, mo, yday, mday; < FILE *afp, *cfp, *gfp; < double otime, starttime; --- > Int i, j, k, itime, mrecs, crecs, grecs, year, mo, yday, mday, rtn; > FILE *mfp, *cfp, *gfp; > double starttime; 160,161c158,159 < arecs = DFLT_RECS; < afp = cfp = NULLF; --- > mrecs = DFLT_RECS; > mfp = cfp = NULLF; 179c177 < atlas_dir = argv[i]; --- > metsys_dir = argv[i]; 184c182 < arecs = atoi( &argv[i][2] ); --- > mrecs = atoi( &argv[i][2] ); 186,188c184,186 < arecs = atoi( argv[++i] ); < if ( arecs > NRECS ) < arecs = NRECS; --- > mrecs = atoi( argv[++i] ); > if ( mrecs > NRECS ) > mrecs = NRECS; 196,206c194,199 < for ( i = itime; itime > i - 10; itime-- ) < { < sprintf( atlas_file, "%s/%05d", atlas_dir, itime ); < sprintf( ctd_file, "%s/%05d", ctd_dir, itime ); < sprintf( gps_file, "%s/%05d", gps_dir, itime ); < afp = fopen( atlas_file, "r" ); < cfp = fopen( ctd_file, "r" ); < gfp = fopen( gps_file, "r" ); < if ( afp != NULLF ) < break; < } --- > sprintf( metsys_file, "%s/%05d", metsys_dir, itime ); > sprintf( ctd_file, "%s/%05d", ctd_dir, itime ); > sprintf( gps_file, "%s/%05d", gps_dir, itime ); > mfp = fopen( metsys_file, "r" ); > cfp = fopen( ctd_file, "r" ); > gfp = fopen( gps_file, "r" ); 208c201,202 < crecs = grecs = 0; --- > crecs = mrecs; > grecs = mrecs/3 + 1; 211,212c205,209 < if ( afp == NULLF ) < printf( "Could not open ATLAS file %s/%05d\n", atlas_dir, i ); --- > if ( mfp == NULLF ) > { > printf( "Could not open METSYS file %s/%05d\n", metsys_dir, itime ); > mrecs = 0; > } 215,217c212,215 < printf( "Could not open CTD file %s/%05d\n", ctd_dir, i ); < else < crecs = arecs; --- > { > printf( "Could not open CTD file %s/%05d\n", ctd_dir, itime ); > crecs = 0; > } 220,222c218,221 < printf( "Could not open GPS file %s/%05d\n", gps_dir, i ); < else < grecs = arecs/3 + 1; --- > { > printf( "Could not open GPS file %s/%05d\n", gps_dir, itime ); > grecs = 0; > } 224c223 < if ( afp != NULLF ) --- > if ( mfp != NULLF ) 226,227c225,227 < fseek( afp, (long)arecs * ALINELEN * (-1), SEEK_END ); < for ( i = 0; fgets(buffer, LINEBUFLEN, afp) != NULL; ) --- > fseek( mfp, (long)(mrecs+1) * MLINELEN * (-1), SEEK_END ); > fgets(buffer, LINEBUFLEN, mfp); > for ( i = 0; fgets(buffer, LINEBUFLEN, mfp) != NULL; ) 231,244c231,241 < if ( sscanf(buffer, " %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg \ < %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg", < &otime, &atlrecs[i].atd_time, &atlrecs[i].atd_air, < &atlrecs[i].atd_sst, &atlrecs[i].atd_temp[0], < &atlrecs[i].atd_temp[1], &atlrecs[i].atd_temp[2], < &atlrecs[i].atd_temp[3], &atlrecs[i].atd_temp[4], < &atlrecs[i].atd_temp[5], &atlrecs[i].atd_temp[6], < &atlrecs[i].atd_temp[7], &atlrecs[i].atd_temp[8], < &atlrecs[i].atd_temp[9], &atlrecs[i].atd_press[0], < &atlrecs[i].atd_press[1], &atlrecs[i].atd_rh, < &atlrecs[i].atd_windspd, &atlrecs[i].atd_winddir, < &atlrecs[i].atd_windu, &atlrecs[i].atd_windv) < >= NFIELDS ) < atlrecs[i++].atd_time = otime; --- > rtn = sscanf(buffer, " %lg %d %d %d %d %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg", > &metrecs[i].met_time, &metrecs[i].met_format, > &metrecs[i].met_jday, &metrecs[i].met_hour, > &metrecs[i].met_min, &metrecs[i].met_battery, > &metrecs[i].met_temp, &metrecs[i].met_humid, > &metrecs[i].met_barometer, &metrecs[i].met_windspeed, > &metrecs[i].met_winddir, &metrecs[i].met_windu, > &metrecs[i].met_windv, &metrecs[i].met_buoy_head, > &metrecs[i].met_windvane); > if ( rtn >= NFIELDS ) > i++; 246,247c243,244 < fclose( afp ); < arecs = i; --- > fclose( mfp ); > mrecs = i; 250,251c247,248 < if ( arecs <= 0 ) < printf( "No ATLAS data in file %s\n", atlas_file ); --- > if ( mrecs <= 0 ) > printf( "No MetSys data in file %s\n", metsys_file ); 253c250 < starttime = atlrecs[0].atd_time; --- > starttime = metrecs[0].met_time; 305c302 < printf("\nLatest ATLAS and CTD data from %s %d, %d (Julian day %d)\n\n", --- > printf("\nLatest M1 Meteorological and CTD data from %s %d, %d (Julian day %d)\n\n", 307,308c304,305 < printf("Local Air Rel Wind Direction Surface Salinity Position\n"); < printf("Time Temp Humid (kts) (from) Temp o/oo\n"); --- > printf("Local Air Rel Wind Barometer Surface Salinity Position\n"); > printf("Time Temp Humid kts from mbar Temp o/oo\n"); 310c307 < for ( i = j = k = 0; (i < arecs); ) --- > for ( i = j = k = 0; (i < mrecs); ) 312c309 < atm = basetime + (SECS_PER_DAY * fmod(atlrecs[i].atd_time, 1.0)); --- > mtm = basetime + (SECS_PER_DAY * fmod(metrecs[i].met_time, 1.0)); 321,324c318 < tp = localtime(&atm); < n = (Int)atlrecs[i].atd_winddir + 180; < if ( n >= 360 ) < n -= 360; --- > tp = localtime(&mtm); 326c320 < if ( abs(ctm - atm) <= 300 ) --- > if ( abs(ctm - mtm) <= 300 ) 329,331c323,326 < printf("%5.1f %4.0f %5.1f %3d", < atlrecs[i].atd_air, atlrecs[i].atd_rh, < MS_TO_KTS * atlrecs[i].atd_windspd, n); --- > printf("%5.1f %4.0f %5.1f %3.0f %4.0f", > metrecs[i].met_temp, metrecs[i].met_humid, > metrecs[i].met_windspeed, metrecs[i].met_winddir, > metrecs[i].met_barometer); 333c328 < printf(" %7.3f %8.4f", --- > printf(" %7.3f %8.4f", 337c332 < else if ( atm <= ctm ) --- > else if ( mtm <= ctm ) 340,342c335,338 < printf("%5.1f %4.0f %5.1f %3d ", < atlrecs[i].atd_air, atlrecs[i].atd_rh, < MS_TO_KTS * atlrecs[i].atd_windspd, n); --- > printf("%5.1f %4.0f %5.1f %3.0f %4.0f ", > metrecs[i].met_temp, metrecs[i].met_humid, > metrecs[i].met_windspeed, metrecs[i].met_winddir, > metrecs[i].met_barometer); 348c344 < printf("%2d:%02d ", --- > printf("%2d:%02d ", 355c351 < if ( gtm <= atm + 300 ) --- > if ( gtm <= mtm + 300 ) diff m2.c /oasis/src/m2.c 26,27c26,27 < #include /* MBARI type definitions */ < #include /* MBARI constants */ --- > #include /* MBARI type definitions */ > #include /* MBARI constants */ 34c34 < #define ALINELEN 170 /* Approx length of one ATLAS record*/ --- > #define MLINELEN 95 /* Approx length of one METSYS record*/ 36c36 < #define GLINELEN 50 /* Approx length of one GPS record */ --- > #define GLINELEN 52 /* Approx length of one GPS record */ 38,41c38,40 < #define NRECS 150 /* Max # ATLAS records displayed */ < #define DFLT_RECS 20 /* Default # ATLAS records displayed*/ < #define NFIELDS 21 /* # fields in ATLAS record */ < #define MS_TO_KTS 1.9438 /* Conversion of m/s to knots */ --- > #define NRECS 150 /* Max # records displayed */ > #define DFLT_RECS 20 /* Default # records displayed */ > #define NFIELDS 15 /* # fields in METSYS record */ 45a45,63 > typedef struct /************************************/ > { /* Struct for decoded Metsys data */ > double met_time; /* OASIS Date/time */ > Int32 met_format; /* Format code */ > Int32 met_jday; /* Julian day from metsys */ > Int32 met_hour; /* Hour of day reported by metsys */ > Int32 met_min; /* Minute of hour reported by metsys*/ > double met_battery; /* Metsys battery voltage */ > double met_temp; /* Air Temperature */ > double met_humid; /* Humidity */ > double met_barometer; /* Barometric pressure minus 800 */ > double met_windspeed; /* Wind speed in knots */ > double met_winddir; /* Wind direction from */ > double met_windu; /* Wind U vector */ > double met_windv; /* Wind V vector */ > double met_buoy_head; /* Buoy heading */ > double met_windvane; /* Wind vane offset from heading */ > } MetDecode; /************************************/ > 67c85 < Global AtlasDecode atlrecs[NRECS]; /* ATLAS records */ --- > Global MetDecode metrecs[NRECS]; /* METSYS records */ 70c88 < Global char atlas_file[NAMESIZE]; /* Name of ATLAS data file */ --- > Global char metsys_file[NAMESIZE]; /* Name of MetSys data file */ 73,75c91,93 < Global char *atlas_dir = "/usr/local/oasis/M2/atlas"; < Global char *ctd_dir = "/usr/local/oasis/M2/ctd"; < Global char *gps_dir = "/usr/local/oasis/M2/gps"; --- > Global char *metsys_dir = "/oasis/m2/metsys"; > Global char *ctd_dir = "/oasis/m2/ctd"; > Global char *gps_dir = "/oasis/m2/gps"; 129c147 < time_t curtime, basetime, atm, ctm, gtm; --- > time_t curtime, basetime, mtm, ctm, gtm; 131,133c149,151 < Int i, j, k, itime, arecs, crecs, grecs, n, year, mo, yday, mday; < FILE *afp, *cfp, *gfp; < double otime, starttime; --- > Int i, j, k, itime, mrecs, crecs, grecs, year, mo, yday, mday, rtn; > FILE *mfp, *cfp, *gfp; > double starttime; 140,141c158,159 < arecs = DFLT_RECS; < afp = cfp = NULLF; --- > mrecs = DFLT_RECS; > mfp = cfp = NULLF; 159c177 < atlas_dir = argv[i]; --- > metsys_dir = argv[i]; 164c182 < arecs = atoi( &argv[i][2] ); --- > mrecs = atoi( &argv[i][2] ); 166,168c184,186 < arecs = atoi( argv[++i] ); < if ( arecs > NRECS ) < arecs = NRECS; --- > mrecs = atoi( argv[++i] ); > if ( mrecs > NRECS ) > mrecs = NRECS; 176,186c194,199 < for ( i = itime; itime > i - 10; itime-- ) < { < sprintf( atlas_file, "%s/%05d", atlas_dir, itime ); < sprintf( ctd_file, "%s/%05d", ctd_dir, itime ); < sprintf( gps_file, "%s/%05d", gps_dir, itime ); < afp = fopen( atlas_file, "r" ); < cfp = fopen( ctd_file, "r" ); < gfp = fopen( gps_file, "r" ); < if ( afp != NULLF ) < break; < } --- > sprintf( metsys_file, "%s/%05d", metsys_dir, itime ); > sprintf( ctd_file, "%s/%05d", ctd_dir, itime ); > sprintf( gps_file, "%s/%05d", gps_dir, itime ); > mfp = fopen( metsys_file, "r" ); > cfp = fopen( ctd_file, "r" ); > gfp = fopen( gps_file, "r" ); 188,189c201,202 < crecs = arecs; < grecs = arecs/3 + 1; --- > crecs = mrecs; > grecs = mrecs/3 + 1; 192c205 < if ( afp == NULLF ) --- > if ( mfp == NULLF ) 194,195c207,208 < printf( "Could not open ATLAS file %s/%05d\n", atlas_dir, i ); < arecs = 0; --- > printf( "Could not open METSYS file %s/%05d\n", metsys_dir, itime ); > mrecs = 0; 200c213 < printf( "Could not open CTD file %s/%05d\n", ctd_dir, i ); --- > printf( "Could not open CTD file %s/%05d\n", ctd_dir, itime ); 206c219 < printf( "Could not open GPS file %s/%05d\n", gps_dir, i ); --- > printf( "Could not open GPS file %s/%05d\n", gps_dir, itime ); 210c223 < if ( afp != NULLF ) --- > if ( mfp != NULLF ) 212,213c225,227 < fseek( afp, (long)arecs * ALINELEN * (-1), SEEK_END ); < for ( i = 0; fgets(buffer, LINEBUFLEN, afp) != NULL; ) --- > fseek( mfp, (long)(mrecs+1) * MLINELEN * (-1), SEEK_END ); > fgets(buffer, LINEBUFLEN, mfp); > for ( i = 0; fgets(buffer, LINEBUFLEN, mfp) != NULL; ) 217,230c231,241 < if ( sscanf(buffer, " %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg \ < %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg", < &otime, &atlrecs[i].atd_time, &atlrecs[i].atd_air, < &atlrecs[i].atd_sst, &atlrecs[i].atd_temp[0], < &atlrecs[i].atd_temp[1], &atlrecs[i].atd_temp[2], < &atlrecs[i].atd_temp[3], &atlrecs[i].atd_temp[4], < &atlrecs[i].atd_temp[5], &atlrecs[i].atd_temp[6], < &atlrecs[i].atd_temp[7], &atlrecs[i].atd_temp[8], < &atlrecs[i].atd_temp[9], &atlrecs[i].atd_press[0], < &atlrecs[i].atd_press[1], &atlrecs[i].atd_rh, < &atlrecs[i].atd_windspd, &atlrecs[i].atd_winddir, < &atlrecs[i].atd_windu, &atlrecs[i].atd_windv) < >= NFIELDS ) < atlrecs[i++].atd_time = otime; --- > rtn = sscanf(buffer, " %lg %d %d %d %d %lg %lg %lg %lg %lg %lg %lg %lg %lg %lg", > &metrecs[i].met_time, &metrecs[i].met_format, > &metrecs[i].met_jday, &metrecs[i].met_hour, > &metrecs[i].met_min, &metrecs[i].met_battery, > &metrecs[i].met_temp, &metrecs[i].met_humid, > &metrecs[i].met_barometer, &metrecs[i].met_windspeed, > &metrecs[i].met_winddir, &metrecs[i].met_windu, > &metrecs[i].met_windv, &metrecs[i].met_buoy_head, > &metrecs[i].met_windvane); > if ( rtn >= NFIELDS ) > i++; 232,233c243,244 < fclose( afp ); < arecs = i; --- > fclose( mfp ); > mrecs = i; 236,237c247,248 < if ( arecs <= 0 ) < printf( "No ATLAS data in file %s\n", atlas_file ); --- > if ( mrecs <= 0 ) > printf( "No MetSys data in file %s\n", metsys_file ); 239c250 < starttime = atlrecs[0].atd_time; --- > starttime = metrecs[0].met_time; 291c302 < printf("\nLatest M2 ATLAS and CTD data from %s %d, %d (Julian day %d)\n\n", --- > printf("\nLatest M2 Meteorological and CTD data from %s %d, %d (Julian day %d)\n\n", 293,294c304,305 < printf("Local Air ATLAS ATLAS Rel Wind CTD Salinity Position\n"); < printf("Time Temp SST 20m Humid kts from Temp\n"); --- > printf("Local Air Rel Wind Barometer Surface Salinity Position\n"); > printf("Time Temp Humid kts from mbar Temp o/oo\n"); 296c307 < for ( i = j = k = 0; (i < arecs); ) --- > for ( i = j = k = 0; (i < mrecs); ) 298c309 < atm = basetime + (SECS_PER_DAY * fmod(atlrecs[i].atd_time, 1.0)); --- > mtm = basetime + (SECS_PER_DAY * fmod(metrecs[i].met_time, 1.0)); 307,310c318 < tp = localtime(&atm); < n = (Int)atlrecs[i].atd_winddir + 180; < if ( n >= 360 ) < n -= 360; --- > tp = localtime(&mtm); 312c320 < if ( abs(ctm - atm) <= 300 ) --- > if ( abs(ctm - mtm) <= 300 ) 315,318c323,326 < printf("%5.1f %7.3f %7.3f %3.0f %4.1f %3d", < atlrecs[i].atd_air, atlrecs[i].atd_sst, < atlrecs[i].atd_temp[1], atlrecs[i].atd_rh, < MS_TO_KTS * atlrecs[i].atd_windspd, n); --- > printf("%5.1f %4.0f %5.1f %3.0f %4.0f", > metrecs[i].met_temp, metrecs[i].met_humid, > metrecs[i].met_windspeed, metrecs[i].met_winddir, > metrecs[i].met_barometer); 320c328 < printf(" %6.3f %7.4f", --- > printf(" %7.3f %8.4f", 324c332 < else if ( atm <= ctm ) --- > else if ( mtm <= ctm ) 327,330c335,338 < printf("%5.1f %7.3f %7.3f %3.0f %4.1f %3d ", < atlrecs[i].atd_air, atlrecs[i].atd_sst, < atlrecs[i].atd_temp[1], atlrecs[i].atd_rh, < MS_TO_KTS * atlrecs[i].atd_windspd, n); --- > printf("%5.1f %4.0f %5.1f %3.0f %4.0f ", > metrecs[i].met_temp, metrecs[i].met_humid, > metrecs[i].met_windspeed, metrecs[i].met_winddir, > metrecs[i].met_barometer); 336c344 < printf("%2d:%02d ", --- > printf("%2d:%02d ", 338c346 < printf("%6.3f %7.4f", --- > printf("%7.3f %8.4f", 343c351 < if ( gtm <= atm + 300 ) --- > if ( gtm <= mtm + 300 ) diff no3.c /oasis/src/no3.c diff port.c /oasis/src/port.c diff range.c /oasis/src/range.c diff sendoasis.c /oasis/src/sendoasis.c 43a44 > #define TIMEOUT_ERR 6 /* Timeout */ 71a73 > MLocal time_t prompt_tmout = 10; /* 60 seconds for prompt */ 502c504 < while ( !aborted && (time(&curtime) <= datatime + timeout) ) --- > while ( !aborted && (time(&curtime) <= datatime + prompt_tmout) ) 527c529 < return( DOWNLOAD_ERR ); --- > return( TIMEOUT_ERR ); 562c564 < if ( wait_for_prompt() != OK ) --- > if ( wait_for_prompt() == DOWNLOAD_ERR ) diff spec.c /oasis/src/spec.c diff argos.h /oasis/src/argos.h 33a34 > #define CHEM4_SIZE 12 /* 12 bits * 8 samples = 12 bytes */ 44a46,50 > #define SPEC_1230_LU_CHAN_REV4 0 /* Channel for 1230pm surface Spec Lu*/ > #define SAT1_ED 1 /* Address tag for Satlantic 1 Ed */ > #define SAT1_LU 1 /* Address tag for Satlantic 1 Lu */ > #define SAT1_ED_CHAN 8 /* Channel for Satlantic 1 Ed */ > #define SAT1_LU_CHAN 8 /* Channel for Satlantic 1 Lu */ 45a52 > #define FLUOR20_WORDS 6 /* 0, 6, 9, 12, 15, 1745 */ 50a58 > /* Rev 4 - Delete NO3, substitute PRR parms, add 10th msg type for Satlantic*/ 77c85,87 < #define NUM_MSG_TYPES NUM_MSG_TYPES_REV3 --- > /* Additional Revision 4 message */ > #define SAT1 9 /* Satlantic 1 message */ > #define NUM_MSG_TYPES_REV4 10 /* Number of message types */ 78a89 > #define NUM_MSG_TYPES NUM_MSG_TYPES_REV4 79a91 > 166,167c178,180 < Nat16 sh_flow; /* Flow meter, if present */ < Nat16 sh_fill[2]; /* No data */ --- > Nat16 sh_ctd_temp; /* MicroCat temp at noon */ > Nat16 sh_ctd_cond; /* MicroCat conductivity at noon */ > Nat16 sh_fill; /* Unused */ 170a184,207 > { /* Chemical Buffer for Rev 4 */ > Word ch_type; /* Message type and checksum */ > Byte ch_pco2[CHEM4_SIZE]; /* pCO2 samples */ > Nat16 ch_prr_pitch; /* Pitch from noon PRR sample */ > Nat16 ch_prr_roll; /* Roll from noon PRR sample */ > Nat16 ch_prr_temp; /* Temp from noon 20m PRR sample */ > Nat16 ch_prr_depth; /* Depth from noon 20m PRR sample */ > Nat16 ch_prr_pitch1230; /* Pitch from 1230 PRR sample */ > Nat16 ch_prr_roll1230; /* Roll from 1230 PRR sample */ > Nat16 ch_prr_temp1230; /* Temp from 1230 20m PRR sample */ > Nat16 ch_prr_depth1230; /* Depth from 1230 20m PRR sample */ > Nat16 ch_fill; /* Unused */ > } Chem4Msg; /************************************/ > > typedef struct /************************************/ > { /* Miscellaneous Message Buffer */ > Word ms_type; /* Message type and checksum */ > Nat16 ms_pco2; /* pCO2 calibration and sample time */ > Nat32 ms_oasis; /* OASIS batt, temp, ARGOS batt */ > Byte fl_0m[FLUOR_SIZE]; /* Surface Wetstar samples */ > Nat16 fl_20m[FLUOR20_WORDS]; /* 20m Wetstar samples */ > } Misc4Msg; /************************************/ > > typedef struct /************************************/ 182a220 > Chem4Msg chem4; /* Rev 4 Chem buffer */ 191a230 > Misc4Msg misc4; /* Rev 4 Miscellaneous buffer */ 194a234 > SpecMsg sat1; /* Satlantic 1 message */ 236c276,278 < SAT1_DARK_FILE /* Satlantic 1 Dark file */ --- > SAT1_DARK_FILE, /* Satlantic 1 Dark file */ > SAT1_FILE, /* Satlantic 1 file */ > SPEC_MISC_FILE, /* Pitch, roll, temp, depth from spec*/ diff decode.h /oasis/src/decode.h 110c110,112 < #define SENSORS (GNDFAULT + 1) /* Number of sensors */ --- > #define MICROCAT 35 /* Seabird serial microCat CTD */ > #define GPS_TYPE3 36 /* Garmin GPS receiver */ > #define SENSORS (GPS_TYPE3 + 1) /* Number of sensors */ 167c169 < Nat16 log_type; /* Record type - see below */ --- > Byte log_type; /* Record type - see below */ 170c172 < time_t log_time; /* Record time */ --- > Nat32 log_time; /* Record time */ 172a175,177 > #define LOG_SYNC 0x55 /* Binary sync char */ > #define HDR_SIZE 9 /* sizeof(LogRecHdr) wrong due to pad*/ > 237a243,260 > typedef struct /************************************/ > { /* Struct for METSYS data */ > int arr_type; /* array type */ > int day; /* day */ > int hr; /* hour */ > int min; /* min */ > double batt_volt; /* battery voltage */ > double air; /* Air temp */ > double rh; /* Relative humidity */ > double baro_press; /* Barometric pressure */ > double windspd; /* Wind speed */ > double winddir; /* Wind direction from, deg. mag */ > double windu; /* Calibrated U (east-west) vector */ > double windv; /* Calibrated V (north-south) vector*/ > double buoy_heading; /* Buoy heading, deg. mag */ > double rel_winddir; /* deg. relative to "prop. over box */ > } Metsys; /************************************/ > 239d261 < #define GFIDENTLEN 48 /* Length of buffer for GF ident */ 404a427,429 > #define MAX_GF_CALS 6 /* Max number ground fault channels */ > #define GFIDENTLEN 48 /* Length of buffer for GF ident */ > 408c433 < int raw_offset; /* Offset into raw data */ --- > Int raw_offset; /* Offset into raw data */ 416c441,463 < #define MAX_GF_CALS 6 --- > #define MAX_TSTRING 12 /* Max number Seacats in tstring */ > > typedef struct /************************************/ > { /* Config struct for one TSTRING pod*/ > Int ser_no; /* Instrument serial number */ > Int depth; /* Nominal depth inst. deployed at */ > Int press_flag; /* Pressure sensor,yes=1,no=0 */ > } TStringPodCfg; /************************************/ > > typedef struct /************************************/ > { /* Struct for TSTRING configuration */ > Int numValidPods; /* Number of valid pods in config */ > TStringPodCfg pod[MAX_TSTRING]; /* Cfg for each pod */ > } TStringCfg; /************************************/ > > typedef struct /************************************/ > { /* Struct for TSTRING data */ > Int valid; /* Has valid data */ > double temp; /* Temp */ > double cond; /* Conductivity */ > double press; /* Pressure */ > double jdate; /* yymmm.ttttt */ > } Tstring; /************************************/