# File: lobsmode.src
#
# This procedure puts MDI into nominal observing mode.  
# Mechanism positions updated per I. Zayer 4/14/94
#

program "@(#) MODULE: lobsmode.src RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/eof/src/lobsmode.src"
descr "lobsmode - Configure mechanisms for observing mode"

checkVAC:			## Prompt for Air/Vacuum tuning configuration

  if !GS6 = "AIR" then
    display "Going to nominal OBSERVING mode & continuum for AIR" 
    writen !GS9 "Going to nominal OBSERVING mode & continuum for AIR" 
# Per Zayer - 4/14/94
#   tcblock mbdpconf 0x0100 0x0100 0x0200 0x0200 0x0200
    tcblock mbdpconf 0x0100 0x0100 0x0100 0x0100 0x0100
#   tcblock mbdpconf     26     78    125     91     89
#   setstr !GS0   = "    26     78    125     91     89"
    tcblock mbdpconf     13     82    125     55     89
    setstr !GS0   = "    13     82    125     55     89"
    goto doneVAC
  end if

  if !GS6 = "VAC" then
    display "Going to nominal OBSERVING mode & continuum for VAC" 
    writen !GS9 "Going to nominal OBSERVING mode & continuum for VAC" 
# Per Zayer - 4/14/94
#   tcblock mbdpconf 0x0100 0x0100 0x0200 0x0200 0x0200
    tcblock mbdpconf 0x0100 0x0100 0x0100 0x0100 0x0100
#   tcblock mbdpconf    149     51    125     91     89
#   setstr !GS0   = "   149     51    125     91     89"
    tcblock mbdpconf     10     47    125    127     89
    setstr !GS0   = "    10     47    125    127     89"
    goto doneVAC
  end if

  menu !GS6 "Enter AIR or VAC for optics tuning" "AIR" "VAC"

goto checkVAC

doneVAC:

wait mf 2
writen !GS9 "             MTM1   MTM2    PAW   CAL1   CAL2"
write  !GS9 "command:  "
writen !GS9 " %s" !GS0
write  !GS9 "actual:   "
write  !GS9 "    %3d" getint(mkm1pos) 
write  !GS9 "    %3d" getint(mkm2pos) 
write  !GS9 "    %3d" getint(mkpapos) 
write  !GS9 "    %3d" getint(mkc1pos) 
writen !GS9 "    %3d" getint(mkc2pos) 
writen !GS9 " "

display "Finished procedure lobsmode"
