fixed small bugs M.Z.

This commit is contained in:
cvs
2004-07-06 13:12:37 +00:00
parent 731108ea98
commit 7a7570d083
3 changed files with 55 additions and 25 deletions

View File

@ -4,13 +4,12 @@ set what="$1"
set where="$2"
set destlist=( type@osf1 \
AMOR@lnsa14:tecs/ FOCUS@lnsa16:tecs/ TRICS@lnsa18:tecs/ \
lnsg@lnsa15:tecs/ \
AMOR@amor:tecs/ FOCUS@focus:tecs/ TRICS@trics:tecs/ \
alpha=/afs/psi.ch/project/sinq/tru64/stow/tecs/bin/ \
type@linux \
linux=/afs/psi.ch/project/sinq/linux/stow/tecs/bin/ \
TASP@pc4478:tecs/ DMC@pc4629:tecs/ HRPT@hrpt:tecs/ \
MORPHEUS@pc4120:tecs/ SANS@pc3965:tecs/ SANS2@sans2:tecs/ \
TASP@tasp:tecs/ DMC@dmc:tecs/ HRPT@hrpt:tecs/ \
MORPHEUS@morpheus:tecs/ SANS@sans:tecs/ SANS2@sans2:tecs/ \
type@darwin \
macosx=/afs/psi.ch/project/sinq/mac_os/stow/tecs/bin/ \
)

View File

@ -15,7 +15,8 @@
real*4 x1,x2,xmin,xmax,ymin(nwin),ymax(nwin),window
real*4 xd(dmax, nmax),yd(dmax,nmax), yy0(nmax), yy1(nmax)
real*4 ylast1,ylast2,y1,y2
real*4 ylast1,ylast2
real*4 y1/0.0/,y2/0.0/
real*4 ex,ey,fx,fy,row,ticks,tim0,tim1,menuwid
real*4 dx,dy
real*4 ylim(nmax) ! limits of sensor label text
@ -30,6 +31,7 @@
logical focus(nmax)/3*.true.,9*.false./
logical omit(nmax)/12*.false./
logical fixleft/.false./
logical yzoom
integer winconf(nwin) ! number of windows below actual
integer showsets
real winh
@ -86,6 +88,7 @@
if (window .eq. 0) window=1800.
saveit=.false.
mode=live
yzoom=.false.
iret=pgopen(' ')
call pgqinf('TYPE', device, l)
@ -254,11 +257,16 @@
2 continue
endif
enddo
if (j .eq. 0) then ! no T-channel in focus: select all
do is=1,nset
im=imx(is)
if (retLen(is) .gt. 0 .and. unit(im) .eq. 1) focus(im)=.true.
enddo
if (j .eq. 0) then
if (.not. yzoom) then
y1=ymin(1)
y2=ymax(1)
yzoom=.true.
endif
! do is=1,nset
! im=imx(is)
! if (retLen(is) .gt. 0 .and. unit(im) .eq. 1) focus(im)=.true.
! enddo
endif
if (saveit) goto 9
if (mode .eq. live) then
@ -322,9 +330,11 @@
enddo
do rl=1,nwin
if (mode .eq. zoom .and. rl .eq. 1) then
ymin(1)=y1
ymax(1)=y2
if (yzoom .and. rl .eq. 1) then
if (y2 .gt. y1) then
ymin(1)=y1
ymax(1)=y2
endif
else
ymin(rl)=1e30
ymax(rl)=-1e30
@ -594,6 +604,8 @@
endif
j=chartperiod-mod(myc_now(), chartperiod)
rl=1
call set_win(rl,winh,winconf,x1,x2,ymin(rl),ymax(rl))
call get_cursor(ex, ey, key, -j)
enddo
else
@ -608,23 +620,28 @@
if (mode .eq. zoom) then
x1=x1-(x2-x1)/2
x2=x2+(x2-x1)/3
endif
if (yzoom) then
y1=y1-(y2-y1)/2
y2=y2+(y2-y1)/3
endif
elseif (key .eq. 'X') then
window=0
mode=0
yzoom=.true.
elseif (key .eq. '+' .or. key .eq. ',') then
window=max(winmin,window/2)
if (ex .eq. undef) then
ex=(x1+x2)/2
ey=(min(y2,ymax(1))+max(y1,ymin(1)))/2
end if
if (mode .eq. zoom) then
if (ex .eq. undef) then
ex=(x1+x2)/2
ey=(min(y2,ymax(1))+max(y1,ymin(1)))/2
end if
fx=max(winmin,x2-x1)
fy=max(y2-y1,1e-3,y2*1e-5)
x1=ex-fx/4
x2=ex+fx/4
endif
if (yzoom) then
fy=max(y2-y1,1e-3,y2*1e-5)
y1=ey-fy/4
y2=ey+fy/4
endif
@ -665,7 +682,12 @@
y1=ymin(1)
y2=ymax(1)
endif
mode=zoom
if (y1 .ne. ymin(1) .or. y2 .ne. ymax(2)) then
yzoom=.true.
endif
if (x1 .ne. xmin .or. x2 .ne. xmax) then
mode=zoom
endif
elseif (key .eq. 'J') then
dx=ex-(xmax+xmin)*0.5
dy=ey-(ymax(1)+ymin(1))*0.5
@ -674,6 +696,7 @@
y1=ymin(1)+dy
y2=ymax(1)+dy
mode=zoom
yzoom=.true.
elseif (key .ge. '0' .and. key .le. '9' .or. key .eq. '.') then ! number
if (numl .lt. len(numb)) then
numl=numl+1
@ -682,27 +705,28 @@
call pgsch(0.8)
call pgmtxt('T', 2.0, menuwid, 0.0, numb(1:numl))
endif
! call get_cursor(ex, ey, key, -chartperiod)
! if (key .ne. char(0)) goto 8
if (mode .eq. zoom) mode=0
! if (mode .eq. zoom) mode=0
goto 7
elseif (key .eq. 'D') then
ex=1
read(numb, *, iostat=iostat) ex
window=min(maxRange,max(minRange, nint(oneDay*ex)))
if (mode .lt. right) mode=right
yzoom=.false.
x1=0
elseif (key .eq. 'H') then
ex=1
read(numb, *, iostat=iostat) ex
window=min(maxRange,max(minRange, nint(3600*ex)))
if (mode .lt. right) mode=right
yzoom=.false.
x1=0
elseif (key .eq. 'M') then
ex=1
read(numb, *, iostat=iostat) ex
window=min(maxRange,max(minRange, nint(60*ex)))
if (mode .lt. right) mode=right
yzoom=.false.
x1=0
elseif (key .eq. 'T' .or. numl .gt. 0 .and.
1 (key .eq. char(13) .or. key .eq. char(10))) then
@ -721,6 +745,7 @@
x2=oneDay
window=x2
mode=0
yzoom=.false.
elseif (key .eq. 'L') then
if (mode .eq. live) then
mode=right
@ -742,7 +767,7 @@
if (ey .lt. ylim(is)) then
im=imx(is)
omit(im)=.true.
goto 7
goto 1
endif
enddo
else
@ -792,7 +817,7 @@
im=imx(j)
focus(im)=.true.
endif ! else select none -> will be all
89 if (mode .eq. zoom) mode=0
89 yzoom=.false.
elseif (mode .eq. live) then
goto 7
endif

View File

@ -45,12 +45,18 @@ int term_raw_key(char *key, int msecTmo) {
int term_wait_fd(int fd, int msecTmo) {
fd_set mask;
struct timeval tmo;
int i;
FD_ZERO(&mask);
FD_SET(fd, &mask);
FD_SET(STDIN_FILENO, &mask);
tmo.tv_sec=msecTmo / 1000;
tmo.tv_usec=(msecTmo % 1000) * 1000+1;
return(select(FD_SETSIZE, &mask, NULL, NULL, &tmo));
i=select(FD_SETSIZE, &mask, NULL, NULL, &tmo);
if (FD_ISSET(STDIN_FILENO, &mask)) {
return 0;
}
return i;
}
int term_get_key(char *key, int msecTmo) {