From 840e89be39c473edfd64e1a731e0d21bb7b6a3b5 Mon Sep 17 00:00:00 2001 From: oliverhaag Date: Wed, 3 Oct 2012 18:22:17 +0000 Subject: [PATCH] DSO-2250 uses different capture state for available data --- openhantek/ChangeLog | 3 +++ openhantek/src/hantek/control.cpp | 9 +++++++-- openhantek/src/hantek/types.h | 9 +++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/openhantek/ChangeLog b/openhantek/ChangeLog index 2dba7fe..b39c00c 100644 --- a/openhantek/ChangeLog +++ b/openhantek/ChangeLog @@ -158,3 +158,6 @@ 2012-10-02 Oliver Haag * Bugfix: Hantek::Control redesign missing for used channels * Bugfix: Always check DataAnalyzer::data for null pointer + +2012-10-03 Oliver Haag +* Bugfix: Add CAPTURE_READY2250 for the DSO-2250 diff --git a/openhantek/src/hantek/control.cpp b/openhantek/src/hantek/control.cpp index a186527..bffe86f 100644 --- a/openhantek/src/hantek/control.cpp +++ b/openhantek/src/hantek/control.cpp @@ -199,11 +199,16 @@ namespace Hantek { #endif switch(captureState) { case CAPTURE_READY: + case CAPTURE_READY2250: case CAPTURE_READY5200: // Get data and process it, if we're still sampling errorCode = this->getSamples(samplingStarted); if(errorCode < 0) qWarning("Getting sample data failed: %s", Helper::libUsbErrorString(errorCode).toLocal8Bit().data()); +#ifdef DEBUG + else + qDebug("Received %d B of sampling data", errorCode); +#endif // Check if we're in single trigger mode if(this->settings.trigger.mode == Dso::TRIGGERMODE_SINGLE && samplingStarted) @@ -310,7 +315,7 @@ namespace Hantek { } /// \brief Gets sample data from the oscilloscope and converts it. - /// \return 0 on success, libusb error code on error. + /// \return sample count on success, libusb error code on error. int Control::getSamples(bool process) { int errorCode; @@ -445,7 +450,7 @@ namespace Hantek { emit samplesAvailable(&(this->samples), &(this->samplesSize), this->settings.samplerate.current, &(this->samplesMutex)); } - return 0; + return errorCode; } /// \brief Sets the size of the sample buffer without updating dependencies. diff --git a/openhantek/src/hantek/types.h b/openhantek/src/hantek/types.h index 7cf62c9..59785cd 100644 --- a/openhantek/src/hantek/types.h +++ b/openhantek/src/hantek/types.h @@ -674,10 +674,11 @@ namespace Hantek { /// \enum CaptureState hantek/types.h /// \brief The different capture states which the oscilloscope returns. enum CaptureState { - CAPTURE_WAITING = 0, - CAPTURE_SAMPLING = 1, - CAPTURE_READY = 2, - CAPTURE_READY5200 = 7 + CAPTURE_WAITING = 0, ///< The scope is waiting for a trigger event + CAPTURE_SAMPLING = 1, ///< The scope is sampling data after triggering + CAPTURE_READY = 2, ///< Sampling data is available (DSO-2090/DSO-2150) + CAPTURE_READY2250 = 3, ///< Sampling data is available (DSO-2250) + CAPTURE_READY5200 = 7 ///< Sampling data is available (DSO-5200/DSO-5200A) }; ////////////////////////////////////////////////////////////////////////////// -- libgit2 0.21.4