08-15-2014 01:29 PM
In the Diadem Advanced course manual (Aug 2010 edition) on page 6-19, there is a SUD for creating a graph. I would like to do something similar, but I am having trouble.
I have over 200 channels of waveform data and need to be able to let the user go in and make custom graphs to add to the standard report.
I wrote a script to have them supply a trigger channel and value and the time frame they are looking at. Now I just need them to be able to graph the channels they want over that time frame.
Does anyone have something like this already that they don't mind sharing?
Thanks in advance.
Solved! Go to Solution.
08-20-2014 11:21 AM
I have attached what I have for an attempt.
I can't figure out what to do to get the buttons to work to transfer channels from the channel list box into the Y1 and Y2 boxes.
These are waveform channels so the x is not needed.
Can anyone help?
08-21-2014 04:54 AM - edited 08-21-2014 05:01 AM
i think you should call this in the "EventClick"-methods:
Call handleBoxEntries(ChnListBox1, ListBoxY1, False) 'for remove-buttons use this Call handleBoxEntries(ListBoxY1, ChnListBox1, True)
The implementation for the function looks like this:
Sub handleBoxEntries(ByRef lbFrom, ByRef lbTo, bRemove) Dim i For i = lbFrom.MultiSelection.Count To 1 Step -1 If Not(isInList(lbTo, lbFrom.MultiSelection(i).Text)) Then Call lbTo.Items.add(lbFrom.MultiSelection(i).Text, lbFrom.MultiSelection(i).Value) End If If (bRemove) Then Call lbFrom.Items.remove(lbFrom.MultiSelection(i).index) End If Next End Sub Function isInList(lbTo, sText) Dim i isInList = False For i = 1 To lbTo.Items.Count If (lbTo.Items(i).Text = sText) Then isInList = True Exit Function End If Next End Function
08-27-2014 11:43 AM
Thank you Martin.
The Y1 and Y2 buttons are working now.
Now I have a different problem.
I choose a channel, hit the Y1 button and it puts it in the correct box. However when I click the graph button, the script seems to stall. No graph is created and the dialog box stays open. What am I missing?
08-27-2014 02:04 PM - edited 08-27-2014 02:05 PM