#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 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.
| 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 353 of file data.old.c.
References AddAscData(), 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, 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.
Referenced by main(), and ProcessTimeFrame().
| 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().
| 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().
| void ProcessAux1Frame | ( | const unsigned char * | frame | ) |
Definition at line 76 of file data.old.c.
References auxiliaryMask, frame2i24, MAX_OSIRIS_CHANNEL, PrintDebug, and SetAuxChannel1().
| int64_t ProcessDataFrame | ( | const unsigned char * | frame | ) |
Identify and process the frame.
| frame | the frame to be analysed and processed |
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.
| 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 | |||
| ) |
Definition at line 101 of file data.old.c.
References Titan2SRType::base, HWConfigType::data, Titan2SRType::div, HWConfig, Titan2SRType::npts, HWConfigType::srExp, and HWConfigType::srObs.
Referenced by ProcessMiscFrame().
| 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.
1.5.6