GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EDS / V2-11-6 > edsd / rad750
#include <EDS/EDSD_unpack.h>
#include <EDS/LCBV.h>
#include <EDS/TMR.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 <PBI/FFS.ih>
#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. |
CVS $Id: EDSD_unpack.c,v 1.8 2011/03/25 22:16:56 russell Exp $
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.
what | A string indentifying the customer | |
nbytes | The number of bytes to allocate |
Referenced by EDSD_unpackConstruct().
static void calc_summary | ( | EDSD_unpackSummary * | summary, | |
const EDSD_unpackResult * | results, | |||
int | nresults, | |||
unsigned int | objects | |||
) | [static] |
Calculates the summary statistics.
summary | Returned as the summary statistics | |
results | The results | |
nresults | The number of results | |
objects | Bit mask of active objects |
References _EDSD_unpackSummary::cnt, EDSD_UNPACK_OBJ_K_CNT, _EDSD_unpackResult::recs, _EDSD_unpackCtl::result, _EDSD_unpackRecord::size, _EDSD_unpackRecord::time, and _EDSD_unpackSummary::tots.
Referenced by EDSD_unpackReport().
int EDSD_unpackConstruct | ( | EDSD_unpackCtl * | ctl, | |
int | nevts, | |||
unsigned int | objects, | |||
LCBV_pktsRngFreeCb | freeRtn, | |||
void * | freePrm | |||
) |
Allocates and initializes the unpacking buffers.
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 |
References _EDSD_unpackCtl::acd, alloc(), _EDSD_unpackCtl::cal, _EDSD_unpackCtl::calCal, _EDSD_unpackCtl::dir, EDSD_UNPACK_OBJ_M_ACD, EDSD_UNPACK_OBJ_M_CAL, EDSD_UNPACK_OBJ_M_DIR, EDSD_UNPACK_OBJ_M_TKR, _EDSD_unpackCtl::freePrm, _EDSD_unpackCtl::freeRtn, _EDSD_unpackCtl::ievts, _EDSD_unpackCtl::nevts, _EDSD_unpackCtl::nobjects, _EDSD_unpackCtl::objects, _EDSD_unpackCtl::result, _EDSD_unpackCtl::results, _EDSD_unpackCtl::siv, and _EDSD_unpackCtl::tkr.
int EDSD_unpackDestruct | ( | EDSD_unpackCtl * | ctl | ) |
DeAllocates and the unpacking buffers.
ctl | Pointer to the control buffer |
References _EDSD_unpackCtl::acd, _EDSD_unpackCtl::cal, _EDSD_unpackCtl::dir, EDSD_UNPACK_OBJ_M_ACD, EDSD_UNPACK_OBJ_M_CAL, EDSD_UNPACK_OBJ_M_DIR, EDSD_UNPACK_OBJ_M_TKR, EDSD_UNPACK_OBJ_M_TOT, _EDSD_unpackCtl::objects, _EDSD_unpackCtl::results, and _EDSD_unpackCtl::tkr.
unsigned int EDSD_unpackProcess | ( | EDSD_unpackCtl * | ctl, | |
unsigned int | edw, | |||
EBF_pkt * | pkt | |||
) |
Loops through the events, printing the contents to stdout.
ctl | Control structure dictating how many and what to print | |
edw | The event descriptor word | |
pkt | The packet to process |
References _EDSD_unpackCtl::acd, _EDSD_unpackCtl::cal, _EDSD_unpackCtl::calCal, _EDSD_unpackCtl::dir, _EDSD_unpackCtl::dirtime, EBF__edwPktSize(), EBF_EBW_LEN_TO_BYTES, EDSD_UNPACK_OBJ_K_ACD, EDSD_UNPACK_OBJ_K_CAL, EDSD_UNPACK_OBJ_K_DIR, EDSD_UNPACK_OBJ_K_TKR, EDSD_UNPACK_OBJ_K_TOT, EDSD_UNPACK_OBJ_M_ACD, EDSD_UNPACK_OBJ_M_CAL, EDSD_UNPACK_OBJ_M_TKR, _EDSD_unpackCtl::freePrm, _EDSD_unpackCtl::freeRtn, _EDSD_unpackCtl::ievts, _EDSD_unpackCtl::nevts, _EDSD_unpackCtl::objects, _EDSD_unpackCtl::pkt, _EDSD_unpackResult::recs, _EDSD_unpackCtl::result, _EDSD_unpackCtl::siv, _EDSD_unpackRecord::size, _EDSD_unpackCtl::size, _EDSD_unpackRecord::time, _EDSD_unpackCtl::tkr, and tkrSize().
void EDSD_unpackReport | ( | const EDSD_unpackCtl * | ctl | ) |
The reporting function.
ctl | The control parameters |
References calc_summary(), EDSD_UNPACK_OBJ_M_EVT, EDSD_UNPACK_OBJ_M_SUM, _EDSD_unpackCtl::nobjects, _EDSD_unpackCtl::objects, print_separator(), print_title(), report_evt_results(), report_summary(), _EDSD_unpackCtl::result, and _EDSD_unpackCtl::results.
int EDSD_unpackSizeof | ( | void | ) |
Returns the size, in bytes, of the control structure.
static void print_separator | ( | int | cnt | ) | [static] |
Prints the separator line of the title bar.
cnt | The number columns to print |
References new_line().
Referenced by EDSD_unpackReport(), and print_title().
static void print_title | ( | const char * | caption, | |
unsigned int | objects | |||
) | [static] |
Prints the title bars for the report summary.
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 |
References EDSD_UNPACK_OBJ_K_CNT, new_line(), and print_separator().
Referenced by EDSD_unpackReport().
static void report_evt_results | ( | const EDSD_unpackResult * | results, | |
int | nresults, | |||
unsigned int | objects | |||
) | [static] |
Reports the event-byt-event results.
results | The results | |
nresults | The number of results | |
objects | Bit mask of active objects |
References EDSD_UNPACK_OBJ_K_CNT, _EDSD_unpackResult::recs, _EDSD_unpackCtl::result, _EDSD_unpackRecord::size, _EDSD_unpackCtl::size, and _EDSD_unpackRecord::time.
Referenced by EDSD_unpackReport().
static void report_summary | ( | const EDSD_unpackSummary * | summary, | |
unsigned int | objects | |||
) | [static] |
Reports the summary statisitics for the specified objects.
summary | The summary statistics | |
objects | Bit mask of objects to report on |
References _EDSD_unpackSummary::cnt, EDSD_UNPACK_OBJ_K_CNT, _EDSD_unpackCtl::nevts, _EDSD_unpackRecord::size, _EDSD_unpackCtl::size, _EDSD_unpackRecord::time, and _EDSD_unpackSummary::tots.
Referenced by EDSD_unpackReport().
static void tkrSize | ( | const EBF_dir * | dir, | |
int * | nLayerEnds, | |||
int * | nStrips | |||
) | [static] |
Count the total number of hit strips.
dir | The directory structure | |
nLayerEnds | The number of active layer ends | |
nStrips | The number of active strips |
References _EDSD_unpackCtl::tkr.
Referenced by EDSD_unpackProcess(), and printSizesSummary().