Skip to content

Commit

Permalink
Add timefactor and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
knro committed Sep 9, 2021
1 parent 4536dd4 commit 9673c8b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
7 changes: 7 additions & 0 deletions debian/indi-toupbase/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
indi-toupbase (0.7) bionic; urgency=low

* Add OEM camera support like Meade.
* Make timeout factor configurable.

-- Jasem Mutlaq <mutlaqja@ikarustech.com> Thu, 9 Sep 2021 09:00:00 +0300

indi-toupbase (0.6) bionic; urgency=low

* Fixed snap issue.
Expand Down
2 changes: 1 addition & 1 deletion indi-toupbase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ find_package(MALLINCAM REQUIRED)
find_package(USB1 REQUIRED)

set(TOUPBASE_VERSION_MAJOR 0)
set(TOUPBASE_VERSION_MINOR 6)
set(TOUPBASE_VERSION_MINOR 7)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/indi_toupbase.xml.cmake ${CMAKE_CURRENT_BINARY_DIR}/indi_toupbase.xml)
Expand Down
25 changes: 23 additions & 2 deletions indi-toupbase/indi_toupbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,13 @@ bool ToupBase::initProperties()
IUFillNumber(&ADCN[0], "ADC_BITDEPTH", "Bit Depth", "%.f", 8, 32, 0, 8);
IUFillNumberVector(&ADCNP, ADCN, 1, getDeviceName(), "ADC", "ADC", IMAGE_INFO_TAB, IP_RO, 60, IPS_IDLE);

///////////////////////////////////////////////////////////////////////////////////
/// Timeout Factor
///////////////////////////////////////////////////////////////////////////////////
IUFillNumber(&TimeoutFactorN[0], "VALUE", "Factor", "%.f", 1, 10, 1, 1.2);
IUFillNumberVector(&TimeoutFactorNP, TimeoutFactorN, 1, getDeviceName(), "TIMEOUT_FACTOR", "Timeout", OPTIONS_TAB, IP_RW,
60, IPS_IDLE);

///////////////////////////////////////////////////////////////////////////////////
/// Gain Conversion settings
///////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -374,6 +381,7 @@ bool ToupBase::updateProperties()
if (m_MonoCamera == false)
defineProperty(&WBAutoSP);

defineProperty(&TimeoutFactorNP);
defineProperty(&ControlNP);
defineProperty(&AutoControlSP);
defineProperty(&AutoExposureSP);
Expand Down Expand Up @@ -424,6 +432,7 @@ bool ToupBase::updateProperties()
if (m_MonoCamera == false)
deleteProperty(WBAutoSP.name);

deleteProperty(TimeoutFactorNP.name);
deleteProperty(ControlNP.name);
deleteProperty(AutoControlSP.name);
deleteProperty(AutoExposureSP.name);
Expand Down Expand Up @@ -1252,6 +1261,17 @@ bool ToupBase::ISNewNumber(const char *dev, const char *name, double values[], c
return true;
}

//////////////////////////////////////////////////////////////////////
/// Timeout factor
//////////////////////////////////////////////////////////////////////
if (!strcmp(name, TimeoutFactorNP.name))
{
IUUpdateNumber(&TimeoutFactorNP, values, names, n);
TimeoutFactorNP.s = IPS_OK;
IDSetNumber(&TimeoutFactorNP, nullptr);
return true;
}

}

return INDI::CCD::ISNewNumber(dev, name, values, names, n);
Expand Down Expand Up @@ -1967,7 +1987,7 @@ bool ToupBase::StartExposure(float duration)
}

// Timeout 500ms after expected duration
m_CaptureTimeout.start(duration * 1000 + m_DownloadEstimation * 1.2);
m_CaptureTimeout.start(duration * 1000 + m_DownloadEstimation * TimeoutFactorN[0].value);

return true;
}
Expand Down Expand Up @@ -2016,7 +2036,7 @@ void ToupBase::captureTimeoutHandler()
}

LOG_DEBUG("Capture timed out, restarting exposure...");
m_CaptureTimeout.start(ExposureRequest * 1000 + m_DownloadEstimation * 1.2);
m_CaptureTimeout.start(ExposureRequest * 1000 + m_DownloadEstimation * TimeoutFactorN[0].value);
}

bool ToupBase::UpdateCCDFrame(int x, int y, int w, int h)
Expand Down Expand Up @@ -2330,6 +2350,7 @@ bool ToupBase::saveConfigItems(FILE * fp)
{
INDI::CCD::saveConfigItems(fp);

IUSaveConfigNumber(fp, &TimeoutFactorNP);
if (HasCooler())
IUSaveConfigSwitch(fp, &CoolerSP);
IUSaveConfigNumber(fp, &ControlNP);
Expand Down
4 changes: 4 additions & 0 deletions indi-toupbase/indi_toupbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,10 @@ class ToupBase : public INDI::CCD
INumberVectorProperty ADCNP;
INumber ADCN[1];

// Timeout factor
INumberVectorProperty TimeoutFactorNP;
INumber TimeoutFactorN[1];

// Gain Conversion
INumberVectorProperty GainConversionNP;
INumber GainConversionN[2];
Expand Down

0 comments on commit 9673c8b

Please sign in to comment.