GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EDS / V2-10-1 > edsd / linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

EDSD_unpack.c File Reference

EDS unpacking demo and test routines, implementation. More...

#include "EDS/EDSD_unpack.h"
#include "EDS/LCBV.h"
#include "EDS/TMR.h"
#include "EDS/FFS.h"
#include "EDS/EBF_cid.h"
#include "EDS/EBF_ctb.h"
#include "EDS/EBF_evt.h"
#include "EDS/EBF_pkt.h"
#include "EDS/EBF_dir.h"
#include "EDS/EBF_siv.h"
#include "EDS/EBF_tem.h"
#include "EDS/EBF_tkr.h"
#include "EDS/EBF_edw.h"
#include "EDS/EDA_cal.h"
#include "EDS/ECR_cal.h"
#include "EDS/EDR_acd.h"
#include "EDS/EDR_acdUnpack.h"
#include "EDS/EDR_cal.h"
#include "EDS/EDR_calUnpack.h"
#include "EDS/EDR_tkr.h"
#include "EDS/EDR_tkrUnpack.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Classes

struct  _EDSD_unpackRecord
 Information about the unpacking of one object. More...
struct  _EDSD_unpackResult
 Information about the unpacking of one event. More...
struct  _EDSD_unpackSummary
 Summary result record. More...
struct  _EDSD_unpackCtl
 Demonstration/test of the basic unpacking routines control block. More...

Typedefs

typedef struct
_EDSD_unpackRecord 
EDSD_unpackRecord
 Typedef for struct _EDSD_unpackRecord.
typedef struct
_EDSD_unpackResult 
EDSD_unpackResult
 Typedef for struct _EDSD_unpackResult.
typedef struct
_EDSD_unpackSummary 
EDSD_unpackSummary
 Typedef for struct _EDSD_unpackSummar.
typedef struct
_EDSD_unpackCtl 
EDSD_unpackCtl
 Typedef for struct _EDSD_unpack.

Functions

static void * alloc (const char *what, int nbytes)
 Attempts to allocate the specified number of bytes and issues an error message if it cannot.
static void tkrSize (const EBF_dir *dir, int *nLayerEnds, int *nStrips)
 Count the total number of hit strips.
static void report_evt_results (const EDSD_unpackResult *results, int nresults, unsigned int objects)
 Reports the event-byt-event results.
static void report_summary (const EDSD_unpackSummary *summary, unsigned int objects)
 Reports the summary statisitics for the specified objects.
static void calc_summary (EDSD_unpackSummary *summary, const EDSD_unpackResult *results, int nresults, unsigned int objects)
 Calculates the summary statistics.
static void print_title (const char *caption, unsigned int objects)
 Prints the title bars for the report summary.
static void print_separator (int cnt)
 Prints the separator line of the title bar.
static void new_line (void)
 Print a new line character.
int EDSD_unpackSizeof (void)
 Returns the size, in bytes, of the control structure.
int EDSD_unpackConstruct (EDSD_unpackCtl *ctl, int nevts, unsigned int objects, LCBV_pktsRngFreeCb freeRtn, void *freePrm)
 Allocates and initializes the unpacking buffers.
int EDSD_unpackDestruct (EDSD_unpackCtl *ctl)
 DeAllocates and the unpacking buffers.
unsigned int EDSD_unpackProcess (EDSD_unpackCtl *ctl, unsigned int edw, EBF_pkt *pkt)
 Loops through the events, printing the contents to stdout.
void EDSD_unpackReport (const EDSD_unpackCtl *ctl)
 The reporting function.


Detailed Description

EDS unpacking demo and test routines, implementation.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: EDSD_unpack.c,v 1.7 2006/02/14 18:36:39 russell Exp $

Function Documentation

static void * alloc ( const char *  what,
int  nbytes 
) [static]

Attempts to allocate the specified number of bytes and issues an error message if it cannot.

Parameters:
what A string indentifying the customer
nbytes The number of bytes to allocate

static void calc_summary ( EDSD_unpackSummary summary,
const EDSD_unpackResult results,
int  nresults,
unsigned int  objects 
) [static]

Calculates the summary statistics.

Parameters:
summary Returned as the summary statistics
results The results
nresults The number of results
objects Bit mask of active objects

int EDSD_unpackConstruct ( EDSD_unpackCtl ctl,
int  nevts,
unsigned int  objects,
LCBV_pktsRngFreeCb  freeRtn,
void *  freePrm 
)

Allocates and initializes the unpacking buffers.

Returns:
Status
Parameters:
ctl Pointer to the control buffer
nevts The number of events to process
objects Which objects to unpack
freeRtn Virtual packet free routine
freePrm Parameter passed to the free routine, likely the LCB device handle

int EDSD_unpackDestruct ( EDSD_unpackCtl ctl  ) 

DeAllocates and the unpacking buffers.

Returns:
Status
Parameters:
ctl Pointer to the control buffer

unsigned int EDSD_unpackProcess ( EDSD_unpackCtl ctl,
unsigned int  edw,
EBF_pkt *  pkt 
)

Loops through the events, printing the contents to stdout.

Parameters:
ctl Control structure dictating how many and what to print
edw The event descriptor word
pkt The packet to process

void EDSD_unpackReport ( const EDSD_unpackCtl ctl  ) 

The reporting function.

Parameters:
ctl The control parameters

int EDSD_unpackSizeof ( void   ) 

Returns the size, in bytes, of the control structure.

Returns:
The size, in bytes, of the control structure

static void print_separator ( int  cnt  )  [static]

Prints the separator line of the title bar.

Parameters:
cnt The number columns to print

static void print_title ( const char *  caption,
unsigned int  objects 
) [static]

Prints the title bars for the report summary.

Returns:
The count of the number of objects in the object list
Parameters:
caption Character string to be used as the caption of the first column (5 or less characters).
objects Bit list of the objects to print

static void report_evt_results ( const EDSD_unpackResult results,
int  nresults,
unsigned int  objects 
) [static]

Reports the event-byt-event results.

Parameters:
results The results
nresults The number of results
objects Bit mask of active objects

static void report_summary ( const EDSD_unpackSummary summary,
unsigned int  objects 
) [static]

Reports the summary statisitics for the specified objects.

Parameters:
summary The summary statistics
objects Bit mask of objects to report on

static void tkrSize ( const EBF_dir *  dir,
int *  nLayerEnds,
int *  nStrips 
) [static]

Count the total number of hit strips.

Parameters:
dir The directory structure
nLayerEnds The number of active layer ends
nStrips The number of active strips


Generated on Fri Feb 26 09:17:00 2010 by  doxygen 1.5.3