Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVBONYCCD: Workaround for an issue that rarely retrieves the previous iamge. #906

Merged
merged 3 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading