MAK Data Logger API Documentation for HLA
3 - Inspecting Logger State

Loggers send heartbeats periodically.

They send total state interactions by request. They contain the overall state of the Logger. This information is maintained in a list of remote connection records. Entries for these records can be inspected. The entries are updated when heartbeats are received or the Loggers can be polled using a request state interaction (DtRemoteControlSystemInterface::requestStateUpdate()). As mentioned in 2 - Connecting to Loggers, you can register callbacks for the interactions. Alternatively, the system interface receivedTotalState() method can be overridden to process the list of connections when all of them have been updated by a total state interaction. The following code is from the lgrControl application.

virtual void receivedTotalState()
{
DtEntityIdSet connectedLoggers;
myInterface->getConnectionIds( connectedLoggers );
if (connectedLoggers.size() == 0)
{
DtInfo << "No Loggers Connected.\n";
}
else
{
DtInfo << "Connected Loggers\n";
DtEntityIdSet::const_iterator idIter = connectedLoggers.begin();
DtEntityIdSet::const_iterator lgrEnd = connectedLoggers.end();
for ( ; idIter != lgrEnd; ++idIter)
{
DtRemoteLoggerConnection* connection =
myInterface->getConnection(*idIter);
if (connection)
{
connection->printDataToStream(DtInfo);
}
}
DtInfo << std::endl;
}
}

[<< Connecting to Loggers] [Home] [Top of Page] [Sending Commands Using the Remote Control Interface >>]


Document ID: Generated on Thu Apr 11 12:13:00 EDT 2013 from SVN revision 126011
Copyright © 2005-2012 VT MÄK. All Rights Reserved (www.mak.com)