GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > EFC / V4-1-2

Constituent: filter     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

filter.c File Reference

Driver program to test filtering code. More...

#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include "filter_rto.h"
#include "filter_sdi.h"
#include "GFC_resultDef.h"
#include "EFC/EFA.h"
#include "EFC/GFC_status.h"
#include "EFC/EDM.h"
#include "EFC/EFC.h"
#include "EFC/EFC_edsFw.h"
#include "EFC/EFA_def.h"
#include "EFC/EFS.h"
#include "EFC/EFC_time.h"
#include "EFC/EFR_key.h"
#include "EMP/EMP_hdrdefs.h"
#include "EDS/EDS_fw.h"
#include "EDS/EBF_dir.h"
#include "EDS/EBF_pkt.h"
#include "EDS/EBF_cid.h"
#include "EDS/ECR_cal.h"
#include "EDS/TMR.h"
#include "EDS/FFS.h"
#include "EDS/LCBV.h"
#include "EDS/io/LCBP.h"
#include "EDS/io/EBF_stream.h"
#include "EDS/io/EBF_evts.h"
#include "EFC_DB/EFC_DB_schema.h"
#include "EFC_DB/EH_ids.h"
#include "GFC_DB/GFC_DB_schema.h"
#include "GFC_DB/GAMMA_DB_instance.h"
#include "LSF/LSF_reason.h"
#include "ITC/ITC_pubdefs.h"
#include "IMM/FPM_pubdefs.h"
#include "IMM/RBM_pubdefs.h"
#include "MSG/MSG_pubdefs.h"
#include "PBS/PBS.h"
#include "CDM/CDM_pubdefs.h"
#include "CMX/CMX_lookupPub.h"
#include <string.h>
#include "EFC/GFC.h"
#include "EFC/GFC_resultsPrint.h"
#include "EFC/GFC_statsPrint.h"
#include "EFC/GFC_cfgPrint.h"
#include "EFC/GFC_stats.h"
#include "GFC_def.h"
#include "EDS/EBF_evt.h"
#include "EDS/EBF_mc.h"

Include dependency graph for filter.c:


Data Structures

struct  _FilterResultCtx
 The filter result context, will replace FilterResultCtl. More...
struct  _OutputHandler
 Binds an output routine with its parameter. More...
struct  _FilterCtx
 Structure to bind all the filtering parameters together into something suitable for passing to the LCB event call back handler. More...
struct  _RestartPkt
 Defines an EBF restart packet. More...

Defines

#define CACHE_cleanData(_ptr, _nbytes)
 Macro to move the data from cache to memory and then invalidate the cache. This is a NOP all but VxWorks platforms.

Typedefs

typedef _FilterResultCtx FilterResultCtx
 Typedef for struct _FilterResultCtx.
typedef _OutputHandler OutputHandler
 Typedef for struct _OutputHandler.
typedef _FilterCtx FilterCtx
 Typedef for struct _FilterCtx.
typedef _RestartPkt RestartPkt
 Typedef for struct _RestartPkt.

Functions

static int doFilter (const FilterRto *rto)
 Common routine to do the filtering.
static void * allocate (int nbytes, const char *name)
 Allocates the number of bytes, prints an error message if unsuccessful.
static void free_em (void *ptr)
 Jacketing routine to the free function.
static int createOutput (OutputHandler *output, const char *name, unsigned int options)
 Creates an output file if name is not NULL.
static void start_run (EDS_fw *edsFw, unsigned int handler_mask, unsigned int post_mask)
 Notifies the handlers and posters of the start run.
const EDS_DB_HandlerConstructServices * gfc_constructServicesGet (FilterCtx *ctx)
int main (int argc, char **argv)
 Entry point for filter.
int GRBP_start (FILE *fp, int reason, unsigned int run_id, unsigned int startTime, unsigned int mode, unsigned int hw_key, unsigned int cfg_key)
void GRBP_write (FILE *fp, EDS_fwIxb *ixb)
int GRBP_notify (FILE *fp, unsigned int mode, unsigned int active, const unsigned char cfgs[32], const EDS_rsdTbl *rsdTbl)
int GRBP_flush (FILE *fp, int reason)
static void printOutput (OutputHandler *output, EDS_fwIxb *ixb)
 Prints a 1 line summary of the events that are output.
static int dummyStart (void *prm, unsigned int reason, unsigned int run_id, unsigned int startTime, unsigned int mode, unsigned int hw_key, unsigned int cfg_key)
 Dummy routine to intercept the output events when one does not have a real output routine.
static void dummyWrite (OutputHandler *output, EDS_fwIxb *ixb)
 Dummy routine to intercept the output events when one does not have a real output routine.
static int dummyNotify (void *prm, unsigned int mode, unsigned int active, const unsigned char cfgs[32], const EDS_rsdTbl *rsdTbl)
 Dummy routine to handle mode change notifications to the output stream.
static void dummyFlush (void *prm, int reason)
 Dummy routine to close an output stream.
static __inline unsigned int restart_construct (RestartPkt *restart, const EBF_evt *evt)
 Constructs a template of the packet restart header. This includes both the 8 word header and the 4 word restart cell.
static void streamWrite (OutputHandler *output, EDS_fwIxb *ixb)
 Routine to flush an output stream.
static void streamFlush (OutputHandler *output, int reason)
 Routine to flush an output stream.

Variables

static const EDS_fwPostServices GrbpServices

Detailed Description

Driver program to test filtering code.

Author:
JJRussell - russell@slac.stanford.edu
  CVS $Id: filter.c,v 1.17 2007/12/13 02:39:05 russell Exp $

Function Documentation

static void * allocate int  nbytes,
const char *  name
[static]
 

Allocates the number of bytes, prints an error message if unsuccessful.

Returns:
Pointer to the allocated memory or NULL if unsuccessful.
Parameters:
nbytes The number of bytes to allocate
name The name of the object being allocated

static int createOutput OutputHandler output,
const char *  name,
unsigned int  options
[static]
 

Creates an output file if name is not NULL.

Returns:
Status
Parameters:
output The output handler to fill in
name The name of the output file to create
options Bit list of output options.

static int doFilter const FilterRto rto  )  [static]
 

Common routine to do the filtering.

Parameters:
rto The run time options or control parameters, assumed to be already filled in.
Returns:
Status

void dummyFlush void *  prm,
int  reason
[static]
 

Dummy routine to close an output stream.

Parameters:
prm The user context parameter
reason The reason flush is being called

int dummyNotify void *  prm,
unsigned int  mode,
unsigned int  active,
const unsigned char  cfgs[32],
const EDS_rsdTbl *  rsdTbl
[static]
 

Dummy routine to handle mode change notifications to the output stream.

Parameters:
prm The user context parameter
mode The current mode
active The list of active handlers
cfgs The array of handler configurations
rsdTbl The result summary data table

static int dummyStart void *  prm,
unsigned int  reason,
unsigned int  run_id,
unsigned int  startTime,
unsigned int  mode,
unsigned int  hw_key,
unsigned int  cfg_key
[static]
 

Dummy routine to intercept the output events when one does not have a real output routine.

Parameters:
prm The user context parameter
reason The reason for starting
run_id The run identifier
startTime The start time (in seconds since the SA epoch)
mode The starting mode
hw_key The hardware configuration key
cfg_key The software configuration key

void dummyWrite OutputHandler output,
EDS_fwIxb *  ixb
[static]
 

Dummy routine to intercept the output events when one does not have a real output routine.

Parameters:
output Output context handle
ixb The information exchange block, contains a reference to the event to write plus other event related information

static void free_em void *  ptr  )  [static]
 

Jacketing routine to the free function.

Parameters:
ptr The pointer to free, if NULL, do nothing

main int  argc,
char **  argv
 

Entry point for filter.

Parameters:
argc Standard argument count.
argv Standard vector of command line parameter strings.
Return values:
0,if successful -1, if the file does not exist or some other internal error.
The usage of this routine is self-documenting. Simply type filter with no parameters for its usage.

static void printOutput OutputHandler output,
EDS_fwIxb *  ixb
[static]
 

Prints a 1 line summary of the events that are output.

Parameters:
output The output context handle
ixb The information exchange block

static __inline unsigned int restart_construct RestartPkt restart,
const EBF_evt *  evt
[static]
 

Constructs a template of the packet restart header. This includes both the 8 word header and the 4 word restart cell.

Returns:
Template copy of the Event Builder Word
Parameters:
restart The target restart packet
evt The event to derive the information from

void streamFlush OutputHandler output,
int  reason
[static]
 

Routine to flush an output stream.

Parameters:
output The output context handle
reason The reason flush is being called

void streamWrite OutputHandler output,
EDS_fwIxb *  ixb
[static]
 

Routine to flush an output stream.

Parameters:
output The output context handle
ixb The information exchange block


Variable Documentation

const EDS_fwPostServices GrbpServices [static]
 

Initial value:

{
    (EDS_fwPostStartRtn )GRBP_start,
    (EDS_fwPostWriteRtn )GRBP_write,
    (EDS_fwPostNotifyRtn)GRBP_notify,
    (EDS_fwPostFlushRtn )GRBP_flush
}


Generated on Thu Sep 4 01:45:51 2008 by  doxygen 1.4.4