GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSE / V2-3-0 > qse / sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

QSE_ctxUpdate.c File Reference

Updates the standard event context. More...

#include "LSF/LSF_ids.h"
#include "LSE/LSE_ids.h"
#include "LSE/LSE_timCtb.h"
#include "LSE/LSE_etxCtb.h"
#include "QSE/QSE_evt.h"
#include "QSE/QSE_ctx.h"
#include "QSE/QSE_ctxUpdate.h"
#include "EDS/EBF_dir.h"
#include "EDS/EBF_gem.h"
#include "EDS/EBF_cid.h"
#include "EDS/EBF_ctb.h"
#include <string.h>

Typedefs

typedef int(* Updater )(QSE_ctx *ctx, const LSF_contribution *ctb)
 Call signature for a contribution update routine.

Functions

static void transfer_did (QSD_ctxDid *dst, const LSE_did *src)
 Transfers the datagram identification information from the event datagram to the presentation level.
static void transfer_ctrs (QSE_ctxCounters *ctrs, const LSE_xcr *xcr)
 Transfers the datagram extended counter information from the event datagram to the presentation level.
static __inline
unsigned long long
int 
update64 (unsigned long long ctr, unsigned int new, unsigned int msk)
 Updates the specified 64-bit counter.
static __inline
unsigned long long
int 
update32 (unsigned int ctr, unsigned int new, unsigned int msk)
 Updates the specified 32-bit counter.
static void etxFullOpen (QSE_ctx *ctx, const LSE_etxCtb *etx)
 Opens a new presentation level event context using the information from the event datagram context.
static void etxAbrvOpen (QSE_ctx *ctx, const LSE_etxCtb *etx)
 Opens a new presentation level event context using the information from the event datagram context.
static void timFullUpdate (QSE_ctx *ctx, const LSE_timCtbFull *tim)
 Opens a new presentation level event context using the information from the event datagram context.
static void timAbrvUpdate (QSE_ctx *ctx, const LSE_timCtbAbbreviated *tim)
 Opens a new presentation level event context using the information from the event datagram context.
static void ctx_update (QSE_ctx *ctx, const EBF_gem *gem, unsigned int sequence)
 Updates the information in the presentation level event context using information in the GEM and the trigger sequence number.
void QSE_ctxConstruct (QSE_ctx *ctx)
 Constructs/Initializes the public context structure.
int QSE_ctxUpdateAtRoot (QSE_ctx *ctx, const LSF_contribution *ctb)
 The datagram root contribution handler.
void QSE_ctxUpdateAtContribution (QSE_ctx *ctx, const LSF_contribution *ctb)
 Updates the context based on the contribution.
void QSE_ctxUpdateAtEvent (QSE_ctx *ctx, const QSE_ctxUpdateInfo *info)
 Updates the context based on partially decoded information in event portion of the context.


Detailed Description

Updates the standard event context.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: QSE_ctxUpdate.c,v 1.17 2008/06/09 21:13:09 russell Exp $

Typedef Documentation

int(* Updater)(const LSF_contribution *ctb)

Call signature for a contribution update routine.

Return values:
< 0, Private contribtuion
= 0, Standard contribution
> 0, Event contribution
Parameters:
ctx The context to update
ctb The contribution to use in updating


Function Documentation

static void ctx_update ( QSE_ctx ctx,
const EBF_gem *  gem,
unsigned int  sequence 
) [static]

Updates the information in the presentation level event context using information in the GEM and the trigger sequence number.

Parameters:
ctx The present level event context record to be updated
gem The GEM information for this event;
sequence The trigger event sequence number

void etxAbrvOpen ( QSE_ctx ctx,
const LSE_etxCtb *  etx 
) [static]

Opens a new presentation level event context using the information from the event datagram context.

Parameters:
ctx The present level event context record to be filled
etx The event datagram context contribution
This routine is nothing more than a glorified copy, providing a layer of insulation between the producer of the information (presented in the transport layer representation) and the consumer (presented in the presentation layer representation).

void etxFullOpen ( QSE_ctx ctx,
const LSE_etxCtb *  etx 
) [static]

Opens a new presentation level event context using the information from the event datagram context.

Parameters:
ctx The event context record to be filled
etx The event datagram context contribution
This routine is nothing more than a glorified copy, providing a layer of insulation between the producer of the information (presented in the transport layer representation) and the consumer (presented in the presentation layer representation).

void QSE_ctxConstruct ( QSE_ctx ctx  ) 

Constructs/Initializes the public context structure.

Parameters:
ctx The public context structure

void QSE_ctxUpdateAtContribution ( QSE_ctx ctx,
const LSF_contribution *  ctb 
)

Updates the context based on the contribution.

Parameters:
ctx The event context handle
ctb The datagram contribution used in doing the update

void QSE_ctxUpdateAtEvent ( QSE_ctx ctx,
const QSE_ctxUpdateInfo info 
)

Updates the context based on partially decoded information in event portion of the context.

Parameters:
ctx The event context handle
info The event context update information
This routine requires that GEM and the event sequence number have been committed to the QSE_evt portion of the context

int QSE_ctxUpdateAtRoot ( QSE_ctx ctx,
const LSF_contribution *  ctb 
)

The datagram root contribution handler.

Returns:
==0, if it was successfully handled

!=0, if it was not recognized

Parameters:
ctx The event context handle
ctb The contribution to handle
Note:
To Future Maintainers If a standard contribution every has records, this routine should implement the record scan, either by call LSF_scanRecords or doing the scan locally.

void timAbrvUpdate ( QSE_ctx ctx,
const LSE_timCtbAbbreviated *  tim 
) [static]

Opens a new presentation level event context using the information from the event datagram context.

Parameters:
ctx The present level event context record to be filled
tim The time update contribution, abbreviated version
This routine is nothing more than a glorified copy, providing a layer of insulation between the producer of the information (presented in the transport layer representation) and the consumer (presented in the presentation layer representation).

void timFullUpdate ( QSE_ctx ctx,
const LSE_timCtbFull *  tim 
) [static]

Opens a new presentation level event context using the information from the event datagram context.

Parameters:
ctx The event context record to be filled
tim The time update contribution, full version
For the most part, this is very straightforward, make the current values the previous and make the new values the current. The one exception is that a current timetone message with the NO_MESSAGE bit never replaces the previous. In this case the new message just replaces the current message.
The rational for this is that timetone messages with the NO_MESSAGE bit set are, in fact, fabricated messages. Normally this happens when because of a race condition between the SIU -> EPU timetone message and an event that occurs very near (in time) with the 1-PPS. In this case the EPU will simulate the timetone message (when it discovers the real one has not arrived), marking it with the NO_MESSAGE status bit as simulated. Normally when the real time message arrives, usually in a matter of 100-200usecs after the 1-PPS interrupt, the time, both absolute and GEM 1-PPS strobe values, will match the fabricated message. This is because the timetone message is almost (but not quite) unnecessary. If one was assured that one 1-PPS interrupt to the GEM was ever lost and that the receiving CPU saw events frequently enough such that the 1-PPS interrupt index in the GEM's 1-PPS register did not rollover (7-bits -> 128 seconds), once the absolute time was established (and assuming the GPS lock was maintained so that the 1-PPS interrupt was accurate), the timetone message itself is unnecessary.
The bottom line here is that the time message can, excepting the conditions outlined above, be completely reconstructed on the receiving CPU without any need of the matching timetone message. In almost all cases the actual timetone message amounts to nothing more than a consistency check.

static __inline void transfer_ctrs ( QSE_ctxCounters ctrs,
const LSE_xcr *  xcr 
) [static]

Transfers the datagram extended counter information from the event datagram to the presentation level.

Parameters:
ctrs The presentation level counter information
xcr The event datagram context extended counter record

static __inline void transfer_did ( QSD_ctxDid *  dst,
const LSE_did *  src 
) [static]

Transfers the datagram identification information from the event datagram to the presentation level.

Parameters:
dst The presentation level datagram identification
src The event datagram context contribution

static __inline unsigned int update32 ( unsigned int  ctr,
unsigned int  new,
unsigned int  msk 
) [static]

Updates the specified 32-bit counter.

Returns:
The updated counter
Parameters:
ctr The counter value to update
new The new value of the GEM version of this counter
msk The mask of the significant bits

static __inline unsigned long long int update64 ( unsigned long long  ctr,
unsigned int  new,
unsigned int  msk 
) [static]

Updates the specified 64-bit counter.

Returns:
The updated counter
Parameters:
ctr The counter value to update
new The new value of the GEM version of this counter
msk The mask of the significant bits


Generated on Thu Sep 2 14:54:57 2010 by  doxygen 1.5.3