#include <stdio.h>#include <ctype.h>#include <stdlib.h>#include <unistd.h>#include <time.h>#include <string.h>#include <assert.h>#include <sys/types.h>#include "common.h"
Go to the source code of this file.
Functions | |
| int | AddString (FILE *f, char *str) |
| int | WriteFileDescriptorBlock (FILE *f) |
| Only Write File descriptor Block. | |
| int | UpdateFileDescriptorBlock (FILE *f, int channelS0) |
| UPDATE FILE DESCRIPTOR BLOCK WHEN ADDING A CHANNEL. | |
| int | WriteTraceDescriptorBlock (FILE *f, int channel) |
| write a SEG-2 file descriptor block | |
| FILE * | OpenFullSeg2 (char *path, int channel) |
| FILE * | OpenSeg2Channel (int channel) |
| open an seg2 file for output | |
| void | AppendChannelToSeg2File (int channel, FILE *fid) |
| Function exact copy Only data are written in the file identified by fid the data after TraceDescriptorBlock in the file identified by seg2File. | |
| void | CloseFullSeg2File () |
| void | CloseSeg2File (int channel) |
| end a SEG2 channel file The seg2 header is updated according to the previous information structure | |
| void | AbortSeg2File (int channel) |
| cancel a SEG2 channel file | |
| void | AddSeg2Data (int channel) |
| process one channel | |
Variables | |
| FILE * | seg2ChannelFile [MAX_CHANNEL] |
| char | seg2ChannelFileName [MAX_CHANNEL][128] |
| int | KFULLSEG = 1 |
| FILE * | seg2File = NULL |
| char | seg2FileName [128] |
| int | NbrChan = 0 |
| int | CurChan = 0 |
| void AbortSeg2File | ( | int | channel | ) |
cancel a SEG2 channel file
| channel | the channel to cancel |
Definition at line 453 of file seg2.c.
References PrintDebug, seg2ChannelFile, and seg2ChannelFileName.
Referenced by AddSeg2Data().
| void AddSeg2Data | ( | int | channel | ) |
process one channel
Definition at line 466 of file seg2.c.
References AbortSeg2File(), HWConfigType::data, HWConfig, infoHeader, InfoHeaderType::npts, Titan2SRType::npts, OpenSeg2Channel(), PrintError, seg2ChannelFile, seg2ChannelFileName, HWConfigType::srExp, and HWConfigType::srObs.
Referenced by EndSuperFrame().
| int AddString | ( | FILE * | f, | |
| char * | str | |||
| ) |
Definition at line 58 of file seg2.c.
Referenced by WriteFileDescriptorBlock(), and WriteTraceDescriptorBlock().
| void AppendChannelToSeg2File | ( | int | channel, | |
| FILE * | fid | |||
| ) |
Function exact copy Only data are written in the file identified by fid the data after TraceDescriptorBlock in the file identified by seg2File.
Definition at line 368 of file seg2.c.
References infoHeader, and seg2File.
Referenced by CloseSeg2File().
| void CloseFullSeg2File | ( | void | ) |
| void CloseSeg2File | ( | int | channel | ) |
end a SEG2 channel file The seg2 header is updated according to the previous information structure
| channel | the channel to close |
Definition at line 396 of file seg2.c.
References AppendChannelToSeg2File(), CurChan, FileName(), fileNameOptions, KFULLSEG, NbrChan, noWrite, OpenFullSeg2(), PrintError, Rename(), seg2ChannelFile, seg2ChannelFileName, seg2File, UpdateFileDescriptorBlock(), UpdateInfoHeader(), and WriteTraceDescriptorBlock().
Referenced by FlushDataFiles().
| FILE* OpenFullSeg2 | ( | char * | path, | |
| int | channel | |||
| ) |
Definition at line 311 of file seg2.c.
References ADD_CHANNEL_CODE, ADD_NETWORK_CODE, FileName(), fileNameOptions, KFULLSEG, PrintLog, seg2File, and WriteFileDescriptorBlock().
Referenced by CloseSeg2File().
| FILE* OpenSeg2Channel | ( | int | channel | ) |
open an seg2 file for output
| channel | the channel number |
Definition at line 338 of file seg2.c.
References FILE_BUFFER_SIZE, InitInfoHeader(), NbrChan, OpenTempFile(), PrintError, seg2ChannelFile, and seg2ChannelFileName.
Referenced by AddSeg2Data().
| int UpdateFileDescriptorBlock | ( | FILE * | f, | |
| int | channelS0 | |||
| ) |
UPDATE FILE DESCRIPTOR BLOCK WHEN ADDING A CHANNEL.
| f | : the file to write to | |
| channelS0 | : the ieme channel to process,(first processed channel is 0) |
Definition at line 194 of file seg2.c.
Referenced by CloseSeg2File().
| int WriteFileDescriptorBlock | ( | FILE * | f | ) |
Only Write File descriptor Block.
| f | the file to write to |
Definition at line 83 of file seg2.c.
References AddString(), correctedTime, infoHeader, and NbrChan.
Referenced by OpenFullSeg2().
| int WriteTraceDescriptorBlock | ( | FILE * | f, | |
| int | channel | |||
| ) |
write a SEG-2 file descriptor block
| f | the file to write to | |
| channel | the channel to process : number between zero and MAX_CHANNEL |
Definition at line 222 of file seg2.c.
References AddString(), Titan2SRType::base, currentFile, HWConfigType::gain, HWConfig, infoHeader, HWConfigType::LSB, InfoHeaderType::npts, HWConfigType::selectedGain, and InfoHeaderType::sr.
Referenced by CloseSeg2File().
| int CurChan = 0 |
| int KFULLSEG = 1 |
| int NbrChan = 0 |
Definition at line 55 of file seg2.c.
Referenced by CloseFullSeg2File(), CloseSeg2File(), OpenSeg2Channel(), and WriteFileDescriptorBlock().
| FILE* seg2ChannelFile[MAX_CHANNEL] |
Initial value:
{
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
}
Definition at line 39 of file seg2.c.
Referenced by AbortSeg2File(), AddSeg2Data(), CloseSeg2File(), and OpenSeg2Channel().
| char seg2ChannelFileName[MAX_CHANNEL][128] |
Definition at line 47 of file seg2.c.
Referenced by AbortSeg2File(), AddSeg2Data(), CloseSeg2File(), and OpenSeg2Channel().
| FILE* seg2File = NULL |
Definition at line 53 of file seg2.c.
Referenced by AppendChannelToSeg2File(), CloseFullSeg2File(), CloseSeg2File(), and OpenFullSeg2().
| char seg2FileName[128] |
1.5.6