minor changes in tecs (M.Z.)

This commit is contained in:
cvs
2001-04-27 08:48:58 +00:00
parent e5e594d3af
commit 87bea26315
5 changed files with 193 additions and 59 deletions

View File

@@ -2,7 +2,7 @@ subroutine tecs_plot(file)
character(len=*) file
integer, parameter :: dmax=500, nset=3, nmenu=9, chartfreq=2
integer, parameter :: dmax=500, nset=3, nmenu=10, chartfreq=2
real, parameter :: winmin=60., undef=-65535.0
real*4 x1,x2,xmin,xmax,ymin(2),ymax(2),window
@@ -15,28 +15,28 @@ subroutine tecs_plot(file)
integer color(3)/2,4,3/
character key*1
character text(nmenu)*12/ &
'live off','sel. zoom','zoom in','zoom out','show all','n days','n hours','n min','quit'/
character keys*(nmenu)/'LZ+-XDHMQ'/
'live off','sel. zoom','zoom in','zoom out','show all','n days','n hours','n min','file','quit'/
character keys*(nmenu)/'LZ+-XDHMFQ'/
character weekdays(7)*3/'Mon','Tue','Wed','Thu','Fri','Sat','Sun'/
character buf*8
character buf*8, device*8, line*40, filnam*128
external tplot_close
logical live, xwin, zoom, right
integer iret, numb
logical live, xwin, zoom, right, saveit
integer iret, numb, lund
integer dlog_open_r, dlog_get, dlog_close_r
data window/1800./
saveit=.false.
zoom=.false.
right=.true.
call pgopen(" ")
call pgqinf('TYPE', buf, l)
if (buf=='NULL') then
call pgqinf('TYPE', device, l)
if (device=='NULL') then
print *,'No PGPLOT-Device defined'
goto 9
endif
xwin=(buf(1:1)=='X')
live=.not. xwin ! live switched off by default on X-Windows
live=device(1:1)/='X' ! live switched off by default on X-Windows
call pgask(.false.)
l=0
@@ -83,6 +83,7 @@ subroutine tecs_plot(file)
call err_txt('dlog_get')
goto 99
endif
if (saveit) goto 9
if (ntot>0) then
xmin=minval(xd(1:ntot))
xmax=maxval(xd(1:ntot))
@@ -153,6 +154,11 @@ subroutine tecs_plot(file)
zoom=.false.
call pgswin(x1,x2,ymin(rl),ymax(rl))
call pgscr(0, 1.0, 1.0, 1.0)
call pgscr(1, 0.0, 0.0, 0.0)
call pgscr(2, 1.0, 0.0, 0.0)
call pgscr(3, 0.0, 0.7, 0.0)
call pgscr(4, 0.0, 0.0, 1.0)
do i=i1,i2
call pgsci(color(i))
@@ -252,7 +258,7 @@ subroutine tecs_plot(file)
numb=0
7 if (live) then
if (xwin) then
if (device(1:1)=='X') then
call pgmtxt('T', 1.0, 1.0, 1.0, 'LIVE MODE (click on text window before pressing any further key)')
endif
call get_key(key, 0, chartfreq)
@@ -354,7 +360,7 @@ subroutine tecs_plot(file)
call pgsci(1)
call pgmtxt('T', 2.0, 0.9, 0.0, buf(l:))
endif
if (xwin .and. .not. live) then
if (device(1:1)=='X' .and. .not. live) then
call pgcurs(ex, ey, key)
call must_purge
else
@@ -380,6 +386,8 @@ subroutine tecs_plot(file)
right=.true.
x2=xmax
endif
elseif (key .eq. 'F') then
saveit=.true.
elseif (key=='Q' .or. key==char(13)) then
goto 9
elseif (live) then
@@ -393,6 +401,24 @@ subroutine tecs_plot(file)
call tplot_close
call get_key(key, 0, 0) ! purge type-ahead-buffer
print *
if (saveit) then
lund=41
print '(x,a,$)', 'Filename: '
read(*,'(a)') filnam
open(lund, file=filnam, status='unknown', carriagecontrol='list')
write(lund, *) ' time [h]',char(9),' T1 [K]',char(9),' T2 [K]',char(9),'power [W]'
do i=1,ntot
write(line, '(4(f9.4,a))') xd(i)/3600., (char(9), max(-999.,min(9999.,yd(i,j))), j=1,3)
do j=1,3
if (yd(i,j)==undef) then
line(10*j+1:10*j+9)=' '
endif
enddo
write(lund, *) line(1:39)
enddo
close(lund)
print *, ntot+1, ' lines written to ',filnam(1:48)
endif
end subroutine
subroutine get_key(key, tmo1, tmo2)