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

      changes to%:  (VARS GAUGEDIGIMETERCOMS)

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


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

(PRETTYCOMPRINT GAUGEDIGIMETERCOMS)

(RPAQQ GAUGEDIGIMETERCOMS ((DECLARE%: DONTCOPY (PROP MAKEFILE-ENVIRONMENT GAUGEDIGIMETER))
                               (FILES (FROM VALUEOF LOOPSLIBRARYDIRECTORY)
                                      GAUGEMETERS GAUGEALPHANUMERICS)
                               (CLASSES DigiMeter)
                               (METHODS DigiMeter.ComputeScale DigiMeter.Set DigiMeter.SetParameters
                                      DigiMeter.Shape DigiMeter.ShowReading)))
(DECLARE%: DONTCOPY 

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

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

(DEFCLASSES DigiMeter)
(DEFCLASS DigiMeter
   (MetaClass Class doc "A combination Meter and LCD, for both analog and digital readout." Edited%:
                                                         (* RBGMartin "29-Apr-86 14:25"))
   (Supers Meter LCDMixin)
   (InstanceVariables (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 DigiMeter  ComputeScale (min max labelScale)
      "Compute scale for both dial and alphaDisplay" (category (Instrument)))


(METH DigiMeter  Set (reading)
      "set both on dial and on digits" (category (Meter)))


(METH DigiMeter  SetParameters NIL
      "Set all params" (category (Internal)))


(METH DigiMeter  Shape (newRegion noUpdateFlg)
      "Shapes outside of region to specified shape. If newRegion is bound, make sure it is at least the minimum required size. If it is not specified, prompt for a new region based upon minimum size."
      (category (Public)))


(METH DigiMeter  ShowReading (reading)
      "Show displayVal both on dial and on digits" (category (RoundScale)))



(Method ((DigiMeter ComputeScale) self min max labelScale)
                                                             (* ; "dgb: 10-JUN-83 11:53")
   "Compute scale for both dial and alphaDisplay"
   (_SuperFringe
    self ComputeScale min max labelScale))

(Method ((DigiMeter Set) self reading)                   (* ; "dgb: 10-JUN-83 11:53")
   "set both on dial and on digits"
   (_SuperFringe
    self Set reading))

(Method ((DigiMeter SetParameters) self)                 (* ; "edited: 28-Jan-87 22:46")
   "Set all params"
   [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]

         (* first determine height for meter, then add to it the height for the LCD.
       Height of meter is same as the width.)

         (_@ spaceForLCD (PLUS 3 border fontHeight))
         (_@ height (HEIGHTIFWINDOW (PLUS (@ yc)
                                          (ShowRayLabelLength self (@ radius))
                                          (IQUOTIENT fontHeight 2)
                                          (@ spaceForLCD))
                           (@ title)))
         (_@ height%:,min (PLUS (@ height%:,min)
                                (@ spaceForLCD)))
         (_@ readingY (IDIFFERENCE (@ height)
                             (PLUS titleHeight (@ spaceForLCD))))
                                                             (* set up small reading region)
         (_ self SmallRegion)
         (_@ width%:,min (MAX (@ width%:,min)
                              (fetch WIDTH of (@ precision%:,readingRegion))))
         (_@ width (MAX (@ width)
                        (@ width%:,min)))])

(Method ((DigiMeter Shape) self newRegion noUpdateFlg)   (* ; "RBGMartin 28-Jan-87 17:12")
   "Shapes outside of region to specified shape. If newRegion is bound, make sure it is at least the minimum required size. If it is not specified, prompt for a new region based upon minimum size."
   (_Super self Shape (if newRegion
                          then (GetMinRegion newRegion self)
                        else (GETREGION (@ width%:,min)
                                        (@ height%:,min)
                                        (WINDOWPROP (@ window)
                                               'REGION)
                                        (FUNCTION DigiMeterNEWREGIONfn)
                                        self))
                noUpdateFlg))

(Method ((DigiMeter ShowReading) self reading)           (* ; "dgb: 28-OCT-83 11:30")
   "Show displayVal both on dial and on digits"
   (_SuperFringe
    self ShowReading reading))

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