[user/user-setup-mbsgui.tex]
\label{user-setup-mbsgui-chapter}
\lsection[Installing GUI]{user-install}{Installing GUI}

\subsection{Linux at GSI}
When working at the GSI linux cluster, the \dabc\ framework including Java GUI is already installed and will
be maintained by people of the GSI EE department. Here \dabc\ needs just to be
activated from any GSI shell by typing: 
\begin{small}
\begin{verbatim}
. dabclogin
\end{verbatim}
\end{small}
Note the space behind the dot.
In this case, please skip this installation section. 

However, if working on a separate node outside GSI, 
it is mandatory to install the \dabc\ Java GUI software
from scratch. 
Hence the \dabc\ Java GUI distribution is available for download at \hyperref{http://dabc.gsi.de}{}{}{http://dabc.gsi.de}.
It is provided as a compressed tarball of sources \verba{dabcgui\_vn.m.ss.tar.gz}
where n m and ss are version numbers.
The following steps describe the recommended installation procedure:

\bnum
\item Unpack this \dabc\ Java GUI distribution at an appropriate installation directory,
e.~g.~:
\begin{small}
\begin{verbatim}
cd /opt/dabcgui 
tar zxvf dabcgui_v1.0.00.tar.gz
\end{verbatim}
\end{small}
This will extract the archive into a subdirectory which is labelled
with the current version number like \verba{/opt/dabcgui/dabcgui\_v1.0.00}.
This is the GUI system directory.

\item Prepare the GUI environment login script:
A template for this script can be found as
\begin{small}
\begin{verbatim}
guilogin.sh
\end{verbatim}
\end{small}
You need a DIM installation built with the JDIM=yes option.
DIMDIR must be set in the script. In addition one may define for convenience
\begin{small}
\begin{verbatim}
alias dimdns=$DIMDIR/linux/dns
alias dimdid=$DIMDIR/linux/did
\end{verbatim}
\end{small}


\item Copy the script to a location in your global \verba{\$PATH} for later login,
e.~g.\ \verba{/usr/bin}. Alternatively, you
may set an \func{alias} to the full pathname of \verba{guilogin.sh} in your shell profile.

\item Execute the just modified login script in your shell to set the environment:  
\begin{small}
\begin{verbatim}
. guilogin.sh
\end{verbatim} 
\end{small}
This will set the environment to run the GUI.
\enum

\subsection{Windows}
On Windows one needs the xgui.jar file only. The GUI itself can be started from a
little BAT file like:
\begin{small}
\begin{verbatim}
set HOST=%COMPUTERNAME% 
set USER=%USERNAME%
set DIM_DNS_NAME=
set CLASSPATH=%CLASSPATH%;<dim path>/classes;<gui jar file>
set PATH=%PATH%;<dim path>/bin
java -Xmx200m xgui.xGui -mbs
\end{verbatim} 
\end{small}
To start GUI from desktop one has to create a Verknuepfung (RMB on file), then change Icon in Eigenschaften (RMB), then drag Verknuepfung to desktop.

\subsection{Starting the GUI}
When the installation is done, or at GSI after \verba{dabclogin},
one more thing is necessary for DIM control and GUI: the DIM name server.
It must run on a node accessible from all \mbs\ nodes and the node the GUI shall run. 

\bnum
\item Open a dedicated shell on the machine that shall provide the DIM name server,
e.~g.~ 
\begin{small}
\begin{verbatim}
ssh nsnode.cluster.domain
export DIM_DNS_NODE=nsnode.cluster.domain
. guilogin.sh
$DIMDIR/linux/dns &
$DIMDIR/linux/did &
\end{verbatim} 
\end{small}
to launch the DIM name server. This is done \strong{once} at the beginning of
the DAQ setup; usually the DIM name server needs not to be shut down 
when the \mbs\ and/or the GUI terminates. The DID is useful for inspecting DIM services.

\item Set the DIM name server environment variable in any working shell (e.~g.~
the shell that will start the GUI later):
\begin{small}
\begin{verbatim}
. guilogin.sh
export DIM_DNS_NODE=nsnode.cluster.domain
\end{verbatim} 
\end{small}

\item Now the \mbs\ GUI can be started in such prepared shell by typing 
\verba{mbs}.

\enum

\medskip

The GUI may run on a machine with no access to the \mbs\ working directory,
e.~g.\ a windows PC.
Therefore the GUI setup files are typically on their own GUI 
working directory, containing: 
\bbul
\item Data files for startup panels (XML).
\item Configuration files for GUI (XML).
\ebul
These configuration files for the GUI are described in more detail 
in Chapters \paref{user-gui-chapter} and \paref{user:mbs}.


