GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LSEC / V7-1-1 > lsec / rhel6-64
#include <LSEC_p.h>
#include <LSEC/LSEC.h>
#include <LSEC/LSEC_ctx.h>
#include <LSEC/LSEC_msgs.h>
#include <LSE/LSEW_dgmFw.h>
#include <EDS/EBF_cid.h>
#include <EDS/EBF_dir.h>
#include <EDS/EBF_edw.h>
#include <EDS/EBF_gemLocate.h>
#include <EDS/EBF_siv.h>
#include <EDS/EBF_tem.h>
#include <EDS/EBF_tkr.h>
#include <ITC/ITC_pubdefs.h>
#include <PBS/BSWP.h>
#include <PBS/FPA.h>
#include <PBS/MBA.h>
#include <PBS/SEM.h>
#include <PBS/WCT.h>
#include <MSG/MSG_pubdefs.h>
#include <string.h>
Classes | |
| struct | _LSEC_consignment |
| Structure holding processed event data. More... | |
Typedefs | |
| typedef enum _LSEC_cnsState | LSEC_cnsState |
| Consignment state. | |
| typedef unsigned | LSEC_consignRtn (LSEC_consignment *cns) |
| Definition of routine to perform the consignment. | |
Enumerations | |
| enum | _LSEC_cnsState { LSEC_CNS_EMPTY = 0, LSEC_CNS_FULL = 1 } |
| Consignment state. More... | |
| enum | { DATAGRAM_SIZE = 1024 * 128, MAX_EVENT_SIZE = 26500, MAX_CAL_EVENT_SIZE = 6530 + 10, MAX_TKR_EVENT_SIZE = 6594 + 10, SSR_APID_BASE = 0x3c5, EVT_CELL_SIZE = 4, EVT_CELL_MASK = EVT_CELL_SIZE - 1 } |
| Various constants. | |
Functions | |
| LSEC_consignment * | LSEC_consCreate (unsigned cpuid, unsigned srcid, unsigned cap, LSEC_compaction *cpc, LSEC_event *evt, long long *times) |
| Create a new consignment. | |
| LSEC_ctx * | LSEC_consCtxGet (LSEC_consignment *cns) |
| Get the address of the context structure. | |
| void | LSEC_consDelete (LSEC_consignment *cns) |
| Free the previously allocated consignment structure. | |
| unsigned | LSEC_consEventCal (void *parm, EBF_dir *dir) |
| Process a compressed CAL event. | |
| unsigned | LSEC_consEventImm (void *parm, EBF_dir *dir) |
| Process an event immediately. | |
| void | LSEC_consPrepare (LSEC_consignment *cns, unsigned runid, unsigned mode, LSEC_compLevel comp) |
| Prepare for a new calibration run. | |
| unsigned | LSEC_consProcess (LSEC_consignment *cns) |
| Process a consignment. | |
| void | LSEC_consReason (LSEC_consignment *cns, int reason) |
| Set the current datagram close reason. | |
$Id: consign.c,v 1.5 2011/03/27 17:45:33 saxton Exp $
| enum _LSEC_cnsState |
| LSEC_consignment* LSEC_consCreate | ( | unsigned | cpuid, | |
| unsigned | srcid, | |||
| unsigned | cap, | |||
| LSEC_compaction * | cpc, | |||
| LSEC_event * | evt, | |||
| long long * | times | |||
| ) |
Create a new consignment.
This routine allocates memory for a consigment structure and its associated data structures, and initialises it.
| srcid | ID of the data source | |
| cpuid | ID of the CPU the calibration is being run on | |
| cap | The capacity (in events) of the consignment | |
| cpc | Pointer to the compaction state information | |
| evt | Pointer to the event store | |
| times | Pointer to the processing times array. |
References _LSEC_consignment::acdFw, _LSEC_consignment::buf, _LSEC_consignment::calFw, _LSEC_consignment::cpc, _LSEC_consignment::ctx, _LSEC_consignment::evt, _LSEC_consignment::fpa, LSEC_consDelete(), LSEC_ID_CALIB_ACD, LSEC_ID_CALIB_CAL, LSEC_ID_CALIB_TKR, _LSEC_consignment::sentSem, _LSEC_consignment::times, and _LSEC_consignment::tkrFw.
Referenced by LSEC_initialize().
| LSEC_ctx* LSEC_consCtxGet | ( | LSEC_consignment * | cns | ) |
Get the address of the context structure.
| cns | Pointer to the consignment structure |
References _LSEC_consignment::ctx.
Referenced by LSEC_getCtx(), and LSEC_initialize().
| void LSEC_consDelete | ( | LSEC_consignment * | cns | ) |
Free the previously allocated consignment structure.
| cns | Pointer to allocated, intialised consignment structure |
References _LSEC_consignment::acdFw, _LSEC_consignment::buf, _LSEC_consignment::calFw, _LSEC_consignment::ctx, _LSEC_consignment::fpa, _LSEC_consignment::sentSem, and _LSEC_consignment::tkrFw.
Referenced by LSEC_consCreate(), and LSEC_terminate().
| unsigned LSEC_consEventCal | ( | void * | parm, | |
| EBF_dir * | dir | |||
| ) |
Process a compressed CAL event.
This routine starts the process by accumulating data for the CAL means calculation.
| parm | Pointer to the consignment structure | |
| dir | Pointer to the event directory |
| LSEC_SUCCESS | Success (always) |
References _LSEC_consignment::cpc, _LSEC_consignment::evt, LSEC_accumCalMeans(), and LSEC_eventPut().
Referenced by LSEC_initRun().
| unsigned LSEC_consEventImm | ( | void * | parm, | |
| EBF_dir * | dir | |||
| ) |
Process an event immediately.
This routine is used to pass an event immediately to the datagram framework. It is used in all cases except compressed CAL events.
| parm | Pointer to the consignment structure | |
| dir | Pointer to the event directory |
| LSEC_SUCCESS | Success | |
| LSEC_OVERSIZE | Event too large for a datagram |
References _LSEC_consignment::evtErr, and _LSEC_consignment::fw.
Referenced by LSEC_initRun().
| void LSEC_consPrepare | ( | LSEC_consignment * | cns, | |
| unsigned | runid, | |||
| unsigned | mode, | |||
| LSEC_compLevel | comp | |||
| ) |
Prepare for a new calibration run.
This routine sets the runid and start time for the first datagram of a new calibration, as well as several other mode-dependent parameters.
| cns | Pointer to allocated, intialised consignment structure | |
| runid | 32-bit number identifying the calibration run | |
| mode | The calibration mode (ACD, CAL or TKR) | |
| comp | The compression level (normal, only, none) |
References _LSEC_consignment::acdFw, _LSEC_consignment::calFw, _LSEC_consignment::comp, _LSEC_consignment::consign, _LSEC_consignment::cpc, _LSEC_consignment::ctxId, _LSEC_consignment::ctxSize, _LSEC_consignment::dgmQued, _LSEC_consignment::dgmSent, _LSEC_consignment::fw, LSEC_clearCalCompaction(), LSEC_COMP_NONE, LSEC_COMP_NORM, LSEC_COMP_ONLY, LSEC_ID_CALIB_ACD_CTX, LSEC_ID_CALIB_CAL_CTX, LSEC_ID_CALIB_TKR_CTX, and _LSEC_consignment::tkrFw.
Referenced by LSEC_initRun().
| unsigned LSEC_consProcess | ( | LSEC_consignment * | cns | ) |
Process a consignment.
| cns | Pointer to a consignment structure |
| LSEC_SUCCESS | If all goes well |
References _LSEC_consignment::comp, _LSEC_consignment::consign, _LSEC_consignment::dgmQued, _LSEC_consignment::dgmSent, _LSEC_consignment::fw, LSEC_COMP_NORM, LSEC_TIM_SND, _LSEC_consignment::reason, _LSEC_consignment::sentSem, and _LSEC_consignment::times.
Referenced by LSEC_consign().
| void LSEC_consReason | ( | LSEC_consignment * | cns, | |
| int | reason | |||
| ) |
Set the current datagram close reason.
| cns | Pointer to the consignment structure | |
| reason | The reason code to be set |
References _LSEC_consignment::reason.
Referenced by LSEC_setReason().
1.5.8