GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSSP / dev > qstd_print / linux-gcc
#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>
Classes | |
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 struct _Ctl | Ctl |
Typedef for struct _Ctl. | |
typedef struct _ApidStats | ApidStats |
Typedef for struct _ApidStats. | |
typedef struct _QstdPrintCtx | QstdPrintCtx |
Typedef for struct _QstdPrintCtx. | |
typedef struct _ApidStream | ApidStream |
Typedef for struct _ApidStream. | |
typedef struct _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 ApidStream * | resolve (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. |
Cvs $Id: qstd_print.c,v 1.4 2011/03/29 00:14:58 russell Exp $
> qstd_print -d -n:<# of stats> -s<# to skip> <file_name>
#define RND_TO | ( | _x, | |||
_r | ) | (((_x) + (_r) - 1) / (_r)) * (_r) |
Round _x up to the nearest boundary of _r.
_x | The value to round | |
_r | The rounding |
enum _PRT_M |
static void construct | ( | QstdPrintCtx * | ptx, | |
ApidStream * | astream | |||
) | [static] |
Constructs/initializes the context for handling the statistics datagrams.
ptx | The print context handle to construct | |
astream | The application stream to associate with this print driver. |
References _QstdPrintCtx::qstd.
Referenced by construct_astreams().
static void construct_astreams | ( | ApidStream * | astreams, | |
int | astream_cnt, | |||
unsigned int | which, | |||
Ctl * | ctl | |||
) | [static] |
Constructs the individual APID streams.
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 |
References _ApidStream::apid, construct(), _ApidStream::ctl, _ApidStream::dsc, _ApidStream::dsc_buf, _ApidStream::ptx, size(), and _ApidStream::stats.
Referenced by qstd_print().
static void destruct | ( | QstdPrintCtx * | ptx | ) | [static] |
Destructor for the context for handling the statistics datagrams.
ptx | The print context handle to destruct |
References _QstdPrintCtx::qstd.
Referenced by destruct_astreams().
static void destruct_astreams | ( | ApidStream * | astreams, | |
int | astream_cnt, | |||
unsigned int | which | |||
) | [static] |
Constructs the individual APID streams.
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 |
References destruct(), and _ApidStream::ptx.
Referenced by qstd_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.
ctl | The parameter run time options block. | |
argc | The number of command line parameters. | |
argv | The array of pointers to the command line parameters. |
0,Everything | is okay. | |
-1,Incorrect | command usage. Usually this means that the input file name was absent. |
References _Ctl::cpus, _Ctl::dmp_ccsds, _Ctl::file, loadLib(), _Ctl::nprint, _Ctl::nskip, _Ctl::options, PRT_M_HDR, PRT_M_RAW, PRT_M_STATS, and report_usage().
Referenced by qstd_print().
static int loadLib | ( | const char * | library_name, | |
int | verbose | |||
) | [static] |
Dynamically loads the specified configuration library.
0,success | ||
-1,failure |
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.
argc | The argument count | |
argv | The vector of command line strings |
References qstd_print().
static LSF_scanRecordHandler print_ctb | ( | DgmStream * | dstream, | |
const LSF_contribution * | ctb | |||
) | [static] |
Prints the contribution context information.
dstream | The datagram stream handle | |
ctb | The contribution |
References _DgmStream::astream, _QSTD_ctx::com, _ApidStream::ctl, _QstdPrintCtx::flush, _QSTD_ctx::labels, _QSTD_ctxVersions::master, _QstdPrintCtx::max, _ApidStats::nctbs, new_line(), _ApidStats::nrecs, _Ctl::options, print_rec(), print_rec_only(), printRaw(), PRT_M_HDR, PRT_M_RAW, PRT_M_STATS, _ApidStream::ptx, _QstdPrintCtx::qstd, _QstdPrintCtx::sample, _QstdPrintCtx::samples, _ApidStream::stats, and _QSTD_ctx::version.
Referenced by screen_dgm().
static unsigned int print_rec | ( | DgmStream * | dstream, | |
const LSF_record * | rec | |||
) | [static] |
Prints the record information.
dstream | The datagram stream handle | |
rec | The record |
References _DgmStream::astream, _ApidStream::ctl, _QSTD_ctx::cumulative, _QSTD_ctx::current, _QstdPrintCtx::flush, _QSTD_ctx::labels, _QstdPrintCtx::max, _ApidStats::nrecs, _Ctl::options, print_rec_only(), PRT_M_HDR, PRT_M_RAW, _ApidStream::ptx, _QstdPrintCtx::qstd, _QSTD_ctxVersions::sample, _QstdPrintCtx::sample, _QstdPrintCtx::samples, _ApidStream::stats, and _QSTD_ctx::version.
Referenced by print_ctb().
static unsigned int print_rec_only | ( | DgmStream * | dstream, | |
const LSF_record * | rec | |||
) | [static] |
Prints the record information.
dstream | The datagram stream handle | |
rec | The record |
References _DgmStream::astream, _ApidStream::ctl, new_line(), _ApidStats::nrecs, _Ctl::options, printRaw(), PRT_M_HDR, PRT_M_RAW, and _ApidStream::stats.
Referenced by print_ctb(), and print_rec().
static void printRaw | ( | const unsigned int * | pdata, | |
unsigned int | cnt | |||
) | [static] |
Bare bones dump of the specified number of 32-bit words.
pdata | Pointer to the data to print | |
cnt | The number of 32-bit words to dump |
Referenced by print_ctb(), and print_rec_only().
static int qstd_print | ( | int | argc, | |
char *const | argv[] | |||
) | [static] |
Process a file of science statistics datagrams.
argc | The argument count | |
argv | The vector of command line strings |
References construct_astreams(), _Ctl::cpus, destruct_astreams(), _Ctl::dmp_ccsds, _ApidStream::dsc, _Ctl::file, get_ctl(), resolve(), and screen_dgm().
Referenced by main().
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.
astreams | The array of APID streams | |
astream_cnt | The number of APID streams | |
pkt | The CCSDS packet |
Referenced by qstd_print().
static LSF_scanContributionHandler screen_dgm | ( | ApidStream * | astream, | |
const LSF_datagram * | dgm | |||
) | [static] |
Screens out any datagrams that are not LSEP event datagrams.
astream | The APID stream handle | |
dgm | The datagram |
References _DgmStream::astream, _QSTD_ctx::com, _ApidStream::ctl, _ApidStream::dstream, _QSTD_ctx::labels, _QSTD_ctxVersions::master, _ApidStats::nctbs, _ApidStats::ndgms, new_line(), _Ctl::options, print_ctb(), PRT_M_HDR, PRT_M_STATS, _ApidStream::ptx, _QstdPrintCtx::qstd, _ApidStream::stats, and _QSTD_ctx::version.
Referenced by qstd_print().
static int size | ( | const Ctl * | ctl | ) | [static] |
Returns the size, in bytes, of the control handle.
ctl | The control block |
Referenced by construct_astreams().