Oscilloscope Reference Writing math plugins
{
input1.CurrentFrame = f;
input2.Curre
ntFrame = f;
output.CurrentFrame = f;
for (long i = 0; i < output.Count; i++)
output[i] = input1[i] * input2[i];
}
The final waveform type is IWaveformDB (waveform database or DPO d ata). This type essentially tracks
hits in a visual manner. The higher the value that is stored into a point relative to the other values stored,
the brighter the color will be. U nlike an INormalizedVector or an IFastFrame, the IWaveformDB goes
both horizontally and vertically across the screen. The horizontal length is in Horizontal.Count and the
vertical height is in Vertical.Count. To access a point inside the IWaveformDB, use double array indices
where the vertical position comes before the horizontal position:
IWaveformDB output;
long hCount = output.Horizontal.Count;
long vCount = output.Vertical.Count;
for (long hh = 0; hh < hCount - 1; hh++)
{
Parallel.For(0, vCount, vv =>
{
output[vv, hh] = output[vv, hh + 1];
});
}
If the output type of a plugin is IWaveformDB, when the plugin is called the output waveform is populated
with the values the plugin returned the last time it was called. If this is the first time the plugin was called,
all of the values inside the IWaveformDB will be zero (displays as clear).
The advanced user can change the vertical scale and position, as well as the horizontal scale and spacing by
setting Vertical.Scale, Vertical.Position, Horizontal.Scale, and Horizontal.Spacing in the IWaveformDB.
IString
A plugin may use an unlimited number of IStrings as input. An IString is simply a string and is used to
pass meta data or additional information into a plugin.
ISettings: scope settings
You can access information about instrument settings through ISettings. Settings for the math target, as
well as the input and output waveforms, are put into the dictionary. However, if the waveform is an
intermediate, no setting information is available. Examples of intermediates are:
MATH1=Add(Ch1*Ch2, Ch3): Ch1*Ch2 is an intermediate
MATH1=Add(Ch1, Ch2)*Ch3: The output of Add is an intermediate
To look up information in ISettings, you need to know the waveform name. For input or output waveforms,
this is put into the SourceName field. This is either Ch<n>, Math<n>, Ref<n> or Intermediate<n> if it is a
DSA/DPO70000D, MSO/DPO/DSA70000C, DPO7000C, and MSO/DPO5000 Series 753