calibration: support to-physical-only softcal boards.
authorW. Trevor King <wking@tremily.us>
Fri, 19 Oct 2012 13:53:22 +0000 (09:53 -0400)
committerW. Trevor King <wking@tremily.us>
Fri, 19 Oct 2012 13:53:22 +0000 (09:53 -0400)
commitac38a7987800c3982ac363af5b7780885c88d3a1
tree439bc469df15f133f0d2b0b4a65aac76fed25e30
parentfe62ce7615fcc4445011ff00bf9f2761fa2b6f6b
calibration: support to-physical-only softcal boards.

This is a hack to fix Éric Piel's issue:

On Thu, Oct 18, 2012 at 12:10:49PM +0200, Éric Piel wrote:
> Unfortunately, with my device there seems to still be a problem with
> comedi_get_softcal_converter(), which returns -1 with direction
> from_physical. I get the same problem when using the SWIG wrapper, so
> it's probably not an error in pycomedi. So when I run cmd.py I get this
> error, but it works anyway as the _to_phys converter works:
> ./cmd.py -f /dev/comedi0 -s 0 -c 0 -a diff -N 1 -p
> Exception pycomedi.PyComediError:
> PyComediError('comedi_get_softcal_converter: Resource temporarily
> unavailable (-1)',) in
> 'pycomedi.channel.AnalogChannel.get_softcal_converter' ignored
> 0.220157

I feel like we should make an effort to invert the from_physical
polynomial, but as a stop-gap measure, we can just raise the original
exception and let the user decide what to do about it.
pycomedi/calibration.pxd
pycomedi/calibration.pyx
pycomedi/channel.pyx