Skip to content

Commit

Permalink
Extend wait times
Browse files Browse the repository at this point in the history
  • Loading branch information
knro committed Sep 30, 2023
1 parent d35a5d8 commit a02ee35
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions indi-svbony/svbony_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,10 +990,10 @@ bool SVBONYBase::grabImage(float duration, bool send)
}
}

for (int i = 0; i < 3; i++)
for (int i = 0; i < 5; i++)
{
ret = SVBGetVideoData(mCameraInfo.CameraID, buffer, nTotalBytes, 100);
// Sleep for 100 ms and try up to three times
ret = SVBGetVideoData(mCameraInfo.CameraID, buffer, nTotalBytes, 1000);
// Sleep for 100 ms and try up to five times
if (ret == SVB_ERROR_TIMEOUT)
{
std::this_thread::sleep_for(std::chrono::milliseconds(100));
Expand All @@ -1012,18 +1012,26 @@ bool SVBONYBase::grabImage(float duration, bool send)
break;
}

if (ret != SVB_SUCCESS)
PrimaryCCD.setExposureLeft(0);

// Duration 0 means aborted so we just need to discard the frame.
if (duration == 0)
{
PrimaryCCD.setExposureFailed();
if (type == SVB_IMG_RGB24)
free(buffer);
return true;
}
else if (ret != SVB_SUCCESS)
{
LOGF_ERROR("Failed to get data after exposure (%dx%d #%d channels) (%s).", subW, subH, nChannels, Helpers::toString(ret));
PrimaryCCD.setExposureLeft(0);
PrimaryCCD.setExposureFailed();
if (type == SVB_IMG_RGB24)
free(buffer);
return false;
}
else
{
PrimaryCCD.setExposureLeft(0.0);
if (PrimaryCCD.getExposureDuration() > VERBOSE_EXPOSURE)
LOG_INFO("Exposure done, downloading image...");
}
Expand Down

0 comments on commit a02ee35

Please sign in to comment.