GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LIM / V1-22-4 > lim / mv2304


Interface   Data Structures   File List   Data Fields   Globals  

LIM_arr.c File Reference

Handle ARR mode observations. More...

#include <string.h>
#include <CCSDS/CCSDS_pkt.h>
#include <ITC/ITC_pubdefs.h>
#include <LIM/LIM_cmddefs.h>
#include <LIM/LIM_msgs.h>
#include <LIM/LIM_pubdefs.h>
#include <MSG/MSG_pubdefs.h>
#include <PBS/MBA.h>
#include <PBS/WUT.h>
#include <LIM_action.h>
#include <LIM_arr.h>
#include <LIM_bulk.h>
#include <LIM_gbm.h>
#include <LIM_lpa.h>
#include <LIM_pkt_send.h>
#include <LIM_sc.h>
#include <LIM_task.h>

Classes

struct  _LIM_Arr
 State information for an ARR observation object. More...

Defines

#define LIM_ARR_VALID_KEY   (('L'<<24)+('A'<<16)+('R'<<8)+'R')
 Value that indicates the ARR observation object state is valid.

Functions

static unsigned int lim_arr_check (LIM_Arr *object_p)
 Validate an ARR observation object pointer.
static WUT_cb_status lim_arr_wut_handler (void *prm, WUT_tmr *wut)
 Handle GRB timer expiration.
static unsigned int lim_arr_change_grb_state (LIM_Arr *object_p, int new_state)
 Change the GRB state of an object.
static unsigned int lim_arr_set_grb_idle (LIM_Arr *object_p)
 Set an object to the IDLE GRB state.
static unsigned int lim_arr_set_grb_0 (LIM_Arr *object_p, LIM_Operating_Mode op_mode)
 Set an object to the GRB 0 state.
unsigned int LIM_arr_new (LIM_Arr **object_pp, LIM_Task *task_p, LIM_Action *action_p, LIM_Gbm *gbm_p, LIM_Sc *sc_p, LIM_Lpa *lpa_p, LIM_Bulk *bulk_p, const LIM_DB_Schema *db_p)
 Create and initialize a new ARR observation object.
unsigned int LIM_arr_delete (LIM_Arr *object_p)
 Shutdown and delete a ARR observation object.
int LIM_arr_is_ready (LIM_Arr *object_p)
 Return the READY status of an ARR observation.
LIM_Grb_State LIM_arr_grb_state (LIM_Arr *object_p)
 Return the GRB state of an ARR observation.
unsigned int LIM_arr_get_info (LIM_Arr *object_p, LIM_Info *info_p)
 Return ARR observation information.
unsigned int LIM_arr_handle_abort (LIM_Arr *object_p, const ITC_QueueItem *qitem_p)
 Handle an ARR-Abort command.
static unsigned int lim_arr_handle_grb_active (LIM_Arr *object_p, LIM_Lpa_Mode grb_mode)
 Perform activity for an 'active' GRB state.
unsigned int LIM_arr_handle_activity (LIM_Arr *object_p)
 Handle ARR observation activity.
unsigned int LIM_arr_handle_bulk (LIM_Arr *object_p, LIM_Operating_Mode op_mode)
 Handle a message on the BULK queue.
unsigned int LIM_arr_handle_calcinfo (LIM_Arr *object_p, const ITC_QueueItem *qitem_p, int forward_ok, LIM_Operating_Mode op_mode)
 Handle a GBM-Calcinfo command.
unsigned int LIM_arr_handle_closeout (LIM_Arr *object_p, const ITC_QueueItem *qitem_p, int forward_ok)
 Handle a GBM-Closeout command.
unsigned int LIM_arr_handle_confirmed (LIM_Arr *object_p, const ITC_QueueItem *qitem_p, LIM_Operating_Mode op_mode)
 Handle a GRB-Confirmed command.
unsigned int LIM_arr_handle_finished (LIM_Arr *object_p)
 Handle a GRB-Finished command.
unsigned int LIM_arr_handle_repoint (LIM_Arr *object_p, const ITC_QueueItem *qitem_p, int forward_ok, int slew_req_ok, LIM_Operating_Mode op_mode)
 Handle a GBM-Repoint command.
unsigned int LIM_arr_handle_suspected (LIM_Arr *object_p, LIM_Operating_Mode op_mode)
 Handle a GRB-Suspected command.
unsigned int LIM_arr_handle_physics_start (LIM_Arr *object_p, const ITC_QueueItem *qitem_p)
 Handle a PHYSICS-START command in ARR mode.
unsigned int LIM_arr_handle_response (LIM_Arr *object_p, const ITC_QueueItem *qitem_p)
 Handle an ARR-Response message.


Detailed Description

Handle ARR mode observations.

**  CVS $Id: LIM_arr.c,v 1.24 2011/03/29 21:20:28 apw Exp $
**  

Function Documentation

unsigned int lim_arr_change_grb_state ( LIM_Arr object_p,
int  new_state 
) [static]

Change the GRB state of an object.

Parameters:
object_p Pointer to ARR observation object.
new_state New GRB state.
Returns:
MSG code.

References _LIM_Arr::action_p, _LIM_Arr::grb_state, LIM_ACTION_ARR_STATE_CHANGE, LIM_action_report(), LIM_task_lock_access(), LIM_task_unlock_access(), and _LIM_Arr::task_p.

Referenced by LIM_arr_handle_bulk(), LIM_arr_handle_finished(), LIM_arr_handle_response(), lim_arr_set_grb_0(), and lim_arr_set_grb_idle().

unsigned int lim_arr_check ( LIM_Arr object_p  )  [static]

unsigned int LIM_arr_delete ( LIM_Arr object_p  ) 

Shutdown and delete a ARR observation object.

Parameters:
object_p Pointer to object.
Returns:
MSG code.

References _LIM_Arr::key, lim_arr_check(), and _LIM_Arr::wut.

Referenced by LIM_arr_new(), and LIM_mode_delete().

unsigned int LIM_arr_get_info ( LIM_Arr object_p,
LIM_Info info_p 
)

Return ARR observation information.

Parameters:
object_p Pointer to ARR observation object.
info_p Location to return GBM interface information (must not be NULL).
Returns:
MSG code.

References _LIM_Arr::duration, _LIM_Info::gbm_int_dis_remain_sec, lim_arr_check(), _LIM_Arr::start_sec, and _LIM_Arr::wut_active.

Referenced by LIM_mode_get_info().

LIM_Grb_State LIM_arr_grb_state ( LIM_Arr object_p  ) 

Return the GRB state of an ARR observation.

Parameters:
object_p Pointer to ARR observation object.
Returns:
Current GRB state.

References _LIM_Arr::grb_state, lim_arr_check(), and LIM_GRB_STATE_IDLE.

Referenced by LIM_mode_get_info().

unsigned int LIM_arr_handle_abort ( LIM_Arr object_p,
const ITC_QueueItem *  qitem_p 
)

Handle an ARR-Abort command.

Parameters:
object_p Pointer to ARR observation object.
qitem_p Pointer to queue item containing the command.
Returns:
MSG code.

References lim_arr_check(), and lim_arr_set_grb_idle().

Referenced by lim_mode_arr_abort().

unsigned int LIM_arr_handle_activity ( LIM_Arr object_p  ) 

Handle ARR observation activity.

Parameters:
object_p Pointer to ARR observation object.
Returns:
MSG code.

References _LIM_Arr::grb_state, lim_arr_check(), lim_arr_handle_grb_active(), LIM_GRB_STATE_0, LIM_GRB_STATE_1, LIM_GRB_STATE_2, LIM_GRB_STATE_IDLE, LIM_LPA_MODE_GRB0, LIM_LPA_MODE_GRB1, and LIM_LPA_MODE_GRB2.

Referenced by lim_mode_handle_obs().

unsigned int LIM_arr_handle_bulk ( LIM_Arr object_p,
LIM_Operating_Mode  op_mode 
)

unsigned int LIM_arr_handle_calcinfo ( LIM_Arr object_p,
const ITC_QueueItem *  qitem_p,
int  forward_ok,
LIM_Operating_Mode  op_mode 
)

Handle a GBM-Calcinfo command.

Parameters:
object_p Pointer to ARR observation object.
qitem_p Pointer to queue item containing the command.
forward_ok Flag indicating that command may be fowarded to LPA.
op_mode Current operating mode.
Returns:
MSG code.

References _LIM_Arr::gbm_p, _LIM_Arr::grb_state, lim_arr_check(), lim_arr_set_grb_0(), LIM_gbm_handle_calcinfo(), and LIM_GRB_STATE_IDLE.

Referenced by lim_mode_gbm_calcinfo().

unsigned int LIM_arr_handle_closeout ( LIM_Arr object_p,
const ITC_QueueItem *  qitem_p,
int  forward_ok 
)

Handle a GBM-Closeout command.

Parameters:
object_p Pointer to ARR observation object.
qitem_p Pointer to queue item containing the command.
forward_ok Flag indicating that command can be forwarded to LPA.
Returns:
MSG code.

References _LIM_Arr::gbm_p, _LIM_Arr::grb_state, lim_arr_check(), lim_arr_set_grb_idle(), LIM_gbm_handle_closeout(), LIM_GRB_STATE_0, LIM_sc_rep_req_is_pending(), and _LIM_Arr::sc_p.

Referenced by lim_mode_gbm_closeout().

unsigned int LIM_arr_handle_confirmed ( LIM_Arr object_p,
const ITC_QueueItem *  qitem_p,
LIM_Operating_Mode  op_mode 
)

Handle a GRB-Confirmed command.

Parameters:
object_p Pointer to ARR observation object.
qitem_p Pointer to queue item containing the command.
op_mode Current operating mode.
Returns:
MSG code.

References _LIM_Arr::action_p, _LIM_Arr::grb_state, LIM_ACTION_RCV_GRB_CONFIRM, LIM_action_report(), LIM_ACTION_SEND_SLEW_REQ, lim_arr_check(), lim_arr_set_grb_0(), LIM_GRB_STATE_0, LIM_GRB_STATE_IDLE, LIM_lpa_get_confirmed_parms(), LIM_sc_send_slew_request(), and _LIM_Arr::sc_p.

Referenced by lim_mode_grb_confirmed().

unsigned int LIM_arr_handle_finished ( LIM_Arr object_p  ) 

unsigned int lim_arr_handle_grb_active ( LIM_Arr object_p,
LIM_Lpa_Mode  grb_mode 
) [static]

Perform activity for an 'active' GRB state.

Parameters:
object_p Pointer to ARR observation object.
grb_mode Expected GRB mode.
Returns:
MSG code.

References lim_arr_set_grb_idle(), LIM_lpa_get_mode(), LIM_lpa_get_state(), LIM_lpa_set_mode(), LIM_OTHER_STATE_RUNNING, and _LIM_Arr::lpa_p.

Referenced by LIM_arr_handle_activity().

unsigned int LIM_arr_handle_physics_start ( LIM_Arr object_p,
const ITC_QueueItem *  qitem_p 
)

Handle a PHYSICS-START command in ARR mode.

Parameters:
object_p Pointer to ARR observation object.
qitem_p Pointer to queue item containing the command.
Returns:
MSG code.

References _LIM_Arr::grb_state, lim_arr_check(), LIM_GRB_STATE_0, LIM_GRB_STATE_1, LIM_GRB_STATE_2, LIM_GRB_STATE_IDLE, LIM_lpa_get_start_parms(), LIM_LPA_MODE_GRB0, LIM_LPA_MODE_GRB1, LIM_LPA_MODE_GRB2, LIM_lpa_restart(), LIM_lpa_send_start(), _LIM_Arr::lpa_p, and _LIM_Arr::lpa_was_idle.

Referenced by lim_mode_physics_start().

unsigned int LIM_arr_handle_repoint ( LIM_Arr object_p,
const ITC_QueueItem *  qitem_p,
int  forward_ok,
int  slew_req_ok,
LIM_Operating_Mode  op_mode 
)

Handle a GBM-Repoint command.

Parameters:
object_p Pointer to ARR observation object.
qitem_p Pointer to queue item containing the command.
forward_ok Flag indicating that cmd can be forwarded to LPA.
slew_req_ok Flag indicating that slew-req can be sent to S/C.
op_mode Current operating mode.
Returns:
MSG code.

References _LIM_Arr::gbm_p, _LIM_Arr::grb_state, lim_arr_check(), lim_arr_set_grb_0(), LIM_gbm_handle_repoint(), and LIM_GRB_STATE_IDLE.

Referenced by lim_mode_gbm_repoint().

unsigned int LIM_arr_handle_response ( LIM_Arr object_p,
const ITC_QueueItem *  qitem_p 
)

Handle an ARR-Response message.

Parameters:
object_p Pointer to ARR observation object.
qitem_p Pointer to queue item containing the message.
Returns:
MSG code.

References _LIM_Arr::grb_state, lim_arr_change_grb_state(), lim_arr_check(), lim_arr_set_grb_idle(), LIM_GRB_STATE_0, LIM_GRB_STATE_1, LIM_sc_handle_slew_response(), LIM_sc_rep_is_active(), and _LIM_Arr::sc_p.

Referenced by lim_mode_arr_response().

unsigned int LIM_arr_handle_suspected ( LIM_Arr object_p,
LIM_Operating_Mode  op_mode 
)

Handle a GRB-Suspected command.

Parameters:
object_p Pointer to ARR observation object.
op_mode Current operating mode.
Returns:
MSG code.

References _LIM_Arr::action_p, _LIM_Arr::grb_state, LIM_ACTION_RCV_GRB_SUSPECT, LIM_action_report(), lim_arr_check(), lim_arr_set_grb_0(), LIM_GRB_STATE_IDLE, LIM_OP_MODE_ARR, LIM_OP_MODE_PHYSICS, LIM_OP_MODE_QUIESCENT, and LIM_OP_MODE_TOO.

Referenced by lim_mode_grb_suspected().

int LIM_arr_is_ready ( LIM_Arr object_p  ) 

Return the READY status of an ARR observation.

Parameters:
object_p Pointer to ARR observation object.
Returns:
Nonzero if the observation is READY.

References _LIM_Arr::grb_state, lim_arr_check(), and LIM_GRB_STATE_IDLE.

Referenced by LIM_mode_get_info(), and lim_mode_target_mode().

unsigned int LIM_arr_new ( LIM_Arr **  object_pp,
LIM_Task task_p,
LIM_Action action_p,
LIM_Gbm gbm_p,
LIM_Sc sc_p,
LIM_Lpa lpa_p,
LIM_Bulk bulk_p,
const LIM_DB_Schema *  db_p 
)

Create and initialize a new ARR observation object.

Parameters:
object_pp Location to return pointer to new object.
task_p Pointer to a task object.
action_p Pointer to an action reporting object.
gbm_p Pointer to a GBM interface object.
sc_p Pointer to a spacecraft interface object.
lpa_p Pointer to an LPA task interface object.
bulk_p Pointer to a BULK queue object.
db_p Pointer to configuration information.
Returns:
MSG code.

References _LIM_Arr::action_p, _LIM_Arr::bulk_p, _LIM_Arr::duration, _LIM_Arr::expired, _LIM_Arr::gbm_p, _LIM_Arr::grb_state, _LIM_Arr::key, LIM_arr_delete(), LIM_ARR_VALID_KEY, LIM_GRB_STATE_IDLE, _LIM_Arr::lpa_p, _LIM_Arr::lpa_was_idle, _LIM_Arr::sc_p, _LIM_Arr::task_p, _LIM_Arr::wut, and _LIM_Arr::wut_active.

Referenced by LIM_mode_new().

unsigned int lim_arr_set_grb_0 ( LIM_Arr object_p,
LIM_Operating_Mode  op_mode 
) [static]

unsigned int lim_arr_set_grb_idle ( LIM_Arr object_p  )  [static]

WUT_cb_status lim_arr_wut_handler ( void *  prm,
WUT_tmr *  wut 
) [static]

Handle GRB timer expiration.

Parameters:
prm Pointer to ARR observation object.
wut Pointer to wake-up timer.
Returns:
WUT status.

References _LIM_Arr::bulk_p, _LIM_Arr::expired, lim_arr_check(), and LIM_bulk_send().

Referenced by lim_arr_set_grb_0().


Generated on Wed Nov 21 21:17:38 2012 by  doxygen 1.5.8