Set out to adapt an old (from, oh, last-spring-ish) Ruby utility yesterday morning.
Computer handy was my current work laptop, running Debian-testing.
First step is to copy the existing program with a suitable new name.
Next, run it, to make sure it still works, and to refresh my memory as to what it does and how the GUI is laid out.
Oops. Can't find 'gnomecanvas2'. Oh, well: known problem. Fortunately, this program wasn't actually using that sub-library, so I just had to delete that line.
Next: having opened a telnet session to the instrument, I use << to send a command, and gets to receive a line. In Ruby 1.9, Net::Telnet doesn't allow those anymore, exactly and perfectly contrary to what it says in the old Book. Further, the new method waitfor seems to have no provision for reading exactly the next line... or, at least, How To Do That is a FAQ that appears never to have been answered (and I didn't want to restructure my program around "read whatever's available, split it into lines, pass each line into a block, and hope for the best").
Oh, well. I'm not really using any of the Telnet features, so the easy solution turns out to be to remove the Telnet layer and just open a raw TCPSocket.
And, just when I'd got it working and was figuring out where to hook in the new datalogging capability, the boss suddenly remembered that there was already a datalogging utility of sorts, left over from environmental testing, which might serve for our new purposes.
And so it was time to break for lunch, and I discovered that the water was off, which meant it was actually time to go home. On the way out of the complex, we found the cause of the lack of water: the pipe was cracked, right where ground level had been before the ground got washed away. Upstream of the shutoff valve. So the boss called the water company to let 'em know, and we declared the day officially Done.
Update: that cracked water pipe at the industrial park? Seems it didn't crack; it was cut. Some idiot plumbing thief, apparently. Only got partway through the pipe, on account of closing the cutoff valve downstream of the cut utterly failed to prevent massive spraying.
Maybe next time he'll try to steal a gas pipe.

Comments