#!/bin/sh
# \
exec oagwish "$0" "$@"

# $Log: not supported by cvs2svn $
# Revision 1.5  1996/07/06 18:07:59  borland
# Changed to use data directory /home/helios/oagData/sr/snapshots.
#
# Revision 1.4  1996/03/04  20:04:36  saunders
# Added revision/author to Version menu.
#
# Revision 1.3  1996/01/17  16:59:21  saunders
# Added /usr/local/oag/lib_patch to front to auto_path.
#
# Revision 1.2  1996/01/12  22:36:35  saunders
# Removing dependence on ~borland/tcl/rel auto_path entry. There are still
# references to personal directories. Also fixed minor bugs as encountered.
#
# Revision 1.1  1996/01/02  19:24:10  saunders
# Bringing official area up to date with Christmas 95 commissioning activity.
#

set auto_path [linsert $auto_path 0  /usr/local/oag/apps/lib/$env(HOST_ARCH)]
set auto_path [linsert $auto_path 0 /usr/local/oag/lib_patch/$env(HOST_ARCH)]
set CVSRevisionAuthor "\$Revision: 1.6 $ \$Author: borland $"

cd $env(HOME)

APSApplication . -name "SRrfTempALH" -version $CVSRevisionAuthor \
  -overview "This utility launches the alarm handler for monitor SR rf temperatures and cavity reflected powers.  It also configures the process variables to ensure proper alarm levels."

set mainStatus "Ready."
proc SetMainStatus {text} {
    global mainStatus
    set mainStatus "$text [exec date]"
    update
}

set dataDir /home/helios/oagData/sr/snapshots

proc LaunchAlh {} {
    global dataDir
    SetMainStatus "Configuring..."
    catch {exec sddscasr -restore $dataDir/SRrfTempAlarmSetup-121995.snp} message
    if [string length $message] {
        puts "$message"
        SetMainStatus "Error restoring PV configuration!"
        return
    }
    exec alh $dataDir/SRrfTemp-121995.alhConfig &
    SetMainStatus "alh launched"
}

APSStatusLine .status -parent .userFrame -variable mainStatus -width 50
APSButton .go -text LAUNCH -parent .userFrame -command LaunchAlh \
  -contextHelp "Press to configure PVs for temperature/reflected-power alarms and then lauch the alarm handler."



