BGUTUTL ; IHS/OIT/MJL - Trace utilities ;
;;1.5;BGU;;MAY 26, 2005
;
; BGUST = 1 --> Start trace
; BGUST = 0 --> Stop trace
START ;EP Called by option BGU START TRACE
; Start trace
S BGUST=1 D ASKDJ,SET:'$D(DIRUT)
D KILL
Q
;
STOP ;EP Called by option BGU STOP TRACE
;Stop trace
S BGUST=0 D ASKDJ
I '$D(DIRUT) D SET:BGUALL,DEL:'BGUALL
D KILL
Q
;
ASKDJ ;
; Ask for $J
S U="^",BGUALL=1,DIR(0)="YO",DIR("A")="TURN "_$S(BGUST:"ON",1:"OFF")_" TRACE FOR ALL JOBS ?"
D ^DIR Q:$D(DUOUT) I '$D(DIRUT) S BGUANS=X K DIRUT Q
S BGUALL=0,DIR(0)="NO^1:999999",DIR("A")="ENTER $J TO "_$S(BGUST:"START",1:"HALT")_" TRACING"
S DIR("?")="Enter numeric characters for the $J you want to "_$S(BGUST:"start",1:"halt")_" tracing"
D ^DIR Q:$D(DIRUT)
S BGUDJ=Y
Q
;
SET ;
I BGUALL S BGUFDA(90062,"?1,",.01)=1,BGUFDA(90062,"?1,",.02)=$S(BGUST&(BGUANS="Y"):"Y",'BGUST&(BGUANS="N"):"Y",1:"N") D UPDATE^DIE("","BGUFDA","BGUDJ","BGUEMSG") Q
S BGUFDA(90062.01,"?+1,1,",.01)=BGUDJ D UPDATE^DIE("","BGUFDA","BGUDJ","BGUEMSG")
Q
;
DEL ;
S DIK="^BGUSP(1,1,",DA(1)=1 S BGUN=0 F BGUQ=0:0 S BGUN=$O(^BGUSP(1,1,"B",BGUDJ,BGUN)) Q:BGUN="" S DA=BGUN D ^DIK
Q
;
KILL ;
K BGUALL,BGUDJ,BGUFDA,BGUN,BGUQ,BGUST,DA,DIK,DIR,DIRUT,DUOUT,X,Y
Q
BGUTUTL ; IHS/OIT/MJL - Trace utilities ;
+1 ;;1.5;BGU;;MAY 26, 2005
+2 ;
+3 ; BGUST = 1 --> Start trace
+4 ; BGUST = 0 --> Stop trace
START ;EP Called by option BGU START TRACE
+1 ; Start trace
+2 SET BGUST=1
DO ASKDJ
IF '$DATA(DIRUT)
DO SET
+3 DO KILL
+4 QUIT
+5 ;
STOP ;EP Called by option BGU STOP TRACE
+1 ;Stop trace
+2 SET BGUST=0
DO ASKDJ
+3 IF '$DATA(DIRUT)
IF BGUALL
DO SET
IF 'BGUALL
DO DEL
+4 DO KILL
+5 QUIT
+6 ;
ASKDJ ;
+1 ; Ask for $J
+2 SET U="^"
SET BGUALL=1
SET DIR(0)="YO"
SET DIR("A")="TURN "_$SELECT(BGUST:"ON",1:"OFF")_" TRACE FOR ALL JOBS ?"
+3 DO ^DIR
IF $DATA(DUOUT)
QUIT
IF '$DATA(DIRUT)
SET BGUANS=X
KILL DIRUT
QUIT
+4 SET BGUALL=0
SET DIR(0)="NO^1:999999"
SET DIR("A")="ENTER $J TO "_$SELECT(BGUST:"START",1:"HALT")_" TRACING"
+5 SET DIR("?")="Enter numeric characters for the $J you want to "_$SELECT(BGUST:"start",1:"halt")_" tracing"
+6 DO ^DIR
IF $DATA(DIRUT)
QUIT
+7 SET BGUDJ=Y
+8 QUIT
+9 ;
SET ;
+1 IF BGUALL
SET BGUFDA(90062,"?1,",.01)=1
SET BGUFDA(90062,"?1,",.02)=$SELECT(BGUST&(BGUANS="Y"):"Y",'BGUST&(BGUANS="N"):"Y",1:"N")
DO UPDATE^DIE("","BGUFDA","BGUDJ","BGUEMSG")
QUIT
+2 SET BGUFDA(90062.01,"?+1,1,",.01)=BGUDJ
DO UPDATE^DIE("","BGUFDA","BGUDJ","BGUEMSG")
+3 QUIT
+4 ;
DEL ;
+1 SET DIK="^BGUSP(1,1,"
SET DA(1)=1
SET BGUN=0
FOR BGUQ=0:0
SET BGUN=$ORDER(^BGUSP(1,1,"B",BGUDJ,BGUN))
IF BGUN=""
QUIT
SET DA=BGUN
DO ^DIK
+2 QUIT
+3 ;
KILL ;
+1 KILL BGUALL,BGUDJ,BGUFDA,BGUN,BGUQ,BGUST,DA,DIK,DIR,DIRUT,DUOUT,X,Y
+2 QUIT