DIRECTORY ImagerFont USING [Font], Rope USING [ROPE], ViewerClasses USING [Viewer]; Histograph: CEDAR DEFINITIONS = BEGIN Font: TYPE = ImagerFont.Font; ROPE: TYPE = Rope.ROPE; Viewer: TYPE = ViewerClasses.Viewer; NewHistograph: PROC [ dataWidth: NAT _ 480, -- # of samples buffered for display dataHeight: NAT _ 100, -- # of vertical units for samples maxSample: INT _ 100, -- sample corresponding to the height averageFactor: REAL _ 0.9, -- used to compute declining average vertiLog: NAT _ 0, -- log base to use on Y-axis (0, 1 => linear) title: ROPE _ NIL, -- graph title subTitle: ROPE _ NIL, -- graph sub-title firstSampleX: NAT _ 64, -- x position of first sample numberW: INTEGER _ 32, -- # of units for displaying numbers name: ROPE _ NIL, -- name to use if top-level viewer parent: Viewer _ NIL, -- parent viewer wx: INTEGER _ 0, -- x position in parent wy: INTEGER _ 0, -- y position in parent historical: BOOL _ TRUE, -- => strip chart style, else random access border: BOOL _ FALSE, -- => give returned viewer a border childXbound: BOOL _ FALSE, -- => make right bound match parent tickX: NAT _ 60, -- # of units to use between horizontal ticks tickY: NAT _ 25, -- # of units to use between vertical ticks numberFont: Font _ NIL, -- font for numbers (default: Helvetica8) smallFont: Font _ NIL, -- font for subTitle (default: Helvetica8) largeFont: Font _ NIL] -- font for title (default: Helvetica10) RETURNS [Viewer]; FetchSample: PROC [viewer: Viewer, index: NAT] RETURNS [REAL]; Reset: PROC [viewer: Viewer, paint: BOOL _ TRUE]; AddSample: PROC [viewer: Viewer, sample: REAL, paint: BOOL _ TRUE]; StoreSample: PROC [viewer: Viewer, index: NAT, sample: REAL, paint: BOOL _ TRUE]; ModifySample: PROC [viewer: Viewer, index: NAT, sample: REAL, paint: BOOL _ TRUE]; Error: ERROR [code: ATOM, message: ROPE]; END.  Histograph.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Russ Atkinson (RRA) May 22, 1986 7:17:53 pm PDT General operations ... creates a new Histograph class of viewer. Fetches the sample at the given index. Returns 0.0 if the sample was never written. Useful if using this viewer class as a histogram instead of as a strip chart. Clears all of the data samples. If paint, also forks a paint update. Historical operations (requires viewer created with historical: TRUE) Adds a data sample to the histograph. Requires that the viewer was created with historical = TRUE, otherwise Error[$notHistorical] is raised. If paint, also forks a paint update. Random access operations (requires viewer created with historical: FALSE) Stores the sample to the given index. Returns 0.0 if the sample was never written. Requires that the viewer was created with historical = FALSE, otherwise Error[$historical] is raised. If paint, also forks a paint update. Adds the sample to the sample at the given index. Requires that the viewer was created with historical = FALSE, otherwise Error[$historical] is raised. If paint, also forks a paint update. Exceptions The error raised when certain preconditions are not met. Some codes are: $historical: historical = FALSE was required $notHistorical: historical = TRUE was required $notHistograph: viewer data not from this implementation $invalidIndex: index > dataWidth Κσ˜codešœ™Kšœ Οmœ1™K™£K˜—šŸœžœžœžœ˜1KšœE™EK˜——šœ@žœ™Eš Ÿ œžœžœ žœžœ˜CKšœ^žœR™΄K™——šœCžœ™Iš Ÿ œžœžœ žœ žœžœ˜QKšœŒžœM™ΰK˜—š Ÿ œžœžœ žœ žœžœ˜RKšœjžœM™ΎK˜——šœ ™ šŸœžœžœ žœ˜)™IKšœžœ ™,Kšœžœ ™.Kšœ8™8Kšœ ™ —K™——Kšžœ˜˜K˜K˜—J˜—…—0Γ