How to set up an environment for CLEO GUI design (NT)

Table of Contents

Introduction and assumptions

CLEO III uses a system of graphical user interfaces written in Java to connected with lower level systems by Corba to allow the supervision of the detector without experts for all the various components. This tutorial assumes you have been given the task of creating a GUI, or at least part of one. This also assumes that you are using a Windows NT box for the development. Here, the goal is to provide a cookbook method that will provide a nice 'straight-from-the-box' installation. Anything extra may very well not be here. Updating this document is strongly encouraged. Right now, the only thing this document covers is enough installation to get you developing, a little bit about dealing with CORBA, and an introduction to placement of the GUI into the CLEO framework.

Return to the top of this page
Return to the software index

Permissions and required resources

You will need several things. The first is a C:\ drive with a large amount of free space. I would guess you need about 1.5-2 GB of space minimum provided you don't already have any of the necessary components. Most of the scripts that we'll mention later have been written for the C drive. As a result, if you have a different drive with a whole bunch of space feel free to use that drive, but you may have to edit scripts for a few hours.

You will need an account at Cornell (such that you can logon to or you will need to have all of the following files provided for you. To access the files in cvsroot and cvsroot_Online (this will be explained fully later) you will need access to the cleo3 group. To see what groups you are in, type groups on the command line of your Cornell account.

The setup used to describe this tutorial involved creating a local account on the machine in question. Although we doubt that this step is strictly necessary, it can't hurt, and is strongly encouraged. To do so, you will probably need adiministrator privaleges, which will also be nice for the software installation steps to follow. Create a local account named cleo3, and make the home folder of this account a folder called C:\cleo3

You will need to install Visual C++ (Version 5 or higher generally, but if you have Version 4, give it a try) and Java (version 1.3 is great, and since that's a free download at there's no need to settle for anything different). From there, you should be provided with access to the following zip files: Many of these zip files can be found at this Ohio State page. Beware, however, that any files or information found on the Ohio State pages may be out of date. Instead of some of these files ( and, you may be supplied with individual components. Full instructions on where to place these files into the heirarchy should be supplied.

You will need the Common, DAQBoards, corba, DBGeneric, and scsystem directories. However, if you have Cornell account with the aforementioned permissions, then you can retrieve these in a method that will be explained shortly. Otherwise, they must be provided to you.

Once you have these files, programs, accounts, and permissions, you are ready to install.

Return to the top of this page
Return to the software index

Software and installation configuration

Instructions for the installation of Visual C++ are provided within the installation program and included documentation. Instructions for the installation of Java are provided on the same web site that you go to for downloading the program.

Take all of the zip files and extract them to the C:\ drive. If you do not have a tool for dealing with zip files, you can find PKZIP relatively easily with an online search. After you have done so, look in your C:\ directory. You will notice files named environment.reg and mount_points.reg. Right click on these, and select the Merge command. After this, check your user variables in the System Control Panel under the Environment tab. You will have used this same tab earlier is setting your Java path and classpath (provided you didn't already have Java set up). You will notice you have many more. Check to make sure you still have all of your old variables. Add them back if they are missing, provided that they do not conflict with the new variables. You may wish to write these variables down ahead of time. Also, add C:\gnuwin32\Cvs19\bin and C:\gnuwin32\rcs57\bin to the path.

Now, take the file .bashrc in C:\ directory and move it to the C:\cleo3 directory. This directory was created when was unzipped.

If you have a Cornell account, you should open up a file called .rhosts and put in first the ip of your computer, then your user name on that computer. Consider the following examples: username alice
This is the general format you should use. Type all the machines and user names that you will use during various installations of the SlowControl GUI environment. This file can be edited as necessary.

Go to your root drive and type the word bash. This will start a unix shell, and you will see a unix like prompt. You may see a few messages, some of them error messages, after the line loading .bashrc profile... We will discuss the editing of the .bashrc file in the next section. Change to the directory C:\cleo3\Common\development\cvssrc ; if this directory does not exist, create it.

If you have been given a Common directory, place it here. If not, first type, inside of bash, replacing username with your actual user name: 

Now, try typing:
cvs checkout Common
If this doesn't work, then go to the C:\gnuwin32\Cvs19\bin and try it again. If it succeeds here, copy this folder into the directory C:\cleo3\Common\develoment\cvssrc.

Now change to the directory C:\cleo3\SlowControl\dlib\cvssrc ; if this directory does not exist, create it.

If you have been given folders for DAQBoards, corba, DBGeneric, and scsystem, place them here. If not, first type, inside of bash, replacing username with your actual user name: 
Now, try typing:
cvs checkout DAQBoards
cvs checkout corba
cvs checkout DBGeneric
cvs checkout scsystem
If this doesn't work, then go to the C:\gnuwin32\Cvs19\bin and try it again. If it succeeds here, copy these folders into the directory C:\cleo3\SlowControl\dlib\cvssrc.

Now, you should have all the files you need.

Return to the top of this page
Return to the software index

More configuration, compilation, and running

The following is a copy of the .bashrc file. You should modify it from the current form by changing all references to alice to your user name.
#.bashrc file
echo "loading .bashrc profile..."

# Other stuff
export PS1='${HOSTNAME} \w> '
export PATH=.:/bin:/usr/X11/bin:/usr/local/bin:${PATH}
export CYGWIN32="strip_title tty"
export CYGWIN="strip_title tty"
export TERM=ansi

# Java 2
export PATH=/jdk1.3/bin:${PATH}
export CLASSPATH="c:\cleo3\jas.jar;."

# CVS setup for alice

# Common setup
export COM_=//C/cleo3/Common
export COMLIB=development
export MACHNAME=i686-pc-cygwin32_r
. /cleo3/Common/scripts/cleo3defs

# SlowControl setup
export SC_=//C/cleo3/SlowControl
export SCLIB=dlib
. /cleo3/SlowControl/defs/sc_cleodefs

echo "Env set: COM=${COM_LIB}, SC=${SC_LIB}"

# alias
alias scdir="cd /cleo3/SlowControl/dlib/cvssrc"
alias comdir="cd /cleo3/Common/development/cvssrc/Common/src"
alias guidir="cd /cleo3/SlowControl/dlib/cvssrc/scsystem/src/java/edu/osu/daqiii"

alias SessionManager='$SC_EXE/SessionManager'
echo "${SC_EXE}"
alias ds='ls -l'
alias cls='clear'
alias dbconfCommon='configure --prefix=/cleo3/Common/development --with-timezone=EDT --with-bdl=/cleo3/Common/development/bdl --enable-mt ; cp /cleo3/Common/sc_config.h.orig headers/sc_config.h'

echo "END OF LINE"

If you aren't using bdl or don't know if you are, you may wish to take out the --with-bdl=/cleo3/Common/developmnet/bdl, at least temporarily. Also, if desired, you can change to your own timezone.

Now that your .bashrc is configured, end bash and start it again. Now set up your /etc/passwd file and your /etc/group file by typing:
mkpasswd --local /etc/passwd
mkgroup --local /etc/group
Change local to domain if you are using a domain account instead of a local account.

This is an optional step to remove an unimportant error message. Now that your .bashrc resembles this one, check to see if you have a folder called C:\cleo3\Common\development\bin containing a file called config.guess. If you don't, copy this file from C:\cleo3\Common\developmnet\cvssrc\Common\src\configure. Now, exit bash and start it again. You should see no error messages (no messages without a corresponding echo). Now, back to business.

Change to
C:\cleo3\Common\development\cvssrc\Common\src\configure and type
One way to check to see if things went smoothly is to change the line slightly to
dbconfCommon > configout.txt
This way errors will be printed immediately to the screen, and the regular output will end up in the above file. Do realize that even if you have no error messages, you may have still have a problem. If you want the error messages also placed into a file, type >& instead of >

Now, type make while inside of this folder. Whenever typing any of the make instructions, you can direct the output to a *.txt file as mentioned above should you so desire. Change up a directory, and type make here, also. Here, you may notice some errors, but they are likely to be unimportant. Change to DAQBoards, corba, DBGeneric, and scsystem in this order, running make in each of these. These directories are found in C:\cleo3\SlowControl\dlib\cvssrc

Now, while you are in the scsystem directory, change from there up C:\cleo3\SlowControl\dlib\cvssrc\scsystem\src\java\edu\osu\daqiii\SessionManager

Run first make, and then make install. After that type osagent -C & and then SessionManager. If you have followed these instructions without fail and we have made no errors, and the system has not been updated since the last time we checked out everything from CVS, then you should see the Java messages and windows relating to the SessionManager.

Return to the top of this page
Return to the software index

Corba, how to talk to your server

Assuming Java is your thing, you will be able to add your applet into the SessionManager menu without a problem. With the Ohio State pages explaining how to derive your class from CLEOGUI, and a good Java reference (I like to use both Deitel and the online Sun documentation), you can design all of the graphical interface. However, you haven't written any of the client from which you actually get the data you are presenting.

For this to happen, you have to have access to the *.idl file that both you and the server are going to be reading from. The idl should have a format similar to:
module BreakfastCommands
     inferface Toast
         short getNumberOfSlices();
	 void addButter(in short sliceNumber);
	 void addJelly(in short sliceNumber);
     // more of breakfast will be supported, I'm sure
Now, to access these methods, you will have to have a toast object. The first thing you need is the proper path name for your import (most of the IDL paths for the import are subdirectories the edu.osu.daqiii import, a result of the OSU GUI work). An example of the import, declaration, and definition (about which more will be said):
import edu.osu.daqiii.BreakfastCommands.*; // gets the Toast class in our namespace
// lots of code
private Toast cleoToast; // object declaration
// more code
     cleoToast = ToastHelper.bind(SessionManager.getORB(),"TOASTSERVER"); // object definition
     short sliceNum = cleoToast.getNumberOfSlices();  // usage example
     for(short index = 1;index <= sliceNum;index++)
catch (org.omg.CORBA.SystemException ex) // in case TOASTSERVER orb not available
    System.out.println("\nApparently CLEO has no toast.\n\n");
// more code

Now you may have some questions about the syntax for the object definition. Essentially, that says, "Look out into your host's ORB space and give me back an object that responds to the string "TOASTSERVER", please." The exception is, "I'm sorry, but there is no object being served by that name." The identifier string is something that you and the writer of the server and you, the client author, must agree on.

Return to the top of this page
Return to the software index

Submitting your work with CVS

This is more of a task for CLEO regulars than those brought in for GUI design. However, should you reach this stage, and should you be expected to CVS your work, then the LNS CVS Howto should be sufficient documentation. Notice that this site is restricted to authorized personell.

Return to the top of this page
Return to the software index
CLEO Colaboration, Last modified August 8, 2000