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

Constituent: qsec_print     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

qsec_print.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_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 "EDS/EBF_gem.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

Include dependency graph for qsec_print.c:


Data Structures

struct  _Ctl
struct  _ApidStream

Defines

#define RND_TO(_x, _r)   (((_x) + (_r) - 1) / (_r)) * (_r)
#define CLK_FREQ   20000000
#define CLK_BITS   25
#define CLK_MASK   ((1 << CLK_BITS) - 1)
#define SECS_MASK   ((1 << (32 - CLK_BITS)) - 1)

Typedefs

typedef enum _PRT_M PRT_M
typedef _Ctl Ctl
typedef _ApidStream 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,
  PRT_M_ETIME = 0x200
}

Functions

static void report_usage (void)
static int get_ctl (Ctl *ctl, int argc, char *const argv[])
static int size (const Ctl *ctl)
static void construct_astreams (ApidStream *astreams, int astream_cnt, unsigned int which, Ctl *ctl)
static void construct (QSE_printDvr *printDvr, unsigned int resource_level, void *printDvrPrm, ApidStream *astream)
static __inline ApidStreamresolve (ApidStream *astreams, int astream_cnt, const CCSDS_telemetry *hdr)
LSF_scanContributionHandler screen_dgm (void *dvr, const LSF_datagram *dgm)
static unsigned int print_dgm (void *astream, const LSF_datagram *dgm, void *qsec)
static unsigned int print_ctb (void *astream, const LSF_contribution *ctb, void *qsec)
static unsigned int print_rec (void *astream, const LSF_record *rec, void *qsec)
static LSF_scanContributionHandler dgm_count (void *count, const LSF_datagram *dgm)
static LSF_scanRecordHandler ctb_count (void *count, const LSF_contribution *ctb)
static void updateEtime (const EBF_gem *gem, Ctl *ctl)
static void printEtime (const Ctl *ctl)
static void printEvt (const QSE_ebfEvt *evt, int nbytes)
static void printRec (const LSF_record *rec)
static void printDmp (const unsigned int *dat, int cnt)
static void new_line (void)
int QSEC_print (int argc, char *const argv[])
int main (int argc, char *const argv[])

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

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


Typedef Documentation

typedef struct _ApidStream ApidStream
 

APID stream structure

typedef struct _Ctl Ctl
 

Run time print options/parameters

typedef enum _PRT_M PRT_M
 

What to print


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.
PRT_M_ETIME  Print the event time.


Function Documentation

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

Construct/initialize 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.

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

Construct 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 *  count,
const LSF_contribution *  ctb
[static]
 

Count the number of events in this contribution

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

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

Count the number of events in this datagram

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

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

Examine the command line parameters and fill 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[]
 

Main program to process a file of calibration event datagrams

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

void new_line void   )  [static]
 

Print a new line

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

Print the event context information

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

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

Print the event context information

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

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

Expand and print the contents of the event

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

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

Print 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

void printEtime const Ctl ctl  )  [static]
 

Print the time of the event.

Parameters:
ctl Pointer to the control structure

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

Print 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

void printRec const LSF_record *  rec  )  [static]
 

Print 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 event 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_print usage

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.

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

LSF_scanContributionHandler screen_dgm void *  dvr,
const LSF_datagram *  dgm
 

Screen out any datagrams that are not LSEC event datagrams

Parameters:
dvr The print driver's contribution handle
dgm The datagram
Returns:
Either a stop scan signal or the contribution handler

int size const Ctl ctl  )  [static]
 

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

The amount of memory returned by this routien should be allocated by caller and passed, along with prm, to construction routine

Parameters:
ctl The control block
Returns:
The size, in bytes, of the control handle.

void updateEtime const EBF_gem *  gem,
Ctl ctl
[static]
 

Update the time of the event.

Parameters:
gem Pointer to the GEM data
ctl Pointer to the control structure


Generated on Fri Apr 24 01:25:43 2009 by  doxygen 1.4.4