XEROX THERMOMETER 2 4 1 THERMOMETER 1 4 By: Shaul Markovitch (shm%eecs.umich-cilprnet.csnet@csnet-relay.ARPA) How many times have you sat glaring at the screen waiting for your long computation to be completed, breaking the program from time to time to see how long you still have to wait, and generally approaching a nervous breakdown? Well, not any more if you use the Thermometer Package. The thermometer package is built to show you what part of your work has been done, compared with how much still has to be done. The package is usually used in a loop which takes long time and you want to watch its progress. You must have in mind some criteria to measure the progress of the loop. For this you need some integer number that will represent the length of the computation. The most simple one is the loop variable. If it is (For a in L .....) type of loop the you may consider (LENGTH L) as the "length" of computation. If you are reading a random access file, you may want to use (GETEOFPTR F) for the length of computation. The package is very simple and contains three functions. (CREATE-THERMOMETER MAX MIN? REGION-OR-POSITION TITLE) [Function] Creates Thermometer window. Only the MAX argument is neccessary, the other arguments have defaults. MAX is a positive integer marks the "lentgh" of the computation. MIN? is default to zero and may be used to have other base then zero. (Then, the "length" of the computation is asumed to be MAX? - MIN). The region of the Thermometer window will be calculated according to MAX and MIN?, but can be given explicitly. You may want to let it calculate the region and specify only the position of the window using the same argument. TITLE is the title of the thermometer window. The function creates a thermometer window and returns this window. (UPDATE-THERMOMETER VALUE TH-WINDOW SHADE) [Function] Fills in the TH-WINDOW thermometer a region with height propotional to (VALUE - MIN) / (MAX - MIN) with SHADE . SHADE is optional. The function doesn't reset the thermometer first, because it assumes increasing values. If you may have decreasing values call RESET-THERMOMETER before each call. (RESET-THERMOMETER TH-WINDOW) [Function] Fills the TH-WINDOW thermometer with white shade. Examples: 1] (LAMBDA (FILE-SET) (PROG (Thermometer)(SETQ Thermometer (CREATE-THERMOMETER (LENGTH FILE-SET) ) (FOR F IN FILE-SET AS I FROM 1 DO (MAKEFILE F) (UPDATE-THERMOMETER I Thermometer )))) 2] ......(SETQ TH (CREATE-THERMOMETER (GETEOFPTR F) 0 NIL "Input ") [WHILE (NOT (EOFP F)) DO (SETQ NEXT (READ F)) (PERFORM-COMPUTATION F) (UPDATE-THERMOMETER (GETFILEPTR F) TH] For a demonstration of THERMOMETER, load THERMOMETERDEMO.(LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC) STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC)) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC)) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))(È (ŠŠ8(ŠŠ8DÈÈ PAGEHEADING RUNNINGHEAD(È (MODERN MODERNLOGOMODERN TERMINAL MODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))   HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN   HRULE.GETFNMODERN  HRULE.GETFNMODERN Fœÿ9!@C' 2 ,A9*FA8;J9 DTzº