# File: seq_options.src
# HISTORY:
#	Written 11-Jan-96 by M.Morrison
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/dev/src/seq_options.src"
descr "A menu tool to allow the user to adjust the sequence options"


display " "

for !LI9 = 0 to 32000
    menu !LS0 "Seq Options" \
	"Set cam addr"   "Set cam flag"   "Clr cam flag" \
	"Set chain addr" "Set chain flag" "Clr chain flag" \
	"Enable Alt Seq" "Disable Alt Seq" \
	"QUIT"

##	"Set new cam addr" "Set new cam flag" "Clr new cam flag" \
##	"Change Alt Cadence" "Change Alt Repeat Count" \

    exit if !LS0 = "QUIT"


    ## ------------- Main campaign stuff
    if !LS0 = "Set cam addr" then
	ask !LI0 "Enter the campaign address"
	tcblock mbsqreg 67 !LI0		## set campaign address
    end if

    if !LS0 = "Clr cam flag" then
	tcblock mbsqreg 66     0	## Disable Campaign Flag
    end if

    if !LS0 = "Set cam flag" then
	tcblock mbsqreg 66     1	## enable Campaign Flag
    end if

    ## ------------- Chain campaign stuff
    if !LS0 = "Set chain addr" then
	ask !LI0 "Enter the campaign address"
	tcblock mbsqreg 73 !LI0		## set chain address
    end if

    if !LS0 = "Clr chain flag" then
	tcblock mbsqreg 72     0	## Disable chain Flag
    end if

    if !LS0 = "Set chain flag" then
	tcblock mbsqreg 72     1	## enable chain Flag
    end if

    ## ------------- New campaign stuff
    if !LS0 = "Set new cam addr" then
	ask !LI0 "Enter the campaign address"
	tcblock mbsqreg 69 !LI0		## set new cam address
    end if

    if !LS0 = "Clr new cam flag" then
	tcblock mbsqreg 68     0	## Disable new Flag
    end if

    if !LS0 = "Set new cam flag" then
	tcblock mbsqreg 68     1	## enable new Flag
    end if

    ## ------------- Alternate seq stuff
    if !LS0 = "Enable Alt Seq" then
	tcblock mbsqreg 65     1	## Enable ALT 
    end if

    if !LS0 = "Disable Alt Seq" then
	tcblock mbsqreg 65     0        ## Disable ALT 
    end if

    if !LS0 = "Change Alternate Cadence" then
	ask !LI0 "Enter the new cadence in minutes"
	tcblock mbsqreg 54 !LI0		## ALT cadence
    end if

    if !LS0 = "Change Alternate Repeat Count" then
	ask !LI0 "Enter the new repeat count (ie 5)"
	tcblock mbsqreg 53 !LI0   	## ALT repeats (DEP Reg)
	tcblock mbipldin 0x140 1349 !LI0  ## ALT repeats (IP Reg)
    end if

end for
