I haven’t written here in a while, but that’s mostly because I haven’t done much with the code for a while, at least not much worth writing about – recently though (about 4 days ago by now), there’s been quite a few changes, that are big enough I feel I should mention them.
First off, I realized that I’ve been conflating two things – I’ve basically been thinking of the tempered program as an example program, but at the same time wanted it to be a useful utility. These things came to a head when I started wanting to add some more complex features (well, complex for example code anyway), yet wanted to keep it simple so people could use its code as an example. I decided that my best bet would be to split it out into separate programs, one useful utility and one or more examples.
So, I’ve now done this – wrote a few examples (mostly by copy-paste) in their own subdir, and added some features to the utility (including a proper options parser).
One of the first features added was the ability to just enumerate the found devices, without reading them – which allowed me to move the enumerate program to the examples dir, and remove it from the list of programs being installed. (I never really liked the name “enumerate” for an installed program, as it’s a bit too generic.)
Next up was the ability to show temperatures in different scales than Celcius – most importantly Fahrenheit, but also Kelvin and a couple others, in a way that should be easy to extend with new scales later, as necessary.
After that came calibration – the ability to adjust the measured temperature before displaying it. I think the way this was implemented makes it both easy to use for simple cases, and flexible enough for most of the more complex ones, but admit I can’t really know yet since it hasn’t seen much use yet (that I know of). For more information about this, see the wiki, where I’ve posted some information including examples.
Both of these latter features were put into a new utility library, along with some supporting code, that the tempered program then uses – as I figured they are features likely to be wanted by other programs using libtempered as well, but do not really belong in libtempered itself. Hence, libtempered-util was born.
The dew point calculation function was also moved to this new library, as it is similarly likely to be wanted by other programs – and I’ll probably add more later, when I come up with other similar features to add.
Come to think of it, I should probably update the readme file, and maybe add some examples for the util lib… Maybe add a readme for the examples… *adds to his TODO list*