There's a couple of ways of doing this.
1. So far, I've avoided making the drivers into a service. They are just a bit of standalone Python code.
However, there are times when they do need access to the things a first class service offers. The Vantage driver is an example of this. I solved this by writing, as always, a standalone Python driver, then using multiple inheritance to derive from both the driver and StdService. This allowed access to the database, which I used to get the temperature 12 hours ago (needed to reverse calculate gauge pressure). It seems to be working well.
This suggests that all drivers could be derived from some StdDriver class, which would include calibration corrections. To make this work, we'd have to define a couple of new events, say RAW_LOOP and RAW_ARCHIVE that would give access to the raw, uncorrected data. StdDriver would hook into those events and apply the corrections. Then the driver is free to calculate any derived variables.
This approach would complicate writing a device driver. It would have to create the events RAW_LOOP and RAW_ARCHIVE.
2. Another approach would be to regard the driver as just a source of raw data. A follow on service would apply corrections, then an even farther downstream new service, call it StdDerived, would add any missing, derived data (if any).
The advantage is that it basically keeps the existing architecture. It also gives the drivers one, simple chore: source raw data.
Disadvantage is that these downstream services would have very limited context in deciding what to do. Any information about the type of instrument would have been lost by then.
I'll have to mull this over a bit. Any insights welcome!
-tk