WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
WXP::WmoIngest Class Reference

This class ingests WMO formated data (see NOAAPORT/FOS). More...

#include "../include/WmoIngest.h"

Public Member Functions

 WmoIngest ()
int init ()
int setParam (const char *str)
int setProdFile (const char *name)
int setLogFile (const char *name)
int setDate (Date &rdate)
int terminate ()
int printLog (const char *mess,...)
int readProdFile (const char *filename)
int readProdFile ()
int isSelected ()
int cleanLine (char *line, int len, int flag)
int setAction (const char *command, int offset, char *string, int len)
int action ()
int close ()
int saveHeader (const char *fullhead, const char *header, const char *header2)
int saveLine (unsigned char *line, int size)
int sendPAN ()
int process (const char *filename)
int checkProcessing ()

Detailed Description

This class ingests WMO formated data (see NOAAPORT/FOS).

Author
Dan Vietor

Constructor & Destructor Documentation

◆ WmoIngest()

WmoIngest::WmoIngest ( )

Constructor

References init().

Member Function Documentation

◆ action()

◆ checkProcessing()

int WXP::WmoIngest::checkProcessing ( )
inline

Returns if object still processing data

◆ cleanLine()

int WmoIngest::cleanLine ( char * line,
int len,
int flag )

Cleans a line, stripping non-printable characters

Parameters
lineThe string to clean
lenThe length of the string
flagType of cleaning. 1=strip, retain newline, 2=strip, retain carriage return and newline, 3=strip and convert "/" to "-" for header processing.

Referenced by saveLine(), and setAction().

◆ close()

int WmoIngest::close ( )

Closes open files

References action(), and WXP::Product::APPEND.

Referenced by process().

◆ init()

int WmoIngest::init ( )

Initializes the class

References setLogFile(), setParam(), and setProdFile().

Referenced by WmoIngest().

◆ isSelected()

int WmoIngest::isSelected ( )

Determines if a WMO header is selected to be processed. Header is stored in header and header2.

Returns
1=found, 0=not found

References action(), WXP::StrLib::equal(), and WXP::Product::NONE.

Referenced by process().

◆ printLog()

int WmoIngest::printLog ( const char * mess,
... )

Prints information to log file

Parameters
messThe message to write to log file. This can be a format to be passed to vsprintf.

References WXP::FileTool::addPath(), WXP::File::close(), WXP::StrLib::equal(), WXP::String::get(), WXP::NameConvFile::getFilename(), WXP::File::isOpen(), WXP::File::open(), WXP::File::printf(), WXP::NameConv::set(), and WXP::NameConv::setFile().

Referenced by action(), process(), readProdFile(), saveLine(), and terminate().

◆ process()

int WmoIngest::process ( const char * filename)

◆ readProdFile() [1/2]

int WmoIngest::readProdFile ( )

Reads the product file into memory

References readProdFile().

Referenced by process(), and readProdFile().

◆ readProdFile() [2/2]

◆ saveHeader()

int WmoIngest::saveHeader ( const char * fullhead,
const char * header,
const char * header2 )

Saves the WMO header to output file/program

Parameters
fullheadThe full header with control characters
headerThe actual WMO header
header2The secondary header (AWIPS header)

Referenced by process().

◆ saveLine()

int WmoIngest::saveLine ( unsigned char * line,
int size )

Saves a line to the output file/program

Parameters
lineThe line of data
sizeThe number of bytes in line

References cleanLine(), and printLog().

Referenced by process().

◆ sendPAN()

int WmoIngest::sendPAN ( )

◆ setAction()

int WmoIngest::setAction ( const char * command,
int offset,
char * string,
int len )

Sets up action string using wildcard characters in command string.

Parameters
commandThe command string to interpret
offsetOffset time by this amount (-sec)
Return values
stringOutput string
Parameters
lenLength of output string

References WXP::Date::addSeconds(), WXP::Date::adjustMinute(), cleanLine(), WXP::DateVal::day, WXP::Date::get(), WXP::Date::getJulian(), WXP::DateTool::getMonthLower(), WXP::DateVal::hour, WXP::StrLib::lowCase(), WXP::DateVal::min, WXP::DateVal::month, WXP::Date::set(), WXP::StrLib::upCase(), and WXP::DateVal::year.

Referenced by action().

◆ setLogFile()

int WmoIngest::setLogFile ( const char * name)

Sets the log file name

Parameters
nameThe log file name

Referenced by init(), and setParam().

◆ setParam()

int WmoIngest::setParam ( const char * str)

Sets class parameters

Parameters
strString with parameters to set

References WXP::Strings::equal(), WXP::Strings::getInt(), WXP::Strings::getNum(), WXP::Strings::getStringAfter(), setLogFile(), and setProdFile().

Referenced by init().

◆ setProdFile()

int WmoIngest::setProdFile ( const char * name)

Sets the product file name

Parameters
nameThe product file name

Referenced by init(), and setParam().

◆ terminate()

int WmoIngest::terminate ( )

Terminates ingest. If idle, exits program, otherwise sets flag to end ingest after product is transmitted.

References WXP::Wxp::exit(), WXP::Wxp::NOERR, and printLog().


The documentation for this class was generated from the following files: