nidas  v1.2-1520
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Attributes | List of all members
nidas::dynld::isff::SimGOESXmtr Class Referenceabstract

An IOChannel implementation to simulate a GOES transmitter. More...

#include <SimGOESXmtr.h>

Inheritance diagram for nidas::dynld::isff::SimGOESXmtr:
Inheritance graph
[legend]

Public Member Functions

 SimGOESXmtr ()
 Constructor. More...
 
 SimGOESXmtr (const SimGOESXmtr &)
 Copy constructor. More...
 
 ~SimGOESXmtr ()
 Destructor. More...
 
SimGOESXmtrclone () const
 Clone invokes default copy constructor. More...
 
void setRFBaud (long val) throw (nidas::util::InvalidParameterException)
 Set the RF baud rate. More...
 
int getRFBaud () const
 
void open () throw (nidas::util::IOException)
 
size_t read (void *, size_t) throw (nidas::util::IOException)
 Do the actual hardware read. More...
 
size_t write (const void *, size_t) throw (nidas::util::IOException)
 Do the actual hardware write. More...
 
size_t write (const struct iovec *, int) throw (nidas::util::IOException)
 Do the actual hardware write. More...
 
void transmitData (const nidas::util::UTime &at, int configid, const Sample *) throw (nidas::util::IOException)
 Queue a sample for writing to a GOES transmitter. More...
 
unsigned long checkId () throw (nidas::util::IOException)
 
int checkClock () throw (nidas::util::IOException)
 Check transmitter clock, and correct it if necessary. More...
 
void printStatus () throw ()
 Request that transmitter status be printed to an output stream. More...
 
void reset () throw (nidas::util::IOException)
 
void init () throw (nidas::util::IOException)
 Initialize tranmitter. More...
 
const std::string & getName () const
 
void setName (const std::string &val)
 
void setId (unsigned long val)
 
unsigned long getId () const
 
void setChannel (int val)
 
int getChannel () const
 
void setXmitInterval (long val)
 Set the transmission interval. More...
 
int getXmitInterval () const
 
void setXmitOffset (long val)
 Set the transmission offset. More...
 
int getXmitOffset () const
 
void requestConnection (IOChannelRequester *rqstr) throw (nidas::util::IOException)
 Request a connection. More...
 
IOChannelconnect () throw (nidas::util::IOException)
 Establish a connection. More...
 
void setNonBlocking (bool val __attribute__((unused))) throw (nidas::util::IOException)
 
virtual void setNonBlocking (bool val)=0 throw (nidas::util::IOException)
 
bool isNonBlocking () const throw (nidas::util::IOException)
 
void flush () throw (nidas::util::IOException)
 Default flush implementation does nothing. More...
 
void close () throw (nidas::util::IOException)
 
int getFd () const
 
void setStatusFile (const std::string &val)
 
const std::string & getStatusFile () const
 
void fromDOMElement (const xercesc::DOMElement *node) throw (nidas::util::InvalidParameterException)
 Initialize myself from a xercesc::DOMElement. More...
 
virtual void setRequestType (enum McSocketRequest)
 
virtual enum McSocketRequest getRequestType () const
 
virtual bool isNewInput () const
 Some IOChannels, namely FileSet, which opens successive files, need to indicate when a read is from the start of a new file. More...
 
virtual int getReconnectDelaySecs () const
 
virtual const ConnectionInfogetConnectionInfo () const
 What is the IP address of the host at the other end of the connection. More...
 
virtual void setConnectionInfo (const ConnectionInfo &val)
 
virtual size_t getBufferSize () const throw ()
 Return suggested buffer length. More...
 
virtual dsm_time_t createFile (dsm_time_t t, bool exact)
 Request that an IOChannel open a new file, with a name based on a time. More...
 
virtual bool writeNidasHeader () const
 Should the NIDAS header be written to this IOChannel? NIDAS headers are not written to DatagramSockets, because there is no guarantee they will get there. More...
 
virtual void setDSMConfig (const DSMConfig *val)
 What DSM is this IOChannel connected to? More...
 
virtual const DSMConfiggetDSMConfig () const
 What DSM is this IOChannel connected to? May be NULL. More...
 
virtual xercesc::DOMElement * toDOMParent (xercesc::DOMElement *parent, bool complete) const throw (xercesc::DOMException)
 Create a DOMElement and append it to the parent. More...
 
virtual xercesc::DOMElement * toDOMElement (xercesc::DOMElement *node, bool complete) const throw (xercesc::DOMException)
 Add my content into a DOMElement. More...
 

Static Public Member Functions

static IOChannelcreateIOChannel (const xercesc::DOMElement *node) throw (nidas::util::InvalidParameterException)
 
static const XMLCh * getNamespaceURI ()
 

Protected Attributes

nidas::util::SerialPort _port
 

Private Attributes

nidas::util::UTime _transmitQueueTime
 
nidas::util::UTime _transmitAtTime
 
nidas::util::UTime _transmitSampleTime
 
int _rfBaud
 

Detailed Description

An IOChannel implementation to simulate a GOES transmitter.

Constructor & Destructor Documentation

SimGOESXmtr::SimGOESXmtr ( )

Constructor.

SimGOESXmtr::SimGOESXmtr ( const SimGOESXmtr x)

Copy constructor.

SimGOESXmtr::~SimGOESXmtr ( )

Destructor.

Member Function Documentation

int SimGOESXmtr::checkClock ( )
throw (nidas::util::IOException
)
virtual

Check transmitter clock, and correct it if necessary.

Returns
transmitter clock minus system clock, in milliseconds.

Implements nidas::dynld::isff::GOESXmtr.

unsigned long SimGOESXmtr::checkId ( )
throw (nidas::util::IOException
)
virtual
SimGOESXmtr* nidas::dynld::isff::SimGOESXmtr::clone ( ) const
inlinevirtual

Clone invokes default copy constructor.

Implements nidas::core::IOChannel.

void nidas::dynld::isff::GOESXmtr::close ( )
throw (nidas::util::IOException
)
inlinevirtualinherited
IOChannel * GOESXmtr::connect ( )
throw (nidas::util::IOException
)
virtualinherited

Establish a connection.

On return, the connection has been established. It may return a new instance of an IOChannel.

Implements nidas::core::IOChannel.

References nidas::dynld::isff::GOESXmtr::open().

virtual dsm_time_t nidas::core::IOChannel::createFile ( dsm_time_t  t,
bool  exact 
)
inlinevirtualinherited

Request that an IOChannel open a new file, with a name based on a time.

This should be implemented by derived classes which write to disk files. Other derived classes (e.g. sockets) can just use this default implementation - basically ignoring the request.

Parameters
tTime to use when creating file name.
exactUse exact time when creating file name, else the time is adjusted to an even time interval.

Reimplemented in nidas::core::FileSet.

Referenced by nidas::core::IOStream::createFile().

IOChannel * IOChannel::createIOChannel ( const xercesc::DOMElement *  node)
throw (nidas::util::InvalidParameterException
)
staticinherited
void nidas::dynld::isff::GOESXmtr::flush ( )
throw (nidas::util::IOException
)
inlinevirtualinherited

Default flush implementation does nothing.

Reimplemented from nidas::core::IOChannel.

Reimplemented in nidas::dynld::isff::SE_GOESXmtr.

void GOESXmtr::fromDOMElement ( const xercesc::DOMElement *  )
throw (nidas::util::InvalidParameterException
)
virtualinherited
virtual size_t nidas::core::IOChannel::getBufferSize ( ) const
throw (
)
inlinevirtualinherited
int nidas::dynld::isff::GOESXmtr::getChannel ( ) const
inlineinherited
virtual const ConnectionInfo& nidas::core::IOChannel::getConnectionInfo ( ) const
inlinevirtualinherited

What is the IP address of the host at the other end of the connection.

If this IOChannel is not a socket then return INADDR_ANY, using the default constructor of an Inet4Address. Socket subclasses should override this.

Referenced by nidas::dynld::SampleInputStream::setIOChannel().

virtual const DSMConfig* nidas::core::IOChannel::getDSMConfig ( ) const
inlinevirtualinherited

What DSM is this IOChannel connected to? May be NULL.

Referenced by nidas::core::FileSet::setDir(), and nidas::core::FileSet::setFileName().

int nidas::dynld::isff::GOESXmtr::getFd ( ) const
inlinevirtualinherited
unsigned long nidas::dynld::isff::GOESXmtr::getId ( ) const
inlineinherited
const std::string& nidas::dynld::isff::GOESXmtr::getName ( ) const
inlinevirtualinherited
static const XMLCh* nidas::core::DOMable::getNamespaceURI ( )
inlinestaticinherited
virtual int nidas::core::IOChannel::getReconnectDelaySecs ( ) const
inlinevirtualinherited
virtual enum McSocketRequest nidas::core::IOChannel::getRequestType ( ) const
inlinevirtualinherited
int nidas::dynld::isff::SimGOESXmtr::getRFBaud ( ) const
inlinevirtual

Implements nidas::dynld::isff::GOESXmtr.

Referenced by printStatus().

const std::string& nidas::dynld::isff::GOESXmtr::getStatusFile ( ) const
inlineinherited
int nidas::dynld::isff::GOESXmtr::getXmitInterval ( ) const
inlineinherited
int nidas::dynld::isff::GOESXmtr::getXmitOffset ( ) const
inlineinherited
void nidas::dynld::isff::SimGOESXmtr::init ( )
throw (nidas::util::IOException
)
inlinevirtual

Initialize tranmitter.

Implements nidas::dynld::isff::GOESXmtr.

virtual bool nidas::core::IOChannel::isNewInput ( ) const
inlinevirtualinherited

Some IOChannels, namely FileSet, which opens successive files, need to indicate when a read is from the start of a new file.

This method is used by code which may need to do special things at the beginning of a file, like read a SampleInputHeader.

Reimplemented in nidas::core::UnixIOChannel, nidas::core::McSocketUDP, nidas::core::McSocket, nidas::core::Socket, nidas::core::DatagramSocket, and nidas::core::FileSet.

Referenced by nidas::core::IOStream::read().

bool nidas::dynld::isff::GOESXmtr::isNonBlocking ( ) const
throw (nidas::util::IOException
)
inlinevirtualinherited
void SimGOESXmtr::open ( )
throw (nidas::util::IOException
)
virtual

Reimplemented from nidas::dynld::isff::GOESXmtr.

void SimGOESXmtr::printStatus ( )
throw (
)
virtual
size_t nidas::dynld::isff::SimGOESXmtr::read ( void *  ,
size_t   
)
throw (nidas::util::IOException
)
inlinevirtual

Do the actual hardware read.

Implements nidas::core::IOChannel.

void GOESXmtr::requestConnection ( IOChannelRequester rqstr)
throw (nidas::util::IOException
)
virtualinherited

Request a connection.

Implements nidas::core::IOChannel.

void nidas::dynld::isff::SimGOESXmtr::reset ( )
throw (nidas::util::IOException
)
inlinevirtual
void nidas::dynld::isff::GOESXmtr::setChannel ( int  val)
inlineinherited

Referenced by main().

virtual void nidas::core::IOChannel::setConnectionInfo ( const ConnectionInfo val)
inlinevirtualinherited
virtual void nidas::core::IOChannel::setDSMConfig ( const DSMConfig val)
inlinevirtualinherited
void nidas::dynld::isff::GOESXmtr::setId ( unsigned long  val)
inlineinherited

Referenced by main().

void nidas::dynld::isff::GOESXmtr::setName ( const std::string &  val)
inlinevirtualinherited

Implements nidas::core::IOChannel.

Referenced by main().

virtual void nidas::core::IOChannel::setNonBlocking ( bool  val)
throw (nidas::util::IOException
)
pure virtualinherited
void nidas::dynld::isff::GOESXmtr::setNonBlocking ( bool val   __attribute__(unused))
throw (nidas::util::IOException
)
inlineinherited
virtual void nidas::core::IOChannel::setRequestType ( enum McSocketRequest  )
inlinevirtualinherited
void nidas::dynld::isff::SimGOESXmtr::setRFBaud ( long  val)
throw (nidas::util::InvalidParameterException
)
inlinevirtual

Set the RF baud rate.

Parameters
valRF baud, in bits/sec.

Implements nidas::dynld::isff::GOESXmtr.

void nidas::dynld::isff::GOESXmtr::setStatusFile ( const std::string &  val)
inlineinherited
void nidas::dynld::isff::GOESXmtr::setXmitInterval ( long  val)
inlineinherited

Set the transmission interval.

Parameters
valInterval, in seconds.
void nidas::dynld::isff::GOESXmtr::setXmitOffset ( long  val)
inlineinherited

Set the transmission offset.

Parameters
valOffset, in seconds.
xercesc::DOMElement * DOMable::toDOMElement ( xercesc::DOMElement *  node,
bool  complete 
) const
throw (xercesc::DOMException
)
virtualinherited
xercesc::DOMElement * DOMable::toDOMParent ( xercesc::DOMElement *  parent,
bool  complete 
) const
throw (xercesc::DOMException
)
virtualinherited
void SimGOESXmtr::transmitData ( const nidas::util::UTime at,
int  configid,
const Sample samp 
)
throw (nidas::util::IOException
)
virtual

Queue a sample for writing to a GOES transmitter.

Implements nidas::dynld::isff::GOESXmtr.

size_t nidas::dynld::isff::SimGOESXmtr::write ( const void *  ,
size_t   
)
throw (nidas::util::IOException
)
inlinevirtual

Do the actual hardware write.

Implements nidas::core::IOChannel.

size_t nidas::dynld::isff::SimGOESXmtr::write ( const struct iovec *  ,
int   
)
throw (nidas::util::IOException
)
inlinevirtual

Do the actual hardware write.

Implements nidas::core::IOChannel.

virtual bool nidas::core::IOChannel::writeNidasHeader ( ) const
inlinevirtualinherited

Should the NIDAS header be written to this IOChannel? NIDAS headers are not written to DatagramSockets, because there is no guarantee they will get there.

Reimplemented in nidas::core::DatagramSocket.

Referenced by nidas::dynld::SampleInputStream::setIOChannel().

Member Data Documentation

nidas::util::SerialPort nidas::dynld::isff::GOESXmtr::_port
protectedinherited
int nidas::dynld::isff::SimGOESXmtr::_rfBaud
private
nidas::util::UTime nidas::dynld::isff::SimGOESXmtr::_transmitAtTime
private

Referenced by printStatus().

nidas::util::UTime nidas::dynld::isff::SimGOESXmtr::_transmitQueueTime
private

Referenced by printStatus().

nidas::util::UTime nidas::dynld::isff::SimGOESXmtr::_transmitSampleTime
private

Referenced by printStatus().


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