Documentation:Beginners:JScope - MdsWiki
Navigation
Personal tools

From MdsWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 19:51, 2 February 2011 (edit)
Asquit (Talk | contribs)

← Previous diff
Current revision (12:59, 26 November 2021) (edit)
Manduchi (Talk | contribs)

 
Line 1: Line 1:
-<center><br />'''<font size="+3"> jScope</font>'''</center><br />[[Image:jScope.jpg]]+This page has been replaced by the [https://mdsplus.org/index.php?title=Documentation:Tutorial:GUIs:jScope&open=1624466399993194807359&page=Tutorials%2FGUIs%2FjScope JScope Tutorial Page]
- +
-jScope is a Java tool for the display of waveforms. Its concepts derive from the MDSPlus Scope, the MDSplus tool for data visualization. jScope adds new features, such as color support and error bars. <br />With jScope it is possible to define a set of panels and a set of waveforms is associated with each panel. Once the Waveform(s) have been displayed, it is possible to zoom parts of them, to move a cursor in order to get exact coordinates, and to drag waveforms.+
- +
-Following is a brief summary of the options currently available in jScope:+
- +
-'''Main Menu bar'''<nowiki>: </nowiki>+
- +
-* '''<u>File</u><nowiki>:</nowiki>'''+
-** <u>New Window:</u> creates a new jScope windows+
-** <u>Close</u><nowiki>: closes the current window</nowiki>+
-** <u>Exit:</u> quit the application<br /><br />+
- +
-* '''<u>Pointer mode</u>'''<nowiki>: defines the current mouse behaviour, which can be set as follows:</nowiki>+
-** <u>Point:</u> in this configuration, a crosshair is present on each panel, and can be moved over the waveform. The corresponding point coordinates are displayed on a bottom line, and crosshairs on the other panels are moved accordingly to the time coordinates of the selected crosshair. When more tha one waveform is displayed on the same panel, clicking the mouse near one waveform, locks the crosshair to the selected waveform (as indicated also by the colour of the crosshair). The bottom line indicates which waveform is currently selected. Clicking MB2 mouse button when in point mode sets all the scales of the waveforms (both X and Y) to the scale of the selected panel.+
-** <u>Zoom</u><nowiki>: when in Zoom mode it is possible to drag the mouse in order to define a zoom region. Clicking MB1 mouse button when in Zoom mode also enlarges the waveform, centered around the current mouse position.</nowiki>+
-** <u>Pan</u><nowiki>: when in Pan mode, it is possible to drag the waveform(s) of the selected panel.</nowiki>+
-** <u>Copy</u><nowiki>: in Copy mode, it is possible to select one panel (clicking MB1 mouse button) and copy its contents in the other panels (clicking MB2 mouse button). Deselection is made by clicking MB2 mouse button in the selected panel. Pointer modes are also selectable using the bottom radio boxes.</nowiki><br /><br />+
-* '''<u>Print</u>'''<nowiki>:</nowiki>+
-** <u>Print All:</u> prints all the waveforms.<br /><br />+
- +
-* '''<u>Customize</u>'''<nowiki>:</nowiki>+
-** <u>Global Setting</u><nowiki>: defines a subset of the waveform settings which is valid for all waveforms (see description of waveform settings below). It defines also grid configuration, such as the number the number of vertical and horizontal grids. A toggle button will also define black or white background.</nowiki>+
-** <u>Window</u><nowiki>: defines the number of panels. Panels can then be re-dimensioned by dragging the small handles between panels.</nowiki>+
-** <u>Printer</u><nowiki>: to be used for printer selection. It appears only using JDK 1.2.</nowiki>+
-** <u>Page setup</u><nowiki>: It appears only using JDK 1.2, to be used for page orientation and print margins.</nowiki>+
-** <u>Font Selection:</u> defines the font to be used for labels and numbers in jScope+
-** <u>Color list</u><nowiki>: defines the color palette, which is then used to assign colors to waveforms.</nowiki>+
-** <u>Public variables</u><nowiki>: defines the context for data access (see customization section for using this feature in non MDSPlus systems)</nowiki>+
-** <u>Brief error</u><nowiki>: defines complete or reduced error reporting (MDSPlus version only).</nowiki>+
-** <u>Use last Saved Setting, Use Saved Setting from...</u>'' ''<nowiki>: retrieve the a saved jScope configuration. jScope configurations can be saved in files, and reloaded at any time. The name of a configuration file can be defined as a command argument. e.g. java jScope &lt;configuration filename&gt;.</nowiki>+
-** <u>Save current setting, Save current setting as</u><nowiki>: save current configuration in a file.</nowiki><br /><br />+
-* '''<u>Autoscale:</u>''' used to redisplay full waveforms (e.g. after zooming or dragging) it is a subset of a popup menu described below.+
-** <u>All</u><nowiki>: autoscale all signals</nowiki>+
-** <u>All y</u><nowiki>: autoscale only y values.</nowiki><br /><br />+
-* '''<u>Network</u>'''<nowiki>: defines current connection to data.</nowiki>+
-** <u>Fast network access</u><nowiki>: enables data reduction over the network (MDSplus version only)</nowiki>+
-** <u>Servers</u><nowiki>: defines data source. A server can be local or remote. In the latter case it is defined by its IP address. The current server can be defined at the command line as follows: java -Ddata.address=&lt;IP address&gt; jScope. The current server is displayed in the bottom line on the right.</nowiki>+
-** <u>Edit server list</u><nowiki>: allows to add new servers on the server list.</nowiki><br /><br />+
- +
-'''Popup Menu'''<br />A popup menu is displayed clicking MB3 mouse button on a panel (except in Copy mode) as follows: <br />[[Image:data_popup.jpg]]<br /> <br />+
- +
-The first item of this menu defines the contents of the selected panel and activates a setup form. The form is as follows <br />[[Image:data_setup.jpg]]+
- +
-and defines the following fields:+
- +
-<blockquote>+
- +
-* <u>Title</u><nowiki>: the title of the panel (optional)</nowiki>+
-* <u>Signal Label</u><nowiki>: the string to appear in the legend associated with the signal. If no label is defined, the definition of the Y axis of the signal is displayed.</nowiki>+
-* <u>Y</u><nowiki>: the y axis of the signal</nowiki>+
-* <u>Y</u> label: the label associated with y axis (optional)+
-* <u>X</u><nowiki>: the x axis of the signal (optional, see below how jScope handles the case in which no x axis is specified)</nowiki>+
-* <u>X label:</u> the label associated with x axis (optional)+
-* <u>Xmin, Xmax, Ymin, Ymax</u><nowiki>: maximum and minimum values for x and y axis (optional)</nowiki>+
-* <u>Experiment:</u> the name of the experiment (pulse file)+
-* <u>Shot</u><nowiki>: the shot number</nowiki>+
-* <u>Update event:</u> the name of the event which generates an automaic update (MDSPlus version only)+
-* <u>Default node</u><nowiki>: the default node in expression evaluation (MDSPlus version only)</nowiki>+
- +
-</blockquote>+
- +
-It is possible to define a set of signals using the form: after filling the fields and pressing &lt;return&gt;, the signal is added to the list. Definitions can be modified by selecting the signal on the list. To add a new signal to the list, select the first item; to remove a signal from the list, select it and press &lt;del&gt;. <br />Clicking the <u>expand expr</u> button, a popup window is displayed, which allows easier typing of long specifications of the X and Y axis. It is possible then to define maximum and minimum errors for displaying error bars, by clicking <u>button error...</u>. Most fields have a toggle button associated with them: when selected, the value of the corresponding field is taken from the global configuration (see before). For the definition of the shot field it is also possible to use the bottom shot field. In this case a set or a range of shots can be defined: a set is specified by the following syntax: [&lt;sho1&gt;, ,shot2&gt;, ...]; a range by: &lt;first_shot&gt;:&lt;last_shot&gt;. Once a signal has been added to the list, the corresponding color and type of marker can be set first selecting the signal and then using the pull-down menus on the right of the form. <br />When a signal in the signal list is selected in the Setup data source popup form, it is possible to define the associated marker and color, as well to define wether the interpolating line has to be displayed and the marker step, i.e. the number of data points for each visible marker.+
- +
-The second item of the Waveform popup menu allows the selection of the associated waveform (indicated by a red border around the selected waveform). Waveform selection is used as a fast way for defining waveforms: in this case the name of the signal can be typed in the bottom ''Signal'' text field and inserted in the selected waveform by pressing &lt;Return&gt;. The name refers only to the Y Value field of the Setup popup form; all the other parameters are taken from the global configuration. Multiple waveforms can be inserted by consecutively typing the waveform name and pressing &lt;Return&gt; in the Signal field. If no wave panel is selected and new signals are entered, a new panel is created for each signal.+
- +
-The other two items of the Waveform popup menu allow the definition of legend for the signals associated with the waveform. The legen can be activated/deactivated and positioned where needed in the waveform window. The associated labels associated with the signals are displayed in the legend. If no label is associated with a given signal, the Y-value name is displayed istead.+
- +
-The ''Signals ''item of the Waveform popup menu allows a rapid activation/deactivation of the currently defined signals. It is useful when dealing with multiple signals to individually define their visibility in the waveform panel.+
- +
-The ''Marker'', ''Marker-step'', ''Colors'' and ''Interpolate'' items of the Waveform popup menu are active only in point mode, i.e. when one signal is selected, and allow a rapid definition of the associated graphical configuration without opening the Setup data source popup form.+
- +
-The other items of the popup list allow rescalings of waveforms, and their meanings are clear from the associated label.+
- +
-Finally the last item ''Save as Text'' writes the displayed waveforms points in a text file.+
- +
-<center><br />'''<font size="+2">jScope and Images</font>'''</center><br />+
- +
-It is now possible with jScope to look at sequences of frames (usually produced by a camera) and to correlate them with other waveforms. Using standard jdk, it is possible to look at gif, jpeg and multiframe gifs developed at CMOD. It is also possible to look at other formats by installing the standard java extension JAI (Java Advanced Imaging). <br />A jScope panel can be connected to a sequence of frames by selecting the is_image check box in the data setup dialog. When image mode is selected, the fields of the setu data dialog are changed and looks like the following: <br />[[Image:image_setup.jpg]]<br /> +
- +
-where the fields have the following meaning+
- +
-* <u>Title</u><nowiki>: title written above the image</nowiki>+
-* <u>Frames</u><nowiki>: frame sequence name (the following section will explain how names are associated with frame sequences)</nowiki>+
-* <u>Times</u><nowiki>: defines the time to be associated with each frame. If timing information is stored into the frame set (such as for CMOD multiframe gifs) , there is no need to fill this field. Otherwise it will refer to a vector of times.</nowiki>+
-* <u>t min, t.max</u><nowiki>: defines minimum and maximum time to be considered in the frame sequence. NOTE: this field is very important for very large sequences of frames. jScope in fact discards frames whose time is outside the specified interval, thus freeing memory resources. The default value(as specified by the associated checkboxes) is taken from xmin and xmax fields of the global setting.</nowiki>+
-* <u>use JAI</u> enables the use of the JAI library. NOTE: avoid using JAI support for formats already supported by jdk because JAI libraries use more memory.+
-* <u>Y label</u><nowiki>: the label associated with y axis (optional)</nowiki>+
-* <u>X label:</u> the label associated with x axis (optional)+
-* <u>Pix Xmin, Pix Xmax, Pix Ymin, Pix Ymax</u><nowiki>: maximum and minimum values for the region of interest in the image(in pixel)</nowiki>+
-* <u>Experiment:</u> the name of the experiment (pulse file)+
-* <u>Shot</u><nowiki>: the shot number</nowiki>+
-* <u>Update event:</u> the name of the event which generates an automaic update (MDSPlus version only)+
-* <u>Default node</u><nowiki>: the default node in expression evaluation (MDSPlus version only)</nowiki>+
- +
-and the checkboxes indicate wether the corresponding value is taken from the global setup. <br />Once the frame sequence has been loaded, the first frame of the sequence is displayed. When in zoom mode, it is possible to enlarge portions of the image. When in point mode, the frame sequence is synchronized with the other displayed waveforms. This means that moving the cursor over a waveform will also update the displayed frame accordingly. When in point mode, &lt;ctrl&gt;MB1 click will proceede one frame further (moving in correspondence the cursor over the other waveforms). Conversely, &lt;shift&gt;MB1 click will go back one frame. <br />When a panel is displaying a frame sequence, the popup menu will look as follows:+
- +
-[[Image:frame_popup.jpg]]+
- +
-where some frame-specific menu items are defined as follows(the others have the same meaning as when looking at waveforms):+
- +
-* <u>Start play</u><nowiki>: start frame animation. When in zoom mode, the cursor is moved over the other waveforms, and animation is performed in step for the other frame panels. During animation the item is chenged to stop play for stopping the animation.</nowiki>+
-* <u>Autoscale</u><nowiki>: used to come back to the original frame width after zooming.</nowiki>+
-* <u>Autoscale all images</u><nowiki>: the same as above, performed on all the frame panels.</nowiki>+
- +
-<br />'''<font size="+1">How to integrate frame sequences in jScope using MDSplus</font>'''+
- +
-When using a MDSplus data server (mdsip) for getting data in jScope, the following TDI functions must be provided for displaying frame sequences, and will be invoked by jScope in the given sequence: <br />+
- +
-* '''JavaGetAllFrames(in _experiment, in_frame_name, in_shot)''' : this TDI function receive the experiment (string), the shot (int) and the frame sequence name(string) as defined in the popup dialog. This fun will return 0 if frames are stored in separate items, thus making jScope separately request each frame of the request. Currently this fun will return a non zero value only for multiframe gif format implemented at CMOD. In this case, the content of the file is returned in the form of a byte array as it stands (it will be decoded by jScope) and the following funs are <u>not</u> called.+
-* '''JavaGetFrameTimes(in _experiment, in _frame_name, in _shot):''' this TDI function receives the same parameters of the above function, and will return an array of times, specifying the ime associated with each frame.+
-* '''JavaGetFrameAt(in _experiment, in _frame_name, in _shot, in _frame_idx): '''this TDI function receives in addition the index of the required frame in the frame sequence. It will be called by jScope as many times as the dimension of the time vector returned by JavaGetFrameTimes, and will provide the selected image (frame) as it stands in the form of a byte array.+
- +
-'''<font size="+1">The property file of jScope</font>'''<br />When started, jScope looks for the jScope.properties file. This file allows user configuration of jScope and may look as follows:+
- +
- jScope.directory=E:\\<br />jScope.default_server=Demo server<br />jScope.data_server_1=Jet data<br />jScope.data_server_2=Ftu data:192.107.51.30<br />jScope.data_server_3=150.178.3.47<br />jScope.data_server_4=150.178.3.80<br />jScope.data_server_5=150.178.3.80:8000<br />jScope.data_server_6=pdigi1.igi.pd.cnr.it:8000<br />+
- jScope.reversed=false<br />jScope.grid_mode=Dotted<br />jScope.x_grid=5<br />jScope.y_grid=5</font><br />+
- jScope.item_color_0=Blak,java.awt.Color[r=0,g=0,b=0]<br />jScope.item_color_1=Blue,java.awt.Color[r=0,g=0,b=255]<br />jScope.item_color_2=Cyan,java.awt.Color[r=0,g=255,b=255]<br />jScope.item_color_3=DarkGray,java.awt.Color[r=64,g=64,b=64]<br />jScope.item_color_4=Gray,java.awt.Color[r=128,g=128,b=128]<br />jScope.item_color_5=Green,java.awt.Color[r=0,g=255,b=0]<br />jScope.item_color_6=LightGray,java.awt.Color[r=192,g=192,b=192]<br />jScope.item_color_7=Magenta,java.awt.Color[r=255,g=0,b=255]<br />jScope.item_color_8=Orange,java.awt.Color[r=255,g=200,b=0]<br />jScope.item_color_9=Pink,java.awt.Color[r=255,g=175,b=175]<br />jScope.item_color_10=Red,java.awt.Color[r=255,g=0,b=0]<br />jScope.item_color_11=Yellow,java.awt.Color[r=255,g=255,b=0]+
- +
-* '''jScope.directory''' defines the default directory for storing and retrieving configurations.+
-* '''jScope.default_server''' defines the data server at startup.+
-* '''jScope.data_server_n''' defines the data nth data server displayed in the server list.+
-* '''jScope.reversed''', if true, defines black background.+
-* '''jScope.grid_mode''' defines the grid selection.+
-* '''jScope.x_grid''' defines the tentative number of x labels.+
-* '''jScope.y_grid''' defines the tentative number of y labels.+
-* '''jScope.item_color_n''' defines the nth color in the color palette.+
- +
-<center><br />'''<font size="+2">How to customize jScope to a non MDSplus system</font>'''</center><br />+
- +
-Using jScope in another system requires the implementation of two classes'' LocalProvider'', used to access local data, and ''NetworkProvider'', used to access remote data, both implementing the ''DataProvider'' interface.+
- +
-''DataProvider'' defines the following methods, which must be implemented by both classes: <br />+
- +
-* '''''public void SetEnvironment(String s)''''' defines the environment for data retirieval: the argument is a String which defines &lt;name value&gt; pairs, which is defined by the customize-global variables menu bar item. In MDSplus, for example, it is used to set global variables which can then be used in expression evaluation, i.e. when retrieving signals. If the system does not support anything similar, the simply returns.+
-* '''''public void Update(String experiment, int shot)''''' called before each signal readout to define the current experiment and shot.+
-* '''''public String GetString(String in)'''<nowiki>: </nowiki>''called when a string (i.e. a title of a panel, or a X/Y label) needs to be evalueted. If no evaluation is required, simply return the argument.+
-* '''''public float GetFloat(String in)'''''<nowiki>: called when a single floating point value is required. It is used to evaluate X/Y min/max values when defined in the setup form. If no particular evaluation is required, simply return </nowiki>''new Float(in).floatValue()''.+
-* '''''public float[] GetFloatArray(String in)'''''<nowiki>: called each time a signal must be read. The argument is the specification given in Y field of the setup form. Its interpretation is left to this method.</nowiki>+
-* '''''public int[] GetIntArray(String in)'''''<nowiki>: called to evaluate shot number(s). The argument to be evaluated is the content of the bottom </nowiki>''shot'' field, possibly defining an array of shot numbers.+
-* '''''public String GetXSpecification(String in)''<nowiki>:</nowiki>''' called when data must be retrieved, but no specification of the X axis is given. Most systems, in fact provide some method for evaluating x axis, based on the specification of the signal. The returned string is then passed to ''GetFloatArray'' to retrieve x values.+
-* '''''public String ErrorString()'''''<nowiki>: if </nowiki>''GetFloatArray'' returns null, jScope assumes that an error occurred in data retrievel, and calls ''ErrorString'' to get the description of the error, in order to display it on a popup window.+
-* '''''public String GetDefaultTitle(String in_y[])'''''+
-* '''''public String GetDefaultXLabel(String in_y[])'''''+
-* '''''public String GetDefaultYLabel(String in_y[]) '''''<nowiki>:these methods are called when fields title, x label and y label, repectively, are left empty. The argument is the content of the y value field. If no default label is defined, these methods return null.</nowiki>+
-* '''''public byte[] GetAllFrames(String frame_name)''''' called first when a frame sequence is requested. Returns null if frames are stored individually. Currently only CMOD multiframe gifs are supported.+
-* '''''public float[]GetFrameTimes(String frame_name)''''' return the array of times associated with the specified frame sequence.+
-* '''''public byte[] GetFrameAt(String frame_name, int idx) '''''return the frame at index idx. The content of the file is passed as a byre array.<br />+
- +
-The following methods refer to more specialized tasks, currently supported by MDSplus. Implement them as follows:<br />+
- +
- public boolean SupportsAsynch() { return false; } <br />public void addMdsEventListener(MdsEventListener l, String event){} <br />public void removeMdsEventListener(MdsEventListener l, String event){}+
- +
-Besides implementing the DataProvider interfaces, class ''LocalProvider'' must provide a constructor with no arguments, (and will likely define a set of native methods, linking against the data access libraries), while class ''NetworkProvider'' must provide a constructor with one String argument, i.e. the IP address of the associated server. Class NetworkProvider will handle the required protocol with the remote data server. <br /> <br />+
- +
-<center><br />'''<font size="+2">Options for Starting jScope</font>'''</center><br />+
- +
-jScope is included in the mdsplus distribution but you may also download it separately:+
- +
- http://www.igi.pd.cnr.it/wwwexp/technologies/MDSPlusTools/jScopeDownload.html +
- +
-Launching jScope from the command-line offers flexibility for use with scripting or launching+
-by icon with custom settings.+
- +
-*jScope is by default started with the Java Web Start .jnlp file :+
- +
- > javaws /Applications/jScope.jnlp+
- +
-This loads the most recent version from the rfx repository and passes some system+
-info , e.g. max heap size to the appication.+
- +
-You can then pass the .jscp file to jScope with the -open parameter, note that you pass it _first_ :+
- >javaws -open <path+yourjScope.jscp> <path+jScope.jnlp>+
-N.B. One might alter the .jnlp to include the .jscp file to pass in but this seems+
-buggy and not well diagnosed. The above method seems to work in a variety of+
-situations .+
- +
-* If you have mdsplus installed, you may also start it directly from java:+
- > java jScope <path+yourjScope.jscp> +
-This launches your local .jar file, useful for example when java updates cause indigestion in the latest version of jScope or if for some reason you do not wish to query igi.pd.cnr.it.+
- +
-Java installation must include the environmental variable CLASSPATH which points to the Java Application Archive .jar file , e.g.+
- export CLASSPATH=/usr/local/mdsplus/java/classes/jScope.jar+
-Is the default path in many installations.+
- +
-On OSX, user environmental variables are in a .plist, loaded at login. Add this item :+
- > open /Users/myaccount/.MacOSX/environment.plist+
- +
-In Windows :+
-Control Panel -> Advanced -> Environment Variables.+
-<br /><br />+
-<hr>+
- +
-For further information, contact me at the following e-mail address:[mailto:manduchi@igi.pd.cnr.it ''manduchi@igi.pd.cnr.it'']+

Current revision

This page has been replaced by the JScope Tutorial Page