diff --git a/Desktop_Interface/isodriver.cpp b/Desktop_Interface/isodriver.cpp index f38b17dc..3ab71f60 100644 --- a/Desktop_Interface/isodriver.cpp +++ b/Desktop_Interface/isodriver.cpp @@ -593,7 +593,7 @@ void isoDriver::setTriggerEnabled(bool enabled) void isoDriver::setTriggerLevel(double level) { - internalBuffer375_CH1->setTriggerLevel(level, 128, AC_CH1); + internalBuffer375_CH1->setTriggerLevel(level, (driver->deviceMode == 7 ? 2048 : 128), AC_CH1); internalBuffer375_CH2->setTriggerLevel(level, 128, AC_CH2); internalBuffer750->setTriggerLevel(level, 128, AC_CH1); triggerStateChanged(); @@ -770,7 +770,18 @@ void isoDriver::multimeterAction(){ } double triggerDelay = 0; - readData375_CH1 = internalBuffer375_CH1->readBuffer(display.window,GRAPH_SAMPLES, false, display.delay + ((triggerEnabled&&!paused_multimeter) ? triggerDelay + display.window/2 : 0)); + if (triggerEnabled) + { + triggerDelay = internalBuffer375_CH1->getDelayedTriggerPoint(display.window) - display.window; + + if (triggerDelay < 0) + triggerDelay = 0; + } + + if(singleShotEnabled && (triggerDelay != 0)) + singleShotTriggered(1); + + readData375_CH1 = internalBuffer375_CH1->readBuffer(display.window,GRAPH_SAMPLES, false, display.delay + triggerDelay); QVector x(GRAPH_SAMPLES), CH1(GRAPH_SAMPLES); analogConvert(readData375_CH1.get(), &CH1, 2048, 0, 1); //No AC coupling! diff --git a/Desktop_Interface/mainwindow.cpp b/Desktop_Interface/mainwindow.cpp index b88db7c9..36181049 100644 --- a/Desktop_Interface/mainwindow.cpp +++ b/Desktop_Interface/mainwindow.cpp @@ -148,6 +148,10 @@ MainWindow::MainWindow(QWidget *parent) : connect(ui->controller_iso, SIGNAL(setGain(double)), ui->controller_iso->driver, SLOT(setGain(double))); connect(ui->controller_fg, &functionGenControl::functionGenToUpdate, ui->controller_iso->driver, &genericUsbDriver::setFunctionGen); connect(ui->bufferDisplay, SIGNAL(modeChange(int)), ui->controller_iso->driver, SLOT(setDeviceMode(int))); + connect(ui->bufferDisplay, &bufferControl::modeChange, this, [this](){ + // Force a trigger refresh + ui->controller_iso->setTriggerLevel(ui->triggerLevelValue->value()); + }); connect(ui->bufferDisplay, SIGNAL(updateDig(int)), ui->controller_iso->driver, SLOT(newDig(int))); //Set the settings again! @@ -1359,6 +1363,10 @@ void MainWindow::reinitUsbStage2(void){ connect(ui->controller_iso, SIGNAL(setGain(double)), ui->controller_iso->driver, SLOT(setGain(double))); connect(ui->controller_fg, &functionGenControl::functionGenToUpdate, ui->controller_iso->driver, &genericUsbDriver::setFunctionGen); connect(ui->bufferDisplay, SIGNAL(modeChange(int)), ui->controller_iso->driver, SLOT(setDeviceMode(int))); + connect(ui->bufferDisplay, &bufferControl::modeChange, this, [this](){ + // Force a trigger refresh + ui->controller_iso->setTriggerLevel(ui->triggerLevelValue->value()); + }); connect(ui->bufferDisplay, SIGNAL(updateDig(int)), ui->controller_iso->driver, SLOT(newDig(int))); //Set the settings again!