DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

View Display Type - Dialog Box?

I'm working on a script to allow users to define the bias and scale factor for several channels interactively with the 2d Chart as opposed to copying down data values.  It turns out the v11.0 example, "Dynamic Display of Statistical Characteristic Values in DIAdem VIEW" got me over the first big hurdle of learning how to process a user-selected subset of each channel.  It's also helpful in that I'm using a dialog box to provide some additional form of user interaction, but I'm still a little fuzzy on how to hook up my dialog box and script.

 

For one thing, all the dialog box examples I have seen so far use modal or non-modal floating dialog boxes invoked with SUDDlgCreate or SUDDlgShow.  My dialog box is in a view area.  Is there another command to invoke an embedded dialog or does it automatically start running when the view is opened?  Are the dialog box objects and the rest of the DIAdem's object model equally visible to each other?  Is there any issue with, for example, having a button on the dialog box create new channels of filtered data, add custom channel properties, or change the leading curve?  What about the other way around?  I assume having the CursorChangedEvent handler inject values into the dialog box is not too difficult, based on what I've been able to see in the example?

 

Thx,

Dave 

0 Kudos
Message 1 of 6
(5,353 Views)

Hi Dave,

 

Your SUDialog has full programming access to items in DIAdem (channels, properties, etc.) that you could access with a VBScript running in the SCRIPT panel.

 

If you want to embed your SUDialog in a VIEW area, your SUDialog must be non-modal.  You can add the VIEW-Area control to the GUI of your SUDialog to accomplish the embedding, but the easiest option is to right-click on the VIEW area you want the SUDialog to be in and choose a Display Type of "Dialog Box", then provide the SUDialog file path AND the name of the dialog (Dlg1?) you want from that SUdialog file.

 

A DIAdem script or button or menu can control the SUDialog through the non-modal dialog handle.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 2 of 6
(5,331 Views)

Thanks Brad.  I've defined a view with my dialog box displaying in one of the areas and have been able to transfer a lot of the functionality previously in scripts to the dialog box.

 

However, the event support might be too thin for what I'm trying to accomplish.  Originally I wanted to update the information on the dialog box when the user selected a different channel group in the portal, but I don't see anything like a Portal.SelectionChanged event.  Updating the info when the user adds new channels to the curve chart would be fine, but I don't see an event for that either.  Do you have any suggested work arounds?

 

I'm also curious about event handlers with multiple worksheets.  If I have several worksheets each with a curve chart, does moving the cursor in one of those charts trigger the ViewConnector_EventCursorPosChanged event handler in the dialog boxes on every worksheet, or does the dialog box on a worksheet only trigger on events originating from that worksheet?

0 Kudos
Message 3 of 6
(5,324 Views)

Hi Daklu,

 

There are no Data Portal change events in DIAdem 2012 that you can hang your custom VBScript code on, aside from data loading/saving events.  There are also no curve configuration change events in VIEW (there is one in REPORT).  The only DIAdem 2012 events in VIEW are double-click, cursor change, sheet change and context menu display and selection.  If the VIEW cursor event change event occurs, it will only trigger the corresponding callback function in the SUDialog embedded in THAT sheet.  You can put your own UserCommand VBScript code behind any of the VIEW events and make calls to your SUdialogs using the object variable for the corresponding non-modal dialog.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 4 of 6
(5,319 Views)

"If the VIEW cursor event change event occurs, it will only trigger the corresponding callback function in the SUDialog embedded in THAT sheet."

 

Cool, I wasn't expecting that.  I assume if I register a cursor change event in a script using AddUserCommandToEvent it will fire regardless of the sheet on which the cursors change? 

0 Kudos
Message 5 of 6
(5,317 Views)

Correct.

0 Kudos
Message 6 of 6
(5,305 Views)