Showing results for 
Search instead for 
Did you mean: 

create a graph dialog box

Go to solution

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.

0 Kudos
Message 1 of 5

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?

0 Kudos
Message 2 of 5
Accepted by topic author 2Pale4TX

Hi There, 


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
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
End Function





0 Kudos
Message 3 of 5

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?

0 Kudos
Message 4 of 5



It looks like I have it now.  Thanks for the help. 


0 Kudos
Message 5 of 5