From b96b3cd4e0a0ce53bb85c2bdf3dde24b04af35f2 Mon Sep 17 00:00:00 2001 From: Kyle Van Gorkom Date: Wed, 4 Jan 2023 12:53:47 -0700 Subject: [PATCH] query camera for gain settings --- apps/asiCtrl/asiCtrl.hpp | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/apps/asiCtrl/asiCtrl.hpp b/apps/asiCtrl/asiCtrl.hpp index ce3688245..478cacfc3 100644 --- a/apps/asiCtrl/asiCtrl.hpp +++ b/apps/asiCtrl/asiCtrl.hpp @@ -134,7 +134,7 @@ class asiCtrl : public MagAOXApp<>, public dev::stdCamera, public dev:: //std::string m_cameraName; //std::string m_cameraModel; - int m_gain; + //int m_gain; public: @@ -195,6 +195,7 @@ class asiCtrl : public MagAOXApp<>, public dev::stdCamera, public dev:: int setTempSetPt(); int setReadoutSpeed(); //int setVShiftSpeed(); + int getEMGain(); int setEMGain(); int setExpTime(); //int capExpTime(piflt& exptime); @@ -688,10 +689,24 @@ int asiCtrl::setEMGain() log( "Set gain to: " + std::to_string(m_emGainSet)); + updateIfChanged(m_indiP_emGain, "current", m_emGainSet, INDI_IDLE); + return 0; - //updateIfChanged(m_indiP_emgain, "current", m_gain, INDI_IDLE); +} + +inline +int asiCtrl::getEMGain() +{ + long gainReal; + ASI_BOOL bAuto; + ASIGetControlValue(m_camNum, ASI_GAIN, &gainReal, &bAuto); + + log( "Got gain of: " + std::to_string(gainReal)); + m_emGain = gainReal; + + return 0; } @@ -881,12 +896,13 @@ int asiCtrl::configureAcquisition() // gain - rv = ASISetControlValue(m_camNum,ASI_GAIN, m_gain, ASI_FALSE); - if(rv < 0) - { - log({__FILE__, __LINE__, "Error setting gain"}); - return -1; - } + //rv = ASISetControlValue(m_camNum,ASI_GAIN, m_gain, ASI_FALSE); + //if(rv < 0) + //{ + // log({__FILE__, __LINE__, "Error setting gain"}); + // return -1; + //} + setEMGain(); //Start continuous acquisition //ASIStartVideoCapture(m_camNum);