*DECK CSESOM
USETEXT TEXTSS
USETEXT TEXTCS
USETEXT TXTAPSS
USETEXT TXTSMCS
PROC CSESOM;
# TITLE - SEND OPERATOR MESSAGE. #
BEGIN
#
** CSESOM - SEND OPERATOR MESSAGE.
*
* D.K. ENDO 82/03/29
*
* THIS PROCEDURE FORMATS MESSAGE TO THE OPERATORS AND SENDS IT TO
* THEM VIA THE OPERATOR RESPONSE QUEUE.
*
* PROC CSESOM
*
* ENTRY 1. MSG/OP/U SM FROM THE EVENT QUEUE.
*
* EXIT 1. FORMATTED MESSAGE TO THE OPERATORS SENT TO THE
* OPERATOR RESPONSE QUEUE WITH THE AUDIENCE GROUP
* SET TO TWO.
*
#
#
**** PROC CSESOM - XREF LIST BEGINS.
#
XREF
BEGIN
FUNC SSDCAD U; # CONVERT ASCII TO DISPLAY CODE #
PROC SSTAQE; # ADD QUEUE ENTRY #
END
#
****
#
DEF NONTXT$ # 15 #; # NUMBER OF CHARS NOT PART OF TEXT #
DEF TNM$TXTL # 40 #; # CHAR COUNT OF TERMINAL NAME TEXT #
ITEM A$CHAR = 0; # ASCII CHARACTER FROM MESSAGE TEXT #
ITEM BPOS; # BIT POSITION OF CURRENT ASCII CHARACTER #
ITEM CHARCNT; # CHARACTER COUNT OF MESSAGE #
ITEM CHARPOS; # BIT POSITION OF CRNT DISPLAY CODE CHAR #
ITEM I; # LOOP INDUCTION VARIABLE #
ITEM MCC; # MESSAGE CHARACTER COUNT #
ITEM MWC; # WORD COUNT INTO MESSAGE TEXT #
ITEM WC; # WORD COUNT OF TEXT SENT #
#
THIS ARRAY DEFINES THE MESSAGE TEXT FORMATTED AS SENT TO THE
OPERATORS.
#
DEF MX$MTO # 07 #;
ARRAY MTO$TXT [01:MX$MTO] S(1);
BEGIN
ITEM MTO$TIM C(00,00,10) = [" "];
ITEM MTO$WORD U(00,00,60);
END
#
* THIS ARRAY DEFINES THE TERMINAL NAME TEXT SENT WITH THE MESSAGE
#
ARRAY TNM$TXT [00:00] S(4);
BEGIN
ITEM TNM$TIM C(00,00,10);
ITEM TNM$TERM C(01,00,11) = ["FROM TERM--"];
ITEM TNM$TNM U(02,06,42);
ITEM TNM$C1 C(02,48,02) = [": "];
ITEM TNM$ZBYT U(03,00,60) = [0];
END
CONTROL EJECT;
# #
# CSESOM CODE BEGINS HERE #
# #
#
* APPEND THE CURRENT TIME TO THE TEXT. CONVERT THE TERMINAL NAME
* AND APPEND IT TO THE TEXT. CONVERT THE MESSAGE AND CONVERT IT TO
* TEXT. SEND THE TEXT OFF TO THE OPERATOR RESPONSE QUEUE WITH AN
* AUDIENCE GROUP OF TWO.
#
TNM$TIM[0] = CTM$CLOCK[0];
FOR I=0 STEP 1 UNTIL 6
DO
BEGIN
B<I*6,6>TNM$TNM[0] = SSDCAD(B<I*8,8>MSGTN[0]);
END
WCB$WORD[1] = 0;
WCB$WC[1] = 2 + (TNM$TXTL / 10);
ABHWORD[1] = TNM$TXTL;
ABHADR[1] = AUDGR4$;
FOR I=0 STEP 1 WHILE NPU$NID[I] NQ ABHSN[0] AND
I LS CSNPCNT
DO
BEGIN
END
ABHABN[1] = I;
SSTAQE(P<ORQ>,WCBUF[1],ABH[1],TNM$TXT);
FOR I=2 STEP 1 UNTIL MX$MTO
DO
BEGIN
MTO$WORD[I] = 0;
END
A$CHAR = 0;
BPOS = 0;
CHARCNT = 1;
MWC = 2;
MCC = ABHTLC[0] - NONTXT$;
FOR WC=2 STEP 1 WHILE CHARCNT LQ MCC AND
WC LS MX$MTO
DO
BEGIN
FOR CHARPOS=0 STEP 6 WHILE CHARCNT LQ MCC AND
CHARPOS LS 60
DO
BEGIN
IF BPOS LQ 52
THEN
BEGIN
A$CHAR = B<BPOS,8>MSG$WORD[MWC];
B<CHARPOS,6>MTO$WORD[WC] = SSDCAD(A$CHAR);
BPOS = BPOS + 8;
END
ELSE IF BPOS EQ 56
THEN
BEGIN
B<52,4>A$CHAR = B<BPOS,4>MSG$WORD[MWC];
MWC = MWC + 1;
B<56,4>A$CHAR = B<0,4>MSG$WORD[MWC];
B<CHARPOS,6>MTO$WORD[WC] = SSDCAD(A$CHAR);
BPOS = 4;
END
ELSE
BEGIN
MWC = MWC + 1;
A$CHAR = B<0,8>MSG$WORD[MWC];
B<CHARPOS,6>MTO$WORD[WC] = SSDCAD(A$CHAR);
BPOS = 8;
END
CHARCNT = CHARCNT + 1;
END
END
IF CHARPOS LQ 48
THEN
BEGIN
WC = WC - 1;
END
WCB$WC[1] = 2 + WC;
ABHTLC[1] = WC * 10;
SSTAQE(P<ORQ>,WCBUF[1],ABH[1],MTO$TXT);
RETURN; # **** RETURN **** #
END # CSESOM #
TERM