RVsHeader.gif (20695 bytes)
 
Home

 

Installation

Content
Installing

 

User Guide

Introduction
A first approach
Example 1
Example 2
Example 3
Example 4
Example 5
Example 6
Creating a component
Creating a DataServer

 

Developer Guide

Developer guide
Classes reference

 

Examples

Running the applet

 

line.gif (43 bytes) A first approach

To do a first test, we will use the http driver which comes with the package. This DataServer goes through the standard Web server on which you have installed the package, to read and eventually write the variables (variables are here also named Tags).
From your Web browser, access test_http.html (the Java VM must be enabled of course). If you look inside the html source, you will see the following parameters (If you have installed correctly the package, the settings in test_http.html should work) :

<PARAM name=PROCESS_NAME value="TestHTTP">
<PARAM name=COMMUNICATION_TYPE value="http">
<PARAM name=HOST value="Values.txt">
<PARAM name=TAGS_IN_URL value="false">
<PARAM name=FREQUENCY value="6">

Because, from the same program, you can access different data sources, each data source has to be named. The first parameter names our data source TestHTTP. The second parameter defines the protocol used by the DataServer to access the remote data source (in our case the Web server). The content of the third parameter depends on the protocol. Here, it names the URL (relative to the HTML file) which holds the values. It can be a normal file, but in many cases it will be some kind of CGI program. The next parameter, TAGS_IN_URL, is only relevant for the http protocol. If it is set to TRUE, then the names of the tags to be read are appended to the URL in the following way: http://MYURL?tags=name1,name2,... Because in our example we access a text file, this parameter is set to false. The parameter FREQUENCY gives the time in seconds between two accesses to the URL (here Values.txt). If you look in the file Values.txt, you will see the expected format for the file. For example, the line level1=2.1 means that the variable named level1 has been set to 2.1 .

When the applet starts, it will open a new window, the database viewer. It is empty for the time being. DataBase.gif (9082 bytes)

We will now define a variable by hand. Enter the name level1 in the input field of the database viewer and press the New button. The variable level1 will appear in the list without any value. If you double click on it, you will see the name of the variable appearing in the input field of the menu bar of the applet main window. This is because, in RView, whenever you point an object, an event is sent to all the software objects which have subscribed to this kind of event.
Click now on the limits button and enter the following limits for this variable:

Min 0.0
Max 10.0
Low limit 0.0
High limit 10.0

Press the OK button and go to the main window.
MainWind.gif (4811 bytes)

From there, we will read and write this variable. If the name level1 is not written in the input field of the menu bar, write it and then press the insert button. A dialog box will open. For the first test, just keep the defaults and press the insert component button. Then, from the list of declared components, choose HSlider and enter the following values:

X = 0
Y = 110
Width = 100
Height = 40

Press the insert component button once more and close the dialog box. By moving the cursor of the horizontal slider, you can now change the value of level1.
Insert.gif (4537 bytes)


Click now on the new button of the main window. The New View dialog box appears, presenting some predefined components (the ones for which it makes sense to open a new window). Click on the chart to select chart view and on the OK button. A new window with the frame of the chart appears. Click on one of the representation of level1 (for example on the horizontal slider previously created). The name level1 should then appear in the input field of the chart window (you can also just enter manually the name). Click on the insert button of the chart window. Now you can see the trend curve of level1.
Go back to the database window and change the high limit of level1 to 8 (via the limits button). If you move the slider so that the value of level1 goes over 8, you should hear a beep and you should see in the Java console an alarm message. This is how the default alarm handler works (it is quite easy to develop your own alarm handler as it is described in the developer guide).

Now, we will fetch the value of level1 from the network. Click once again on the limits button. In the bottom of the dialog box, there is a text field named "Process Name" (remember the parameters of the applet ?). Enter TestHTTP in this field and press OK. Go to the main window and press the Enable DataServer button. The value of level1 should be set accordingly to what is written in the file Values.txt. You can now change the value of level1 in Values.txt on the Web server and see how it is refreshed in RView (if you want to reload the file more quickly, change the FREQUENCY parameter of the HTML file but remember that this DataServer is as efficient as your Web server and your connection to it and not more).

Our last step is to save the example window you have just created. In the main window, click on the Save button, enter a name for your configuration and press enter. This can only work if you made the programs Rv_save and Rv_add callable from the Web server (see "Installing the package"). You should now have a new file on your Web server in the …/RView/SYNOPTICS/Desc directory. The name of the file is composed of the date and time of creation. You should also have a new line added to the file ConfigList which contains all the configurations (you can have several lists of configurations, the name of the list being passed to the applet as a parameter).

line.gif (43 bytes)
author: F.Momal - CERN - LHC division - IAS group