GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCI / V6-0-0 > lci / mv2304


Interface   Data Structures   File List   Data Fields   Globals  

collect.c File Reference

Routines to collect the event data. More...

#include "LCI/LCI_msgs.h"
#include "collect_p.h"
#include "enums_p.h"
#include "LSEC/enums.h"
#include "LEM/list.h"
#include "LEM/defs.h"
#include "MSG/MSG_pubdefs.h"
#include "PBS/MBA.h"
#include "PBS/WCT.h"
#include "EDS/EBF_siv.h"
#include "EDS/EBF_cid.h"
#include "EDS/EBF_edw.h"
#include "macros_p.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 (unsigned cap)
 Allocate and initialise an LCI_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 the events to be collected and constructed.
unsigned LCI_collected (LCI_collection *cll)
 Get the number of events collected.
unsigned int LCI_collEventCB (void *prm, unsigned int edw, LCBD_evt *pkt)
 LCI event handler.
EBF_dir * LCI_collGet (LCI_collection *cll)
 Return the directory of the next event (or NULL) and advance the read counter.
void LCI_collRestart (LCI_collection *cll)
 Reset the read counter to 0.
void LCI_collSetCom (LCI_collection *cll, void *lcbd, void *cr)
 Set the communications pointers of the collection structure.
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

Function Documentation

void LCI_collClearCounts ( LCI_collection cll  ) 

Clear collection counters.

This routine calls through to the cue counter clear routine.

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

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:
cll Pointer to a collection structure.
nWait Address of an integer to receive the number of wait calls, or NULL if not needed.
nSignal Address of an integer to receive the number of signal calls, or NULL if not needed.
nTimeout Address of an integer to receive the number of timeouts, or NULL if not needed.

LCI_collection* LCI_collCreate ( unsigned  cap  ) 

Allocate and initialise an LCI_collection structure.

Parameters:
cap Capacity, the maximum number of events that can be collected
Returns:
Pointer to an allocated, initialised LCI_collection

void LCI_collDelete ( LCI_collection cll  ) 

Free a structure previously allocated using LCI_collCreate.

Parameters:
cll Pointer to an allocated and initialised LCI_collection structure

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

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

Parameters:
cll Pointer to an intialised event collection structure
nev Number of events to be collected
period The period (in 50 ns ticks) between triggers
Return values:
LCI_SUCCESS If all the expected events were successfully collected
LCI_LOSTEVT If some of the events were not collected

unsigned LCI_collected ( LCI_collection cll  ) 

Get the number of events collected.

Parameters:
cll Pointer to an allocated and initialised collection structure that has been used to collect events
Returns:
Number of events collected

unsigned int LCI_collEventCB ( void *  prm,
unsigned int  edw,
LCBD_evt *  pkt 
)

LCI event handler.

Copy the packet into the storage area, update the state information vector and compose the directory - on the last packet of the event construct the event

Parameters:
prm Pointer to the LCI_collection structure, passed through the LCBD event handler
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
Return values:
0 Indicates that the packet should be freed by the LCB driver

EBF_dir* LCI_collGet ( LCI_collection cll  ) 

Return the directory of the next event (or NULL) and advance the read counter.

Parameters:
cll Pointer to an allocated and initialised collection
Returns:
Pointer to the directory of the next event, or none if the collection has been exhausted.

void LCI_collRestart ( LCI_collection cll  ) 

Reset the read counter to 0.

Parameters:
cll Pointer to a collection structure

void LCI_collSetCom ( LCI_collection cll,
void *  lcbd,
void *  cr 
)

Set the communications pointers of the collection structure.

The lcbd and cr pointers are void to avoid dragging in LCBD and LEM dependancies

Parameters:
cll Pointer to a collection structure.
lcbd Pointer to the LCB control block,
cr Pointer to a multi-item command-response list.

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

Return accumulated collection time.

Parameters:
cll Pointer to a collection structure.
clear If TRUE, clear the time after copying it.
ctime Address of a variable to receive the accumulated time taken to do collections, or NULL if no time wanted.


Generated on Thu Aug 20 14:53:30 2009 by  doxygen 1.5.3