Fixed trigger for Multimeter++

This commit is contained in:
Chris Esposito 2019-10-11 14:25:52 +11:00
parent d04da3748d
commit f6901671f4
2 changed files with 21 additions and 2 deletions

View File

@ -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<double> x(GRAPH_SAMPLES), CH1(GRAPH_SAMPLES);
analogConvert(readData375_CH1.get(), &CH1, 2048, 0, 1); //No AC coupling!

View File

@ -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!