
Slider control for XY data does not work on waveform...how to do that ?

supra
My question is what changes I need to do to have applicable also on waveform data.
Function/DF GetSupraPackageDFR() DFREF dfr = root:Packages:Supra if (DataFolderRefStatus(dfr) != 1) NewDataFolder /O root:Packages NewDataFolder /O root:Packages:Supra DFREF dfr = root:Packages:Supra Variable/G dfr:gLastSliderValueAdded = 0 endif return dfr End Function AddSliderValue(xWave, yWave, startX, endX, sliderValue) Wave xWave, yWave Variable startX, endX Variable sliderValue // Take the previously-added slider value, if any, into account DFREF dfr = GetSupraPackageDFR() NVAR gLastSliderValueAdded = dfr:gLastSliderValueAdded // To avoid accumulation of roundoff error we do this in two steps YWave -= (XWave>=startX && XWave<=endX) ? gLastSliderValueAdded : 0 YWave += (XWave>=startX && XWave<=endX) ? sliderValue : 0 gLastSliderValueAdded = sliderValue End
You might look in to the function x2pnt, leading I think to the following or its equivalent:
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
July 11, 2012 at 05:04 am - Permalink
JJWeimer's use of a variable to hold the result of pnt2x() would be a bit faster, but I don't think it will be noticeable in this application.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
July 11, 2012 at 09:19 am - Permalink
Somehow I still didnt able to make it work on wave data.
but somehow still it does not work ?
July 11, 2012 at 07:56 pm - Permalink
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
July 12, 2012 at 04:30 am - Permalink
July 12, 2012 at 05:46 pm - Permalink
The downside is that it employs a different syntax than the first part, but, at least for me, it's much easier to follow.
But maybe I miss something.
July 13, 2012 at 06:05 am - Permalink
I agree with your coding, but I could also be missing something.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
July 13, 2012 at 11:06 am - Permalink