00001 00002 /* 00003 * THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE 00004 * CHECKED IT OUT USING THE COMMAND CHECKOUT. 00005 * 00006 * $Id: data__buf_8h-source.html 2161 2006-05-19 16:55:03Z paulf $ 00007 * 00008 * Revision history: 00009 * $Log$ 00009 * Revision 1.1 2006/05/19 16:55:01 paulf 00009 * first inclusion 00009 * 00010 * Revision 1.1 2000/02/14 20:05:54 lucky 00011 * Initial revision 00012 * 00013 * 00014 */ 00015 00016 #ifndef DATA_BUF_H 00017 #define DATA_BUF_H 00018 /* 00019 File DATA_BUF.H 00020 00021 EARTHWORM PROJECT 00022 2/9/93 00023 5/95 modified to include pin numbers 00024 00025 Header file containing Waveform Data Buffer Format 00026 00027 Background: 00028 00029 In earthworm, there are global parameter files which all modules 00030 will have access to. The Data Source parameter file will contain the 00031 channel-station name/component association, 00032 skew, 00033 data sample format code, 00034 and other relevant parameters of the data source. 00035 00036 00037 Waveform Data Buffer Header 00038 00039 Time Stamp Two 4 byte words - first=the number 00040 of seconds since some specified date. 00041 second=the no. of microseconds past 00042 the last second. 00043 Scan Count of first scan of buffer 4 bytes 00044 Series 2 bytes - incremented each time 00045 a data source is started. 00046 Digitization Rate Two 2 byte integers - 00047 first integer = length of standard 00048 interval in seconds 00049 second integer = the number of samples 00050 per interval. 00051 Data Source Module ID byte 00052 Error Byte byte 00053 No of Channels 2 bytes 00054 No of scans per buffer 2 bytes 00055 Network Identifier 2 bytes 00056 00057 00058 Header is followed by nchan pin numbers, expressed as two-byte integers. 00059 The waveform data, in multiplexed format, follows the pin numbers. 00060 */ 00061 00062 /* This defines the message type 00063 ******************************/ 00064 #define MSG_TYPE_TRACE_DATA 1 00065 00066 typedef struct { 00067 long tssec; /* Time stamp - seconds */ 00068 long tsmic; /* Time stamp - microsecs past the last sec */ 00069 unsigned long first_scan; /* Number of first scan in buffer */ 00070 short series; /* Incremented each time data source starts */ 00071 short sample_dt; /* Length of standard interval in seconds */ 00072 short nsample; /* Number of samples per this interval */ 00073 char mod_id; /* Data source module id */ 00074 char padding; 00075 unsigned short errors; /* Error word */ 00076 short nchan; /* Number of channels */ 00077 short nscan; /* Number of scans per buffer */ 00078 short netid; /* Network identifier */ 00079 } WF_HEADER; 00080 00081 /* Below are bits to be set in the error word 00082 ******************************************/ 00083 #define AD_TIME_BAD 1 00084 #define AD_GUIDE1_BAD 2 00085 #define AD_GUIDE2_BAD 4 00086 #define AD_GUIDE3_BAD 8 00087 #define AD_GUIDE4_BAD 16 00088 #define AD_DKWRERR 32 00089 #define AD_NI_ERR 64 00090 #define AD_NEW_YEAR 128 00091 00092 #endif