GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSEC / V3-2-0 > qsec_extract / sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

qsec_extract.c File Reference

#include "QSEC/QSEC.h"
#include "QSD/CCSDS_istream.h"
#include "QSD/CCSDS_apidDsc.h"
#include "QSD/CCSDS_telemetry.h"
#include "QSE/QSE_update.h"
#include "QSE/QSE_ctx.h"
#include "QSE/QSE_ebf.h"
#include "LSE/LSE_ids.h"
#include "LSF/LSF_scan.h"
#include "LSF/LSF.h"
#include "EDS/EBF_edw.h"
#include "EDS/EBF_ebw.h"
#include "EDS/EBF_pkt.h"
#include "EDS/io/EBF_stream.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Classes

struct  _Ctl
 Run time print options/parameters. More...
struct  _ApidStream
 The print context for one APID. More...

Defines

#define RND_TO(_x, _r)   (((_x) + (_r) - 1) / (_r)) * (_r)
 Round _x up to the nearest boundary of _r.

Typedefs

typedef struct _Ctl Ctl
 Typedef for struct _Ctl.
typedef struct
_ApidStream 
ApidStream
 Typedef for struct _ApidStream.

Enumerations

enum  {
  QSEC_APID_BASE = 0x3c5,
  QSEC_MAX_APIDS = 4
}
 Miscellaneous constants. More...

Functions

static void report_usage (void)
static int get_ctl (Ctl *ctl, int argc, char *const argv[])
static void construct_astreams (ApidStream *astreams, int astream_cnt, unsigned int which, Ctl *ctl)
static int resolve (void *astreamp, const CCSDS_telemetry *pkt, CCSDS_apidDsc **dsc)
static int check_packet (void *parm, void *stream, const CCSDS_telemetry *pkt, CCSDS_apidDsc *dsc)
static int process_dgm (void *astream, const void *dgm, int dglen)
static
LSF_scanContributionHandler 
handle_dgm (void *astreamp, const LSF_datagram *dgm)
static
LSF_scanRecordHandler 
handle_ctb (void *astreamp, const LSF_contribution *ctb)
static unsigned handle_rec (void *astreamp, const LSF_record *rec)
static
LSF_scanContributionHandler 
dgm_count (void *countp, const LSF_datagram *dgm)
static
LSF_scanRecordHandler 
ctb_count (void *countp, const LSF_contribution *ctb)
int qsec_extract (int argc, char *const argv[])
int main (int argc, char *const argv[])

Detailed Description

Program to extract the event data to EBF format

Author:
russell@slac.stanford.edu
Usage
   > qsec_extract -n:<# of events> -s<# to skip> -o<file_name> <file_name>
  

For a complete explanation type qsec_extract with no arguments

Define Documentation

#define RND_TO ( _x,
_r   )     (((_x) + (_r) - 1) / (_r)) * (_r)

Round _x up to the nearest boundary of _r.

Returns:
The rounded of value
Parameters:
_x The value to round
_r The rounding


Enumeration Type Documentation

anonymous enum

Miscellaneous constants.

Enumerator:
QSEC_APID_BASE  Base APID for calibration data packets.
QSEC_MAX_APIDS  Maximum number of APIDs.


Function Documentation

int check_packet ( void *  parm,
void *  stream,
const CCSDS_telemetry *  pkt,
CCSDS_apidDsc *  dsc 
) [static]

Check a packet for validity

This routine is the packet checker callback routine for an APID stream. It simply calls the standard routine.

Parameters:
parm The processing parameters.
stream The data stream.
pkt The address of the packet.
dsc The address of the APID descriptor.
Returns:
The value returned from the standard packet checking routine.

void construct_astreams ( ApidStream astreams,
int  astream_cnt,
unsigned int  which,
Ctl ctl 
) [static]

Constructs the individual APID streams

Parameters:
astreams The array of APID streams to construct
astream_cnt The count of APID streams to construct
which Bit mask of which CPUs to process
ctl The control structure

LSF_scanRecordHandler ctb_count ( void *  countp,
const LSF_contribution *  ctb 
) [static]

Count the number of events in this contribution

Parameters:
countp Returned with the number of events in this contribution
ctb The contribution
Returns:
Record handler descriptor

LSF_scanContributionHandler dgm_count ( void *  countp,
const LSF_datagram *  dgm 
) [static]

Count the number of events in this datagram

Parameters:
countp Returned with the number of events in this datagram
dgm The datagram
Returns:
Contribution handler descriptor

int get_ctl ( Ctl ctl,
int  argc,
char *const   argv[] 
) [static]

Examines the command line parameters and fills the print run time options control structure

Parameters:
ctl The parameter run time options block.
argc The number of command line parameters.
argv The array of pointers to the command line parameters.
Return values:
0,Everything is okay.
-1,Incorrect command usage. Usually this means that the input file name was absent.

LSF_scanRecordHandler handle_ctb ( void *  astreamp,
const LSF_contribution *  ctb 
) [static]

Handle the event context information at contribution time

Parameters:
astreamp The apid stream
ctb The datagram contribution
Returns:
Record handler descriptor

LSF_scanContributionHandler handle_dgm ( void *  astreamp,
const LSF_datagram *  dgm 
) [static]

Handle the datatgram

Parameters:
astreamp The apid stream
dgm The datagram
Returns:
Contribution handler descriptor

unsigned int handle_rec ( void *  astreamp,
const LSF_record *  rec 
) [static]

Extract and write the contents of the event

Parameters:
astreamp The apid stream
rec The LSF record containing the event
Return values:
0 Continue processing
LSF_SCAN_STATUS_M_DGM_USR_ABORT Stop processing

int main ( int  argc,
char *const   argv[] 
)

Process a file of calibration events datagrams

Parameters:
argc The argument count
argv The vector of command line strings
Returns:
Overall status

int process_dgm ( void *  astream,
const void *  dgm,
int  dglen 
) [static]

Process a datagram

This routine is the datagram processor callback routine for an APID stream. It calls the LSF processor.

Parameters:
astream The address of the APID stream.
dgm The address of the datagram.
dglen The length of the datagram.
Return values:
zero Continue processing
non-zero Stop processing

int qsec_extract ( int  argc,
char *const   argv[] 
)

Process a file of calibration events datagrams

Parameters:
argc The argument count
argv The vector of command line strings
Returns:
Overall status

void report_usage ( void   )  [static]

Brief explanation on qsec_extract usage

int resolve ( void *  astreamp,
const CCSDS_telemetry *  pkt,
CCSDS_apidDsc **  dsc 
) [static]

Resolve a packet into its APID stream

This routine is the resolve callback routine for the entire data stream. It determines which APID stream (if any) the packet belongs to.

Parameters:
astreamp The array of APID streams.
pkt The address of the CCSDS packet.
dsc The address of a pointer to receive the address of the matching APID descriptor.
Return values:
CCSDS_ISTREAM_RESOLVER_STATUS_K_SUCCESS Stream found
CCSDS_ISTREAM_RESOLVER_STATUS_K_NOTFOUND Stream not found


Generated on Thu May 27 13:59:41 2010 by  doxygen 1.5.3