WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Public Member Functions | List of all members
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()

int WmoIngest::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 ( )

◆ 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(), WXP::Product::NONE, and WXP::Product::selected.

Referenced by process().

◆ printLog()

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

◆ process()

int WmoIngest::process ( const char *  filename)

◆ readProdFile() [1/2]

int WmoIngest::readProdFile ( )

Reads the product file into memory

References WXP::String::get(), and readProdFile().

Referenced by process(), and readProdFile().

◆ readProdFile() [2/2]

int WmoIngest::readProdFile ( const char *  name)

◆ 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)

References WXP::Product::file, WXP::Product::hfile, WXP::Product::pos, WXP::File::printf(), and WXP::File::tell().

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(), WXP::Product::file, printLog(), and WXP::File::write().

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::Date::isSet(), 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

References WXP::String::set().

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

References WXP::String::set().

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::Date::getSeconds(), WXP::Wxp::NOERR, and printLog().


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