GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LSEC / dev > lsec / rhel5-64


Interface   Data Structures   File List   Data Fields   Globals  

event.c File Reference

Routines that handle raw event data. More...

#include <LSEC_p.h>
#include <LSEC/LSEC.h>
#include <LSEC/LSEC_msgs.h>
#include <EDS/EBF_dir.h>
#include <EDS/EBF_edw.h>
#include <EDS/EBF_siv.h>
#include <PBS/MBA.h>
#include <MSG/MSG_pubdefs.h>
#include <string.h>

Classes

struct  _LSEC_event
 Structure holding raw event data. More...

Enumerations

enum  { MAX_OVERHEAD_PER_EVENT = sizeof(EBF_pktHdr) * 8 * 56 }
 Various constants. More...

Functions

void LSEC_eventClear (LSEC_event *evt)
 Clear the stored event data.
LSEC_eventLSEC_eventCreate (int cap, long long *times)
 Create a new event structure.
void LSEC_eventDelete (LSEC_event *evt)
 Delete the previously allocated event structure.
unsigned int * LSEC_eventGet (LSEC_event *evt)
 Get the address of the next stored event.
void LSEC_eventPrepare (LSEC_event *evt)
 Prepare for a new run.
unsigned LSEC_eventProcess (LSEC_event *evt, unsigned int edw, EBF_pkt *pkt)
 Process an event packet.
void LSEC_eventProcSet (LSEC_event *evt, LSEC_eventProcRtn *rtn, void *parm)
 Set the event processing routine to use.
unsigned int * LSEC_eventPut (LSEC_event *evt)
 Get the address of the next event to store.
void LSEC_eventRewind (LSEC_event *evt)
 Rewind the event store reading to the beginning.


Detailed Description

Routines that handle raw event data.

Author:
Owen Saxton
$Id: event.c,v 1.5 2011/03/27 17:47:17 saxton Exp $

Enumeration Type Documentation

anonymous enum

Various constants.

Enumerator:
MAX_OVERHEAD_PER_EVENT  Maximum fragmentation gives 8 pktHdrs and 8 event descriptor words per KB,.


Function Documentation

void LSEC_eventClear ( LSEC_event evt  ) 

Clear the stored event data.

Parameters:
evt Pointer to an event structure.

References _LSEC_event::dir, _LSEC_event::read, _LSEC_event::start, and _LSEC_event::write.

Referenced by LSEC_clearEvent().

LSEC_event* LSEC_eventCreate ( int  cap,
long long *  times 
)

Create a new event structure.

Parameters:
cap The maximum number of events that can be stored.
times Address of the processing times array.
Returns:
A pointer to the new event structure, or NULL if there is insufficient memory available.

References _LSEC_event::blksz, _LSEC_event::end, LSEC_eventDelete(), LSEC_MAX_EVENT_SIZE, MAX_OVERHEAD_PER_EVENT, _LSEC_event::read, _LSEC_event::siv, _LSEC_event::start, _LSEC_event::times, and _LSEC_event::write.

Referenced by LSEC_initialize().

void LSEC_eventDelete ( LSEC_event evt  ) 

Delete the previously allocated event structure.

Parameters:
evt Pointer to allocated, intialised event structure

References _LSEC_event::start.

Referenced by LSEC_eventCreate(), and LSEC_terminate().

unsigned int* LSEC_eventGet ( LSEC_event evt  ) 

Get the address of the next stored event.

This routine return a pointer to the next event and advances the read pointer.

Parameters:
evt Pointer to an event structure
Returns:
Pointer to the next event, or NULL if there are no more events.

References _LSEC_event::blksz, _LSEC_event::read, and _LSEC_event::write.

void LSEC_eventPrepare ( LSEC_event evt  ) 

Prepare for a new run.

Parameters:
evt Pointer to allocated, intialised event structure

References _LSEC_event::count.

Referenced by LSEC_initRun().

unsigned LSEC_eventProcess ( LSEC_event evt,
unsigned int  edw,
EBF_pkt *  pkt 
)

Process an event packet.

This routine is called whenever a new event packet arrives.

Parameters:
evt Pointer to an event structure
edw Description of the event (a thirty-two bit number that indicates, among other things, errors in the event transmission)
pkt Pointer to the event packet
Returns:
The OR of zero or more of the bits:

References _LSEC_event::count, _LSEC_event::dir, LSEC_EVT_DONE, LSEC_TIM_EVT, _LSEC_event::procParm, _LSEC_event::procRtn, _LSEC_event::siv, and _LSEC_event::times.

Referenced by LSEC_processEvent().

void LSEC_eventProcSet ( LSEC_event evt,
LSEC_eventProcRtn rtn,
void *  parm 
)

Set the event processing routine to use.

Parameters:
evt Pointer to an event structure.
rtn Pointer to the processing routine.
parm Parameter to pass to the processing routine.

References _LSEC_event::procParm, and _LSEC_event::procRtn.

Referenced by LSEC_initRun().

unsigned int* LSEC_eventPut ( LSEC_event evt  ) 

Get the address of the next event to store.

This routine return a pointer to the next event that can be stored and advances the write pointer.

Parameters:
evt Pointer to an event structure
Returns:
Pointer to the next event to store, or NULL if the storage area is filled to capacity.

References _LSEC_event::blksz, _LSEC_event::end, and _LSEC_event::write.

Referenced by LSEC_consEventCal().

void LSEC_eventRewind ( LSEC_event evt  ) 

Rewind the event store reading to the beginning.

Parameters:
evt Pointer to an event structure.

References _LSEC_event::read, and _LSEC_event::start.


Generated on Mon Mar 28 10:58:03 2011 by  doxygen 1.5.8