Hi Mark,
Interesting that you mention that subject. It seems to the hot topic for
the last two week. Another convergence I suppose ;)
You'll need to 'beef up' your display to "every data sample" status. True,
the blob viewer (and most of the ActiveX controls) simply display the
current value only and don't bother with the extra processing it takes to
ensure every data point. However, most of the displays on the first tab of
the display builder (what we call Iads 'core' displays) do actually process
every data point (stripchart, crossplot, freqPlots, etc).
If this wasn't an aperiodic blob, I would direct you to the example project
"Creating an ActiveX display using C++ VS2005"
(
http://iads.symvionics.com/programs.html), specifically the
SampleEveryDataPoint class. In fact, you've probably already implemented the
example yet you're still missing data. What makes your job so difficult
right now is that aperiodic blobs aren't supported in the example's
StartFrameRead/GetNextFrameRead functions that make this operation
relatively easy. We have actually fixed this issue in the latest release.
It's a long shot, but if you can upgrade to the version 7.3.3 (beta version
available), this problem will go away and the example project's code will
work fine. I'll continue along assuming you can't upgrade.
Essentially, what you need to do is follow the SampleEveryDataPoint class,
except you'll need to program the StartFrameRead and GetNextFrameRead
functions by hand. What they accomplish is rather simple, but the devil is
in the details. It might take a while to get things working 100%.
Let me give you a sense of the overall work that needs to be done, and then
we can translate that into the example code. A display is 'rendered' at a
frequency of the update rate of the AnalysisWindow (depends on processing
load, but it's approximately 50 times per second). What you need to do is
keep track of the last time you've processed data, and when the next display
cycle comes around, you simply get all of the data from the 'lastTime' to
the 'currentTime', one point (blob) at a time from the Parameter
(IParameter) using the Value2 function. Does this make sense?
The StartFrameRead call in the SampleEveryDataPoint class marks the current
time, so at that point, you would need to copy that time into an IIadsTime
'lastTime' member variable of your class. When the GetNextFrameFread is
called, you would then have to set the parameter's current time to your
'lastTime', then call the Value2 function with the argument
'iadsTimeAdvanceFoward'. This will essentially return the value (blob) at
the specific time, and then walk to the next sequential data point in the
parameter as you call it multiple times. The Value2 function has a argument
to return the time of the data point, and you would use that time to compare
to your 'currentTime'. When the time is >= currentTime you're done. After
that step you'll mark the new 'lastTime' as your current time and then wait
for the next drawing cycle.
There are a number of issues here that makes this complex. The worse part is
that the data is aperiodic, so you can't actually predict how many point to
read in a given time frame... and it's difficult to keep track of the time
values for the data ranges read, so you'll most likely be processing
duplicate points. Also, in order to read aperiodic data from a parameter,
you'll need to set the InterpolatedSampleRate value to zero. The
StartFrameRead/GetNextFrame read takes care of all these issues and more.
Too bad we can't use it ;)
I'll let you absorb this for a bit, then I'll try to build up an
SampleEveryDataPoint example without using StartFrameRead/GetNextFrameRead
functions. It might take a while because I'm pretty busy, sorry.
Jim
--------------------------------------------------
From: "Mark Weston" <
mark.w...@lmco.com>
Sent: Thursday, May 24, 2012 8:33 AM
To: "IADS" <
ia...@googlegroups.com>
Subject: [IADS] Re: Sending blobs through CDS
> --
> You received this message because you are subscribed to the Google Groups
> "IADS" group.
> To post to this group, send email to
ia...@googlegroups.com.
> To unsubscribe from this group, send email to
>
iads+uns...@googlegroups.com.
> For more options, visit this group at
>
http://groups.google.com/group/iads?hl=en.
>