GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCI / V6-1-0 > lci / rhel5-32


Interface   Data Structures   File List   Data Fields   Globals  

Functions
collect.c File Reference

Routines to collect the event data. More...

#include <lci_p.h>
#include <LCI/LCI_msgs.h>
#include <LSEC/LSEC.h>
#include <LSEC/enums.h>
#include <LEM/list.h>
#include <LEM/defs.h>
#include <MSG/MSG_pubdefs.h>
#include <EDS/EBF_pkt.h>
#include <EDS/EBF_edw.h>
#include <LCBD/LCBD_evt.h>
#include <PBS/MBA.h>
#include <PBS/WCT.h>
#include <string.h>
#include <stdio.h>

Functions

void LCI_collClearCounts (LCI_collection *cll)
 Clear collection counters.
void LCI_collCounts (LCI_collection *cll, unsigned int *nWait, unsigned int *nSignal, unsigned int *nTimeout)
 Get collection counters.
LCI_collectionLCI_collCreate (LSEC_control *lsec)
 Allocate and initialise a collection structure.
void LCI_collDelete (LCI_collection *cll)
 Free a structure previously allocated using LCI_collCreate.
unsigned LCI_collect (LCI_collection *cll, unsigned nev, unsigned period)
 Initiate the calibration triggers and wait for each event to be collected and constructed.
unsigned LCI_collected (LCI_collection *cll)
 Get the number of events collected.
void LCI_collRunInit (LCI_collection *cll, LCBD lcbd, LEM_micr *cr)
 Initialize for a new calibration run.
void LCI_collRunTerm (LCI_collection *cll)
 Terminate a calibration run.
void LCI_collTime (LCI_collection *cll, int clear, long long *ctime)
 Return accumulated collection time.

Detailed Description

Routines to collect the event data.

Author:
James Swain & Owen Saxton

$Id: collect.c,v 1.14 2011/03/29 19:32:56 saxton Exp $


Function Documentation

void LCI_collClearCounts ( LCI_collection cll)

Clear collection counters.

This routine calls through to the cue counter clear routine.

Parameters:
cllPointer to an allocated and initialised collection structure that has been used to collect events

References LCI_clearCueCounts().

Referenced by LCI_calibrate().

void LCI_collCounts ( LCI_collection cll,
unsigned int *  nWait,
unsigned int *  nSignal,
unsigned int *  nTimeout 
)

Get collection counters.

This routine calls through to the cue counters get routine, returning the counts accumulated since the last clear.

Parameters:
cllPointer to a collection structure.
nWaitAddress of an integer to receive the number of wait calls, or NULL if not needed.
nSignalAddress of an integer to receive the number of signal calls, or NULL if not needed.
nTimeoutAddress of an integer to receive the number of timeouts, or NULL if not needed.

References LCI_getCueCounts().

Referenced by LCI_terminate().

LCI_collection* LCI_collCreate ( LSEC_control *  lsec)

Allocate and initialise a collection structure.

Parameters:
lsecLSEC access handle.
Returns:
Pointer to an allocated, initialised LCI_collection

References LCI_collDelete(), and LCI_newCue().

Referenced by LCI_newController().

void LCI_collDelete ( LCI_collection cll)

Free a structure previously allocated using LCI_collCreate.

Parameters:
cllPointer to an allocated and initialised LCI_collection structure

References LCI_deleteCue().

Referenced by LCI_collCreate(), and LCI_deleteController().

unsigned LCI_collect ( LCI_collection cll,
unsigned  nev,
unsigned  period 
)

Initiate the calibration triggers and wait for each event to be collected and constructed.

Parameters:
cllPointer to an intialised event collection structure
nevNumber of events to be collected
periodThe period (in 50 ns ticks) between triggers
Return values:
LCI_SUCCESSIf all the expected events were successfully collected
LCI_LOSTEVTIf some of the events were not collected

References LCI_clearCue(), and LCI_waitCue().

unsigned LCI_collected ( LCI_collection cll)

Get the number of events collected.

Parameters:
cllPointer to an allocated and initialised collection structure that has been used to collect events
Returns:
Number of events collected
void LCI_collRunInit ( LCI_collection cll,
LCBD  lcbd,
LEM_micr *  cr 
)

Initialize for a new calibration run.

This routine saves the lcbd and cr pointers and sets up the event callback routine.

Parameters:
cllPointer to a collection structure.
lcbdPointer to the LCB control block,
crPointer to a multi-item command-response list.

Referenced by LCI_calibrate().

void LCI_collRunTerm ( LCI_collection cll)

Terminate a calibration run.

The event callback is set back to its original value.

Parameters:
cllPointer to a collection structure.

Referenced by LCI_terminate().

void LCI_collTime ( LCI_collection cll,
int  clear,
long long *  ctime 
)

Return accumulated collection time.

Parameters:
cllPointer to a collection structure.
clearIf TRUE, clear the time after copying it.
ctimeAddress of a variable to receive the accumulated time taken to do collections, or NULL if no time wanted.

Referenced by LCI_calibrate().