DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

What event for View Pane, is fired when zoom changed for 2D chart?

Hello Group,

 

I am looking to see if there is a way to detect when a DIAdem users when in View pane and are using a 2D chart object, that the Zoom level was changed or a different area of curve was selected.  

Maybe there is an event that will do this that I do not know about!

 

The reason I am asking is that it is very easy for me to try to do a right click in a view 2D chart, and instead of getting the drop down menu that allows the chart to be configured, I change the zoom level quite a bit, and it is time consuming to get the display back to what I had before the error, want to reduce the time to fix this error.    If an event is fired when the zoom is changed, then can make a undo/redo button that would allow users to put the zoom back to where I wanted it to be before it was messed up.

 

Also could use this to zoom in to a waveform to find out the details of a waveform, then just hit the undo button and then go back to the higher resolution display very quickly.

 

Second Question that is kind of related 

Can the View 2 D chart, have custom buttons in the top of the 2 D chart?

 

 

Paul

 

0 Kudos
Message 1 of 6
(2,351 Views)

In Brad Turpin's reply to another forum post, he provides a script named 'Time Align Curves.VBS' that includes code to add a panel button to the View panel.  https://forums.ni.com/t5/DIAdem/Time-Aligning-Two-Datasets/td-p/3985396?profile.language=en 

Direct link to the VBS file:  https://forums.ni.com/ni/attachments/ni/60/26907/1/Time%20Align%20Curves.VBS 

 

The following link may also be helpful with adding the panel button:  http://www.savvydiademsolutions.com/script.php?topic=create-custom-menu-using-barmanager 

 

Another approach to your View zoom changed for 2D chart problem might be to create a View zoom save and restore buttons.  

 

Message 2 of 6
(2,272 Views)

Thanks Mark,

 

Looks like the most workable solution is to make three buttons on top of view pane, One to save to a rolling save array, and the other two to move zoom values between, the saved zoom settings in kind of a forward/back function. 

 

The Values saved would be for just the active view sheet, same for the forward /back buttons.

Will see how this solution goes.

 

Thanks for the feedback!

 

Paul

0 Kudos
Message 3 of 6
(2,252 Views)

Hi Guys,

 

If your customer happens to be zooming with the band cursor, then you could use the "OnCursorChanged" event, though it will fire any time the cursor moves at all or when the active area changes, so it may be too twitchy for you.

 

If your customer is zooming with the right-click-drag method, also known as the zoom icon at the top left of the graph, I'm not aware of an event that tracks with that action.

 

Might be time for a DIAdemIdea,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 4 of 6
(2,242 Views)

 

What I am working to solve sounds like the right click drag issue.  It is very easy with a  mouse to think that you are stationary, but are moving a little bit.  Then when click the right click the zoom is envoked and it puts the curve in to a very odd place, that is difficult/time consuming to put back. 

 

I will see what I can do with the "OnCursorChanged" event. Maybe can check the zoom settings when this fired, and look for changes, and only save when zoom level has actually changed some.  

 

Will see if can describe this into a DIAdem  Idea post.  ( I have not done many of these)

 

Paul

0 Kudos
Message 5 of 6
(2,236 Views)

Hi Paul,

 

That's an excellent idea.  You can use the twitchy callback to monitor other VIEW settings every time the cursor moves, and only act when it's appropriate.  Even if all you do is log states internally to global variables, that could be useful the next time the user clicks a custom button in VIEW.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 6 of 6
(2,225 Views)