pro timing3, infil0, strec
;
;infil0 = 'img_dir:043_111344.tel'	& strec =  60
;infil0 = 'img_dir:043_111344.tel'	& strec =  75
;
if (!d.name eq 'X') then window,0,xsiz=750,ysiz=512
;
strver = 'TIMING3.PRO  12-Feb-91  Ver 1.0'
;
ff = findfile(infil0)
infil = ff(0)
;
nrec  = 16
which = 1
qstop = 0
qdisp = 1
;
rs= 'rowst1   '
wd= 'rowwd1   '
sf= 'setup_flg'
cm= 'camstat  '
fl= 'flush    '
cmd='cmdimgmod'
tim='timehead '
;
stuff=[rs, wd, sf, cm, fl, cmd, tim]
;
if (n_elements(rowst) eq 0) then begin
    rec_arr = indgen(nrec)+strec

    grab, infil, strec, strec+nrec-1, stuff, rowst, rowwd, setup, camera, $
		flush, cmdimgmod, timehead
end
;
x1 = findgen(nrec) + strec
x2 = findgen(nrec*8)/8. + strec
;
ss2 = where(camera ne 0)
setup2 = setup & setup2(ss2) = 0 ;zero setup where camera is cause of setup being set
;
set_xy, strec, strec+nrec-1, 0, 30
!type = 16 + 12
!linetype = 0
!fancy = 2
!yticks = 0		;TODO -6
!xtitle = 'File Record
;
!psym = 0
plot, fltarr(2), fltarr(2)
;
!psym = 10	& oplot, x1, cmdimgmod+20
!psym = 10	& oplot, x2, setup+15
!psym = 10	& oplot, x2, camera+10
!psym = 10	& oplot, x2, setup2+5
!psym = 10	& oplot, x1, flush/4.
;!psym = 1	& oplot, x1, rowst/64 + 26
;
!linetype = 2
for i=1,nrec-1 do plot_vline, strec+i
;
!linetype = 0
!psym = 0
for i=1,nrec*8-1 do oplot, fltarr(2)+strec+i/8., findgen(2)*0.5+14.0
for i=1,nrec*8-1 do oplot, fltarr(2)+strec+i/8., findgen(2)*0.5+ 9.0
;
;; !psym = 3
;; oplot, x2, fltarr(nrec*8)+ 9.5
;; oplot, x2, fltarr(nrec*8)+14.5
;
!linetype = 0
!psym = 2
for i=1,nrec*8-1 do begin
    if (camera(i-1) eq 0) and (camera(i) ne 0) then begin
	xx = fltarr(2) + strec+i/8
	yy = fltarr(2) + 12.5
	oplot, xx, yy
    end
end
!psym = 0
;
fmt = "(1x, i2, ':', i2.2, ':', i2.2, '.', i3.3)"
str_tim1 = string(extract(timehead,          0+1, 4), fmt)
str_tim2 = string(extract(timehead, (nrec-1)*5+1, 4), fmt)
;
xyouts, strec,   0, str_tim1, siz=0.8, orient=90
xyouts, strec+nrec-1, 0, str_tim2, siz=.8, orient=90
plottime, 0.00, .97, infil, 2.0
plottime, 0.02, .08, '#Flush',     1, 90
plottime, 0.02, .25, 'Set-up *',   1, 90
plottime, 0.04, .25, '(not Cam)',   1, 90
plottime, 0.02, .40, 'Camera',     1, 90
plottime, 0.05, .38, 'Idle ', 0.80
plottime, 0.05, .41, 'Expos', 0.80
plottime, 0.05, .44, 'Read ', 0.80
plottime, 0.02, .50, 'Set-up',     1, 90
plottime, 0.02, .70, 'Image Type', 1, 90
plottime, 0.05, .65, 'None  ', 0.80
plottime, 0.05, .68, 'PFI   ', 0.80
plottime, 0.05, .71, 'FWI   ', 0.80
plottime, 0.05, .74, 'Patrol', 0.80
;
plottime, 0, .00, strver
plottime
;
pause
lprint,'d'
end
;------------------------------------------
timing3, '/0d3/ops/raw/10021500.10031400', 3505
end
