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

Constituent: qsec_print     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

qsec_print.c File Reference

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

#include "QSEC/QSEC.h"
#include "QSD/CCSDS_istream.h"
#include "QSD/CCSDS_apidDsc.h"
#include "QSD/CCSDS_telemetry.h"
#include "QSE/QSE_printDvr.h"
#include "QSE/QSE_update.h"
#include "QSE/QSE_ctx.h"
#include "QSE/QSE_ctxPrint.h"
#include "QSE/QSE_dirPrint.h"
#include "QSE/QSE_aem.h"
#include "QSE/QSE_aemPrint.h"
#include "QSE/QSE_aemUnpack.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_gemPrint.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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

Include dependency graph for qsec_print.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 enum _PRT_M PRT_M
 Typedef for enum PRT_M.
typedef _Ctl Ctl
 Typedef for struct _Ctl.
typedef _ApidStream ApidStream
 Typedef for struct _ApidStream.

Enumerations

enum  _PRT_M {
  PRT_M_ACD = 0x1,
  PRT_M_AEM = 0x2,
  PRT_M_TKR = 0x4,
  PRT_M_CAL = 0x8,
  PRT_M_GEM = 0x10,
  PRT_M_RAW = 0x20,
  PRT_M_CMP = 0x40,
  PRT_M_DIR = 0x80,
  PRT_M_ECTRS = 0x100
}
 What to print. More...

Functions

static void report_usage (void)
 Brief explanation on qsec_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 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 construct (QSE_printDvr *printDvr, unsigned int resource_level, void *printDvrPrm, ApidStream *astream)
 Constructs/initializes the print driver handle used in formatting the events.
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.
LSF_scanContributionHandler screen_dgm (QSE_printDvr *dvr, const LSF_datagram *dgm)
 Screens out any datagrams that are not LSEP event datagrams.
static unsigned int print_dgm (ApidStream *astream, const LSF_datagram *dgm, QSEC *qsec)
 Prints the event context information.
static unsigned int print_ctb (ApidStream *astream, const LSF_contribution *ctb, QSEC *qsec)
 Prints the event context information.
static unsigned int print_rec (ApidStream *astream, const LSF_record *rec, QSEC *qsec)
 Expands and prints the contents of the event.
static LSF_scanContributionHandler dgm_count (int *count, const LSF_datagram *dgm, QSEC *qsec)
 Counts the number of events in this contribution.
static LSF_scanRecordHandler ctb_count (int *count, const LSF_contribution *ctb, QSEC *qsec)
 Counts the number of events in this contribution.
static void printEvt (const QSE_ebfEvt *evt, int nbytes)
 Prints a very crude hex dump of the EBF event record to stdout.
static void printRec (const LSF_record *rec)
 Prints a very crude hex dump of the event record to stdout.
static void printDmp (const unsigned int *dat, int cnt)
 Prints a formatted hex dump of the specified block of integers.
static void new_line (void)
 Prints a new line.
int QSEC_print (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 dump the contents of a stream of calibration event datagrams.

Author:
jswain@slac.stanford.edu
Usage
   > qsec_print -d -n:<# of events> -s<# to skip> <file_name>
  

For a complete explanation type qsec_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_ACD  Print the ACD data
PRT_M_AEM  Print the ACD data in hardware fashion
PRT_M_TKR  Print the TKR data
PRT_M_CAL  Print the CAL data
PRT_M_GEM  Print the GEM data
PRT_M_RAW  Print the raw packet
PRT_M_CMP  Print the compressed packet
PRT_M_DIR  Print the EBF directory
PRT_M_ECTRS  Print the counters at event time


Function Documentation

static void construct QSE_printDvr *  printDvr,
unsigned int  resource_level,
void *  printDvrPrm,
ApidStream astream
[static]
 

Constructs/initializes the print driver handle used in formatting the events.

Parameters:
printDvr The print driver handle to initialize
resource_level The maximum resource level that needs supporting
printDvrPrm Options parameter passed to the print driver construction routine
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 LSF_scanRecordHandler ctb_count int *  count,
const LSF_contribution *  ctb,
QSEC *  qsec
[static]
 

Counts the number of events in this contribution.

Parameters:
count Returned with the number of events in this datagram
ctb The contribution
qsec The QSEC event context structure

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

Counts the number of events in this contribution.

Parameters:
count Returned with the number of events in this datagram
dgm The datagram
qsec The QSEC event context structure

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.

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

static unsigned int print_ctb ApidStream astream,
const LSF_contribution *  ctb,
QSEC *  qsec
[static]
 

Prints the event context information.

Parameters:
astream The apid stream
ctb The datagram contribution
qsec The QSEC event context structure

static unsigned int print_dgm ApidStream astream,
const LSF_datagram *  dgm,
QSEC *  qsec
[static]
 

Prints the event context information.

Parameters:
astream The apid stream
dgm The datagram
qsec The QSEC event context structure

static unsigned int print_rec ApidStream astream,
const LSF_record *  rec,
QSEC *  qsec
[static]
 

Expands and prints the contents of the event.

Parameters:
astream The apid stream
rec The LSF record containing the event
qsec The QSEC event context structure

static void printDmp const unsigned int *  dat,
int  cnt
[static]
 

Prints a formatted hex dump of the specified block of integers.

Parameters:
dat Pointer to the 32-bit integer data to print
cnt The count of the number of 32-bit integers to dump

static void printEvt const QSE_ebfEvt *  evt,
int  nbytes
[static]
 

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

Parameters:
evt Pointer to the EBF event record to print
nbytes Number of bytes to print

static void printRec const LSF_record *  rec  )  [static]
 

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

Parameters:
rec Pointer to the event record to print

int QSEC_print 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

LSF_scanContributionHandler screen_dgm QSE_printDvr *  dvr,
const LSF_datagram *  dgm
 

Screens out any datagrams that are not LSEP event datagrams.

Returns:
Either a stop scan signal or the contribution handler
Parameters:
dvr The print driver's contribution 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 routien should be allocated by caller and passed, along with prm, to construction routine


Generated on Tue Apr 15 01:24:19 2008 by  doxygen 1.4.4