pelican/emulator/test/src/RealUdpEmulator.cpp
/**
 * @details Constructs the RealUdpEmulator.
 * This obtains the relevant configuration parameters.
 */
@details Constructs the RealUdpEmulator.
This obtains the relevant configuration parameters.
@details Constructs the RealUdpEmulator . This obtains the relevant configuration parameters .
RealUdpEmulator::RealUdpEmulator(const ConfigNode& configNode)
    : AbstractUdpEmulator(configNode)
{
    _counter = 0;
    _interval = configNode.getOption("packet", "interval", "100000").toULong();
    _packetSize = configNode.getOption("packet", "size", "8192").toULong();
    _initialValue = configNode.getOption("packet", "initialValue", "0").toDouble();
    _numPackets = configNode.getOption("packet", "number", "-1").toInt();
    if (_packetSize % sizeof(double) != 0)
        throw QString("RealUdpEmulator: "
                "Packet size must be a whole number of doubles.");
    if (_packetSize == 0)
        throw QString("RealUdpEmulator: Packet size must be > 0.");
    _packet.resize(_packetSize);
}
RealUdpEmulator :: RealUdpEmulator ( const ConfigNode & configNode ) : AbstractUdpEmulator ( configNode ) { _counter = 0 ; _interval = configNode . getOption ( " " , " " , " " ) . toULong ( ) ; _packetSize = configNode . getOption ( " " , " " , " " ) . toULong ( ) ; _initialValue = configNode . getOption ( " " , " " , " " ) . toDouble ( ) ; _numPackets = configNode . getOption ( " " , " " , " " ) . toInt ( ) ; if ( _packetSize % sizeof ( double ) != 0 ) throw QString ( " " " " ) ; if ( _packetSize == 0 ) throw QString ( " " ) ; _packet . resize ( _packetSize ) ; }
@details Constructs the RealUdpEmulator.
@details Constructs the RealUdpEmulator .
// Initialise members. // Default of -1 == run forever. // Check that the packet size is a multiple of 8. // Check that the packet size is not empty. // Initialise the packet.