diff --git a/openhantek/ChangeLog b/openhantek/ChangeLog index 171f309..d50787b 100644 --- a/openhantek/ChangeLog +++ b/openhantek/ChangeLog @@ -208,3 +208,7 @@ * Use std::vector instead of QList * Experimental Roll-mode support * QThread::msleep is too unprecise, causing problems in Roll-mode + +2013-04-11 Oliver Haag +* Replaced QThread::msleep by QTimer and handler method +* Hantek::Control sends signals after connecting the device diff --git a/openhantek/src/dsocontrol.cpp b/openhantek/src/dsocontrol.cpp index 42cd595..418a186 100644 --- a/openhantek/src/dsocontrol.cpp +++ b/openhantek/src/dsocontrol.cpp @@ -30,7 +30,6 @@ /// \brief Initialize variables. DsoControl::DsoControl(QObject *parent) : QThread(parent) { this->sampling = false; - this->terminate = false; } /// \brief Start sampling process. @@ -53,11 +52,10 @@ const QStringList *DsoControl::getSpecialTriggerSources() { /// \brief Try to connect to the oscilloscope. void DsoControl::connectDevice() { this->sampling = false; - this->terminate = false; this->start(); } /// \brief Disconnect the oscilloscope. void DsoControl::disconnectDevice() { - this->terminate = true; + this->quit(); } diff --git a/openhantek/src/dsocontrol.h b/openhantek/src/dsocontrol.h index ce50dcc..4da6c91 100644 --- a/openhantek/src/dsocontrol.h +++ b/openhantek/src/dsocontrol.h @@ -57,7 +57,6 @@ class DsoControl : public QThread { protected: bool sampling; ///< true, if the oscilloscope is taking samples - bool terminate; ///< true, if the thread should be terminated QStringList specialTriggerSources; ///< Names of the special trigger sources @@ -69,11 +68,11 @@ class DsoControl : public QThread { void statusMessage(const QString &message, int timeout); ///< Status message about the oscilloscope void samplesAvailable(const std::vector > *data, double samplerate, bool append, QMutex *mutex); ///< New sample data is available + void availableRecordLengthsChanged(const QList &recordLengths); ///< The available record lengths, empty list for continuous + void samplerateLimitsChanged(double minimum, double maximum); ///< The minimum or maximum samplerate has changed void recordLengthChanged(unsigned long duration); ///< The record length has changed void recordTimeChanged(double duration); ///< The record time duration has changed void samplerateChanged(double samplerate); ///< The samplerate has changed - void availableRecordLengthsChanged(const QList &recordLengths); ///< The available record lengths, empty list for continuous - void samplerateLimitsChanged(double minimum, double maximum); ///< The minimum or maximum samplerate has changed public slots: virtual void connectDevice(); diff --git a/openhantek/src/hantek/control.cpp b/openhantek/src/hantek/control.cpp index dacb39c..bf6756b 100644 --- a/openhantek/src/hantek/control.cpp +++ b/openhantek/src/hantek/control.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include "hantek/control.h" @@ -86,7 +86,7 @@ namespace Hantek { this->settings.voltage[channel].offsetReal = 0.0; this->settings.voltage[channel].used = false; } - this->settings.recordLengthId = 0; + this->settings.recordLengthId = 1; this->settings.usedChannels = 0; // Special trigger sources @@ -110,6 +110,15 @@ namespace Hantek { // USB device this->device = new Device(this); + // Thread execution timer + this->timer = 0; + + // State of the device + this->captureState = CAPTURE_WAITING; + this->rollState = 0; + this->samplingStarted = false; + this->lastTriggerMode = (Dso::TriggerMode) -1; + // Sample buffers this->samples.resize(HANTEK_CHANNELS); @@ -156,262 +165,53 @@ namespace Hantek { /// \brief Handles all USB things until the device gets disconnected. void Control::run() { - int errorCode, cycleCounter = 0, startCycle = 0; + // Initialize communication thread state + this->captureState = CAPTURE_WAITING; + this->rollState = 0; + this->samplingStarted = false; + this->lastTriggerMode = (Dso::TriggerMode) -1; + + this->cycleCounter = 0; + this->startCycle = 0; + + // Thread execution timer + this->timer = new QTimer(this); + connect(this->timer, SIGNAL(timeout()), this, SLOT(handler()), Qt::DirectConnection); + + this->updateInterval(); + this->timer->start(); // The control loop is running until the device is disconnected - int captureState = CAPTURE_WAITING; - int rollState = 0; - bool samplingStarted = false; - Dso::TriggerMode lastTriggerMode = (Dso::TriggerMode) -1; - - while(captureState != LIBUSB_ERROR_NO_DEVICE && !this->terminate) { - // Send all pending bulk commands - for(int command = 0; command < BULK_COUNT; ++command) { - if(!this->commandPending[command]) - continue; - -#ifdef DEBUG - Helper::timestampDebug(QString("Sending bulk command:%1").arg(Helper::hexDump(this->command[command]->data(), this->command[command]->getSize()))); -#endif - - errorCode = this->device->bulkCommand(this->command[command]); - if(errorCode < 0) { - qWarning("Sending bulk command %02x failed: %s", command, Helper::libUsbErrorString(errorCode).toLocal8Bit().data()); - - if(errorCode == LIBUSB_ERROR_NO_DEVICE) { - captureState = LIBUSB_ERROR_NO_DEVICE; - break; - } - } - else - this->commandPending[command] = false; - } - if(captureState == LIBUSB_ERROR_NO_DEVICE) - break; - - // Send all pending control commands - for(int control = 0; control < CONTROLINDEX_COUNT; ++control) { - if(!this->controlPending[control]) - continue; - -#ifdef DEBUG - Helper::timestampDebug(QString("Sending control command %1:%2").arg(QString::number(this->controlCode[control], 16), Helper::hexDump(this->control[control]->data(), this->control[control]->getSize()))); -#endif - - errorCode = this->device->controlWrite(this->controlCode[control], this->control[control]->data(), this->control[control]->getSize()); - if(errorCode < 0) { - qWarning("Sending control command %2x failed: %s", this->controlCode[control], Helper::libUsbErrorString(errorCode).toLocal8Bit().data()); - - if(errorCode == LIBUSB_ERROR_NO_DEVICE) { - captureState = LIBUSB_ERROR_NO_DEVICE; - break; - } - } - else - this->controlPending[control] = false; - } - if(captureState == LIBUSB_ERROR_NO_DEVICE) - break; - - // Check the current oscilloscope state everytime 25% of the time the buffer should be refilled - // Not more often than every 10 ms though - int cycleTime; - if(this->settings.samplerate.limits->recordLengths[this->settings.recordLengthId] == UINT_MAX) - cycleTime = qMax((int) ((double) this->device->getPacketSize() / ((this->settings.samplerate.limits == &this->specification.samplerate.multi) ? 1 : HANTEK_CHANNELS) / this->settings.samplerate.current * 250), 1); - else - cycleTime = qMax((int) ((double) this->settings.samplerate.limits->recordLengths[this->settings.recordLengthId] / this->settings.samplerate.current * 250), 10); - this->msleep(cycleTime); - - if(!this->sampling) { - samplingStarted = false; - continue; - } - - if(this->settings.samplerate.limits->recordLengths[this->settings.recordLengthId] == UINT_MAX) { - // Roll mode - captureState = CAPTURE_WAITING; - - switch(rollState) { - case ROLL_STARTSAMPLING: - // Don't iterate through roll mode steps when stopped - if(!this->sampling) - continue; - - // Sampling hasn't started, update the expected sample count - this->previousSampleCount = this->getSampleCount(); - - errorCode = this->device->bulkCommand(this->command[BULK_STARTSAMPLING]); - if(errorCode < 0) { - if(errorCode == LIBUSB_ERROR_NO_DEVICE) - captureState = LIBUSB_ERROR_NO_DEVICE; - break; - } -#ifdef DEBUG - Helper::timestampDebug("Starting to capture"); -#endif - - samplingStarted = true; - - break; - - case ROLL_ENABLETRIGGER: - errorCode = this->device->bulkCommand(this->command[BULK_ENABLETRIGGER]); - if(errorCode < 0) { - if(errorCode == LIBUSB_ERROR_NO_DEVICE) - captureState = LIBUSB_ERROR_NO_DEVICE; - break; - } -#ifdef DEBUG - Helper::timestampDebug("Enabling trigger"); -#endif - - break; - - case ROLL_FORCETRIGGER: - errorCode = this->device->bulkCommand(this->command[BULK_FORCETRIGGER]); - if(errorCode < 0) { - if(errorCode == LIBUSB_ERROR_NO_DEVICE) - captureState = LIBUSB_ERROR_NO_DEVICE; - break; - } -#ifdef DEBUG - Helper::timestampDebug("Forcing trigger"); -#endif - - break; - - case ROLL_GETDATA: - // 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 - Helper::timestampDebug(QString("Received %1 B of sampling data").arg(errorCode)); - #endif - - // Check if we're in single trigger mode - if(this->settings.trigger.mode == Dso::TRIGGERMODE_SINGLE && samplingStarted) - this->stopSampling(); - - // Sampling completed, restart it when necessary - samplingStarted = false; - - break; - - default: -#ifdef DEBUG - Helper::timestampDebug("Roll mode state unknown"); -#endif - break; - } - - // Go to next state, or restart if last state was reached - rollState = (rollState + 1) % ROLL_COUNT; - } - else { - // Standard mode - rollState = ROLL_STARTSAMPLING; - -#ifdef DEBUG - int lastCaptureState = captureState; -#endif - captureState = this->getCaptureState(); - if(captureState < 0) - qWarning("Getting capture state failed: %s", Helper::libUsbErrorString(captureState).toLocal8Bit().data()); -#ifdef DEBUG - else if(captureState != lastCaptureState) - Helper::timestampDebug(QString("Capture state changed to %1").arg(captureState)); -#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 - Helper::timestampDebug(QString("Received %1 B of sampling data").arg(errorCode)); -#endif - - // Check if we're in single trigger mode - if(this->settings.trigger.mode == Dso::TRIGGERMODE_SINGLE && samplingStarted) - this->stopSampling(); - - // Sampling completed, restart it when necessary - samplingStarted = false; - - // Start next capture if necessary by leaving out the break statement - if(!this->sampling) - break; - - case CAPTURE_WAITING: - // Sampling hasn't started, update the expected sample count - this->previousSampleCount = this->getSampleCount(); - - if(samplingStarted && lastTriggerMode == this->settings.trigger.mode) { - ++cycleCounter; - - if(cycleCounter == startCycle && this->settings.samplerate.limits->recordLengths[this->settings.recordLengthId] != UINT_MAX) { - // Buffer refilled completely since start of sampling, enable the trigger now - errorCode = this->device->bulkCommand(this->command[BULK_ENABLETRIGGER]); - if(errorCode < 0) { - if(errorCode == LIBUSB_ERROR_NO_DEVICE) - captureState = LIBUSB_ERROR_NO_DEVICE; - break; - } -#ifdef DEBUG - Helper::timestampDebug("Enabling trigger"); -#endif - } - else if(cycleCounter >= 8 + startCycle && this->settings.trigger.mode == Dso::TRIGGERMODE_AUTO) { - // Force triggering - errorCode = this->device->bulkCommand(this->command[BULK_FORCETRIGGER]); - if(errorCode < 0) { - if(errorCode == LIBUSB_ERROR_NO_DEVICE) - captureState = LIBUSB_ERROR_NO_DEVICE; - break; - } -#ifdef DEBUG - Helper::timestampDebug("Forcing trigger"); -#endif - } - - if(cycleCounter < 20 || cycleCounter < 4000 / cycleTime) - break; - } - - // Start capturing - errorCode = this->device->bulkCommand(this->command[BULK_STARTSAMPLING]); - if(errorCode < 0) { - if(errorCode == LIBUSB_ERROR_NO_DEVICE) - captureState = LIBUSB_ERROR_NO_DEVICE; - break; - } -#ifdef DEBUG - Helper::timestampDebug("Starting to capture"); -#endif - - samplingStarted = true; - cycleCounter = 0; - startCycle = this->settings.trigger.position * 1000 / cycleTime + 1; - lastTriggerMode = this->settings.trigger.mode; - break; - - case CAPTURE_SAMPLING: - break; - default: - break; - } - } - } + exec(); + this->timer->stop(); this->device->disconnect(); + + delete this->timer; + this->timer = 0; + emit statusMessage(tr("The device has been disconnected"), 0); } + /// \brief Updates the interval of the periodic thread timer. + void Control::updateInterval() { + if(!this->timer) + return; + + int cycleTime; + + // Check the current oscilloscope state everytime 25% of the time the buffer should be refilled + if(this->settings.samplerate.limits->recordLengths[this->settings.recordLengthId] == UINT_MAX) + cycleTime = (int) ((double) this->device->getPacketSize() / ((this->settings.samplerate.limits == &this->specification.samplerate.multi) ? 1 : HANTEK_CHANNELS) / this->settings.samplerate.current * 250); + else + cycleTime = (int) ((double) this->settings.samplerate.limits->recordLengths[this->settings.recordLengthId] / this->settings.samplerate.current * 250); + + // Not more often than every 10 ms though but at least once every second + cycleTime = qBound(10, cycleTime, 1000); + + this->timer->setInterval(cycleTime); + } + /// \brief Calculates the trigger point from the CommandGetCaptureState data. /// \param value The data value that contains the trigger point. /// \return The calculated trigger point for the given data. @@ -753,15 +553,17 @@ namespace Hantek { } // Check if the divider has changed and adapt samplerate limits accordingly - if(this->specification.bufferDividers[index] != this->specification.bufferDividers[this->settings.recordLengthId]) { + bool bDividerChanged = this->specification.bufferDividers[index] != this->specification.bufferDividers[this->settings.recordLengthId]; + + this->settings.recordLengthId = index; + + if(bDividerChanged) { this->updateSamplerateLimits(); // Samplerate dividers changed, recalculate it this->restoreTargets(); } - this->settings.recordLengthId = index; - return this->settings.samplerate.limits->recordLengths[index]; } @@ -1098,9 +900,6 @@ namespace Hantek { this->specification.sampleSize = 8; break; } - this->settings.recordLengthId = 1; - this->settings.samplerate.limits = &(this->specification.samplerate.single); - this->settings.samplerate.downsampler = 1; this->previousSampleCount = 0; // Get channel level data @@ -1111,6 +910,14 @@ namespace Hantek { return; } + // Emit signals for initial settings + emit availableRecordLengthsChanged(this->settings.samplerate.limits->recordLengths); + updateSamplerateLimits(); + emit recordLengthChanged(this->settings.samplerate.limits->recordLengths[this->settings.recordLengthId]); + if(this->settings.samplerate.limits->recordLengths[this->settings.recordLengthId] != UINT_MAX) + emit recordTimeChanged((double) this->settings.samplerate.limits->recordLengths[this->settings.recordLengthId] / this->settings.samplerate.current); + emit samplerateChanged(this->settings.samplerate.current); + DsoControl::connectDevice(); } @@ -1620,4 +1427,252 @@ namespace Hantek { return Dso::ERROR_UNSUPPORTED; } #endif + + /// \brief Called periodically in the control thread by a timer. + void Control::handler() { + int errorCode = 0; + + // Send all pending bulk commands + for(int command = 0; command < BULK_COUNT; ++command) { + if(!this->commandPending[command]) + continue; + +#ifdef DEBUG + Helper::timestampDebug(QString("Sending bulk command:%1").arg(Helper::hexDump(this->command[command]->data(), this->command[command]->getSize()))); +#endif + + errorCode = this->device->bulkCommand(this->command[command]); + if(errorCode < 0) { + qWarning("Sending bulk command %02x failed: %s", command, Helper::libUsbErrorString(errorCode).toLocal8Bit().data()); + + if(errorCode == LIBUSB_ERROR_NO_DEVICE) { + this->quit(); + return; + } + } + else + this->commandPending[command] = false; + } + + // Send all pending control commands + for(int control = 0; control < CONTROLINDEX_COUNT; ++control) { + if(!this->controlPending[control]) + continue; + +#ifdef DEBUG + Helper::timestampDebug(QString("Sending control command %1:%2").arg(QString::number(this->controlCode[control], 16), Helper::hexDump(this->control[control]->data(), this->control[control]->getSize()))); +#endif + + errorCode = this->device->controlWrite(this->controlCode[control], this->control[control]->data(), this->control[control]->getSize()); + if(errorCode < 0) { + qWarning("Sending control command %2x failed: %s", this->controlCode[control], Helper::libUsbErrorString(errorCode).toLocal8Bit().data()); + + if(errorCode == LIBUSB_ERROR_NO_DEVICE) { + this->quit(); + return; + } + } + else + this->controlPending[control] = false; + } + + // State machine for the device communication + if(this->settings.samplerate.limits->recordLengths[this->settings.recordLengthId] == UINT_MAX) { + // Roll mode + this->captureState = CAPTURE_WAITING; + bool toNextState = true; + + switch(this->rollState) { + case ROLL_STARTSAMPLING: + // Don't iterate through roll mode steps when stopped + if(!this->sampling) { + toNextState = false; + break; + } + + // Sampling hasn't started, update the expected sample count + this->previousSampleCount = this->getSampleCount(); + + errorCode = this->device->bulkCommand(this->command[BULK_STARTSAMPLING]); + if(errorCode < 0) { + if(errorCode == LIBUSB_ERROR_NO_DEVICE) { + this->quit(); + return; + } + break; + } +#ifdef DEBUG + Helper::timestampDebug("Starting to capture"); +#endif + + this->samplingStarted = true; + + break; + + case ROLL_ENABLETRIGGER: + errorCode = this->device->bulkCommand(this->command[BULK_ENABLETRIGGER]); + if(errorCode < 0) { + if(errorCode == LIBUSB_ERROR_NO_DEVICE) { + this->quit(); + return; + } + break; + } +#ifdef DEBUG + Helper::timestampDebug("Enabling trigger"); +#endif + + break; + + case ROLL_FORCETRIGGER: + errorCode = this->device->bulkCommand(this->command[BULK_FORCETRIGGER]); + if(errorCode < 0) { + if(errorCode == LIBUSB_ERROR_NO_DEVICE) { + this->quit(); + return; + } + break; + } +#ifdef DEBUG + Helper::timestampDebug("Forcing trigger"); +#endif + + break; + + case ROLL_GETDATA: + // Get data and process it, if we're still sampling + errorCode = this->getSamples(this->samplingStarted); + if(errorCode < 0) + qWarning("Getting sample data failed: %s", Helper::libUsbErrorString(errorCode).toLocal8Bit().data()); +#ifdef DEBUG + else + Helper::timestampDebug(QString("Received %1 B of sampling data").arg(errorCode)); +#endif + + // Check if we're in single trigger mode + if(this->settings.trigger.mode == Dso::TRIGGERMODE_SINGLE && this->samplingStarted) + this->stopSampling(); + + // Sampling completed, restart it when necessary + this->samplingStarted = false; + + break; + + default: +#ifdef DEBUG + Helper::timestampDebug("Roll mode state unknown"); +#endif + break; + } + + // Go to next state, or restart if last state was reached + if(toNextState) + this->rollState = (this->rollState + 1) % ROLL_COUNT; + } + else { + // Standard mode + this->rollState = ROLL_STARTSAMPLING; + +#ifdef DEBUG + int lastCaptureState = this->captureState; +#endif + this->captureState = this->getCaptureState(); + if(this->captureState < 0) + qWarning("Getting capture state failed: %s", Helper::libUsbErrorString(this->captureState).toLocal8Bit().data()); +#ifdef DEBUG + else if(this->captureState != lastCaptureState) + Helper::timestampDebug(QString("Capture state changed to %1").arg(this->captureState)); +#endif + switch(this->captureState) { + case CAPTURE_READY: + case CAPTURE_READY2250: + case CAPTURE_READY5200: + // Get data and process it, if we're still sampling + errorCode = this->getSamples(this->samplingStarted); + if(errorCode < 0) + qWarning("Getting sample data failed: %s", Helper::libUsbErrorString(errorCode).toLocal8Bit().data()); +#ifdef DEBUG + else + Helper::timestampDebug(QString("Received %1 B of sampling data").arg(errorCode)); +#endif + + // Check if we're in single trigger mode + if(this->settings.trigger.mode == Dso::TRIGGERMODE_SINGLE && this->samplingStarted) + this->stopSampling(); + + // Sampling completed, restart it when necessary + this->samplingStarted = false; + + // Start next capture if necessary by leaving out the break statement + if(!this->sampling) + break; + + case CAPTURE_WAITING: + // Sampling hasn't started, update the expected sample count + this->previousSampleCount = this->getSampleCount(); + + if(this->samplingStarted && this->lastTriggerMode == this->settings.trigger.mode) { + ++this->cycleCounter; + + if(this->cycleCounter == this->startCycle && this->settings.samplerate.limits->recordLengths[this->settings.recordLengthId] != UINT_MAX) { + // Buffer refilled completely since start of sampling, enable the trigger now + errorCode = this->device->bulkCommand(this->command[BULK_ENABLETRIGGER]); + if(errorCode < 0) { + if(errorCode == LIBUSB_ERROR_NO_DEVICE) { + this->quit(); + return; + } + break; + } +#ifdef DEBUG + Helper::timestampDebug("Enabling trigger"); +#endif + } + else if(this->cycleCounter >= 8 + this->startCycle && this->settings.trigger.mode == Dso::TRIGGERMODE_AUTO) { + // Force triggering + errorCode = this->device->bulkCommand(this->command[BULK_FORCETRIGGER]); + if(errorCode < 0) { + if(errorCode == LIBUSB_ERROR_NO_DEVICE) { + this->quit(); + return; + } + break; + } +#ifdef DEBUG + Helper::timestampDebug("Forcing trigger"); +#endif + } + + if(this->cycleCounter < 20 || this->cycleCounter < 4000 / this->timer->interval()) + break; + } + + // Start capturing + errorCode = this->device->bulkCommand(this->command[BULK_STARTSAMPLING]); + if(errorCode < 0) { + if(errorCode == LIBUSB_ERROR_NO_DEVICE) { + this->quit(); + return; + } + break; + } +#ifdef DEBUG + Helper::timestampDebug("Starting to capture"); +#endif + + this->samplingStarted = true; + this->cycleCounter = 0; + this->startCycle = this->settings.trigger.position * 1000 / this->timer->interval() + 1; + this->lastTriggerMode = this->settings.trigger.mode; + break; + + case CAPTURE_SAMPLING: + break; + default: + break; + } + } + + this->updateInterval(); + } } diff --git a/openhantek/src/hantek/control.h b/openhantek/src/hantek/control.h index a509935..677877c 100644 --- a/openhantek/src/hantek/control.h +++ b/openhantek/src/hantek/control.h @@ -37,6 +37,9 @@ #include "hantek/types.h" +class QTimer; + + namespace Hantek { class Device; @@ -210,6 +213,7 @@ namespace Hantek { protected: void run(); + void updateInterval(); unsigned int calculateTriggerPoint(unsigned int value); int getCaptureState(); @@ -223,6 +227,7 @@ namespace Hantek { // Communication with device Device *device; ///< The USB device for the oscilloscope + QTimer *timer; ///< Timer for periodic communication thread Helper::DataArray *command[BULK_COUNT]; ///< Pointers to bulk commands, ready to be transmitted bool commandPending[BULK_COUNT]; ///< true, when the command should be executed @@ -238,6 +243,14 @@ namespace Hantek { std::vector > samples; ///< Sample data vectors sent to the data analyzer unsigned int previousSampleCount; ///< The expected total number of samples at the last check before sampling started QMutex samplesMutex; ///< Mutex for the sample data + + // State of the communication thread + int captureState; + int rollState; + bool samplingStarted; + Dso::TriggerMode lastTriggerMode; + int cycleCounter; + int startCycle; public slots: virtual void connectDevice(); @@ -260,6 +273,9 @@ namespace Hantek { #ifdef DEBUG int stringCommand(QString command); #endif + + protected slots: + void handler(); }; } diff --git a/openhantek/src/openhantek.cpp b/openhantek/src/openhantek.cpp index e767570..219a805 100644 --- a/openhantek/src/openhantek.cpp +++ b/openhantek/src/openhantek.cpp @@ -342,10 +342,6 @@ void OpenHantekMainWindow::initializeDevice() { this->dsoControl->setPretriggerPosition(this->settings->scope.trigger.position * this->settings->scope.horizontal.timebase * DIVS_TIME); this->dsoControl->setTriggerSlope(this->settings->scope.trigger.slope); this->dsoControl->setTriggerSource(this->settings->scope.trigger.special, this->settings->scope.trigger.source); - - // Apply the limits to the dock widgets - this->horizontalDock->availableRecordLengthsChanged(*this->dsoControl->getAvailableRecordLengths()); - this->horizontalDock->samplerateLimitsChanged(this->dsoControl->getMinSamplerate(), this->dsoControl->getMaxSamplerate()); } /// \brief Read the settings from an ini file.