# File: run_camtest2.src
# HISTORY:
#	Written 4-Feb-97 by M.Morrison (added disabling chain and cam flags)
#	
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/flight/src/run_camtest2_v01.src"
descr "run_camtest2 - Start 2 min campaigns every N minutes"


display " "

ask !LS0 "Enter the campaign number 1 type (hrvel,hrmag,fdvel,fdmag)"
set !LI0 = 0
if !LS0 = "hrvel" then
    set !LI0 = 2410
end if
if !LS0 = "hrmag" then
    set !LI0 = 2432
end if
if !LS0 = "fdvel" then
    set !LI0 = 2454
end if
if !LS0 = "fdmag" then
    set !LI0 = 2476
end if
if !LI0 = 0 then
    display "Invalid Option"
    return
end if

ask !LS0 "Enter the campaign number 2 type (hrvel,hrmag,fdvel,fdmag)"
set !LI3 = 0
if !LS0 = "hrvel" then
    set !LI3 = 2410
end if
if !LS0 = "hrmag" then
    set !LI3 = 2432
end if
if !LS0 = "fdvel" then
    set !LI3 = 2454
end if
if !LS0 = "fdmag" then
    set !LI3 = 2476
end if
if !LI3 = 0 then
    display "Invalid Option"
    return
end if

tcblock mbsqreg 66     0       	## Disable Campaign Flag
tcblock mbsqreg 72     0    		## Disable chain Flag
tcblock mbsqreg 67 !LI0		## set campaign address

ask !LI1 "Enter wait between campaigns in minutes"
set !LI2 = !LI1 * 60

ask !LS1 "Verify Address 1.  Hit <CR> to start (halt otherwise)"

top:
    tcblock mbsqreg 67 !LI0		## set campaign address
    tcblock mbsqreg 66     1		## enable Campaign Flag
    wait time !LI2

    tcblock mbsqreg 67 !LI3		## set campaign address
    tcblock mbsqreg 66     1		## enable Campaign Flag
    wait time !LI2
    goto top

