fixed small bugs M.Z.
This commit is contained in:
@ -4,13 +4,12 @@ set what="$1"
|
|||||||
set where="$2"
|
set where="$2"
|
||||||
|
|
||||||
set destlist=( type@osf1 \
|
set destlist=( type@osf1 \
|
||||||
AMOR@lnsa14:tecs/ FOCUS@lnsa16:tecs/ TRICS@lnsa18:tecs/ \
|
AMOR@amor:tecs/ FOCUS@focus:tecs/ TRICS@trics:tecs/ \
|
||||||
lnsg@lnsa15:tecs/ \
|
|
||||||
alpha=/afs/psi.ch/project/sinq/tru64/stow/tecs/bin/ \
|
alpha=/afs/psi.ch/project/sinq/tru64/stow/tecs/bin/ \
|
||||||
type@linux \
|
type@linux \
|
||||||
linux=/afs/psi.ch/project/sinq/linux/stow/tecs/bin/ \
|
linux=/afs/psi.ch/project/sinq/linux/stow/tecs/bin/ \
|
||||||
TASP@pc4478:tecs/ DMC@pc4629:tecs/ HRPT@hrpt:tecs/ \
|
TASP@tasp:tecs/ DMC@dmc:tecs/ HRPT@hrpt:tecs/ \
|
||||||
MORPHEUS@pc4120:tecs/ SANS@pc3965:tecs/ SANS2@sans2:tecs/ \
|
MORPHEUS@morpheus:tecs/ SANS@sans:tecs/ SANS2@sans2:tecs/ \
|
||||||
type@darwin \
|
type@darwin \
|
||||||
macosx=/afs/psi.ch/project/sinq/mac_os/stow/tecs/bin/ \
|
macosx=/afs/psi.ch/project/sinq/mac_os/stow/tecs/bin/ \
|
||||||
)
|
)
|
||||||
|
@ -15,7 +15,8 @@
|
|||||||
|
|
||||||
real*4 x1,x2,xmin,xmax,ymin(nwin),ymax(nwin),window
|
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 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 ex,ey,fx,fy,row,ticks,tim0,tim1,menuwid
|
||||||
real*4 dx,dy
|
real*4 dx,dy
|
||||||
real*4 ylim(nmax) ! limits of sensor label text
|
real*4 ylim(nmax) ! limits of sensor label text
|
||||||
@ -30,6 +31,7 @@
|
|||||||
logical focus(nmax)/3*.true.,9*.false./
|
logical focus(nmax)/3*.true.,9*.false./
|
||||||
logical omit(nmax)/12*.false./
|
logical omit(nmax)/12*.false./
|
||||||
logical fixleft/.false./
|
logical fixleft/.false./
|
||||||
|
logical yzoom
|
||||||
integer winconf(nwin) ! number of windows below actual
|
integer winconf(nwin) ! number of windows below actual
|
||||||
integer showsets
|
integer showsets
|
||||||
real winh
|
real winh
|
||||||
@ -86,6 +88,7 @@
|
|||||||
if (window .eq. 0) window=1800.
|
if (window .eq. 0) window=1800.
|
||||||
saveit=.false.
|
saveit=.false.
|
||||||
mode=live
|
mode=live
|
||||||
|
yzoom=.false.
|
||||||
iret=pgopen(' ')
|
iret=pgopen(' ')
|
||||||
|
|
||||||
call pgqinf('TYPE', device, l)
|
call pgqinf('TYPE', device, l)
|
||||||
@ -254,11 +257,16 @@
|
|||||||
2 continue
|
2 continue
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
if (j .eq. 0) then ! no T-channel in focus: select all
|
if (j .eq. 0) then
|
||||||
do is=1,nset
|
if (.not. yzoom) then
|
||||||
im=imx(is)
|
y1=ymin(1)
|
||||||
if (retLen(is) .gt. 0 .and. unit(im) .eq. 1) focus(im)=.true.
|
y2=ymax(1)
|
||||||
enddo
|
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
|
endif
|
||||||
if (saveit) goto 9
|
if (saveit) goto 9
|
||||||
if (mode .eq. live) then
|
if (mode .eq. live) then
|
||||||
@ -322,9 +330,11 @@
|
|||||||
enddo
|
enddo
|
||||||
|
|
||||||
do rl=1,nwin
|
do rl=1,nwin
|
||||||
if (mode .eq. zoom .and. rl .eq. 1) then
|
if (yzoom .and. rl .eq. 1) then
|
||||||
ymin(1)=y1
|
if (y2 .gt. y1) then
|
||||||
ymax(1)=y2
|
ymin(1)=y1
|
||||||
|
ymax(1)=y2
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
ymin(rl)=1e30
|
ymin(rl)=1e30
|
||||||
ymax(rl)=-1e30
|
ymax(rl)=-1e30
|
||||||
@ -594,6 +604,8 @@
|
|||||||
|
|
||||||
endif
|
endif
|
||||||
j=chartperiod-mod(myc_now(), chartperiod)
|
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)
|
call get_cursor(ex, ey, key, -j)
|
||||||
enddo
|
enddo
|
||||||
else
|
else
|
||||||
@ -608,23 +620,28 @@
|
|||||||
if (mode .eq. zoom) then
|
if (mode .eq. zoom) then
|
||||||
x1=x1-(x2-x1)/2
|
x1=x1-(x2-x1)/2
|
||||||
x2=x2+(x2-x1)/3
|
x2=x2+(x2-x1)/3
|
||||||
|
endif
|
||||||
|
if (yzoom) then
|
||||||
y1=y1-(y2-y1)/2
|
y1=y1-(y2-y1)/2
|
||||||
y2=y2+(y2-y1)/3
|
y2=y2+(y2-y1)/3
|
||||||
endif
|
endif
|
||||||
elseif (key .eq. 'X') then
|
elseif (key .eq. 'X') then
|
||||||
window=0
|
window=0
|
||||||
mode=0
|
mode=0
|
||||||
|
yzoom=.true.
|
||||||
elseif (key .eq. '+' .or. key .eq. ',') then
|
elseif (key .eq. '+' .or. key .eq. ',') then
|
||||||
window=max(winmin,window/2)
|
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 (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)
|
fx=max(winmin,x2-x1)
|
||||||
fy=max(y2-y1,1e-3,y2*1e-5)
|
|
||||||
x1=ex-fx/4
|
x1=ex-fx/4
|
||||||
x2=ex+fx/4
|
x2=ex+fx/4
|
||||||
|
endif
|
||||||
|
if (yzoom) then
|
||||||
|
fy=max(y2-y1,1e-3,y2*1e-5)
|
||||||
y1=ey-fy/4
|
y1=ey-fy/4
|
||||||
y2=ey+fy/4
|
y2=ey+fy/4
|
||||||
endif
|
endif
|
||||||
@ -665,7 +682,12 @@
|
|||||||
y1=ymin(1)
|
y1=ymin(1)
|
||||||
y2=ymax(1)
|
y2=ymax(1)
|
||||||
endif
|
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
|
elseif (key .eq. 'J') then
|
||||||
dx=ex-(xmax+xmin)*0.5
|
dx=ex-(xmax+xmin)*0.5
|
||||||
dy=ey-(ymax(1)+ymin(1))*0.5
|
dy=ey-(ymax(1)+ymin(1))*0.5
|
||||||
@ -674,6 +696,7 @@
|
|||||||
y1=ymin(1)+dy
|
y1=ymin(1)+dy
|
||||||
y2=ymax(1)+dy
|
y2=ymax(1)+dy
|
||||||
mode=zoom
|
mode=zoom
|
||||||
|
yzoom=.true.
|
||||||
elseif (key .ge. '0' .and. key .le. '9' .or. key .eq. '.') then ! number
|
elseif (key .ge. '0' .and. key .le. '9' .or. key .eq. '.') then ! number
|
||||||
if (numl .lt. len(numb)) then
|
if (numl .lt. len(numb)) then
|
||||||
numl=numl+1
|
numl=numl+1
|
||||||
@ -682,27 +705,28 @@
|
|||||||
call pgsch(0.8)
|
call pgsch(0.8)
|
||||||
call pgmtxt('T', 2.0, menuwid, 0.0, numb(1:numl))
|
call pgmtxt('T', 2.0, menuwid, 0.0, numb(1:numl))
|
||||||
endif
|
endif
|
||||||
! call get_cursor(ex, ey, key, -chartperiod)
|
! if (mode .eq. zoom) mode=0
|
||||||
! if (key .ne. char(0)) goto 8
|
|
||||||
if (mode .eq. zoom) mode=0
|
|
||||||
goto 7
|
goto 7
|
||||||
elseif (key .eq. 'D') then
|
elseif (key .eq. 'D') then
|
||||||
ex=1
|
ex=1
|
||||||
read(numb, *, iostat=iostat) ex
|
read(numb, *, iostat=iostat) ex
|
||||||
window=min(maxRange,max(minRange, nint(oneDay*ex)))
|
window=min(maxRange,max(minRange, nint(oneDay*ex)))
|
||||||
if (mode .lt. right) mode=right
|
if (mode .lt. right) mode=right
|
||||||
|
yzoom=.false.
|
||||||
x1=0
|
x1=0
|
||||||
elseif (key .eq. 'H') then
|
elseif (key .eq. 'H') then
|
||||||
ex=1
|
ex=1
|
||||||
read(numb, *, iostat=iostat) ex
|
read(numb, *, iostat=iostat) ex
|
||||||
window=min(maxRange,max(minRange, nint(3600*ex)))
|
window=min(maxRange,max(minRange, nint(3600*ex)))
|
||||||
if (mode .lt. right) mode=right
|
if (mode .lt. right) mode=right
|
||||||
|
yzoom=.false.
|
||||||
x1=0
|
x1=0
|
||||||
elseif (key .eq. 'M') then
|
elseif (key .eq. 'M') then
|
||||||
ex=1
|
ex=1
|
||||||
read(numb, *, iostat=iostat) ex
|
read(numb, *, iostat=iostat) ex
|
||||||
window=min(maxRange,max(minRange, nint(60*ex)))
|
window=min(maxRange,max(minRange, nint(60*ex)))
|
||||||
if (mode .lt. right) mode=right
|
if (mode .lt. right) mode=right
|
||||||
|
yzoom=.false.
|
||||||
x1=0
|
x1=0
|
||||||
elseif (key .eq. 'T' .or. numl .gt. 0 .and.
|
elseif (key .eq. 'T' .or. numl .gt. 0 .and.
|
||||||
1 (key .eq. char(13) .or. key .eq. char(10))) then
|
1 (key .eq. char(13) .or. key .eq. char(10))) then
|
||||||
@ -721,6 +745,7 @@
|
|||||||
x2=oneDay
|
x2=oneDay
|
||||||
window=x2
|
window=x2
|
||||||
mode=0
|
mode=0
|
||||||
|
yzoom=.false.
|
||||||
elseif (key .eq. 'L') then
|
elseif (key .eq. 'L') then
|
||||||
if (mode .eq. live) then
|
if (mode .eq. live) then
|
||||||
mode=right
|
mode=right
|
||||||
@ -742,7 +767,7 @@
|
|||||||
if (ey .lt. ylim(is)) then
|
if (ey .lt. ylim(is)) then
|
||||||
im=imx(is)
|
im=imx(is)
|
||||||
omit(im)=.true.
|
omit(im)=.true.
|
||||||
goto 7
|
goto 1
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
else
|
else
|
||||||
@ -792,7 +817,7 @@
|
|||||||
im=imx(j)
|
im=imx(j)
|
||||||
focus(im)=.true.
|
focus(im)=.true.
|
||||||
endif ! else select none -> will be all
|
endif ! else select none -> will be all
|
||||||
89 if (mode .eq. zoom) mode=0
|
89 yzoom=.false.
|
||||||
elseif (mode .eq. live) then
|
elseif (mode .eq. live) then
|
||||||
goto 7
|
goto 7
|
||||||
endif
|
endif
|
||||||
|
@ -45,12 +45,18 @@ int term_raw_key(char *key, int msecTmo) {
|
|||||||
int term_wait_fd(int fd, int msecTmo) {
|
int term_wait_fd(int fd, int msecTmo) {
|
||||||
fd_set mask;
|
fd_set mask;
|
||||||
struct timeval tmo;
|
struct timeval tmo;
|
||||||
|
int i;
|
||||||
|
|
||||||
FD_ZERO(&mask);
|
FD_ZERO(&mask);
|
||||||
FD_SET(fd, &mask);
|
FD_SET(fd, &mask);
|
||||||
|
FD_SET(STDIN_FILENO, &mask);
|
||||||
tmo.tv_sec=msecTmo / 1000;
|
tmo.tv_sec=msecTmo / 1000;
|
||||||
tmo.tv_usec=(msecTmo % 1000) * 1000+1;
|
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) {
|
int term_get_key(char *key, int msecTmo) {
|
||||||
|
Reference in New Issue
Block a user