HLCSMON1 ;SF-Utilities for Driver Program ;02/04/2004 10:25
;;1.6;HEALTH LEVEL SEVEN;**15,40,49,65,109**;Oct 13, 1995
;
;This routine contains several entry points called from HLCSMON
;no input parameters are required. All variables used which are
;not newed here are newed in HLCSMON
;
DISPLAY ;display link info
;turn of line wrap
S HLXX=0,X=0 X ^%ZOSF("RM")
F S HLXX=$O(HLARYD(HLXX)) Q:(HLXX'>0) D WLINE(HLXX)
;DISPLAY INCOMING FILER STATUS
S HLXX=$$CNTFLR^HLCSUTL2("IN")
;ONLY UPDATE SCREEN IF COUNT HAS CHANGED
I (HLXX'=+HLRUNCNT) D
.D WDATA(5,17,"","",$J(" ",31)),WDATA^HLCSMON1(5,17,"","","Incoming filers running => ",35)
.I (HLXX) D WDATA(32,17,"","",HLXX)
.I ('HLXX) D WDATA(32,17,IOINHI,IOINORM,"Zero")
.S $P(HLRUNCNT,"^",1)=HLXX
;DISPLAY OUTGOING FILER STATUS
S HLXX=$$CNTFLR^HLCSUTL2("OUT")
;ONLY UPDATE SCREEN IF COUNT HAS CHANGED
I (HLXX'=+$P(HLRUNCNT,"^",2)) D
.D WDATA(5,18,"","",$J(" ",31)),WDATA^HLCSMON1(5,18,"","","Outgoing filers running => ",35)
.I (HLXX) D WDATA(32,18,"","",HLXX)
.I ('HLXX) D WDATA(32,18,IOINHI,IOINORM,"Zero")
.S $P(HLRUNCNT,"^",2)=HLXX
S X=$$TM^%ZTLOAD
I X'=$G(HLTMSTAT) D
.S HLTMSTAT=X
.S HLXX=$S('HLTMSTAT:"***TASKMAN NOT RUNNING!!!***",1:"")
.I 'HLTMSTAT D WDATA^HLCSMON1(45,17,IOELEOL_IOBON_IORVON,IOBOFF_IORVOFF,HLXX) I 1
.E D WDATA(45,17,IOELEOL,"",$J("TaskMan running ",16)) ;D WDATA(5,19,IOELALL,"","")
S X=$$STAT^HLCSLM
I X'=$G(HLLMSTAT) D
.S HLLMSTAT=X Q:HLLMSTAT=3
.S HLXX=$S('HLLMSTAT:"***LINK MANAGER NOT RUNNING!!!***",1:"")
.I 'HLLMSTAT D WDATA^HLCSMON1(45,18,IOELEOL_IOBON_IORVON,IOBOFF_IORVOFF,HLXX) I 1
.E D WDATA^HLCSMON1(45,18,IOELEOL,"",$J("Link Manager running",18))
;Turn terminal line wrap back on
D WDATA(45,19,IOELEOL,"",$$SLM^HLEVUTIL) ; HL*1.6*109
S X=IOM X ^%ZOSF("RM")
Q
;
WLINE(HLXX) ;write line from HLARYD=current values, HLARYO=old values
;if values haven't changed, don't do anything
I HLARYD(HLXX)]"",HLARYD(HLXX)=$G(HLARYO(HLXX)) Q
S HLARYO(HLXX)=HLARYD(HLXX),HLERR=$P(HLARYD(HLXX),U,8),DX=1
F X=1:1:7 S @$P("HLNODE^HLREC^HLPROC^HLSEND^HLSENT^HLDEV^HLSTAT",U,X)=$E($P(HLARYD(HLXX),U,X)_" ",1,8)
;if link is in error, write node in rev. video
I HLERR]"" D WDATA(5,HLXX,IOBON_IORVON,IOBOFF_IORVOFF,HLNODE,8) S DX=14
;Turn off terminal line wrap & inform O/S where cursor is located
S DY=HLXX X IOXY,^%ZOSF("XY")
W:HLERR="" ?5,HLNODE
W ?16,HLREC,?26,HLPROC,?37,HLSEND,?47,HLSENT,?58,HLDEV,?64,HLSTAT
Q
;
WDATA(DX,DY,IO1,IO2,HLDATA,HLENGTH) ;
;
;First erase the data block then write to it. Attributes are
;contained in IO1 & IO2
;
N X S X=0 X ^%ZOSF("RM") X ^%ZOSF("XY")
;Turn off terminal line wrap & inform O/S where cursor is located
I '$D(HLENGTH) S HLENGTH=$L(HLDATA)
X IOXY W IOSC,$E($J(" ",79),1,HLENGTH),IORC W IO1,$E(HLDATA,1,HLENGTH),IO2
S X=IOM X ^%ZOSF("RM")
;Turn terminal line wrap back on
Q
HLCSMON1 ;SF-Utilities for Driver Program ;02/04/2004 10:25
+1 ;;1.6;HEALTH LEVEL SEVEN;**15,40,49,65,109**;Oct 13, 1995
+2 ;
+3 ;This routine contains several entry points called from HLCSMON
+4 ;no input parameters are required. All variables used which are
+5 ;not newed here are newed in HLCSMON
+6 ;
DISPLAY ;display link info
+1 ;turn of line wrap
+2 SET HLXX=0
SET X=0
XECUTE ^%ZOSF("RM")
+3 FOR
SET HLXX=$ORDER(HLARYD(HLXX))
IF (HLXX'>0)
QUIT
DO WLINE(HLXX)
+4 ;DISPLAY INCOMING FILER STATUS
+5 SET HLXX=$$CNTFLR^HLCSUTL2("IN")
+6 ;ONLY UPDATE SCREEN IF COUNT HAS CHANGED
+7 IF (HLXX'=+HLRUNCNT)
Begin DoDot:1
+8 DO WDATA(5,17,"","",$JUSTIFY(" ",31))
DO WDATA^HLCSMON1(5,17,"","","Incoming filers running => ",35)
+9 IF (HLXX)
DO WDATA(32,17,"","",HLXX)
+10 IF ('HLXX)
DO WDATA(32,17,IOINHI,IOINORM,"Zero")
+11 SET $PIECE(HLRUNCNT,"^",1)=HLXX
End DoDot:1
+12 ;DISPLAY OUTGOING FILER STATUS
+13 SET HLXX=$$CNTFLR^HLCSUTL2("OUT")
+14 ;ONLY UPDATE SCREEN IF COUNT HAS CHANGED
+15 IF (HLXX'=+$PIECE(HLRUNCNT,"^",2))
Begin DoDot:1
+16 DO WDATA(5,18,"","",$JUSTIFY(" ",31))
DO WDATA^HLCSMON1(5,18,"","","Outgoing filers running => ",35)
+17 IF (HLXX)
DO WDATA(32,18,"","",HLXX)
+18 IF ('HLXX)
DO WDATA(32,18,IOINHI,IOINORM,"Zero")
+19 SET $PIECE(HLRUNCNT,"^",2)=HLXX
End DoDot:1
+20 SET X=$$TM^%ZTLOAD
+21 IF X'=$GET(HLTMSTAT)
Begin DoDot:1
+22 SET HLTMSTAT=X
+23 SET HLXX=$SELECT('HLTMSTAT:"***TASKMAN NOT RUNNING!!!***",1:"")
+24 IF 'HLTMSTAT
DO WDATA^HLCSMON1(45,17,IOELEOL_IOBON_IORVON,IOBOFF_IORVOFF,HLXX)
IF 1
+25 ;D WDATA(5,19,IOELALL,"","")
IF '$TEST
DO WDATA(45,17,IOELEOL,"",$JUSTIFY("TaskMan running ",16))
End DoDot:1
+26 SET X=$$STAT^HLCSLM
+27 IF X'=$GET(HLLMSTAT)
Begin DoDot:1
+28 SET HLLMSTAT=X
IF HLLMSTAT=3
QUIT
+29 SET HLXX=$SELECT('HLLMSTAT:"***LINK MANAGER NOT RUNNING!!!***",1:"")
+30 IF 'HLLMSTAT
DO WDATA^HLCSMON1(45,18,IOELEOL_IOBON_IORVON,IOBOFF_IORVOFF,HLXX)
IF 1
+31 IF '$TEST
DO WDATA^HLCSMON1(45,18,IOELEOL,"",$JUSTIFY("Link Manager running",18))
End DoDot:1
+32 ;Turn terminal line wrap back on
+33 ; HL*1.6*109
DO WDATA(45,19,IOELEOL,"",$$SLM^HLEVUTIL)
+34 SET X=IOM
XECUTE ^%ZOSF("RM")
+35 QUIT
+36 ;
WLINE(HLXX) ;write line from HLARYD=current values, HLARYO=old values
+1 ;if values haven't changed, don't do anything
+2 IF HLARYD(HLXX)]""
IF HLARYD(HLXX)=$GET(HLARYO(HLXX))
QUIT
+3 SET HLARYO(HLXX)=HLARYD(HLXX)
SET HLERR=$PIECE(HLARYD(HLXX),U,8)
SET DX=1
+4 FOR X=1:1:7
SET @$PIECE("HLNODE^HLREC^HLPROC^HLSEND^HLSENT^HLDEV^HLSTAT",U,X)=$EXTRACT($PIECE(HLARYD(HLXX),U,X)_" ",1,8)
+5 ;if link is in error, write node in rev. video
+6 IF HLERR]""
DO WDATA(5,HLXX,IOBON_IORVON,IOBOFF_IORVOFF,HLNODE,8)
SET DX=14
+7 ;Turn off terminal line wrap & inform O/S where cursor is located
+8 SET DY=HLXX
XECUTE IOXY
XECUTE ^%ZOSF("XY")
+9 IF HLERR=""
WRITE ?5,HLNODE
+10 WRITE ?16,HLREC,?26,HLPROC,?37,HLSEND,?47,HLSENT,?58,HLDEV,?64,HLSTAT
+11 QUIT
+12 ;
WDATA(DX,DY,IO1,IO2,HLDATA,HLENGTH) ;
+1 ;
+2 ;First erase the data block then write to it. Attributes are
+3 ;contained in IO1 & IO2
+4 ;
+5 NEW X
SET X=0
XECUTE ^%ZOSF("RM")
XECUTE ^%ZOSF("XY")
+6 ;Turn off terminal line wrap & inform O/S where cursor is located
+7 IF '$DATA(HLENGTH)
SET HLENGTH=$LENGTH(HLDATA)
+8 XECUTE IOXY
WRITE IOSC,$EXTRACT($JUSTIFY(" ",79),1,HLENGTH),IORC
WRITE IO1,$EXTRACT(HLDATA,1,HLENGTH),IO2
+9 SET X=IOM
XECUTE ^%ZOSF("RM")
+10 ;Turn terminal line wrap back on
+11 QUIT