LASMAC4 ;SLC/RWF - SMAC RUN CONTROL FOR SMAC (LASMACA) ;7/20/90 10:10 ;
;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
D PICK
LA2 D TSK I TSK<1!('$D(LWL)) W !," Auto Instrument file not setup right, OR already running!" Q
G LA3:LAGEN'["LWLIST" W !!,$C(7),"Have you BUILT the LOAD LIST? N//" R X:DTIME Q:'$T I "Nn"[X D ^LRLL G LASMAC4
I $S('$D(^LRO(68.2,LWL,2)):1,1:$P(^(2),U,1)'=DT) W !,$C(7)," LOAD LIST IS NOT CURRENT!" Q
LA3 S IOP="HOME" D ^%ZIS K IOT,IOSL,IOBS
D ASK^LA1103
W @IOF,!,"START OF SMAC RUN"
D TSK
S T=TSK D SET^LAB
D4 R !,"PRESS RETURN TO START PROCESSING",X:DTIME,! G D4:'$T
LA1 K ^LA("LOCK",TSK),^LA("STOP",TSK) S ^LRO(68.2,LWL,8,0)="",LRMODE=1 D @("^"_LANM) O IO(0) U IO(0)
I '$D(^LA("STOP",TSK)) W !!,$C(7),"IS THE SMAC RUN FINISHED" S %=2 D YN^DICN G LA1:%'=1
W !,$C(7),"Finished collecting SMAC data."
;W @IOF D MEAN^LACRIT
W !!,"SMAC RUN OVER",@IOF
K ^LA("STOP",TSK),LWL,TC,TV,LRMODE,^TMP($J),^TMP("LA",$J)
END L
Q
EN ;
HALT R !!,"DO YOU REALLY WANT TO STOP THE SMAC RUN? N//",X:DTIME G HALT:'$T Q:X'["Y"
HA2 D PICK
D TSK Q:TSK<1 S ^LA("STOP",TSK)=1 Q
TSK S TSK=$O(^LAB(62.4,"C",LANM,0)) W:TSK<1 !,"NOT IN AUTO INSTRUMENT FILE."
K ^LA("LOCK",TSK),LRTOP D ^LASET Q
PICK S U="^",A=$O(^LAB(62.4,"C","LASMAC")),B=$O(^(A)),A=$P(A,"LASMAC",2),B=$P(B,"LASMAC",2)
PC2 S X=A I $L(B) W !,"SMAC '",A,"' OR '",B,"': " R X:DTIME G PC2:'$T Q:X[U S:X="" X=" " S X=$E(X,1) G PC2:A_B'[X
S LANM="LASMAC"_X Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLASMAC4 1462 printed Dec 13, 2024@01:44:14 Page 2
LASMAC4 ;SLC/RWF - SMAC RUN CONTROL FOR SMAC (LASMACA) ;7/20/90 10:10 ;
+1 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
+2 DO PICK
LA2 DO TSK
IF TSK<1!('$DATA(LWL))
WRITE !," Auto Instrument file not setup right, OR already running!"
QUIT
+1 if LAGEN'["LWLIST"
GOTO LA3
WRITE !!,$CHAR(7),"Have you BUILT the LOAD LIST? N//"
READ X:DTIME
if '$TEST
QUIT
IF "Nn"[X
DO ^LRLL
GOTO LASMAC4
+2 IF $SELECT('$DATA(^LRO(68.2,LWL,2)):1,1:$PIECE(^(2),U,1)'=DT)
WRITE !,$CHAR(7)," LOAD LIST IS NOT CURRENT!"
QUIT
LA3 SET IOP="HOME"
DO ^%ZIS
KILL IOT,IOSL,IOBS
+1 DO ASK^LA1103
+2 WRITE @IOF,!,"START OF SMAC RUN"
+3 DO TSK
+4 SET T=TSK
DO SET^LAB
D4 READ !,"PRESS RETURN TO START PROCESSING",X:DTIME,!
if '$TEST
GOTO D4
LA1 KILL ^LA("LOCK",TSK),^LA("STOP",TSK)
SET ^LRO(68.2,LWL,8,0)=""
SET LRMODE=1
DO @("^"_LANM)
OPEN IO(0)
USE IO(0)
+1 IF '$DATA(^LA("STOP",TSK))
WRITE !!,$CHAR(7),"IS THE SMAC RUN FINISHED"
SET %=2
DO YN^DICN
if %'=1
GOTO LA1
+2 WRITE !,$CHAR(7),"Finished collecting SMAC data."
+3 ;W @IOF D MEAN^LACRIT
+4 WRITE !!,"SMAC RUN OVER",@IOF
+5 KILL ^LA("STOP",TSK),LWL,TC,TV,LRMODE,^TMP($JOB),^TMP("LA",$JOB)
END LOCK
+1 QUIT
EN ;
HALT READ !!,"DO YOU REALLY WANT TO STOP THE SMAC RUN? N//",X:DTIME
if '$TEST
GOTO HALT
if X'["Y"
QUIT
HA2 DO PICK
+1 DO TSK
if TSK<1
QUIT
SET ^LA("STOP",TSK)=1
QUIT
TSK SET TSK=$ORDER(^LAB(62.4,"C",LANM,0))
if TSK<1
WRITE !,"NOT IN AUTO INSTRUMENT FILE."
+1 KILL ^LA("LOCK",TSK),LRTOP
DO ^LASET
QUIT
PICK SET U="^"
SET A=$ORDER(^LAB(62.4,"C","LASMAC"))
SET B=$ORDER(^(A))
SET A=$PIECE(A,"LASMAC",2)
SET B=$PIECE(B,"LASMAC",2)
PC2 SET X=A
IF $LENGTH(B)
WRITE !,"SMAC '",A,"' OR '",B,"': "
READ X:DTIME
if '$TEST
GOTO PC2
if X[U
QUIT
if X=""
SET X=" "
SET X=$EXTRACT(X,1)
if A_B'[X
GOTO PC2
+1 SET LANM="LASMAC"_X
QUIT