home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / archives / 2964 < prev    next >
Encoding:
Internet Message Format  |  1992-07-25  |  7.8 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!ames!agate!agate!usenet
  2. From: lance@diu.cms.udel.edu (Dan Lentz)
  3. Newsgroups: comp.archives
  4. Subject: [comp.windows.x.apps] XUPS update available
  5. Followup-To: comp.windows.x.apps
  6. Date: 25 Jul 1992 09:39:28 GMT
  7. Organization: U of Delaware, College of Marine Studies / Lewes
  8. Lines: 207
  9. Approved: adam@soda.berkeley.edu
  10. Distribution: world
  11. Message-ID: <14r7ggINNqd2@agate.berkeley.edu>
  12. References: <Brx0D9.G4D@news.udel.edu>
  13. Reply-To: lance@diu.cms.udel.edu
  14. NNTP-Posting-Host: soda.berkeley.edu
  15. X-Original-Newsgroups: comp.windows.x.apps
  16. X-Original-Date: Fri, 24 Jul 1992 22:41:32 GMT
  17.  
  18. Archive-name: auto/comp.windows.x.apps/XUPS-update-available
  19.  
  20.  
  21.     Forgot to crosspost...
  22.  
  23.     A new version of xups is available for ftp from ftp.scripps.edu and
  24. ftp.math.psu.edu.  The new version includes substantial new features which
  25. I describe very crypticly in the readme file below. :)  
  26.  
  27.   ---------------------------------------------------------------------------
  28.  
  29.                    X U P S
  30.  
  31.                  Version 1.4B
  32.  
  33.  
  34.      An XView based UPS monitor for the X Window system.
  35.                  By Dan Lentz
  36.  
  37.                    7/22/92
  38.  
  39. mail lance@diu.cms.udel.edu to get on the mailing list.
  40. ---------------------------------------------------------------------------
  41.  
  42. 0.0 CHANGES TO XUPS:
  43.  
  44.     o This version uses heiroglyphics for the buttons.  It's not my 
  45.       favourite way to do things, but it did allow me to get two
  46.       more buttons on without using any extra real estate.  
  47.  
  48.     o ANOTHER STATUS WINDOW.  This one shows you what's going on in 
  49.       the Alarm Status Register (battery charge, temperature 
  50.       conditions) as well as other useful information.
  51.  
  52.     o Nicer About Box.  An ego thing.
  53.  
  54.     o I decided to keep the feature that the xups client will run a
  55.       script when the inverter comes on; I didn't move it to the
  56.       daemon BUT...
  57.  
  58. 0.1 CHANGES TO UPSD
  59.  
  60.     o Added multi script calling feature.  Now, the daemon will
  61.       run a script when the inverter clicks on.  It will call a
  62.       different script (to be used for shutting down) when the
  63.       inverter is still on and the run time remaining has gotten
  64.       low (configurable---see config.h). THE DAEMON QUITS AFTER
  65.       RUNNING THE SHUTDOWN SCRIPT. 
  66.  
  67.     o Cleaned up a couple of things that caused an infinite blocking
  68.       state on some machines.  
  69.  
  70. 0.9 WHO YOU SHOULD BE
  71.  
  72.     You need to be a person who has access to an X station
  73. complete with the XView libraries.  You also need to have a BEST MD
  74. series UPS, or compatible hooked up to the serial port as described in
  75. the manual.  This program can be modified, or course, to run with
  76. other UPS's.  I'll talk about that later.
  77.     And also you need your kernel configured for shared memory.
  78. This program is untested, except on a SPARC IPX running SunOS 4.1.1.
  79. I didn't do anything terribly bizarre, though, so any changes that
  80. need to be made should be minimal.
  81.     
  82.  
  83. 1.0 THE PURPOSE 
  84.  
  85.     The xups package is basically something designed so that you can
  86. have yet another nifty window on your desktop.  Other than that, it
  87. allows you to monitor the status of the UPS and create a shell script
  88. to be executed for different purposes:
  89.  
  90.     - One that the xups client will call if the inverter clicks on.
  91.       This shouldn't do anything really important, since at any given
  92.       time the client may not be running.
  93.  
  94.     - One that the daemon runs if the inverter clicks on.  This should
  95.       probably be set up to send mail to the superuser, or append 
  96.       something to a log file, or whatever. 
  97.  
  98.     - One that the daemon runs if the inverter is still on and the
  99.       run time remaining is low.  This should shut down the system.
  100.  
  101. 1.1 THE NATURE OF THE BEAST
  102.  
  103.     This package works in two parts: UPSD and XUPS.  UPSD runs in
  104. the background all the time.  It allocates 81 bytes of shared memory
  105. to hold the 80 character hex status string that the UPS sends back.
  106. Then, once a second it polls the UPS and updates that status string.
  107. Once per minute it writes some stats to a logfile.  As mentioned
  108. above, it has the ability to call two different scripts depending on
  109. the situation.  XUPS is the front end.  It sets ups a timer to parse
  110. that 81 character shared memory string once per second, and update the
  111. display.  It also executes a shell script (specified in config.h) when
  112. the inverter goes on, and draws a new bitmap in the base window.
  113.     Xups was created using ansi C (compiled with sun CC) and sun's
  114. devguide 3.0. 
  115.  
  116. 2.0 INSTALLATION
  117.  
  118.     First, edit config.h to reflect your local setup.  
  119.  
  120.     Make sure that you specify sane scripts to run, edit mine, or
  121. just leave them like they are.
  122.  
  123.     Decide now if your UPS is set up for 4800 baud transmission.
  124. If not, you can either change the UPS's baud setting, or go into ups.c
  125. and alter the function open_port to set it up for some other data
  126. rate. For example, for 1200 baud, change B4800 to B1200.  Pretty
  127. straightforward, really.  My UPS's entry in the /etc/ttytab looks like
  128. this:
  129.  
  130. ttyb    "/usr/etc/getty std.9600"       unknown         off local secure
  131.  
  132. A good test is that if you can edit your /etc/remote and add a line
  133. something like:
  134.  
  135.             ups:dv=/dev/ttyb:br#4800:
  136.  
  137. and then                tip ups
  138. and get connected and interact with it, then you're ok.  If you can't,
  139. chances are that it isn't set up correctly.  If everything works ok,
  140. then you may proceed:
  141.  
  142.           make -f Makefile.upsd 
  143.     Then      make
  144.     Then       make clean
  145.  
  146.  
  147.     If you happen to be that sort of person, everything will be
  148. working at this point.  Start the upsd, let it run for a second and
  149. then you're free to start as many xups windows as you like.  Just one
  150. is recommended, but more won't hurt.  Just remember that each copy
  151. will execute the shell script if the inverter clicks on.   
  152.  
  153.  
  154.     On the other hand, you may not be compatible with me UPS-wise.
  155. If that happens, then first decide if you know how to program or not.
  156. If you have some experience with C, than it shouldn't be too hard to
  157. change the program to be compatible with your UPS.  You need to edit
  158. the files ups.c and upsd.c and change the annotated parts which query
  159. the ups, and parse the return string.  Other than that, once you get
  160. the values from your ups into my UpsData struct, everything should
  161. work ok.
  162.  
  163. 2.1 FEATURES TO BE ADDED
  164.  
  165.     If I ever get around to it, I was thinking about a couple of
  166. things:
  167.  
  168.  
  169.     o    Another set of bitmaps, for the discriminating user
  170.  
  171.     o    Something so that you could actually change the
  172.         settings of the UPS from this interface.  That
  173.         wouldn't be too hard, I don't think, but would make
  174.         the program even more BEST MD specific.  
  175.  
  176.     o    The BEST MD gives you a nice waveform when you type P.
  177.         So, I was thinking about opening up another canvas and
  178.         painting that, but it seems to be a lot of trouble for
  179.         nothing, really.  I might do it anyway, though, for
  180.         the play value...
  181.  
  182.     o    Maybe support for other UPS's? 
  183.  
  184.  
  185.     o     
  186.  
  187. 2.1 FEATURES NOT TO BE ADDED
  188.  
  189.     o    A built-in WYSIWYG typesetter
  190.  
  191.     o    A patch to make your sparc twelve times as fast when it is
  192.         running this program.
  193.  
  194.     o    Yet another xbiff 
  195.  
  196.     o    VI mode
  197.  
  198.  
  199. 2.2 WHAT ARE YOU WAITING FOR? GO COMPILE THE DAMN THING
  200.  
  201.     Any questions need to be sent to me: lance@diu.cms.udel.edu.
  202. If you change anything, you need to contact me.  Esp if you set it up
  203. for another UPS, get in touch with me and I'll add it in.  There's a
  204. bunch of standard stuff that I'm sure you're aware of.  The software
  205. is copywrite 1992 by the University of Delaware, it can't be used for
  206. commerical gain, or included in any commercial product without prior
  207. written consent from me.  This software may be freely distributed in
  208. the original form.  You may modify this for your own use, but may not
  209. distribute modified copies.  
  210.  
  211.     NEITHER I NOR THE UNIVERSITY OF DELAWARE IS REPONSIBLE FOR 
  212. ANY DAMAGES, INCIDENTAL OR CONSEQUENTIAL, RESULTING FROM THE USE OF 
  213. THIS PROGRAM.  THIS SOFTWARE IS SUPPLIED WITHOUT GUARENTEE OF ANY KIND.
  214. USE IT AT YOUR OWN RISK.  
  215.  
  216. (My boss made me add that)
  217.  
  218.  
  219. This is BeerWare.  If you like it, send me some Guinness Extra Stout. 
  220.  
  221.  
  222.  
  223.  
  224.  
  225.