.;
.; GSRGENDOC.CMD -- DOCUMENT GENERATION COMMAND FILE
.;
.; COMMAND FILE TO HELP MAKE DOCUMENTS
.;
.; EDIT NUMBER = 0001
.; EDITED BY: D.B.CURTIS  17 APR 80  20:10
.;
.; GLOBOLS
.;	$BY -- AUTHORS NAME
.;	$RFUIC -- UIC FOR THE COMMAND FILES
.;	$TITLE -- DOCUMENT TITLE
.;	$GRUP -- PROJECT GROUP
.;	$SUB -- DOCUMENT SUBJECT
.;	$TYPER -- ??
.;	$DATE -- CURRENT DATE
.;	$TIME -- CURRENT TIME
.;	$DOCN -- DOCUMENT NUMBER
.;	$TEST -- TEST MODE ENABLED DO NOT ADD DOCUMENT IN DATABASE
.;	$FILE -- FILE NAME OF DOCUMENT (EXT=RNO)
.;	$IDEA -- A TYPE OF DOCUMENT
.;	$OVERV -- ???
.;	$PROJ -- PROJECT DESIGNATOR (ASCII)
.;	$TRCF -- PROJECT NUMBER
.;
.; CALLS 
.;	GSRDSASK -- ASKS FOR INFO. ABOUT DESIGN SPECS
.;	GSRDSGEN -- GENERATES STANDARD DESIGN FORMAT
.;	GSRTECGEN -- GENERATES STANDARD TECNICAL NOTE FORMAT
.;	GSRMEMASK -- ASKS FOR MEMO INFORMATION
.;	GSRMEMGEN -- GENERATES STANDARD MEMO
.;	GSRGROUP -- GENERATES GROUP INFORMATION
.;	GSRNUMnnn -- GENERATES DOCNUMENT NUMBERS FOR PROJECTS nnn
.;
.; RUNS INSRTDOC IN UIC THAT CONTAINS DATATRIEVE DATA FILES
.;
.; OUTPUTS/ APPENDS 
.;	DOCSnnn.TRC
.;	NEWDOCnnn.TRC
.;	LASTEDIT.CMD;1
.;
	.ENABLE QUIET
	.ENABLE SUBSTITUTION
	.ENABLE GLOBAL
	.ENABLE ESCAPE
	.SETS REFUIC "[1,102]"
	.SETS $RFUIC REFUIC
	.SETS INSUIC "[20,25]"
.START:	.SETF $TEST
	.SETF $IDEA
	.SETF $OVERV
	.SETS M1 "MAC REPLACEMENT PROJECT"
	.SETS M2 "TRIGGER PROCESSOR PROJECT"
	.SETS M3 "MEMO"
	.SETS M4 "SWIC SCANNER PROJECT"
	.SETS M5 "GENERAL HARDWARE PROJECTS"
	.SETS M6 "FASTBUS PROJECTS"
	.GOTO A1
.A1A:
	.DISABLE QUIET
	;THIS COMMAND WILL GENERATE DOCUMENTS FOR THE FOLLOWING
	;PROJECTS
	;
	; 1) 'M1'
	; 2) 'M2'
	; 3) 'M3'
	; 4) 'M4'
	; 5) 'M5'
	; 6) 'M6'
	;
	.ENABLE QUIET
.A1:
	.SETN MAX 6.
	.ASKN [::0.] Z WHAT PROJECT
	.IFT <ESCAPE> .GOTO A1A
	.IF Z = 0 .GOTO A1A
	.IF Z > MAX .GOTO A1A
	.SETS TMP "M'Z'"
	.SETS $PROJ 'TMP'
	.SETN $TRCF 'Z'.
	.IF Z = 3 .SETN TYPDOC 3
	.IF Z = 3 .GOTO 2
	.GOTO 1A
.1:
	.DISABLE QUIET
; FOR TEST, USE DOC TYPE 0
;
; DOCUMENTS HAVE THE FOLLOWING TYPES
;
;	1) DESIGN SPEC
;	2) TECHNICAL NOTE
;	3) MEMO (NO DOCUMENT NUMBER OR TRACE)
;	4) IDEA - DESIGN SPEC W/O DETAILED PLAN & NOT NESSASARLY THOUGHT OUT
;	5) CHANGE SPEC
.IF $TRCF NE 1. ;	6) OVERVIEW
;
;
	.ENABLE QUIET
.1A:
	.ASKN [::0.] TYPDOC WHAT TYPE DOCUMENT DO YOU WANT
	.IFT <ESCAPE> .GOTO 1
	.IF TYPDOC > 0 .GOTO 2
	.SETT $TEST
	.DISABLE QUIET
	; ENTER TEST MODE, DOCUMENT WILL NOT BE MADE
	.ENABLE QUIET
	;
	.GOTO 1A
.2:	.SETN MAX 5
	.IF $TRCF NE 1 .SETN MAX 6.
	.IF TYPDOC = 4 .SETT $IDEA
	.IF TYPDOC = 4 .SETN TYPDOC 1
	.IF TYPDOC = 1 .GOTO DESSPE
	.IF TYPDOC = 2 .GOTO TECSPE
	.IF TYPDOC = 3 .GOTO MEMOS
	.IF TYPDOC = 4 .GOTO ERR1
	.IF $TRCF NE 1 .IF TYPDOC = 6 .SETT $OVERV
	.IF $TRCF NE 1 .IF TYPDOC = 6 .GOTO DESSPE
	.IF TYPDOC > MAX .GOTO ERR1
	.GOTO ERR1

.DESSPE:
.;
.; DESIGN SPEC
.;
	@LB:'REFUIC'GSRDSASK
	.GOSUB DOCNUM
	@LB:'REFUIC'GSRDSGEN
	.GOTO END
.TECSPE:
.;
.; TECHNECAL NOTE
.;
	@LB:'REFUIC'GSRDSASK
	.GOSUB DOCNUM
	@LB:'REFUIC'GSRTECGEN
	.GOTO END
.MEMOS:
	@LB:'REFUIC'GSRMEMASK
	.SETS $DATE <DATE>
	.SETS $TIME <TIME>
	@LB:'REFUIC'GSRMEMGEN
	.GOTO END1
.ERR1:
.;
.;SPECIFIED TYPE OF DOCUMENT IS NOT SUPPORTED
.;
	.DISABLE QUIET
	;SPECIFIED DOCUMENT TYPE IS NOT SUPPORTED
	.ENABLE QUIET
	.GOTO	1
.;
.END:
	.IFT $TEST .GOTO END1
	.OPEN #0 'REFUIC' DOC'$TRCF'.TMP
.ENABLE DATA #0
*****
****
***
**
*

DOCUMENT NUMBER = '$DOCN'
FILE = '<UIC>''$FILE'.RNO
TITLE = '$TITLE'
DATE = '$DATE' '$TIME'
AUTHOR = '$BY'
GROUP ='$GRUP'
SUBJECT = '$SUB'

*
**
***
****
.DISABLE DATA #0
	.CLOSE	#0
	PIP 'REFUIC'DOC'$TRCF'.TMP/PR/WO:RWED
	.IFNDF $TYPER .SETS $TYPER "NEW"
	.OPEN #0 'REFUIC'NEWDOC'$TRCF'.TRC
.ENABLE DATA #0
NM--'$DOCN'
TP--'$TYPER'
DA--'$DATE'
TI--'$TITLE'
AU--'$BY'
FI--'<UIC>''$FILE'
K1--'$GRUP'
.DISABLE DATA
	.CLOSE #0
	PIP 'REFUIC'NEWDOC'$TRCF'.TRC/PR/WO:RWED
	RUN 'INSUIC'INSRTDOC
	PIP 'REFUIC'DOCS'$TRCF'.TRC/AP='REFUIC'DOC'$TRCF'.TMP
	PIP 'REFUIC'DOC'$TRCF'.TMP;*/DE
.END1:
	.OPEN #0 LASTEDIT.CMD;1
	.DATA '$FILE'.RNO
	.CLOSE #0
	.DISABLE QUIET
;
; EDIT FILE '<UIC>''$FILE'.RNO
;
	.ENABLE QUIET
/
.DOCNUM:
	@LB:'REFUIC'GSRGROUP
	.ASK ZZ DO YOU WANT TO DO IT OVER
	.IFT ZZ .GOTO REDO
	.IFF $TEST @LB:'REFUIC'GSRNUM'$TRCF'
	.IFT $TEST .SETN $DOCN 0
	.SETS $DATE <DATE>
	.SETS $TIME <TIME>
	.RETURN
.REDO:
	.GOTO START
