GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSEP / V3-4-1 > qsep_print / sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

qsep_print.c File Reference

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

#include <QSEP/QSEP.h>
#include <QSEP/QSEP_dgmDvr.h>
#include <QSEP/QSEP_ctx.h>
#include <QSEP/QSEP_ctxPrint.h>
#include <QSEP/QSEP_mcPrint.h>
#include <qsep_select.h>
#include <qsep_not_dismissable.h>
#include <QSE/QSE_dirPrint.h>
#include <QSE/QSE_dgmDvr.h>
#include <QSE/QSE_dgmEventSkip.h>
#include <QSE/QSE_update.h>
#include <QSE/QSE_evt.h>
#include <QSE/QSE_ctx.h>
#include <QSE/QSE_ctxPrint.h>
#include <QSE/QSE_gemPrint.h>
#include <QSE/QSE_aem.h>
#include <QSE/QSE_aemUnpack.h>
#include <QSE/QSE_aemPrint.h>
#include <QSE/QSE_acd.h>
#include <QSE/QSE_acdPrint.h>
#include <QSE/QSE_acdUnpack.h>
#include <QSE/QSE_tkr.h>
#include <QSE/QSE_tkrPrint.h>
#include <QSE/QSE_tkrUnpack.h>
#include <QSE/QSE_cal.h>
#include <QSE/QSE_calPrint.h>
#include <QSE/QSE_calUnpack.h>
#include <QSE/QSE_ecal.h>
#include <QSE/QSE_ecalPrint.h>
#include <QSE/QSE_ecalFill.h>
#include <QSD/CCSDS_istream.h>
#include <QSD/CCSDS_apidDsc.h>
#include <QSD/CCSDS_telemetry.h>
#include <QSD/CCSDS_telemetryPrint.h>
#include <LSE/LSE_ids.h>
#include <LSF/LSF.h>
#include <LSF/LSF_print.h>
#include <EDS/EBF_cid.h>
#include <EDS/EBF_dir.h>
#include <EDS/EBF_match.h>
#include <EDS/ESS.h>
#include <EDS/ECR_cal.h>
#include <CDM/CDM_pubdefs.h>
#include <PBI/PTR.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

Classes

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

Defines

#define APID_STREAM_CNT   5
 The number of Apid Streams, this is really the number of LAT CPUs.

Typedefs

typedef enum _PRT_M PRT_M
 Typedef for enum PRT_M.
typedef struct _Ctl Ctl
 Typedef for struct _Ctl.
typedef struct _ApidStream ApidStream
 Typedef for struct _ApidStream.

Enumerations

enum  _PRT_M {
  PRT_M_GEM = 0x1,
  PRT_M_ACD = 0x2,
  PRT_M_AEM = 0x4,
  PRT_M_TKR = 0x8,
  PRT_M_CALRAW = 0x10,
  PRT_M_CALMAP = 0x20,
  PRT_M_ECAL = 0x40,
  PRT_M_CALRSVD = 0x80,
  PRT_M_PKT = 0x100,
  PRT_M_RAW = 0x200,
  PRT_M_DIR = 0x400,
  PRT_M_MC = 0x800,
  PRT_M_RSD = 0x1000,
  PRT_M_ECTRS = 0x2000,
  PRT_M_TIM = 0x4000,
  PRT_M_DEF = 0x8000,
  PRT_M_CHK = 0x10000,
  PRT_M_QCHK = 0x20000,
  PRT_M_CAL,
  PRT_M_DIRREQ,
  PRT_M_ANY,
  PRT_M_RECSEP = PRT_M_ANY & ~(PRT_M_DEF | PRT_M_CHK),
  PRT_M_CTBSEP = PRT_M_ANY & ~(PRT_M_DEF | PRT_M_CHK),
  PRT_M_DGMSEP = PRT_M_ANY & ~(PRT_M_DEF | PRT_M_CHK),
  PRT_M_RECHDR = ~PRT_M_QCHK
}
 What to print. More...

Functions

static void report_usage (int verbose)
 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 void construct_astreams (ApidStream *astreams, int astream_cnt, unsigned int which, int dmp_ccsds, Ctl *ctl)
 Constructs the individual APID streams.
static int resolve (ApidStream *astreams, const CCSDS_telemetry *pkt, CCSDS_apidDsc **dsc)
 Given a CCSDS header containing the APID, the function resolves the Apid stream.
static unsigned int print_dgm (ApidStream *astream, const LSF_datagram *dgm, QSEP *qsep)
 Prints the event context information.
static unsigned int print_ctb (ApidStream *astream, const LSF_contribution *ctb, QSEP *qsep)
 Prints the event context information.
static unsigned int print_rec (ApidStream *astream, const LSF_record *rec, QSEP *qsep)
 Expands and prints the contents of the event.
static void printSeparator (char c, int left_margin, int n, int newLine)
 Print a separator line.
static void printRsd (const QSEP *qsep)
 Prints the result summary data.
static void printEvtRaw (const QSE_ebfEvt *pkt, unsigned int rsize)
 Prints a very crude hex dump of the event to stdout.
static void printRecRaw (const LSF_record *rec, unsigned int psize)
 Prints a very crude hex dump of the record to stdout.
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.
int QSEP_print (Ctl *ctl)
 Process a file of physics events 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 event datagrams.

Author:
JJRussell - russell@slac.stanford.edu

   Cvs $Id: qsep_print.c,v 1.29 2011/03/29 18:49:04 russell Exp $

Usage
   > qsep_print -d -n:<# of events> -s<# to skip> <file_name>
  

For a complete explanation type qsep_print with no arguments

Enumeration Type Documentation

enum _PRT_M

What to print.

Enumerator:
PRT_M_GEM  Print the GEM data
PRT_M_ACD  Print the ACD data
PRT_M_AEM  Print the AEM data
PRT_M_TKR  Print the TKR data
PRT_M_CALRAW  Print the CAL raw data
PRT_M_CALMAP  Print the CAL map
PRT_M_ECAL  Print the CAL tower energies
PRT_M_CALRSVD  Reserved
PRT_M_PKT  Print the raw packet
PRT_M_RAW  Print the raw decoded packet
PRT_M_DIR  Print the EBF directory
PRT_M_MC  Print the MC information
PRT_M_RSD  Print the result summary data
PRT_M_ECTRS  Print the counters at event time
PRT_M_TIM  Print the time context
PRT_M_DEF  Default print
PRT_M_CHK  Do a directory check, but no print
PRT_M_QCHK  Quiet check
PRT_M_CAL  Any CAL output
PRT_M_DIRREQ  Directory formation required
PRT_M_ANY  Print anything
PRT_M_RECHDR  Print record header


Function Documentation

static void construct_astreams ( ApidStream astreams,
int  astream_cnt,
unsigned int  which,
int  dmp_ccsds,
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
dmp_ccsds Dump the CCSDS packets
ctl The control structure

References _ApidStream::apid, _Ctl::cfg, _Ctl::ctb_ids, _ApidStream::ctl, _Ctl::dgn_ids, _ApidStream::dir, _ApidStream::dsc, _ApidStream::dsc_buf, _Ctl::nprocess, _Ctl::nskip, print_ctb(), print_dgm(), print_rec(), _Ctl::resource_level, and _ApidStream::stats.

Referenced by QSEP_print().

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.

References _Ctl::cfg, _Ctl::cpus, _Ctl::cs_ignore, _Ctl::ctb_ids, _Ctl::dgn_ids, _Ctl::dmp_ccsds, _Ctl::ecal_options, _Ctl::ess, _Ctl::file, loadLib(), _Ctl::nevent, _Ctl::nprint, _Ctl::nprocess, _Ctl::nskip, _Ctl::nsskip, _Ctl::options, PRT_M_ACD, PRT_M_AEM, PRT_M_CALMAP, PRT_M_CALRAW, PRT_M_CHK, PRT_M_DEF, PRT_M_DIR, PRT_M_ECAL, PRT_M_ECTRS, PRT_M_GEM, PRT_M_MC, PRT_M_PKT, PRT_M_QCHK, PRT_M_RAW, PRT_M_RSD, PRT_M_TIM, PRT_M_TKR, qsep_select_parse_size(), report_usage(), _Ctl::resource_level, and _Ctl::size_type.

Referenced by main().

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

Referenced by get_ctl().

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

References get_ctl(), and QSEP_print().

static unsigned int print_ctb ( ApidStream astream,
const LSF_contribution *  ctb,
QSEP *  qsep 
) [static]

Prints the event context information.

Parameters:
astream The APID stream
ctb The datagram contribution
qsep The QSEP event context structure

References _ApidStream::ctl, new_line(), _Ctl::options, printSeparator(), PRT_M_DEF, and _ApidStream::stats.

Referenced by construct_astreams().

static unsigned int print_dgm ( ApidStream astream,
const LSF_datagram *  dgm,
QSEP *  qsep 
) [static]

Prints the event context information.

Parameters:
astream The apid stream
dgm The datagram
qsep The QSEP event context structure

References _ApidStream::ctl, new_line(), _Ctl::options, printSeparator(), PRT_M_DEF, and _ApidStream::stats.

Referenced by construct_astreams().

static unsigned int print_rec ( ApidStream astream,
const LSF_record *  rec,
QSEP *  qsep 
) [static]

static void printEvtRaw ( const QSE_ebfEvt *  pkt,
unsigned int  psize 
) [static]

Prints a very crude hex dump of the event to stdout.

Parameters:
pkt Pointer to the packet to print
psize The packet size in bytes (includes header)

References printRaw().

Referenced by print_rec().

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

Referenced by printEvtRaw(), and printRecRaw().

static void printRecRaw ( const LSF_record *  rec,
unsigned int  rsize 
) [static]

Prints a very crude hex dump of the record to stdout.

Parameters:
rec Pointer to the record to print
rsize The record size in 32-bit words (includes header)

References printRaw().

Referenced by print_rec().

static void printRsd ( const QSEP *  qsep  )  [static]

Prints the result summary data.

Parameters:
qsep The decoding context

Referenced by print_rec().

static void printSeparator ( char  c,
int  m,
int  n,
int  newLine 
) [static]

Print a separator line.

Parameters:
c The character to use as the separator
m The left margin to leave
n The number of separators to print
newLine New line flag

References new_line().

Referenced by print_ctb(), and print_dgm().

int QSEP_print ( Ctl ctl  ) 

Process a file of physics events datagrams.

Returns:
Overall status
Parameters:
ctl The control structure

References _Ctl::acd, APID_STREAM_CNT, _Ctl::cal, construct_astreams(), _Ctl::cpus, _Ctl::dmp_ccsds, _Ctl::ebf, _Ctl::ebf_siz, _Ctl::ecal, _Ctl::file, new_line(), _Ctl::options, PRT_M_CHK, resolve(), and _Ctl::tkr.

Referenced by main().

static void report_usage ( int  verbose  )  [static]

Brief explanation on qsep_print usage.

Parameters:
verbose If true, full documentation

References qsep_select_usage().

Referenced by get_ctl().

static int resolve ( ApidStream astreams,
const CCSDS_telemetry *  pkt,
CCSDS_apidDsc **  dsc 
) [static]

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

Return values:
CCSDS_ISTREAM_RESOLVER_STATUS_K_SUCCESS,if the descriptor was found
CCSDS_ISTREAM_RESOLVER_STATUS_K_NOTFOUND,if the descriptor was not found.
Parameters:
astreams The array of APID streams
pkt The CCSDS telemetry packet
dsc Returned as the pointer to the found descriptor

References APID_STREAM_CNT, and _ApidStream::dsc.

Referenced by QSEP_print().


Generated on Wed Nov 30 01:50:36 2011 by  doxygen 1.5.8