I spotted a bug in Diem. Nobody spotted it in the field yet, fortunately.
As I’ve probably said, Diem supports the two main units worldwide. In fact, there’s a very straightforward conversion from one to the other – a simple multiplication or division. When the user enters a reading, they specify which units the reading has, and Diem basically just uses this as a marker so it kows how to display the reading back to the user. Internally, Diem uses the American, as opposed to the British, unit for everything, and just does the conversion (if necessary) on the way back to the user.
The bug was a tiny one, which might have occurred if the user mixed their units together. This is perfectly allowable, but I figured (in bed last night!) that there’d be a problem displaying mixed units in the graphs. So, I rewrote that section of the application this morning.
The funny thing is that I’m using a control to generate the graphs. The graphs each have two y-axes, one showing the first unit, the other the second. In theory those two bits of code are equal to each other. But I had a funny where this control needed those axes to be defined in a particular order, otherwise it screwed the whole chart up.
It was funny to find it. I couldn’t work out what the problem was, and then I happened to notice that two of the charts were screwed, but that the third was fine. And in the third chart, of course, I’d changed these lines around. But sheer coincidence – I changed the left-hand axis to be the American units (because I figure I’ll hae more American users), so just put that line on top.
The joys of developing software 😄 Still, if I thought that was a silly mistake to find, I’m gonna have to spend this afternoon running test scripts against that piece of code.