User`s manual
Writing Custom Applications
The code fragment above calculates the nominal block processing rate. The AveragedRate object, Time, maintains a moving
averaged filtered rate. This rate is stored in FBlockRate for use by display method of the GUI.
if (Settings.LoggerEnable && !Logger.Logged())
{
// Start counter
Clock.Start();
std::stringstream msg;
msg << "Packet size: " << Packet.Size() << " samples";
UI->Log(msg.str());
}
// If enabled, log the data stream
if (Settings.LoggerEnable || Settings.PlotEnable)
if (FBlockCount < BlocksToLog)
Logger.LogWithHeader(Packet);
//
// Count the blocks gone by on each Channel...
++FBlockCount;
In this example, each received packet is logged to a disk file. The packet header and the body are written into the file, which
implies that a post-analysis tool (such as BinView) will be used to parse channelized data from the file. Alternately, custom
applications may use the Innovative::PacketDeviceMap object to conveniently extract channelized data from a packet data
source.
//
// Stop streaming when both Channels have passed their limit
if (Settings.AutoStop && IsDataLoggingCompleted() && !Stopped)
{
// Stop counter and display it
double elapsed = Clock.Stop();
StopStreaming();
UI->AfterStreamAutoStop();
UI->Log("Stream Mode Stopped automatically");
UI->Log(std::string("Elasped (S): ") + FloatToString(elapsed));
}
// Auto-analyze and retrigger in framed mode
if (!Settings.Framed)
return;
Packets are processed until a specified amount of data is logged or the GUI Stop button is pressed.
if ((Settings.ExternalTrigger == 0) && Settings.AutoTrigger)
{
__int64 samples = FBlockCount * Settings.PacketSize;
int triggers = static_cast<int>(samples/Settings.FrameCount);
if (triggers != FTriggered)
SoftwareTrigger();
}
}
In the event that were operating in framed trigger mode, the example code re-asserts a software trigger each time a frames-
worth of data packets have been received. If we're in continuous mode, no action need be performed to sustain data flow.
X5-GSPS User's Manual 56