Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Addiding a horizontal scroll bar to a waveform graph using a xAxis StripChart mode

Hi

I am developing an application using Measurement Studio 8.0.1 with VS 2005  in C#. The application continuously samples 6 channels of data and plots the results on a waveform chart using the StripChart mode for the XAxis.

I want to add a horizontal scrollbar so the user can pause sampling and scroll back and forward in time. I have seen an example using a vertical scroll (posted by Bilal Durrani) however this is for fixed data.

The scroll box size and scrollbar value would need to change each time data is added to the graph.

Furthermore, how can i determine the horizontal and vertical extents of the 6 plots of data (as a whole) without setting the axes modes to AutoScale, performing a refresh of the graph, getting the axes limits, and then resetting the axes properties?

Thanks

Adam
0 Kudos
Message 1 of 10
(6,664 Views)
A bit more info....

I guess what I am looking at acheiving is the same functionality as is obtained via the Waveform Graph built in capability of panning by using CTRL + mouse left click and dragging but via a scrollbar.

However the scrollbar additionally indicate the amount of data that has been acquired and what percentage of that data is currently being displayed as well as allowing a fast or slow pan capability.
0 Kudos
Message 2 of 10
(6,656 Views)

Hey Adam,

Well you could just have your scrollbar evaluate the history of the chart and then do some calculation to determine the size of the handle on the scrollbar.  Also, you'll have to update the position with your axis.  Then when the scrollbar moves you could generate the Ctrl-Mousemove event.

You would have to determine the plot information based off of the plot data. 

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 3 of 10
(6,642 Views)
Thanks for the reply, that's kind of what I thought.

I have attached a demo application showing what I have done. It seems to work quite well and hope it can be of use to others. Please comment on any suggestions/improvements/etc.
0 Kudos
Message 4 of 10
(6,633 Views)

Hey Adam,

This is great!! Would you mind if I submitted this to our Example Program Database?

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 5 of 10
(6,617 Views)
Hi Sam

No problem
0 Kudos
Message 6 of 10
(6,593 Views)
Hi,

has anybody tested this succesfull with Measurement Studio 8.1? I  can not scroll  with the Slider. Any solutions?

Thanks
Achim
0 Kudos
Message 7 of 10
(6,460 Views)
Hi
 
I just tried it then and didnt work, so I remove the control from the form, and then re-added it and it worked again.
Still not perfect and probably has a few bugs but hopefully a useful place to start.
 
Have attached the newly compiled project for MS 8.1
 
Cheers
 
Adam
0 Kudos
Message 8 of 10
(6,446 Views)
Hi Adam

many thanks for your answer. The new example didnt work. Sorry is my failure (I'm a new Measurement User). I have changed the REFERENCE to my 'NationalInstruments.Analysis.Enterprise'   (vs Professional). Now it works very fine. Many thanks for your very good example.and starting point for me!

Greetings
Achim
0 Kudos
Message 9 of 10
(6,439 Views)

Hi,

 

I have downloaded the project attached here, but I am not understanding very well UpdateScrollBox function so could anyone explain me? I don't understand what are the comments //1, 2, 3, 4, 5 and 6 that describe each possible case.

 

Thx and good job!

0 Kudos
Message 10 of 10
(4,963 Views)