add trigger support

This commit is contained in:
Carl Philipp Klemm 2025-10-13 13:59:35 +02:00
parent bccee9bd36
commit c11630e50a
5 changed files with 180 additions and 8 deletions

View file

@ -2,6 +2,7 @@
#include <QMessageBox>
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "triggerwidget.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
@ -55,6 +56,20 @@ void MainWindow::enumerateDevices()
ui->channelLayout->addWidget(widget.get());
}
}
// Add trigger widgets
int triggerCount = eismultiplexer_get_trigger_count(multiplexer.get());
if (triggerCount > 0)
{
qDebug()<<"Adding triggers from device "<<serial;
for (int trigger = 0; trigger < triggerCount; trigger++)
{
std::shared_ptr<TriggerWidget> triggerWidget(new TriggerWidget(serial, trigger, multiplexer));
qDebug()<<"Added trigger widget from device "<<serial<<" trigger "<<trigger;
triggers.push_back(triggerWidget);
ui->channelLayout->addWidget(triggerWidget.get());
}
}
}
else
{
@ -65,7 +80,7 @@ void MainWindow::enumerateDevices()
}
ui->channelLayout->addStretch();
// Second pass: populate gang combos and connect signals
// Second pass: populate gang combos and connect signals for channels
for (const auto& widget : channels) {
// Populate gang combo with all other channels
for (const auto& otherWidget : channels) {