ASCOM Gain issue with Hypercam 183C

Hi,

There seems to be a minor issue when setting the gain value for a particular binning mode in SGPro 2.6.0.23.

I am using the Altair Hypercam 183C, which reports its available range of gain values as from 100 to 5000. This is correctly shown in the dropdown, but SGPro is sending a value 100 less than the selected value.

Here is the excerpt from the ASCOM log where SGPro fetches the range of gain values:

2017-09-24 16:02:21,878 [Main Thread] DEBUG Calling: get_GainMin()  
2017-09-24 16:02:21,878 [Main Thread] DEBUG GainMin Get : Not implemented  
2017-09-24 16:02:21,878 [Main Thread] DEBUG get_GainMin returned 100  
2017-09-24 16:02:21,878 [Main Thread] DEBUG Calling: get_GainMax()  
2017-09-24 16:02:21,878 [Main Thread] DEBUG GainMax Get : Not implemented  
2017-09-24 16:02:21,878 [Main Thread] DEBUG get_GainMax returned 5000

And here is the call to set the gain when 1080 is selected in the drop down:

2017-09-24 16:02:55,788 [Camera Thread] DEBUG Calling: set_Gain(980)  
2017-09-24 16:02:55,788 [Camera Thread] DEBUG Gain Set : Not implemented  
2017-09-24 16:02:55,789 [Camera Thread] DEBUG set_Gain returned .  
2017-09-24 16:02:55,789 [Camera Thread] DEBUG Calling: get_Gain()  
2017-09-24 16:02:55,789 [Camera Thread] DEBUG Gain Get : Not implemented  
2017-09-24 16:02:55,789 [Camera Thread] DEBUG get_Gain returned 980  

And similarly when selecting a gain of 100, but this then fails as SGPro tries to set a value of zero:

2017-09-24 16:03:08,367 [Camera Thread] DEBUG Calling: set_Gain(0)  
2017-09-24 16:03:08,367 [Camera Thread] DEBUG Gain Set : Not implemented  
2017-09-24 16:03:08,367 [Camera Thread] ERROR set_Gain(0) failed with AltairCameraException : Error '80070057' from call to 
Altair.set_ExpoAGai) PInvoke.Altair.AltairCameraException: Error '80070057' from call to 
Altair.set_ExpoAGai)
   at PInvoke.Altair.AltairCam.CheckHR(Int32 hr, MethodBase callingMethod, Object[] parameters) in c:\Documents\Source Code\altair-ascom-driver\package_bin\AltairCam.cs:line 760
   at PInvoke.Altair.AltairCam.set_ExpoAGain(UInt16 value) in c:\Documents\Source Code\altair-ascom-driver\package_bin\AltairCam.cs:line 1271
   at ASCOM.Altair.CameraImpl.set_Gain(Int16 value) in c:\Documents\Source Code\altair-ascom-driver\Altair.Camera.ASCOM\CameraImpl.cs:line 768

This is minor as it can be worked around by selecting a value 100 higher than than desired, but I thought I would let you know.

All the best

John

The log fragments are from the SGP log, not an ASCOM log.
I’ve had a go with my Altair GPCAM and see the same thing, log entry pairs like this:

[09/24/17 19:10:46.055][DEBUG] [Camera Thread] SetAscomGain to 400
[09/24/17 19:10:46.059][DEBUG] [Camera Thread] Camera gain set to 300

What I think is happening is that every gain value from 100 to 1000 is put in a colossal combo box list with something like 900 entries. The indexes will be from 0 to 900 with the item at index zero containing the value 100 and the item at index 900 containing the entry 1000. I think that SGP is taking the index and sending that rather than the contents of the item at the index. The index is 100 less than the value.

I’ve just run the ASCOM Conform driver checker over the camera and its driver with no errors. GainMin, GainMax and Gain all seem to be read correctly.