(FILECREATED " 1-MAR-82 17:51:37" {PHYLUM}<FIKES>LISP>INTERFACETO8200.;6 7652Q  

     changes to:  GetMainPanelOutput Read8200 Push8200ButtonSpellings INTERFACETO8200COMS 
INTERFACETO8200VARS Get8200 Push8200Button Select8200Feature

     previous date: "26-FEB-82 16:02:56" {PHYLUM}<FIKES>LISP>INTERFACETO8200.;4)


(PRETTYCOMPRINT INTERFACETO8200COMS)

(RPAQQ INTERFACETO8200COMS [(E (RESETSAVE (RADIX 8)))
			    (FNS Get8200 Push8200Button Read8200 Select8200Feature)
			    (VARS * INTERFACETO8200VARS)
			    (DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS
				      (ADDVARS (NLAMA)
					       (NLAML)
					       (LAMA])
(DEFINEQ

(Get8200
  [LAMBDA (array prop)                                       (* ref: " 1-MAR-82 17:41")
                                                             (* Get the value of property prop from array as obtained
							     by Read8200.)
    (SELECTQ prop
	     (Output (if ((LOGAND (ELT array 17Q)
				  200Q)
			  GT 0)
			 then ' CollatedStapled
		       elseif ((LOGAND (ELT array 17Q)
				       2)
			       GT 0)
			 then ' Uncollated
		       elseif ((LOGAND (ELT array 17Q)
				       1)
			       GT 0)
			 then ' CollatedUnstapled
		       else NIL))
	     (PROG [(fix (FIXSPELL prop NIL '(Output]
	           (RETURN (if fix
			       then (Get8200 array fix)
			     else (HELP "Unknown prop in Get8200:" prop])

(Push8200Button
  [LAMBDA (button)                                           (* ref: " 1-MAR-82 17:21")

          (* Send a signal to the "8200" that will have the effect of pushing the panel button specified by "button". 
"button" can be an integer 0,1,...,9 or one of the atoms Blank, Clear, Copy, CopyMode, Output, PaperTray, Reduction, 
	  StartPrint, or StopPrint.)


    (WRITEPRINTERPORT (SELECTQ button
			       (1 4000Q)
			       (2 4001Q)
			       (3 4002Q)
			       (4 4003Q)
			       (5 4004Q)
			       (6 4005Q)
			       (7 4006Q)
			       (10Q 4007Q)
			       (11Q 2000Q)
			       (0 2001Q)
			       (Blank 2002Q)
			       (StartPrint 2003Q)
			       (StopPrint 2004Q)
			       (Copy 2005Q)
			       (CopyMode 2006Q)
			       (Reduction 2007Q)
			       (Clear 1000Q)
			       (PaperTray 1001Q)
			       (Output 1002Q)
			       (PROG [(fix (FIXSPELL button NIL '(Blank StartPrint StopPrint Copy 
									CopyMode Reduction Clear 
									PaperTray Output]
				     (RETURN (if fix
						 then (Push8200Button fix)
					       else (HELP "Unknown arg to Push8200Button" button])

(Read8200
  [LAMBDA (array)                                            (* ref: " 1-MAR-82 17:01")

          (* Read into array "array" a 36Q byte status report from the 20010Q copier. If "array" is NIL, create a 36Q 
	  element array of type FIXP. Return the array.)


    (PROG (byte)
          (if ~array
	      then (array ←(ARRAY 36Q ' FIXP)))
          (WRITEPRINTERPORT 400Q)
          (repeatuntil (LOGAND byte 10000Q)= 0 do byte ←(READPRINTERPORT))
          (for i to 36Q do (repeatuntil (LOGAND byte 4000Q)= 0 do byte ←(READPRINTERPORT))
			   ((ELT array i)←(LOGAND byte 377Q)))
          (RETURN array])

(Select8200Feature
  [LAMBDA (feature)                                          (* ref: " 1-MAR-82 17:51")
                                                             (* Select one of the features on the 20010Q main control
							     panel.)
    (PROG [(array (ARRAY 36Q ' FIXP))
	   (button (SELECTQ feature
			    ((CollatedStapled Uncollated CollatedUnstapled)
			      ' Output)
			    (HELP]
          (RETURN (until (Get8200 (Read8200 array)
				  button)= feature do (Push8200Button button])
)

(RPAQQ INTERFACETO8200VARS NIL)
(DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS 

(ADDTOVAR NLAMA )

(ADDTOVAR NLAML )

(ADDTOVAR LAMA )
)
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1214Q 7353Q (Get8200 1226Q . 2665Q) (Push8200Button 2667Q . 5060Q) (Read8200 5062Q . 
6316Q) (Select8200Feature 6320Q . 7351Q)))))
STOP