XPDID ;SFISC/VYD,RSD - Display Install Progress ;05/14/98 10:29 [ 04/02/2003 8:29 AM ]
;;8.0;KERNEL;**1002,1003,1004,1005,1007**;APR 1, 2003
;;8.0;KERNEL;**81**;Jul 10, 1995
;;
Q
INIT ;initialize progress screen
N X,XPDSTR
I IO'=IO(0)!(IOST'["C-VT") S XPDIDVT=0 Q
I $T(PREP^XGF)="" S XPDIDVT=0 Q
;S X="XGF" X ^%ZOSF("TEST") E S XPDIDVT=0 Q
D PREP^XGF
S XPDIDVT=1,X="IOSTBM",XPDSTR=" 25 50 75 "
D ENDR^%ZISS
S IOTM=3,IOBM=IOSL-4
W @IOSTBM
D FRAME^XGF(IOTM-2,0,IOTM-2,IOM-1)
D FRAME^XGF(IOBM,0,IOBM,IOM-1)
D FRAME^XGF(IOBM+1,10,IOBM+3,71)
D SAY^XGF(IOBM+2,11,XPDSTR)
D SAY^XGF(IOBM+2,0,$J("0",5)_"%")
D SAY^XGF(IOBM+3,0,"Complete")
D IOXY^XGF(IOTM-2,0)
Q
;
EXIT(XPDM) ;exit progress screen restore screen to normal
I $G(XPDIDVT) D
.S IOTM=1,IOBM=IOSL
.W @IOSTBM,@IOF
.W:$G(XPDM)]"" !!,XPDM,!!
.D CLEAN^XGF
K IOTM,IOBM,IOSTBM,XPDIDCNT,XPDIDMOD,XPDIDTOT,XPDIDVT
Q
;
TITLE(X) ;display title X
Q:'XPDIDVT
N XPDOX,XPDOY
S XPDOX=$X,XPDOY=$Y
D SAY^XGF(0,0,$$CJ^XLFSTR(X,IOM_"T")),CURSOR
Q
;
SETTOT(X) ;X=file # from build
Q:'$D(XPDIDVT)
S XPDIDTOT=$S(X=4:+$P($G(^XTMP("XPDI",XPDA,"BLD",XPDBLD,4,0)),U,4),X=9.8:+$G(^XTMP("XPDI",XPDA,"RTN")),1:+$P($G(^XTMP("XPDI",XPDA,"BLD",XPDBLD,"KRN",X,"NM",0)),U,4))
S XPDIDMOD=$S(XPDIDTOT<60:1,1:XPDIDTOT\60),XPDIDCNT=0
Q:'XPDIDVT
D UPDATE(0)
Q
;
UPDATE(XPDN) ;update the progress bar
I 'XPDIDVT W "." Q
N XPDLEN,XPDMC,XPDOX,XPDOY,XPDS,XPDSTR
S XPDOX=$X,XPDOY=$Y,XPDMC=60,XPDSTR=" 25 50 75 "
S XPDLEN=$S(XPDIDTOT:XPDN/XPDIDTOT*XPDMC\1,1:0),XPDS=$E(XPDSTR,1,XPDLEN)
D SAY^XGF(IOBM+2,11,XPDS,"R1")
S XPDS=$E(XPDSTR,XPDLEN+1,XPDMC)
D SAY^XGF(IOBM+2,11+XPDLEN,XPDS)
D SAY^XGF(IOBM+2,0,$J(XPDLEN/XPDMC*100,5,0)),CURSOR
Q
;
CURSOR ;put cursor back
S:XPDOY>(IOBM-1) XPDOY=IOBM-1
D IOXY^XGF(XPDOY,XPDOX)
Q
XPDID ;SFISC/VYD,RSD - Display Install Progress ;05/14/98 10:29 [ 04/02/2003 8:29 AM ]
+1 ;;8.0;KERNEL;**1002,1003,1004,1005,1007**;APR 1, 2003
+2 ;;8.0;KERNEL;**81**;Jul 10, 1995
+3 ;;
+4 QUIT
INIT ;initialize progress screen
+1 NEW X,XPDSTR
+2 IF IO'=IO(0)!(IOST'["C-VT")
SET XPDIDVT=0
QUIT
+3 IF $TEXT(PREP^XGF)=""
SET XPDIDVT=0
QUIT
+4 ;S X="XGF" X ^%ZOSF("TEST") E S XPDIDVT=0 Q
+5 DO PREP^XGF
+6 SET XPDIDVT=1
SET X="IOSTBM"
SET XPDSTR=" 25 50 75 "
+7 DO ENDR^%ZISS
+8 SET IOTM=3
SET IOBM=IOSL-4
+9 WRITE @IOSTBM
+10 DO FRAME^XGF(IOTM-2,0,IOTM-2,IOM-1)
+11 DO FRAME^XGF(IOBM,0,IOBM,IOM-1)
+12 DO FRAME^XGF(IOBM+1,10,IOBM+3,71)
+13 DO SAY^XGF(IOBM+2,11,XPDSTR)
+14 DO SAY^XGF(IOBM+2,0,$JUSTIFY("0",5)_"%")
+15 DO SAY^XGF(IOBM+3,0,"Complete")
+16 DO IOXY^XGF(IOTM-2,0)
+17 QUIT
+18 ;
EXIT(XPDM) ;exit progress screen restore screen to normal
+1 IF $GET(XPDIDVT)
Begin DoDot:1
+2 SET IOTM=1
SET IOBM=IOSL
+3 WRITE @IOSTBM,@IOF
+4 IF $GET(XPDM)]""
WRITE !!,XPDM,!!
+5 DO CLEAN^XGF
End DoDot:1
+6 KILL IOTM,IOBM,IOSTBM,XPDIDCNT,XPDIDMOD,XPDIDTOT,XPDIDVT
+7 QUIT
+8 ;
TITLE(X) ;display title X
+1 IF 'XPDIDVT
QUIT
+2 NEW XPDOX,XPDOY
+3 SET XPDOX=$X
SET XPDOY=$Y
+4 DO SAY^XGF(0,0,$$CJ^XLFSTR(X,IOM_"T"))
DO CURSOR
+5 QUIT
+6 ;
SETTOT(X) ;X=file # from build
+1 IF '$DATA(XPDIDVT)
QUIT
+2 SET XPDIDTOT=$SELECT(X=4:+$PIECE($GET(^XTMP("XPDI",XPDA,"BLD",XPDBLD,4,0)),U,4),X=9.8:+$GET(^XTMP("XPDI",XPDA,"RTN")),1:+$PIECE($GET(^XTMP("XPDI",XPDA,"BLD",XPDBLD,"KRN",X,"NM",0)),U,4))
+3 SET XPDIDMOD=$SELECT(XPDIDTOT<60:1,1:XPDIDTOT\60)
SET XPDIDCNT=0
+4 IF 'XPDIDVT
QUIT
+5 DO UPDATE(0)
+6 QUIT
+7 ;
UPDATE(XPDN) ;update the progress bar
+1 IF 'XPDIDVT
WRITE "."
QUIT
+2 NEW XPDLEN,XPDMC,XPDOX,XPDOY,XPDS,XPDSTR
+3 SET XPDOX=$X
SET XPDOY=$Y
SET XPDMC=60
SET XPDSTR=" 25 50 75 "
+4 SET XPDLEN=$SELECT(XPDIDTOT:XPDN/XPDIDTOT*XPDMC\1,1:0)
SET XPDS=$EXTRACT(XPDSTR,1,XPDLEN)
+5 DO SAY^XGF(IOBM+2,11,XPDS,"R1")
+6 SET XPDS=$EXTRACT(XPDSTR,XPDLEN+1,XPDMC)
+7 DO SAY^XGF(IOBM+2,11+XPDLEN,XPDS)
+8 DO SAY^XGF(IOBM+2,0,$JUSTIFY(XPDLEN/XPDMC*100,5,0))
DO CURSOR
+9 QUIT
+10 ;
CURSOR ;put cursor back
+1 IF XPDOY>(IOBM-1)
SET XPDOY=IOBM-1
+2 DO IOXY^XGF(XPDOY,XPDOX)
+3 QUIT