GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QSSP / V1-0-2

Constituent: qstd_print     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

qstd_print.c File Reference

Program to dump the contents of a stream of physics statistics datagrams. More...

#include "QSSP/QSTD.h"
#include "QSSP/QSTD_ctx.h"
#include "QSSP/QSTD_sample.h"
#include "QSSP/QSTD_samplesPrint.h"
#include "QSSP/QSTD_labels.h"
#include "QSSP/QSSP_ctxPrint.h"
#include "QSD/CCSDS_istream.h"
#include "QSD/CCSDS_apidDsc.h"
#include "QSD/CCSDS_telemetry.h"
#include "dprintf.h"
#include "LSE/LSEW_ctxTim.h"
#include "LSF/LSF.h"
#include "LSF/LSF_ids.h"
#include "LSF/LSF_print.h"
#include "LSF/LSF_reason.h"
#include "EFC/EFS_ids.h"
#include "CDM/CDM_pubdefs.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Include dependency graph for qstd_print.c:


Data Structures

struct  _Ctl
 Run time print options/parameters. More...
struct  _ApidStats
 Apid statistics. More...
struct  _QstdPrintCtx
 The print context. More...
struct  _DgmStream
 The EFS print datagram context for one Datagram Id. More...
struct  _ApidStream
 The EFS 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 enum _PRT_M PRT_M
 Typedef for enum PRT_M.
typedef _Ctl Ctl
 Typedef for struct _Ctl.
typedef _ApidStats ApidStats
 Typedef for struct _ApidStats.
typedef _QstdPrintCtx QstdPrintCtx
 Typedef for struct _QstdPrintCtx.
typedef _ApidStream ApidStream
 Typedef for struct _ApidStream.
typedef _DgmStream DgmStream
 Typedef for struct _DgmStream.

Enumerations

enum  _PRT_M {
  PRT_M_HDR = 0x0001,
  PRT_M_RAW = 0x0002,
  PRT_M_STATS = 0x0004
}
 What to print. More...

Functions

static void report_usage (void)
 Brief explanation on qsep_print 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 int loadLib (const char *library_name, int verbose)
 Dynamically loads the specified configuration library.
static int size (const Ctl *ctl)
 Returns the size, in bytes, of the control handle.
static void construct_astreams (ApidStream *astreams, int astream_cnt, unsigned int which, Ctl *ctl)
 Constructs the individual APID streams.
static void destruct_astreams (ApidStream *astreams, int astream_cnt, unsigned int which)
 Constructs the individual APID streams.
static void construct (QstdPrintCtx *ptx, ApidStream *astream)
 Constructs/initializes the context for handling the statistics datagrams.
static void destruct (QstdPrintCtx *ptx)
 Destructor for the context for handling the statistics datagrams.
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 screen_dgm (ApidStream *astream, const LSF_datagram *dgm)
 Screens out any datagrams that are not LSEP event datagrams.
static LSF_scanRecordHandler print_ctb (DgmStream *dstream, const LSF_contribution *ctb)
 Prints the contribution context information.
static unsigned int print_rec (DgmStream *dstream, const LSF_record *rec)
 Prints the record information.
static unsigned int print_rec_only (DgmStream *dstream, const LSF_record *rec)
 Prints the record information.
static void printRaw (const unsigned int *pdata, unsigned int cnt)
 Bare bones dump of the specified number of 32-bit words.
static void new_line (void)
 Prints a new line.
static int qstd_print (int argc, char *const argv[])
 Process a file of science statistics datagrams.
int main (int argc, char *const argv[])
 Process a file of physics events datagrams.

Detailed Description

Program to dump the contents of a stream of physics statistics datagrams.

Author:
JJRussell - russell@slac.stanford.edu
   Cvs $Id: qstd_print.c,v 1.1 2008/06/10 22:25:45 russell Exp $

Usage
   > qstd_print -d -n:<# of stats> -s<# to skip> <file_name>
  

For a complete explanation type qstd_print 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

enum _PRT_M
 

What to print.

Enumerator:
PRT_M_HDR  Print the headers
PRT_M_RAW  Print the raw packet
PRT_M_STATS  Print the stats


Function Documentation

static void construct QstdPrintCtx ptx,
ApidStream astream
[static]
 

Constructs/initializes the context for handling the statistics datagrams.

Parameters:
ptx The print context handle to construct
astream The application stream to associate with this print driver.

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 void destruct QstdPrintCtx ptx  )  [static]
 

Destructor for the context for handling the statistics datagrams.

Parameters:
ptx The print context handle to destruct

static void destruct_astreams ApidStream astreams,
int  astream_cnt,
unsigned int  which
[static]
 

Constructs the individual APID streams.

Parameters:
astreams The array of APID streams to destruct
astream_cnt The count of APID streams to destruct
which Bit mask of which CPUs to process

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 int loadLib const char *  library_name,
int  verbose
[static]
 

Dynamically loads the specified configuration library.

Return values:
0,success 
-1,failure 
Parameters:
library_name The name of the library to load
verbose The verbosity level

int main int  argc,
char *const   argv[]
 

Process a file of physics events datagrams.

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

static LSF_scanRecordHandler print_ctb DgmStream dstream,
const LSF_contribution *  ctb
[static]
 

Prints the contribution context information.

Parameters:
dstream The datagram stream handle
ctb The contribution

static unsigned int print_rec DgmStream dstream,
const LSF_record *  rec
[static]
 

Prints the record information.

Parameters:
dstream The datagram stream handle
rec The record

static unsigned int print_rec_only DgmStream dstream,
const LSF_record *  rec
[static]
 

Prints the record information.

Parameters:
dstream The datagram stream handle
rec The record

static void printRaw const unsigned int *  pdata,
unsigned int  cnt
[static]
 

Bare bones dump of the specified number of 32-bit words.

Parameters:
pdata Pointer to the data to print
cnt The number of 32-bit words to dump

static int qstd_print int  argc,
char *const   argv[]
[static]
 

Process a file of science statistics 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 *  pkt
[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
pkt The CCSDS packet

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

Screens out any datagrams that are not LSEP event datagrams.

Returns:
Either a stop scan signal or the contribution handler
Parameters:
astream The APID stream handle
dgm The datagram

static int size const Ctl ctl  )  [static]
 

Returns the size, in bytes, of the control handle.

Returns:
The size, in bytes, of the control handle.
Parameters:
ctl The control block
The amount of memory returned by this routine should be allocated by caller and passed, along with prm, to construction routine


Generated on Tue Aug 26 01:24:44 2008 by  doxygen 1.4.4