data.old.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <ctype.h>
#include <math.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "common.h"

Include dependency graph for data.old.c:

Go to the source code of this file.

Functions

void SetAuxChannel1 (int ch, int32_t val)
 the last segment output in case of ts=
void ProcessAux1Frame (const unsigned char *frame)
void SetAuxChannel2 (int ch, int32_t val)
void FlushDataFiles (void)
 close any open output data file
void FlushNonDataFiles (void)
 close any open output non data file
int CheckContinuity (void)
 Check the continuity of time The time of the current superframe must be the time of the previous superframe shift by the number of expected samples.
void EndSuperFrame (void)
 Reset the data buffers for the next superframe This function is called at the end of a time frame sequence The end of the time frame sequence triggers the action to perform with the data.
int64_t ProcessDataFrame (const unsigned char *frame)
 Identify and process the frame.

Variables

int32_t msf [9][3]
int32_t lastData [MAX_CHANNEL]
int nTitan1 = 0
int nTitan2 = 0
int lastFormat = -1
struct Titan2TimeType lastFrameTime = {0, 0}
int64_t lastSegment = 0


Function Documentation

int CheckContinuity ( void   ) 

Check the continuity of time The time of the current superframe must be the time of the previous superframe shift by the number of expected samples.

We also check that the number of samples received equals the number of sample expected. If there is a discontinuity, the appropriate callback is invoked. It should close the open data file and issue a message.

Returns:
-1 if there is a time discontinuity, 0 if not

Definition at line 146 of file data.old.c.

References Titan2SRType::base, ChangeStreamConfig(), currentFile, currentTime, HWConfigType::data, DiffTimeT2T1(), Titan2SRType::div, extractingData, HWConfigType::formatVersion, HWConfig, ignoreDiscontinuity, lastData, LogPrint(), MAX_CHANNEL, MAX_OSIRIS_CHANNEL, Titan2SRType::npts, nTitan1, nTitan2, PrintDebug, PrintError, PrintMessages(), PrintWarning, seeking, HWConfigType::srExp, HWConfigType::srObs, StrTime(), threshold, titan2File, and Titan2TimeType::usecond.

Here is the call graph for this function:

void EndSuperFrame ( void   ) 

void FlushDataFiles ( void   ) 

close any open output data file

Definition at line 111 of file data.old.c.

References CloseAscFile(), CloseFullSeg2File(), CloseGifFile(), CloseMSeedFile(), CloseSacFile(), CloseSeg2File(), CloseSegyFile(), CloseSisFile(), CloseTitFile(), CloseWavFile(), MAX_CHANNEL, and Titan2TimeType::usecond.

Referenced by EndSuperFrame(), main(), MainCleanUp(), NextFile(), and ProcessTimeFrame().

Here is the call graph for this function:

void FlushNonDataFiles ( void   ) 

close any open output non data file

Definition at line 132 of file data.old.c.

References CloseCacheFile(), CloseTimeFile(), HWConfigType::fieldIdent, and oldHWConfig.

Referenced by EndSuperFrame(), main(), MainCleanUp(), and ProcessTimeFrame().

Here is the call graph for this function:

void ProcessAux1Frame ( const unsigned char *  frame  ) 

Definition at line 76 of file data.old.c.

References auxiliaryMask, frame2i24, MAX_OSIRIS_CHANNEL, PrintDebug, and SetAuxChannel1().

Here is the call graph for this function:

int64_t ProcessDataFrame ( const unsigned char *  frame  ) 

Identify and process the frame.

Parameters:
frame the frame to be analysed and processed
Returns:
a bit mask representing the channels contained in the frame

Definition at line 617 of file data.old.c.

References HWConfigType::absOffset, auxiliaryMask, Titan2SRType::base, channelMask, currentFile, DAT0_FRAME, DAT1_FRAME, DAT2_FRAME, HWConfigType::data, Titan2SRType::div, extracting, HWConfigType::formatVersion, frame2i24, HWConfig, lastData, MAX_CHANNEL, MAX_SAMPLE, msf, Titan2SRType::npts, nTitan1, nTitan2, PrintDebug, PrintError, PrintWarning, ProcessAux1Frame(), HWConfigType::srExp, HWConfigType::srObs, StrFrame(), titan2File, and HWConfigType::trigger.

Here is the call graph for this function:

void SetAuxChannel1 ( int  ch,
int32_t  val 
)

the last segment output in case of ts=

Definition at line 67 of file data.old.c.

References Titan2SRType::base, HWConfigType::data, Titan2SRType::div, HWConfig, Titan2SRType::npts, HWConfigType::srExp, and HWConfigType::srObs.

Referenced by ProcessAux1Frame().

void SetAuxChannel2 ( int  ch,
int32_t  val 
)


Variable Documentation

int32_t lastData[MAX_CHANNEL]

Initial value:

{
        0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0
}

Definition at line 49 of file data.old.c.

int lastFormat = -1

Definition at line 58 of file data.old.c.

struct Titan2TimeType lastFrameTime = {0, 0}

Definition at line 60 of file data.old.c.

int64_t lastSegment = 0

Definition at line 62 of file data.old.c.

int32_t msf[9][3]

Initial value:

 {
        { 0, 0, 0 },
        { 0xffffff, 1, 8 },
        { 0x000fff, 12, 20 },
        { 0x0000ff, 8, 24 },
        { 0x00003f, 6, 26 },
        { 0, 0, 0 },
        { 0x00000f, 4, 28 },
        { 0, 0, 0 },
        { 0x000007, 3, 29 }
}

Definition at line 37 of file data.old.c.

int nTitan1 = 0

Definition at line 57 of file data.old.c.

int nTitan2 = 0

Definition at line 57 of file data.old.c.


Generated on Tue Jul 22 23:11:56 2008 for Titan2Reader by  doxygen 1.5.6