GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QSEC / V3-0-3

Constituent: qsec_extract     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

qsec_extract.c File Reference

Program to extract the event data to EBF format. More...

#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>

Include dependency graph for qsec_extract.c:


Data Structures

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 _Ctl Ctl
 Typedef for struct _Ctl.
typedef _ApidStream ApidStream
 Typedef for struct _ApidStream.

Functions

static void report_usage (void)
 Brief explanation on qsec_extract usage.
static int get_ctl (Ctl *ctl, int argc, char *const argv[])
 Examines the command line parameters and fills the print run time options control structure.
static void construct_astreams (ApidStream *astreams, int astream_cnt, unsigned int which, Ctl *ctl)
 Constructs the individual APID streams.
static __inline ApidStreamresolve (ApidStream *astreams, int astream_cnt, const CCSDS_telemetry *hdr)
 Given a CCSDS header containing the APID, the function resolves the Apid stream.
static LSF_scanContributionHandler handle_dgm (ApidStream *astream, const LSF_datagram *dgm)
 handle the datatgram
static LSF_scanRecordHandler handle_ctb (ApidStream *astream, const LSF_contribution *ctb)
 Handles the event context information at contribution time.
static unsigned int handle_rec (ApidStream *astream, const LSF_record *rec)
 Extracts and writes the contents of the event.
static LSF_scanContributionHandler dgm_count (int *count, const LSF_datagram *dgm)
 Counts the number of events in this contribution.
static LSF_scanRecordHandler ctb_count (int *count, const LSF_contribution *ctb)
 Counts the number of events in this contribution.
int qsec_extract (int argc, char *const argv[])
 Process a file of calibration events datagrams.
int main (int argc, char *const argv[])
 Process a file of calibration events datagrams.

Detailed Description

Program to extract the event data to EBF format.

Author:
russellslac.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


Function Documentation

static 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

static LSF_scanRecordHandler ctb_count int *  count,
const LSF_contribution *  ctb
[static]
 

Counts the number of events in this contribution.

Parameters:
count Returned with the number of events in this datagram
ctb The contribution

static LSF_scanContributionHandler dgm_count int *  count,
const LSF_datagram *  dgm
[static]
 

Counts the number of events in this contribution.

Parameters:
count Returned with the number of events in this datagram
dgm The datagram

static 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.

static LSF_scanRecordHandler handle_ctb ApidStream astream,
const LSF_contribution *  ctb
[static]
 

Handles the event context information at contribution time.

Parameters:
astream The apid stream
ctb The datagram contribution

static LSF_scanContributionHandler handle_dgm ApidStream astream,
const LSF_datagram *  dgm
[static]
 

handle the datatgram

Parameters:
astream The apid stream
dgm The datagram

static unsigned int handle_rec ApidStream astream,
const LSF_record *  rec
[static]
 

Extracts and writes the contents of the event.

Parameters:
astream The apid stream
rec The LSF record containing the event

int main int  argc,
char *const   argv[]
 

Process a file of calibration events datagrams.

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

int qsec_extract int  argc,
char *const   argv[]
 

Process a file of calibration events datagrams.

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

static __inline ApidStream * resolve ApidStream astreams,
int  astream_cnt,
const CCSDS_telemetry *  hdr
[static]
 

Given a CCSDS header containing the APID, the function resolves the Apid stream.

Returns:
IF the APID is one of the known streams, then resolves returns a pointer to the associated stream. If not, then NULL
Parameters:
astreams The array of APID streams
astream_cnt The number of APID streams
hdr The CCSDS packet header


Generated on Thu Jun 12 02:23:46 2008 by  doxygen 1.4.4