GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> GRBP / V1-0-4 > grbpsiu / rhel6-32


Interface   Data Structures   File List   Data Fields   Globals  

GRBP_messageSchedule.c File Reference

Implementation of the routines controlling the scheduling and updating of the GRBP alert message. More...

#include <GRBP_messageSchedule.h>
#include <GRBP_DB/GRBP_DB_messageSchedule.h>

Defines

#define NULL   ((void *)0)

Functions

static __inline void schedulePrmsPrepare (GRBP_messageSchedulePrms *prms, const GRBP_DB_messageSchedule *cfg)
static __inline void scheduleSuspectPrmsPrepare (GRBP_messageScheduleSuspectPrms *prms, const GRBP_DB_messageScheduleSuspect *cfg)
 Prepares the parameters used in dispatching a GRB suspect message.
static __inline void scheduleConfirmPrmsPrepare (GRBP_messageScheduleConfirmPrms *prms, const GRBP_DB_messageScheduleConfirm *cfg)
 Prepares the parameters used in dispatching a GRB confirmation message.
static __inline void scheduleUpdateListPrmsPrepare (GRBP_messageScheduleUpdateListPrms *prms, const GRBP_DB_messageScheduleUpdateList *cfg)
 Prepares the parameters used in dispatching a list/series of GRB update messages.
static __inline void scheduleCloseoutPrmsPrepare (GRBP_messageScheduleCloseoutPrms *prms, const GRBP_DB_messageScheduleCloseout *cfg)
 Prepares the parameters used in dispatching a GRB closeout schedule.
int GRBP_messageScheduleSizeof (void)
void GRBP_messageScheduleConstruct (GRBP_messageSchedule *schedule, const GRBP_DB_messageSchedule *cfg)
int GRBP_messageScheduleInitiate (GRBP_messageSchedule *schedule, int start_count, double start_time)
 Initiates the message schedule.
int GRBP_messageScheduleConfirmCheck (GRBP_messageSchedule *schedule)
 Updates the delivery schedule and whether the threshold for declaring a GRB confirmation message has been exceeded.
int GRBP_messageScheduleUpdateCheck (GRBP_messageSchedule *schedule, int added, double current_time)
 Checks whether to an GRB update or closeout schedule is due.
void GRBP_messageScheduleReset (GRBP_messageSchedule *schedule)
 Resets the schedule.


Detailed Description

Implementation of the routines controlling the scheduling and updating of the GRBP alert message.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: GRBP_messageSchedule.c,v 1.4 2011/03/30 22:11:51 russell Exp $

Function Documentation

int GRBP_messageScheduleConfirmCheck ( GRBP_messageSchedule schedule  ) 

Updates the delivery schedule and whether the threshold for declaring a GRB confirmation message has been exceeded.

Parameters:
schedule The schedule to check.
This function must be called after GRBP_messageScheduleSuspectCheck or GRBP_scheduleUpdate are called. Both of these function update the current counts. Note that in principle, the confirmation message can be issued simoultaneously with an update or, even more rarely, with a suspect message, so the user must check both. Also note that only one such confirmation may be issued within any GRB message sequence.

printf ("GRBP_messageSchedule:confirm\n");

References _GRBP_messageScheduleConfirmPrms::cnt, _GRBP_messageSchedule::cnt, _GRBP_messageSchedulePrms::confirm, _GRBP_messageSchedule::confirmed, and _GRBP_messageSchedule::prms.

Referenced by confirmCheck().

int GRBP_messageScheduleInitiate ( GRBP_messageSchedule schedule,
int  start_count,
double  start_time 
)

Initiates the message schedule.

Parameters:
schedule The schedule to check.
start_count The number of gammas in the GRB at this time
start_time The GRB start time

printf ("GRBP_messageSchedule:suspect at %f\n", start_time);

References _GRBP_messageSchedule::cnt, _GRBP_messageSchedule::prms, _GRBP_messageSchedule::starttime, _GRBP_messageSchedule::update, _GRBP_messageSchedulePrms::updateList, _GRBP_messageScheduleUpdateListPrms::updates, and _GRBP_messageSchedule::updidx.

Referenced by grbDeclare().

void GRBP_messageScheduleReset ( GRBP_messageSchedule schedule  ) 

int GRBP_messageScheduleUpdateCheck ( GRBP_messageSchedule schedule,
int  added,
double  current_time 
)

Checks whether to an GRB update or closeout schedule is due.

Return values:
-1 Closeout
=0 No action
>0 Update sequence
Parameters:
schedule The schedule to check
added The number of photons added since the last update
current_time The current time

printf ("Update Index: %d\n", updidx);

printf ("GRBP_messageSchedule:closeout\n");

printf ("GRBP_messageScheduleUpdateCheck:updidx = %u\n", updidx);

References _GRBP_messageSchedule::chkcnt, _GRBP_message::chkcnt, _GRBP_messagePrms::closeout, _GRBP_messageScheduleSuspectPrms::cnt, _GRBP_messageScheduleUpdateListPrms::cnt, _GRBP_messageSchedule::cnt, _GRBP_message::elapsed, _GRBP_message::prms, _GRBP_messageSchedule::prms, _GRBP_messageSchedule::starttime, _GRBP_messageSchedulePrms::suspect, _GRBP_messageCloseoutPrms::timeout, _GRBP_messageSchedule::update, _GRBP_message::update, _GRBP_messageSchedulePrms::updateList, _GRBP_messageSchedule::updidx, and _GRBP_message::updidx.

Referenced by updateCheck().

static __inline void scheduleCloseoutPrmsPrepare ( GRBP_messageScheduleCloseoutPrms prms,
const GRBP_DB_messageScheduleCloseout *  cfg 
) [static]

Prepares the parameters used in dispatching a GRB closeout schedule.

Parameters:
prms The closeout schedule parameter block to fill
cfg The closeout schedule parameter configuration block

References _GRBP_messageScheduleCloseoutPrms::timeout.

static __inline void scheduleConfirmPrmsPrepare ( GRBP_messageScheduleConfirmPrms prms,
const GRBP_DB_messageScheduleConfirm *  cfg 
) [static]

Prepares the parameters used in dispatching a GRB confirmation message.

Parameters:
prms The confirmation scheduling parameter block to fill
cfg The confirmation scheduling parameter configuration block

References _GRBP_messageScheduleConfirmPrms::cnt, and _GRBP_messageScheduleConfirmPrms::duration.

static __inline void scheduleSuspectPrmsPrepare ( GRBP_messageScheduleSuspectPrms prms,
const GRBP_DB_messageScheduleSuspect *  cfg 
) [static]

Prepares the parameters used in dispatching a GRB suspect message.

Parameters:
prms The suspect parameter block to fill
cfg The suspect parameter configuration block

static __inline void scheduleUpdateListPrmsPrepare ( GRBP_messageScheduleUpdateListPrms prms,
const GRBP_DB_messageScheduleUpdateList *  cfg 
) [static]

Prepares the parameters used in dispatching a list/series of GRB update messages.

Parameters:
prms The update parameter block to fill
cfg The update parameter configuration block

References _GRBP_messageScheduleUpdateListPrms::cnt, _GRBP_message::cnt, _GRBP_messageScheduleUpdatePrms::timeout, and _GRBP_messageScheduleUpdateListPrms::updates.


Generated on Tue Nov 29 17:29:17 2011 by  doxygen 1.5.8