jScope
"MDSplus java signal viewer"
jScope.DataProvider Interface Reference
Inheritance diagram for jScope.DataProvider:
jScope.MdsDataProvider jScope.LocalDataProvider jScope.MdsAsynchDataProvider jScope.MdsDataProviderUdt

Public Member Functions

void SetEnvironment (String exp) throws IOException
 
void Update (String exp, long s)
 
String GetString (String in) throws IOException
 
double GetFloat (String in) throws IOException
 
WaveData GetWaveData (String in)
 
WaveData GetWaveData (String in_y, String in_x)
 
boolean SupportsTunneling ()
 
String ErrorString ()
 
void AddUpdateEventListener (UpdateEventListener l, String event) throws IOException
 
void RemoveUpdateEventListener (UpdateEventListener l, String event) throws IOException
 
FrameData GetFrameData (String in_frame, String in_times, float start_time, float end_time) throws IOException
 
void Dispose ()
 
void AddConnectionListener (ConnectionListener l)
 
void RemoveConnectionListener (ConnectionListener l)
 
int InquireCredentials (JFrame f, DataServerItem server_item)
 
void SetArgument (String arg) throws IOException
 
long[] GetShots (String in) throws IOException
 

Static Public Attributes

static final int LOGIN_OK = 1
 
static final int LOGIN_ERROR = 2
 
static final int LOGIN_CANCEL = 3
 

Detailed Description

The DataProvider interface is used by jScope to deal with signals, regardless their origin. DataProvider defines a set of method for providing the signal and supporting several features which may be enabled or disabled depending on the current implementation of the DataProvider interface. Signals are not directly returned by DataProvider access methods as vectors (as it was done in earlier jScope versions). Rather DataProvider GetWaveData method returns an implementation of WaveData. Interface WaveData defines the methods for collecting signal data.

See also
WaveData

Definition at line 18 of file DataProvider.java.

Member Function Documentation

void jScope.DataProvider.AddConnectionListener ( ConnectionListener  l)

Method AddConnectionListener is called by jScope after the instantiation of a DataProvider implementation, in order to be notified of the status of data transfer. If a DataProvider implementation has to handle the transfer of large chunks of data (e.g. frame sequences) requiring a relatively long time, it should be able to communicate the current status of the transfer to jScope which displays then a status bar. To do this, the DataProvider implementation calls ConnectionListener's method processConnectionEvent, passing an istance of ConnectionEvent as argument. Class ConnectionEvent defines the following information:
- int total_size: total size of the data to be transferred
- int current_size: the size of the data transferred so far
- String info: an additional information string which is displayed by jScope
If the DataProvider implementation does not support transfer notification, method AddConnectionListener is empty.

Parameters
lThe ConnectionListener which has to be notified by means of method processConnectionEvent(ConnenctionEvent)
See also
ConnectionListener
ConnectionEvent

Implemented in jScope.MdsDataProvider, and jScope.LocalDataProvider.

void jScope.DataProvider.AddUpdateEventListener ( UpdateEventListener  l,
String  event 
) throws IOException

Method AddUpdateEventListener is called by jScope when asynchronous update on event is defined. To connect data visualization to asynchronous event an event name has to be defined in the Update event field of the setup data form popup dialog. DataProvider implementations supporting asynchronous signal updating should notify event occurrence to all registered listeners by calling method processUpdateEvent(UpdateEvent e). UpdateEvent defines the following field, in addition to those defined in the AWTEvent superclass:
- String name: the name of the event
The possibility of connecting data display to asynchronous events is useful when jScope is used during data acquisition, for an automatic display update when a signal has been acquired. In this case the data acquisition system would generate an event when the signal has been acquired, and the DataProvider implementation would call method processUpdateEvent (defined in UpdateEventListener interface) to request the display update to jScope.
If the DataProvider implementation does not support asynchronous events, the method is defined empty.

Parameters
lThe passed instance of UpdateEventListener.
eventThe name of the event for which the UpdateEventListener is registering.
Exceptions
java.io.IOException
See also
UpdateEventListener
UpdateEvent

Implemented in jScope.MdsDataProvider, and jScope.LocalDataProvider.

void jScope.DataProvider.Dispose ( )

Method Dispose is called by jScope each time a DataProvider is no more used. Unlike Object.finalize(), method Dispose is guaranteed to be called at the time the DataProvider implementation is no more used by jScope.

Implemented in jScope.MdsDataProvider.

String jScope.DataProvider.ErrorString ( )

If an error is encountered in the evaluation of a signal (GetWaveData or GetResampledWaveData returning null or generation IOException), jScope calls ErrorString method to retrieve the description of the error just occurred.

Returns
A verbose description of the last error.

Implemented in jScope.MdsDataProvider, and jScope.LocalDataProvider.

double jScope.DataProvider.GetFloat ( String  in) throws IOException

Method GetFloat is called by jScope to evaluate x min, x max, y min, y max when defined in the stup data source popup form. The argument is in fact the string typed by the user in the form. In its simplest implementation, method GetFloat converts the string into a float value and returns it. Other data providers, such as MdsDataProvider, evaluate, possibly remotely, the passed string which may therefore be represented by an expression.

Parameters
inThe specification of the value.
Returns
The evaluated value.
Exceptions
java.io.IOException

Implemented in jScope.MdsDataProvider, and jScope.LocalDataProvider.

FrameData jScope.DataProvider.GetFrameData ( String  in_frame,
String  in_times,
float  start_time,
float  end_time 
) throws IOException

GetFrameData is called by jScope to retrieve and display a frame sequence. The frame sequence is returned by means of an object implementing the FramesData interface. The methods defined in the FrameData interface are the following:
- int GetFrameType() returning the type of the corresponding frames, as returned by GetFrameAt, which can be:
-FramesData.BITMAP if the frames are returned by method GetFrameAt as a byte matrix
-FrameData.AWT_IMAGE if the frames are returned by method GetFrameAt as the
content of a gif or jpg file
-FrameData.JAI_IMAGE if the frames are returned by method GetFrameAt as the content of every other file format supported by JAI.


- int GetNumFrames() returning the number of frames in the sequence
- Dimension GetFrameDimension() returning the dimension of the single frame
- float [] GetFrameTimes returning the times associated with each frame
- byte[] GetFrameAt(int idx) returning the corresponding frame

Parameters
in_frameThe frame sequence specification as defined in the frames field of the setup data popup dialog
start_timeInitial considered time for the frame sequence.
end_timeFinal considered time for the frame sequence.
in_timesThe definition of the time specification for the frame list as defined in the times field of the setup data popup dialog.
Returns
An implementation of the FrameData interface representing the corresponding frame sequence
Exceptions
java.io.IOException
See also
FrameData

Implemented in jScope.MdsDataProvider, and jScope.LocalDataProvider.

long [] jScope.DataProvider.GetShots ( String  in) throws IOException

Evaluate the passed string to provide am array of shot numbers. For MDSplus data provider it will carry out the execution of the corresponding expression

Implemented in jScope.MdsDataProvider, and jScope.LocalDataProvider.

String jScope.DataProvider.GetString ( String  in) throws IOException

GetString is called by jScope to evaluate title, X label and Y label. These labels are defined as string in the Setup data source popup form. In the simplest case labels are exactly the same as defined, and therefore GetString simply returns its argument. In any case the data provider is free to interpret differently the argument.

Parameters
inThe specification of the label or title.
Returns
The evaluated label or title.
Exceptions
java.io.IOException

Implemented in jScope.MdsDataProvider, and jScope.LocalDataProvider.

WaveData jScope.DataProvider.GetWaveData ( String  in)

Method GetWaveData is called by jScope when a waveform has to be evaluated and only the Y axis is defined. In this case jScope assumes that the specification is enough and it is up to the data provider implementation to retrieve X and Y axis. The evaluated signal is not directly returned as a vector, rather as a object implementing the WaveData interface. The WaveData interface defines the following methods:


- int GetNumDimensions() returns the number of dimensions. Currently only signals (dimension=1) are supported.
- float[] GetFloatData() returns the Y axis of the signal as a float array. For bidimensional signals (not yet supported) the array is organized in row order;
- float[] GetXData() returns the X axis of the signal;
- float[] GetYData() returns the Y axis for a bidimensional signal;
- String GetTitle() returns the associated title (if no title is defined in the setup data popup dialog);
- String GetXLabel() returns the associated X label(if no X label is defined in the setup data popup dialog);
- String GetYLabel() returns the associated Y label(if no Y label is defined in the setup data popup dialog);
- String GetZLabel() returns the associated Z label(if no Z label is defined in the setup data popup dialog);

Parameters
inThe specification of the signal, typed in the Y axis field of the setup data source popup form, or in the lower right window of jScope.
Returns
The evaluated signal, embedded in a WaveData object, or null if an error is encountered.
See also
WaveData

Implemented in jScope.MdsDataProvider.

WaveData jScope.DataProvider.GetWaveData ( String  in_y,
String  in_x 
)

Method GetWaveData is called by jScope when a waveform has to be avaluated and both X and Y axis are defined. The evaluated signal is not directly treturned as a vector, rather as a object implementing the WaveData interface. jScope the uses the returned object to retieve X and Y axis.

Parameters
in_yY axis specification as typed in the setup data source popupo dialog.
in_xX axis specification as typed in the setup data source popupo dialog.
Returns
The evaluated signal, embedded in a WaveData object, or null if an error is encountered.
See also
WaveData

Implemented in jScope.MdsDataProvider.

int jScope.DataProvider.InquireCredentials ( JFrame  f,
DataServerItem  server_item 
)

Some DataProvider implemenations, such as Jet RDA provider, may require additional information (e.g. username and password) typed by users in a login form. As jScope does not make any assumption on this kind of information it is up to the DataProvider implementation to realize such a form (if any). For this reason jScope calls method InquireCredential passingf as argument the container JFrame. InquireCredentials may return:
-DataProvider.LOGIN_OK if the DataProvider has been succesfully validated
-DataProvider.LOGIN_ERROR if the DataProvided did not succeed in validation
-DataProvider.LOGIN_CANCEL if the login proess has been aborted by user (usually pressing
a canel button)
Only in the first case jScope will proceede with the usega of the DataProvider implementation. In the secon case a warning dialog is shown, and in the third case the DataProvider is simply discarded.

Parameters
fThe container Frame.
userLocal username as specified in the property file or in the Network->Edit server list... dialog
Returns
The status of the DataProvider specific validation process

Implemented in jScope.MdsDataProvider, and jScope.LocalDataProvider.

void jScope.DataProvider.RemoveConnectionListener ( ConnectionListener  l)

Called by jScope when transfer notification is no more requested. Empty if the DataProvider implementation does not support transfer status notification.

Parameters
lThe previously registered ConnectionListener.
See also
ConnectionListener

Implemented in jScope.MdsDataProvider, and jScope.LocalDataProvider.

void jScope.DataProvider.RemoveUpdateEventListener ( UpdateEventListener  l,
String  event 
) throws IOException

Method RemoveUpdateEventListeneris called by jScope when the display of a waveform panel is no more triggered by an event.

Parameters
lThe instance of UpdateEventListener previously registered.
eventThe event to which the listener was previously registered.
Exceptions
java.io.IOException
See also
UpdateEventListener

Implemented in jScope.MdsDataProvider, and jScope.LocalDataProvider.

void jScope.DataProvider.SetArgument ( String  arg) throws IOException

As DataProvider implementations are instantiated by jScope by means of the Class.newInstance(), no arguments can be passed to the constructor method. If an additional argument is required for the proper initialization of the DataProvider implementation (e.g. the ip address for the MdsDataProvider), the argument, defined in the server_n.argument item of the property file is passed through method SetArgument called by jScope just after the DataProvider instantiation.

Parameters
argThe argument passed to the DataProvider implementation.
Exceptions
java.io.IOException

Implemented in jScope.MdsDataProvider, and jScope.LocalDataProvider.

void jScope.DataProvider.SetEnvironment ( String  exp) throws IOException

Defines the environment for data retrieval. Depending on the nature of the provider of data, some environment variable may be defined. For example the MdsDataProvider allows the definition of TDI variables which may be useful for configuring remote data access. jScope allows the definition of an arbitrary set of environment variable using the customize->public variables... option. As jScope does not make any assumption on the syntax of the defined variables, each variable definition is passed to the Data provider by means of the SetEnvironment method, whose argument is a String which defines <name value>=""> pairs. If the DataProvider implementation does not support such a feature, it simply returns.

Parameters
expThe variable definition expressed as <name value>=""> pair.
Exceptions
java.io.IOException

Implemented in jScope.MdsDataProvider.

boolean jScope.DataProvider.SupportsTunneling ( )
void jScope.DataProvider.Update ( String  exp,
long  s 
)

Method Update is called by jScope to notify the experiment name and the shot number. Update can be called several time by jScope for the same DataProvider implementation in the case user changes either the experiment name or the shot number.

Parameters
expThe experiment name
sThe shot number.

Implemented in jScope.MdsDataProvider, and jScope.LocalDataProvider.

Member Data Documentation

final int jScope.DataProvider.LOGIN_CANCEL = 3
static

Definition at line 20 of file DataProvider.java.

final int jScope.DataProvider.LOGIN_ERROR = 2
static

Definition at line 20 of file DataProvider.java.

final int jScope.DataProvider.LOGIN_OK = 1
static

Definition at line 20 of file DataProvider.java.