(DEFINE-FILE-INFO PACKAGE "IL" READTABLE "INTERLISP" BASE 10)
(FILECREATED "15-Aug-90 16:20:47" {DSK}<usr>local>lde>SOURCES>loops>LIBRARY>GAUGEDIGISCALE.;2 5007   

      changes to%:  (VARS GAUGEDIGISCALECOMS)

      previous date%: "23-Feb-88 23:28:33" {DSK}<usr>local>lde>SOURCES>loops>LIBRARY>GAUGEDIGISCALE.;1
)


(* ; "
Copyright (c) 1986, 1987, 1988, 1990 by Venue & Xerox Corporation.  All rights reserved.
")

(PRETTYCOMPRINT GAUGEDIGISCALECOMS)

(RPAQQ GAUGEDIGISCALECOMS ((DECLARE%: DONTCOPY (PROP MAKEFILE-ENVIRONMENT GAUGEDIGISCALE))
                               (FILES (FROM VALUEOF LOOPSLIBRARYDIRECTORY)
                                      GAUGEALPHANUMERICS GAUGESCALES)
                               (CLASSES DigiScale)
                               (METHODS DigiScale.Set DigiScale.SetParameters DigiScale.ShowReading)))
(DECLARE%: DONTCOPY 

(PUTPROPS GAUGEDIGISCALE MAKEFILE-ENVIRONMENT (:PACKAGE "IL" :READTABLE "INTERLISP" :BASE 10))
)

(FILESLOAD (FROM VALUEOF LOOPSLIBRARYDIRECTORY)
       GAUGEALPHANUMERICS GAUGESCALES)

(DEFCLASSES DigiScale)
(DEFCLASS DigiScale
   (MetaClass Class doc "Combines a numeric display with an unlabelled proportional horizontal scale"
          Edited%:                                       (* dgb%: " 6-JUN-83 17:55"))
   (Supers HorizontalScale LCDMixin)
   (InstanceVariables (ticks NIL tickLength NIL doc 
      "ticks on the instrument; value is number or NIL; smallTicks is number between each large tick"
                             )
          (scaleHeight 6 doc "height of scale")
          (scaleLeft 6 doc "left edge of scale")
          (height 24 doc "a window high enough for 11 labels")
          (width 70)
          (spaceForLCD 30 doc "this is the vertical space required for the LCD in the window. It is dependent upon the font and is set by SetParameters."
                 )))


(\BatchMethodDefs)
(METH DigiScale  Set (reading)
      "Combined method for Set" (category (HorizontalScale)))


(METH DigiScale  SetParameters NIL
      "Set parameters for unscaled horizontal gauge combined with LCD on top" (category (Internal)))


(METH DigiScale  ShowReading NIL
      "dgb:  9-JUN-83 21:34" (category (HorizontalScale)))



(Method ((DigiScale Set) self reading)                   (* ; "dgb: 10-JUN-83 11:54")
   "Combined method for Set"
   (_SuperFringe
    self Set reading))

(Method ((DigiScale SetParameters) self)                 (* ; "edited: 28-Jan-87 23:21")
   "Set parameters for unscaled horizontal gauge combined with LCD on top"
   [PROG ((window (@ window))
          (fontHeight (FONTHEIGHT (@ font)))
          border titleHeight)
         (_Super )
         (SETQ border (WINDOWPROP window 'BORDER))
         [SETQ titleHeight (PLUS border (COND
                                           ((@ title)
                                            (FONTHEIGHT (DSPFONT NIL WindowTitleDisplayStream)))
                                           (T 0]
         (_@ spaceForLCD (PLUS 3 border fontHeight))
         (_@ scaleHeight (QUOTIENT fontHeight 2))
         (_@ scaleBottom fontHeight)
         (_@ height%:,min (HEIGHTIFWINDOW (IPLUS (@ scaleBottom)
                                                 (@ scaleHeight)
                                                 (COND
                                                    ((@ ticks)
                                                             (* add 8 to tickLength for extra 
                                                           space on each end of tick.)
                                                     (PLUS 8 (@ ticks%:,tickLength)))
                                                    (T (QUOTIENT fontHeight 3)))
                                                 (@ spaceForLCD))
                                 (@ title)))
         (_@ height (MAX (@ height)
                         (@ height%:,min)))
         (_@ readingY [IPLUS (@ scaleBottom)
                             (@ scaleHeight)
                             (COND
                                ((@ ticks)                   (* add 8 to tickLength for extra 
                                                           space on each end of tick.)
                                 (PLUS 8 (@ ticks%:,tickLength)))
                                (T (QUOTIENT fontHeight 3])
         (_ self SmallRegion)
         (_@ width%:,min (MAX (@ width%:,min)
                              (fetch WIDTH of (@ precision%:,readingRegion))))
         (_@ width (MAX (@ width)
                        (@ width%:,min)))])

(Method ((DigiScale ShowReading) self)                   (* ; "dgb: 10-JUN-83 11:54")
   "dgb:  9-JUN-83 21:34"                                    (* ; "Combined method for ShowReading")
   (_SuperFringe
    self ShowReading))

(\UnbatchMethodDefs)
(PUTPROPS GAUGEDIGISCALE COPYRIGHT ("Venue & Xerox Corporation" 1986 1987 1988 1990))
(DECLARE%: DONTCOPY
  (FILEMAP (NIL)))
STOP
