GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LATC / V9-1-3 > QLATC_report / rhel4-32


Interface   Data Structures   File List   Data Fields   Globals  

QLATC_consume.c File Reference

Host side binary file read functions. More...

#include <LATC/LATC_msgs.h>
#include <consume.h>
#include <data.h>
#include <fi_p.h>
#include <descriptions.ic>
#include <number.ic>
#include <FBS/FBS_pubrtos.h>
#include <MSG/MSG_pubdefs.h>
#include <LEM/msg_macros.h>
#include <fcntl.h>
#include <unistd.h>

Functions

static unsigned consumeNormalFile (File *fp, LATC_imm *imm, LATC_type type)
 Reads a file of mapped data blocks into the LATC structure.
static unsigned consumeDefaultFile (File *fp, LATC_imm *imm)
 Reads a file containing default data (no map) into the LATC structure.
static unsigned consumeAEMFile (File *fp, LATC_imm *imm)
 Reads a file containing AEM data (no map).
static unsigned consumeGEMFile (File *fp, LATC_imm *imm)
 Reads a file containing GEM data (no map).
unsigned QLATC_consumeMap (LATC_map *map, const char *filename)
 Read map data into the map structure.
unsigned QLATC_consume (LATC_imm *imm, char **filelist, int nfiles)
 Reads a configuration, as described by the a list of filenames, into the latc structure.

Variables

static const LATC_type GEM_type [] = {LATC_TAM, LATC_ROI, LATC_TIE, LATC_SCH, -1}
 List of component types that make up the GEM configuration The GEM configuration is made up of several component types. This list is used to collect the data from these components into one file.


Detailed Description

Host side binary file read functions.

Author:
James Swain -- jswain@slac.stanford.edu

Function Documentation

unsigned consumeAEMFile ( File fp,
LATC_imm *  imm 
) [inline, static]

Reads a file containing AEM data (no map).

Parameters:
fp File pointer
imm Pointer to structure to populate with data from the configuration file
Returns:
Error from file_read if there is an error, otherwise LATC_SUCCESS
See also:
readGEMFile, readDefaultFile, writeAEMFile

References file_read(), and sizeofCpt().

Referenced by QLATC_consume().

unsigned consumeDefaultFile ( File fp,
LATC_imm *  imm 
) [inline, static]

Reads a file containing default data (no map) into the LATC structure.

Parameters:
fp File pointer
imm Pointer to structure to populate with data from the configuration file
Returns:
Status from the file_read if an error occurs,
See also:
readGEMFile, readAEMFile, writeDefaultFile

References file_read(), and sizeofCpt().

Referenced by QLATC_consume().

unsigned consumeGEMFile ( File fp,
LATC_imm *  imm 
) [inline, static]

Reads a file containing GEM data (no map).

Parameters:
fp File pointer
imm Pointer to structure to populate with data from the configuration file
Returns:
Error from the file_read, if there is an error, otherwise LATC_SUCCESS

References file_read(), GEM_type, and sizeofCpt().

Referenced by QLATC_consume().

unsigned consumeNormalFile ( File fp,
LATC_imm *  imm,
LATC_type  type 
) [inline, static]

Reads a file of mapped data blocks into the LATC structure.

Parameters:
imm Pointer to the structure to populate with data from the configuration file
fp File pointer
type The file type
Returns:
Status from the file reads (if errors occure) or LATC_SUCCESS

References checkBit(), file_read(), setBit(), sizeofCpt(), and sizeofMap().

Referenced by QLATC_consume().

unsigned QLATC_consume ( LATC_imm *  imm,
char **  filelist,
int  nfiles 
)

Reads a configuration, as described by the a list of filenames, into the latc structure.

Parameters:
imm Pointer to the IMM to repopulate with the configuration information
filelist Array of binary filenames
nfiles Number of files in the filelist
Return values:
LATC_SUCCESS if all goes well
LATC_BADFOPEN if the fid, or any of the names the configuration master file contains, does not match a valid file.
LATC_BADTYPE if the file contains a bad type identifier
LATC_BADREAD if an error occures whilst the file is being read

References consumeAEMFile(), consumeDefaultFile(), consumeGEMFile(), consumeNormalFile(), file_close(), file_open(), and file_read().

Referenced by main().

unsigned QLATC_consumeMap ( LATC_map *  map,
const char *  filename 
)

Read map data into the map structure.

Parameters:
map Map structure to populate from file
filename Name of the file containing the map data
Return values:
LATC_SUCCESS if all goes well
LATC_BADFOPEN if the fid, or any of the names the configuration master file contains, does not match a valid file.
LATC_BADREAD if an error occures whilst the file is being read

References file_close(), file_open(), file_read(), and sizeofMap().


Generated on Sat Apr 9 19:54:01 2011 by  doxygen 1.5.8