×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

[SOLVED] Antiblooming (QSI 583) with INDI

  • Posts: 54
  • Thank you received: 3
Dear all,

Is there any way to control the antiblooming from INDI with the indi-qsi driver? I'm trying to remote control an QSI 583ws with it, and it works nicely except for the fact that I've some columns with something that resembles blooming (not the whole column is illuminated, but spots in a regular pattern following the column from the bright spot down).
8 years 3 months ago #6352

Please Log in or Create an account to join the conversation.

  • Posts: 54
  • Thank you received: 3
I see it isn't implemented in the indi-qsi driver. However, it's available in the qsi API, so I tried to mimic the calls to the *Fan control and implemented (not tested!) AntiBlooming control.
diff -ur indi-qsi/qsi_ccd.cpp indi-qsi-mod/qsi_ccd.cpp
--- indi-qsi/qsi_ccd.cpp	2015-09-06 15:21:05.000000000 +0200
+++ indi-qsi-mod/qsi_ccd.cpp	2015-12-22 12:08:24.058733104 +0100
@@ -16,6 +16,7 @@
     2015:
         + Added Fan speed option
         + Added Gain option
+        + Added AntiBlooming option
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
@@ -145,6 +146,7 @@
      targetFilter = 0;
      canSetGain = false;
      canControlFan = false;
+     canControlAB = false;
      canChangeReadoutSpeed = false;
 
      QSICam.put_UseStructuredExceptions(true);
@@ -191,6 +193,10 @@
     IUFillSwitch(&GainS[2], "Auto", "", ISS_ON);
     IUFillSwitchVector(&GainSP, GainS, 3, getDeviceName(), "Gain", "", OPTIONS_TAB, IP_RW, ISR_1OFMANY, 60, IPS_IDLE);
 
+    IUFillSwitch(&ABS[0], "Normal", "", ISS_ON);
+    IUFillSwitch(&ABS[1], "High", "", ISS_OFF);
+    IUFillSwitchVector(&ABSP, ABS, 2, getDeviceName(), "AntiBlooming", "", MAIN_CONTROL_TAB, IP_RW, ISR_1OFMANY, 60, IPS_IDLE);
+
     IUFillSwitch(&FanS[0], "Off", "", ISS_OFF);
     IUFillSwitch(&FanS[1], "Quiet", "", ISS_OFF);
     IUFillSwitch(&FanS[2], "Full", "", ISS_ON);
@@ -235,7 +241,10 @@
 
         if (canSetGain)
             deleteProperty(GainSP.name);
-
+        
+        if (canControlAB)
+            deleteProperty(ABSP.name);
+        
         if (canControlFan)
             deleteProperty(FanSP.name);
 
@@ -375,10 +384,31 @@
         }
     }
 
+    QSICamera::AntiBloom cAB = QSICamera::AntiBloomNormal;
+    canControlAB = true;
+
+    try
+    {
+        QSICam.get_AntiBlooming(cAB);
+    }
+    catch (std::runtime_error err)
+    {
+        DEBUGF(INDI::Logger::DBG_DEBUG, "Camera does not support AntiBlooming control. %s.", err.what());
+        canControlAB = false;
+    }
+
+    if (canControlAB)
+    {
+        IUResetSwitch(&ABSP);
+        ABS[fMode].s = ISS_ON;
+        defineSwitch(&ABSP);
+    }
+
 
     QSICamera::FanMode fMode = QSICamera::fanOff;
     canControlFan = true;
 
+    
     try
     {
         QSICam.get_FanMode(fMode);
@@ -575,6 +605,40 @@
             return true;
         }
 
+
+        if (!strcmp(name, ABSP.name))
+        {
+            int prevAB = IUFindOnSwitchIndex(&ABSP);
+            IUUpdateSwitch(&ABSP, states, names, n);
+            int targetAB = IUFindOnSwitchIndex(&ABSP);
+
+            if (prevAB == targetAB)
+            {
+                ABSP.s = IPS_OK;
+                IDSetSwitch(&ABSP, NULL);
+                return true;
+            }
+
+            try
+            {
+                QSICam.put_AntiBlooming( ((QSICamera::AntiBloom) targetAB));
+
+            }  catch (std::runtime_error err)
+            {
+                                    IUResetSwitch(&ABSP);
+                                    ABS[prevAB].s = ISS_ON;
+                                    ABSP.s = IPS_ALERT;
+                                    DEBUGF(INDI::Logger::DBG_ERROR, "put_AntiBlooming failed. %s.", err.what());
+                                    IDSetSwitch(&ABSP, NULL);
+                                    return false;
+            }
+
+            ABSP.s = IPS_OK;
+            IDSetSwitch(&ABSP, NULL);
+            return true;
+        }
+
+
         if (!strcmp(name, FanSP.name))
         {
             int prevFan = IUFindOnSwitchIndex(&FanSP);
diff -ur indi-qsi/qsi_ccd.h indi-qsi-mod/qsi_ccd.h
--- indi-qsi/qsi_ccd.h	2015-09-06 15:21:05.000000000 +0200
+++ indi-qsi-mod/qsi_ccd.h	2015-12-22 12:10:59.908730313 +0100
@@ -67,10 +67,13 @@
     ISwitch GainS[3];
     ISwitchVectorProperty GainSP;
 
+    ISwitch ABS[3];
+    ISwitchVectorProperty ABSP;
+
     ISwitch FanS[3];
     ISwitchVectorProperty FanSP;
 
-    bool canAbort, canSetGain, canControlFan, canChangeReadoutSpeed;
+    bool canAbort, canSetGain, canControlAB, canControlFan, canChangeReadoutSpeed;
     short targetFilter;
     double ccdTemp, targetTemperature;
     double minDuration;

I am going to try (first to compile, crossed fingers!). But, does it make sense?
Last edit: 8 years 3 months ago by Miguel.
8 years 3 months ago #6355

Please Log in or Create an account to join the conversation.

  • Posts: 54
  • Thank you received: 3
Ok, I made some progress, but I'm stuck here:
Scanning dependencies of target indi_qsi_ccd
[100%] Building CXX object CMakeFiles/indi_qsi_ccd.dir/qsi_ccd.o
/home/pi/indi-qsi/qsi_ccd.cpp: In member function ‘virtual bool QSICCD::initProperties()’:
/home/pi/indi-qsi/qsi_ccd.cpp:203:51: error: ‘getInterfaceDescriptor’ was not declared in this scope
     setInterfaceDescriptor(getInterfaceDescriptor() | FILTER_INTERFACE);
                                                   ^
/home/pi/indi-qsi/qsi_ccd.cpp:203:71: error: ‘setInterfaceDescriptor’ was not declared in this scope
     setInterfaceDescriptor(getInterfaceDescriptor() | FILTER_INTERFACE);
                                                                       ^
/home/pi/indi-qsi/qsi_ccd.cpp: In member function ‘virtual bool QSICCD::Connect()’:
/home/pi/indi-qsi/qsi_ccd.cpp:1041:27: error: expected ‘;’ before ‘cap’
             CCDCapability cap;
                           ^
/home/pi/indi-qsi/qsi_ccd.cpp:1043:13: error: ‘cap’ was not declared in this scope
             cap.canAbort = canAbort;
             ^
CMakeFiles/indi_qsi_ccd.dir/build.make:54: recipe for target 'CMakeFiles/indi_qsi_ccd.dir/qsi_ccd.o' failed
make[2]: *** [CMakeFiles/indi_qsi_ccd.dir/qsi_ccd.o] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/indi_qsi_ccd.dir/all' failed
make[1]: *** [CMakeFiles/indi_qsi_ccd.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2

The errors also appear in the original code, so apparently it's not something I introduced accidentally with the changes.

I've the following (related) packages
ii  indi-asicam                    0.4                             armhf        INDI Driver for ZWO Optics ASI cameras
ii  indi-bin                       1.1.0                           armhf        INDI server, drivers and tools
ii  indi-qsi                       0.4.1                           armhf        INDI QSI CCD Driver.
ii  libindi-data                   1.1.0                           all          Instrument-Neutral Device Interface library -- shared data
ii  libindi-dev                    1.1.0                           armhf        Instrument-Neutral Device Interface library -- development files
ii  libindi1:armhf                 1.1.0                           armhf        Instrument-Neutral Device Interface library -- shared library
ii  libqsi-dev                     7.2.0                           armhf        Quantum Scientific Imaging (QSI) development headers.
ii  libqsi7                        7.2.0                           armhf        Quantum Scientific Imaging (QSI) library.

Finally, the current 'path':
--- indi-qsi/qsi_ccd.h	2015-12-22 16:48:36.794864050 +0000
+++ indi-qsi_backup/qsi_ccd.h	2015-12-22 16:34:11.860132294 +0000
@@ -67,10 +67,13 @@
     ISwitch GainS[3];
     ISwitchVectorProperty GainSP;
 
+    ISwitch ABS[2];
+    ISwitchVectorProperty ABSP;
+
     ISwitch FanS[3];
     ISwitchVectorProperty FanSP;
 
-    bool canAbort, canSetGain, canControlFan, canChangeReadoutSpeed;
+    bool canAbort, canSetGain, canSetAB, canControlFan, canChangeReadoutSpeed;
     short targetFilter;
     double ccdTemp, targetTemperature;
     double minDuration;
--- indi-qsi/qsi_ccd.cpp	2015-12-22 16:48:36.724864472 +0000
+++ indi-qsi_backup/qsi_ccd.cpp	2015-12-22 16:45:41.775920438 +0000
@@ -16,6 +16,7 @@
     2015:
         + Added Fan speed option
         + Added Gain option
+        + Added AntiBlooming option
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
@@ -144,6 +145,7 @@
  {
      targetFilter = 0;
      canSetGain = false;
+     canSetAB = false;
      canControlFan = false;
      canChangeReadoutSpeed = false;
 
@@ -191,6 +193,10 @@
     IUFillSwitch(&GainS[2], "Auto", "", ISS_ON);
     IUFillSwitchVector(&GainSP, GainS, 3, getDeviceName(), "Gain", "", OPTIONS_TAB, IP_RW, ISR_1OFMANY, 60, IPS_IDLE);
 
+    IUFillSwitch(&ABS[0], "Normal", "", ISS_ON);
+    IUFillSwitch(&ABS[1], "High", "", ISS_OFF);
+    IUFillSwitchVector(&ABSP, ABS, 2, getDeviceName(), "AntiBlooming", "", OPTIONS_TAB, IP_RW, ISR_1OFMANY, 60, IPS_IDLE);
+
     IUFillSwitch(&FanS[0], "Off", "", ISS_OFF);
     IUFillSwitch(&FanS[1], "Quiet", "", ISS_OFF);
     IUFillSwitch(&FanS[2], "Full", "", ISS_ON);
@@ -235,7 +241,10 @@
 
         if (canSetGain)
             deleteProperty(GainSP.name);
-
+        
+        if (canSetAB)
+            deleteProperty(ABSP.name);
+        
         if (canControlFan)
             deleteProperty(FanSP.name);
 
@@ -375,10 +384,31 @@
         }
     }
 
+    QSICamera::AntiBloom cAB = QSICamera::AntiBloomNormal;
+    canSetAB = true;
+
+    try
+    {
+        QSICam.get_AntiBlooming(&cAB);
+    }
+    catch (std::runtime_error err)
+    {
+        DEBUGF(INDI::Logger::DBG_DEBUG, "Camera does not support AntiBlooming control. %s.", err.what());
+        canSetAB = false;
+    }
+
+    if (canSetAB)
+    {
+        IUResetSwitch(&ABSP);
+        ABS[cAB].s = ISS_ON;
+        defineSwitch(&ABSP);
+    }
+
 
     QSICamera::FanMode fMode = QSICamera::fanOff;
     canControlFan = true;
 
+    
     try
     {
         QSICam.get_FanMode(fMode);
@@ -575,6 +605,40 @@
             return true;
         }
 
+
+        if (!strcmp(name, ABSP.name))
+        {
+            int prevAB = IUFindOnSwitchIndex(&ABSP);
+            IUUpdateSwitch(&ABSP, states, names, n);
+            int targetAB = IUFindOnSwitchIndex(&ABSP);
+
+            if (prevAB == targetAB)
+            {
+                ABSP.s = IPS_OK;
+                IDSetSwitch(&ABSP, NULL);
+                return true;
+            }
+
+            try
+            {
+                QSICam.put_AntiBlooming( ((QSICamera::AntiBloom) targetAB));
+
+            }  catch (std::runtime_error err)
+            {
+                                    IUResetSwitch(&ABSP);
+                                    ABS[prevAB].s = ISS_ON;
+                                    ABSP.s = IPS_ALERT;
+                                    DEBUGF(INDI::Logger::DBG_ERROR, "put_AntiBlooming failed. %s.", err.what());
+                                    IDSetSwitch(&ABSP, NULL);
+                                    return false;
+            }
+
+            ABSP.s = IPS_OK;
+            IDSetSwitch(&ABSP, NULL);
+            return true;
+        }
+
+
         if (!strcmp(name, FanSP.name))
         {
             int prevFan = IUFindOnSwitchIndex(&FanSP);
@@ -1032,7 +1096,8 @@
             try
             {
                 QSICam.get_CanAbortExposure(&canAbort);
-            } catch (std::runtime_error err)
+            } 
+            catch (std::runtime_error err)
             {
                 DEBUGF(INDI::Logger::DBG_ERROR, "get_CanAbortExposure() failed. %s.", err.what());
                 return false;
8 years 3 months ago #6356

Please Log in or Create an account to join the conversation.

Send a patch to my email please. You need to update libindi and sudo make install it first. THEN remove all contents in the QSI build directory and run cmake again.
8 years 3 months ago #6357

Please Log in or Create an account to join the conversation.

  • Posts: 54
  • Thank you received: 3
The version of indi (with the corresponding -dev packages) I'm using comes from the daily RPi builds. Isn't it updated enough?.
Last edit: 8 years 3 months ago by Miguel.
8 years 3 months ago #6370

Please Log in or Create an account to join the conversation.

Patch applied, thanks!
8 years 3 months ago #6374

Please Log in or Create an account to join the conversation.

Time to create page: 0.561 seconds