Routine INITIALIZE.GRAPHICS

   '' Goldmine Simulation                                       August 2, 1988
   '' CACI Products Company

   '' Initialize all of the graphic specifics of the program.  Basically, the
   '' simulation can run without the graphics.  This routine simply makes the
   '' links to the control variables to have the simulation run in graphics.


   ''Define DEVICE.ID as a pointer variable


   Let TIMESCALE.V = SCALER*100/60.0   ''clock ticks (1/100 sec) /  unit
   Let TIMESYNC.V = 'UPDATE.CLOCK'

   ''Create a 'Graphic display' using 2 new I/O units
   ''Call DEVINIT.R("VT,GRAPHIC") yielding DEVICE.ID
   ''Open 7 for input, device = DEVICE.ID             
   ''Open 8 for output, device = DEVICE.ID
   ''Use 8 for graphic output

   ''Show the background and make those parts which will be overlapped by
   ''graphs have a priority of 0 for faster update.
   Show GROUND with "ground.icn"   ''smb
   Display GROUND
   Call GPRIORITY.R giving SEGID.A(DFIELD.F("BLOCK1",GROUND)), 1
   Call GPRIORITY.R giving SEGID.A(DFIELD.F("BLOCK2",GROUND)), 1
   Call GPRIORITY.R giving SEGID.A(DFIELD.F("BLOCK3",GROUND)), 1

   ''Select a viewing transform and establish its mapping
   Let VXFORM.V = 1
   Call SETWORLD.R giving -50.0, 200.0, -220.0, 20.0
   Call SETVIEW.R giving 0, 32767, 0, 20000

   ''Give the lift an overrided display routine for special displays (in this
   ''case, display the load of the lift within the lift).
   Let DRTN.A(LIFT) = 'V.LIFT'
   Let LIFT.STATUS(LIFT) = "STOP"
   Display LIFT with "lift.icn" at (0, 0)

   Create a SHAPE called LOADSHAPE
   Show LOADSHAPE with "load.icn"

   ''Set up the graphs
   Let VXFORM.V = 0
   Display CLOCKTIME with "aclock.grf"
   Display N.LOAD.QUEUE(1) with QUEUE.ICON(1)
   Display N.LOAD.QUEUE(2) with QUEUE.ICON(2)
   Let VXFORM.V = 1

   Activate a MENUPROC now


End ''INITIALIZE.GRAPHICS
