Skip to content

Commit

Permalink
SVBONYCCD: Workaround for an issue that rarely retrieves the previous…
Browse files Browse the repository at this point in the history
… iamge. (#906)

* SVBONYCCD: Workaround for an issue that rarely retrieves the previous image

* SVBONYCCD: Added changelog for svbony ccd 1.4.1.

* SVBONY: corrected spacing for changelog
  • Loading branch information
jctk authored Mar 12, 2024
1 parent 43ac082 commit 1567bfa
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
6 changes: 6 additions & 0 deletions debian/indi-svbony/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
indi-svbony (1.4.1) bionic; urgency=low

* SVBONYCCD: Workaround for an issue that rarely retrieves the previous image.

-- Tetsuya Kakura <[email protected]> Tue, 12 Mar. 2024 14:00:00 +0900

indi-svbony (1.3.8) bionic; urgency=low

* SVBONY CCD firmware and SDK version information logs added
Expand Down
2 changes: 1 addition & 1 deletion indi-svbony/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include(GNUInstallDirs)

set (SVBONY_VERSION_MAJOR 1)
set (SVBONY_VERSION_MINOR 4)
set (SVBONY_VERSION_PATCH 0)
set (SVBONY_VERSION_PATCH 1)

find_package(CFITSIO REQUIRED)
find_package(INDI REQUIRED)
Expand Down
1 change: 1 addition & 0 deletions indi-svbony/README
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Limitations
Changelog
=========

+ 1.4.1 : SVBONYCCD: Workaround for an issue that rarely retrieves the previous image.
+ 1.3.8 : SVBONY CCD firmware and SDK version information logs added.
+ 1.3.7 : Fixed Conflict of private variables in SVBONYCCD class.
+ 1.3.6 : Disabled workaround code for bug #666 "the problem that the last exposure image may be read in soft trigger mode".
Expand Down
15 changes: 15 additions & 0 deletions indi-svbony/svbony_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ bool SVBONYBase::SetROIFormat(int x, int y, int w, int h, int bin)
return true;
}

#ifdef WORKAROUND_latest_image_can_be_getten_next_time
// Discard unretrieved exposure data
void SVBONYBase::discardVideoData()
{
unsigned char* imageBuffer = PrimaryCCD.getFrameBuffer();
SVB_ERROR_CODE status = SVBGetVideoData(mCameraInfo.CameraID, imageBuffer, PrimaryCCD.getFrameBufferSize(), 1000);
LOGF_DEBUG("Discard unretrieved exposure data: SVBGetVideoData:result=%d", status);
}
#endif

void SVBONYBase::workerStreamVideo(const std::atomic_bool &isAboutToQuit)
{
SVB_ERROR_CODE ret;
Expand Down Expand Up @@ -176,6 +186,11 @@ void SVBONYBase::workerExposure(const std::atomic_bool &isAboutToQuit, float dur
return;
}

#ifdef WORKAROUND_latest_image_can_be_getten_next_time
// Discard unretrieved exposure data
discardVideoData();
#endif

PrimaryCCD.setExposureDuration(duration);

LOGF_DEBUG("StartExposure->setexp : %.3fs", duration);
Expand Down
8 changes: 8 additions & 0 deletions indi-svbony/svbony_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
#include <indiccd.h>
#include <inditimer.h>

// WORKAROUND for bug #655
// If defined following symbol, get buffered image data before to set exposure duration.
#define WORKAROUND_latest_image_can_be_getten_next_time

class SingleWorker;
class SVBONYBase : public INDI::CCD
{
Expand Down Expand Up @@ -95,6 +99,10 @@ class SVBONYBase : public INDI::CCD
/** Send CCD image to client */
void sendImage(SVB_IMG_TYPE type, float duration);

#ifdef WORKAROUND_latest_image_can_be_getten_next_time
// Discard unretrieved exposure data
void discardVideoData();
#endif
protected:
double mTargetTemperature;
double mCurrentTemperature;
Expand Down

0 comments on commit 1567bfa

Please sign in to comment.