#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"
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 |
| 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.
Definition at line 147 of file data.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.
Referenced by EndSuperFrame().
| 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.
We eventually flush the buffers.
Definition at line 354 of file data.c.
References AddAscData(), AddBinData(), AddGifData(), AddMSeedData(), AddSacData(), AddSeg2Data(), AddSegyData(), AddSisData(), AddTriggerData(), AddWavData(), auxiliaryMask, beginWindow, CachePrintCST(), channelMask, CheckContinuity(), CloseInput(), correctedTime, currentTag, currentTime, cutDtOnReset, HWConfigType::data, dataExtracted, DEFAULT_SERIAL, DEFAULT_STATION, endWindow, extractAsc, extractBin, extractGif, Extracting, extractingData, extractMSeed, extractSac, extractSeg2, extractSegy, extractSis, extractTit, extractTrig, extractWav, HWConfigType::fieldIdent, FlushDataFiles(), FlushNonDataFiles(), HWConfigType::formatVersion, HWConfig, infoHeader, InWindow(), lastData, lastFormat, lastSegment, manualStationName, MAX_CHANNEL, minSamplesPerFrame, NextWindow(), Titan2SRType::npts, nTitan1, nTitan2, oldHWConfig, onlyTag, PrintDebug, PrintLog, PrintWarning, ResetTimes(), scanAll, HWConfigType::serialNumber, HWConfigType::srExp, HWConfigType::srObs, StrTime(), timeList, timeSegment, and Titan2TimeType::usecond.
| void FlushDataFiles | ( | void | ) |
close any open output data file
Definition at line 111 of file data.c.
References CloseAscFile(), CloseBinFile(), CloseFullSeg2File(), CloseGifFile(), CloseMSeedFile(), CloseSacFile(), CloseSeg2File(), CloseSegyFile(), CloseSisFile(), CloseTitFile(), CloseWavFile(), MAX_CHANNEL, and Titan2TimeType::usecond.
| void FlushNonDataFiles | ( | void | ) |
close any open output non data file
Definition at line 133 of file data.c.
References CloseCacheFile(), CloseTimeFile(), HWConfigType::fieldIdent, and oldHWConfig.
| void ProcessAux1Frame | ( | const unsigned char * | frame | ) |
Definition at line 76 of file data.c.
References auxiliaryMask, frame2i24, MAX_OSIRIS_CHANNEL, PrintDebug, and SetAuxChannel1().
Referenced by ProcessDataFrame().
| int64_t ProcessDataFrame | ( | const unsigned char * | frame | ) |
| void SetAuxChannel1 | ( | int | ch, | |
| int32_t | val | |||
| ) |
the last segment output in case of ts=
Definition at line 67 of file data.c.
References Titan2SRType::base, HWConfigType::data, Titan2SRType::div, HWConfig, Titan2SRType::npts, HWConfigType::srExp, and HWConfigType::srObs.
| void SetAuxChannel2 | ( | int | ch, | |
| int32_t | val | |||
| ) |
Definition at line 101 of file data.c.
References Titan2SRType::base, HWConfigType::data, Titan2SRType::div, HWConfig, Titan2SRType::npts, HWConfigType::srExp, and HWConfigType::srObs.
| 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.c.
Referenced by CheckContinuity(), EndSuperFrame(), and ProcessDataFrame().
| int lastFormat = -1 |
| struct Titan2TimeType lastFrameTime = {0, 0} |
| int64_t lastSegment = 0 |
| 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.c.
Referenced by ProcessDataFrame().
| int nTitan1 = 0 |
Definition at line 57 of file data.c.
Referenced by CheckContinuity(), EndSuperFrame(), and ProcessDataFrame().
| int nTitan2 = 0 |
Definition at line 57 of file data.c.
Referenced by CheckContinuity(), EndSuperFrame(), and ProcessDataFrame().
1.5.6