nidas
v1.2-1520
|
An IOChannel implementation to simulate a GOES transmitter. More...
#include <SimGOESXmtr.h>
Public Member Functions | |
SimGOESXmtr () | |
Constructor. More... | |
SimGOESXmtr (const SimGOESXmtr &) | |
Copy constructor. More... | |
~SimGOESXmtr () | |
Destructor. More... | |
SimGOESXmtr * | clone () 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... | |
IOChannel * | connect () 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 ConnectionInfo & | getConnectionInfo () 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 DSMConfig * | getDSMConfig () 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 IOChannel * | createIOChannel (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 |
An IOChannel implementation to simulate a GOES transmitter.
SimGOESXmtr::SimGOESXmtr | ( | ) |
Constructor.
SimGOESXmtr::SimGOESXmtr | ( | const SimGOESXmtr & | x | ) |
Copy constructor.
SimGOESXmtr::~SimGOESXmtr | ( | ) |
Destructor.
|
virtual |
Check transmitter clock, and correct it if necessary.
Implements nidas::dynld::isff::GOESXmtr.
|
virtual |
Implements nidas::dynld::isff::GOESXmtr.
|
inlinevirtual |
Clone invokes default copy constructor.
Implements nidas::core::IOChannel.
|
inlinevirtualinherited |
Implements nidas::core::IOChannel.
Reimplemented in nidas::dynld::isff::SE_GOESXmtr.
|
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().
|
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.
t | Time to use when creating file name. |
exact | Use 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().
|
staticinherited |
References nidas::core::DOMObjectFactory::createObject(), nidas::core::Socket::createSocket(), nidas::util::Process::expandEnvVars(), nidas::core::XDOMElement::getAttributeValue(), and nidas::core::XDOMElement::getNodeName().
Referenced by nidas::dynld::psql::PSQLSampleOutput::fromDOMElement(), nidas::core::DSMService::fromDOMElement(), nidas::dynld::isff::GOESOutput::fromDOMElement(), nidas::core::SampleOutputBase::fromDOMElement(), and nidas::dynld::SampleInputStream::fromDOMElement().
|
inlinevirtualinherited |
Default flush implementation does nothing.
Reimplemented from nidas::core::IOChannel.
Reimplemented in nidas::dynld::isff::SE_GOESXmtr.
|
virtualinherited |
Initialize myself from a xercesc::DOMElement.
Implements nidas::core::DOMable.
References nidas::util::Termios::EVEN, nidas::core::XDOMAttr::getName(), nidas::util::Termios::NONE, nidas::util::Termios::ODD, nidas::util::Termios::setBaudRate(), nidas::util::Termios::setDataBits(), nidas::util::Termios::setParity(), and nidas::util::Termios::setStopBits().
|
inlinevirtualinherited |
Return suggested buffer length.
Reimplemented in nidas::core::Socket, nidas::core::DatagramSocket, and nidas::core::MultipleUDPSockets.
Referenced by nidas::dynld::isff::PacketInputStream::init(), nidas::dynld::isff::PacketInputStream::PacketInputStream(), and nidas::dynld::SampleInputStream::SampleInputStream().
|
inlineinherited |
Referenced by printStatus(), and nidas::dynld::isff::SE_GOESXmtr::testTransmitSE120().
|
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().
|
inlinevirtualinherited |
What DSM is this IOChannel connected to? May be NULL.
Referenced by nidas::core::FileSet::setDir(), and nidas::core::FileSet::setFileName().
|
inlinevirtualinherited |
Implements nidas::core::IOChannel.
|
inlineinherited |
|
inlinevirtualinherited |
Implements nidas::core::IOChannel.
Referenced by nidas::dynld::isff::SE_GOESXmtr::checkClock(), nidas::dynld::isff::SE_GOESXmtr::checkId(), nidas::dynld::isff::SE_GOESXmtr::checkStatus(), nidas::dynld::isff::SE_GOESXmtr::decodeClock(), nidas::dynld::isff::SE_GOESXmtr::detectModel(), nidas::dynld::isff::SE_GOESXmtr::doSelfTest(), nidas::dynld::isff::SE_GOESXmtr::getSelfTestResults(), nidas::dynld::isff::SE_GOESXmtr::recv(), nidas::dynld::isff::SE_GOESXmtr::reset(), nidas::dynld::isff::SE_GOESXmtr::testTransmitSE120(), nidas::dynld::isff::SE_GOESXmtr::tosleep(), and nidas::dynld::isff::SE_GOESXmtr::wakeup().
|
inlinestaticinherited |
References nidas::core::DOMable::namespaceURI.
Referenced by nidas::dynld::UDPSampleOutput::getProjectDOM(), nidas::core::Dataset::toDOMElement(), nidas::core::ProjectConfig::toDOMElement(), nidas::core::Dataset::toDOMParent(), nidas::core::ProjectConfig::toDOMParent(), nidas::core::Datasets::toDOMParent(), nidas::core::ProjectConfigs::toDOMParent(), nidas::core::DSMConfig::toDOMParent(), nidas::core::Project::toDOMParent(), nidas::core::Site::toDOMParent(), nidas::core::SampleTag::toDOMParent(), nidas::core::ServerSocket::toDOMParent(), nidas::core::Variable::toDOMParent(), nidas::core::DSMSensor::toDOMParent(), nidas::core::Datasets::writeXML(), and nidas::core::ProjectConfigs::writeXML().
|
inlinevirtualinherited |
Reimplemented in nidas::core::FileSet.
Referenced by nidas::core::SampleOutputBase::getReconnectDelaySecs().
|
inlinevirtualinherited |
Reimplemented in nidas::core::Socket, nidas::core::McSocketUDP, and nidas::core::McSocket.
|
inlinevirtual |
Implements nidas::dynld::isff::GOESXmtr.
Referenced by printStatus().
|
inlineinherited |
Referenced by nidas::dynld::isff::SE_GOESXmtr::printStatus().
|
inlineinherited |
|
inlineinherited |
|
inlinevirtual |
Initialize tranmitter.
Implements nidas::dynld::isff::GOESXmtr.
|
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().
|
inlinevirtualinherited |
Implements nidas::core::IOChannel.
|
virtual |
Reimplemented from nidas::dynld::isff::GOESXmtr.
|
virtual |
Request that transmitter status be printed to an output stream.
Implements nidas::dynld::isff::GOESXmtr.
References nidas::dynld::isff::GOESXmtr::_port, _transmitAtTime, _transmitQueueTime, _transmitSampleTime, nidas::util::UTime::format(), nidas::dynld::isff::GOESXmtr::getChannel(), nidas::util::SerialPort::getName(), getRFBaud(), nidas::dynld::isff::GOESXmtr::getXmitInterval(), and nidas::dynld::isff::GOESXmtr::getXmitOffset().
|
inlinevirtual |
Do the actual hardware read.
Implements nidas::core::IOChannel.
|
virtualinherited |
Request a connection.
Implements nidas::core::IOChannel.
|
inlinevirtual |
Implements nidas::dynld::isff::GOESXmtr.
|
inlineinherited |
Referenced by main().
|
inlinevirtualinherited |
|
inlinevirtualinherited |
What DSM is this IOChannel connected to?
Referenced by nidas::core::SampleOutputBase::fromDOMElement(), nidas::core::SampleOutputBase::SampleOutputBase(), and nidas::core::SampleOutputBase::setIOChannel().
|
inlineinherited |
Referenced by main().
|
inlinevirtualinherited |
Implements nidas::core::IOChannel.
Referenced by main().
|
pure virtualinherited |
|
inlineinherited |
|
inlinevirtualinherited |
Reimplemented in nidas::core::Socket, nidas::core::McSocketUDP, and nidas::core::McSocket.
Referenced by nidas::dynld::XMLConfigService::schedule().
|
inlinevirtual |
|
inlineinherited |
|
inlineinherited |
Set the transmission interval.
val | Interval, in seconds. |
|
inlineinherited |
Set the transmission offset.
val | Offset, in seconds. |
|
virtualinherited |
Add my content into a DOMElement.
Reimplemented in nidas::core::DSMSensor, nidas::core::Variable, nidas::core::ServerSocket, nidas::core::SampleTag, nidas::core::Site, nidas::core::Project, and nidas::core::DSMConfig.
Referenced by nidas::core::ServerSocket::toDOMParent().
|
virtualinherited |
Create a DOMElement and append it to the parent.
Reimplemented in nidas::core::DSMSensor, nidas::core::Variable, nidas::core::ServerSocket, nidas::core::SampleTag, nidas::core::Site, nidas::core::Project, and nidas::core::DSMConfig.
|
virtual |
Queue a sample for writing to a GOES transmitter.
Implements nidas::dynld::isff::GOESXmtr.
|
inlinevirtual |
Do the actual hardware write.
Implements nidas::core::IOChannel.
|
inlinevirtual |
Do the actual hardware write.
Implements nidas::core::IOChannel.
|
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().
|
protectedinherited |
|
private |
|
private |
Referenced by printStatus().
|
private |
Referenced by printStatus().
|
private |
Referenced by printStatus().