[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[IDV #ZJC-641381]: IDV - VGEE IDV



> I was working with the new Jython Diplay Control, and ran into a small
> problem. The sampleIndex seems to return a data type that can only be
> converted into a string, and not a float or double. This prevents me
> from using the value in other forms (read: my own model).
> 
> 1) Can you add something in the function that allow a user to specifiy
> how the data from the probe should be returned?
The return value from the sample call is a visad object.
If you are using a point probe and are sampling at the animation time
(and if there are actually times in the display) then you will get a VisAD
Real object. If there are no times then the sampleAtTime just samples spatially
and will return a VisAD FieldImpl object.  Likewise, the other probe types
will give some structure (e.g., a FlatField).

To access the value of a Real you can do: 
sample.getValue();
which will return the (double) value of the Real in its native units.


> 2) How do I best use the incl. jtyhon procedure you added the allow the
> user to specify new input data (by presenting the data selector GUI),
> something like:       "displayControl.addEditMenuItem('Change
> parameter','addNewData');" ?

The menu call back routine specified in the menu items is a jython routine.
So you could do the above which will result in a call to the jython routine
addNewData. addNewData can then call back to the displayControl. e.g.:

def addNewData (displayControl):
       displayControl.selectData('Add new parameter');

Note: I changed the methods on the Jython control for selecting data.
They are:
public void addData(String message);
public void addData(String message, String callback);
public void replaceData(String message);
public void replaceData(String message, String callback);

If no call back is specified then it defaults to 'handleData'

If the user does choose something new then the call back routine
is called.

-Jeff



Ticket Details
===================
Ticket ID: ZJC-641381
Department: Support IDV
Priority: High
Status: Closed