added A4818 support for FSU DAQ, extend MAXNBoard = 8
This commit is contained in:
parent
4304a4bd05
commit
fae9762dd9
37
FSUDAQ.cpp
37
FSUDAQ.cpp
|
@ -56,6 +56,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
|
||||||
cbOpenDigitizers->addItem("Open Digitizers ... ", 0);
|
cbOpenDigitizers->addItem("Open Digitizers ... ", 0);
|
||||||
cbOpenDigitizers->addItem("Open Digitizers w/o load Settings", 1);
|
cbOpenDigitizers->addItem("Open Digitizers w/o load Settings", 1);
|
||||||
cbOpenDigitizers->addItem("Open Digitizers + load Settings", 2);
|
cbOpenDigitizers->addItem("Open Digitizers + load Settings", 2);
|
||||||
|
//cbOpenDigitizers->addItem("Open Digitizers via USB", 3);
|
||||||
|
cbOpenDigitizers->addItem("Open Digitizers via A4818", 4);
|
||||||
layout->addWidget(cbOpenDigitizers, 0, 0);
|
layout->addWidget(cbOpenDigitizers, 0, 0);
|
||||||
connect(cbOpenDigitizers, &RComboBox::currentIndexChanged, this, &MainWindow::OpenDigitizers);
|
connect(cbOpenDigitizers, &RComboBox::currentIndexChanged, this, &MainWindow::OpenDigitizers);
|
||||||
|
|
||||||
|
@ -561,13 +563,36 @@ void MainWindow::OpenDigitizers(){
|
||||||
|
|
||||||
if( cbOpenDigitizers->currentIndex() == 0 ) return;
|
if( cbOpenDigitizers->currentIndex() == 0 ) return;
|
||||||
|
|
||||||
//sereach for digitizers
|
// placeholder for USB
|
||||||
LogMsg("Searching digitizers via optical link or USB .....Please wait");
|
// if( cbOpenDigitizers->currentData().toInt() == 3 ) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
QString a4818PID = "26006";
|
||||||
|
if( cbOpenDigitizers->currentData().toInt() == 4 ) {
|
||||||
|
|
||||||
|
bool ok;
|
||||||
|
a4818PID = QInputDialog::getText(nullptr, "A4818 PID", "Can be found on the A4818:", QLineEdit::Normal, "", &ok);
|
||||||
|
|
||||||
|
if ( !ok || a4818PID.isEmpty()) {
|
||||||
|
LogMsg("User cancel or fail to connect A4818 without PID");
|
||||||
|
cbOpenDigitizers->setCurrentIndex(0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if( cbOpenDigitizers->currentData().toInt() == 4 ) {
|
||||||
|
LogMsg("Searching digitizers via A4818 .....Please wait");
|
||||||
|
}else{
|
||||||
|
LogMsg("Searching digitizers via optical link or USB .....Please wait");
|
||||||
|
}
|
||||||
logMsgHTMLMode = false;
|
logMsgHTMLMode = false;
|
||||||
nDigi = 0;
|
nDigi = 0;
|
||||||
std::vector<std::pair<int, int>> portList; //boardID, portID
|
std::vector<std::pair<int, int>> portList; //boardID, portID
|
||||||
for(int port = 0; port < MaxNPorts; port++){
|
for(int port = 0; port < MaxNPorts; port++){
|
||||||
for( int board = 0; board < MaxNBoards; board ++){ /// max number of iasy chain
|
if( cbOpenDigitizers->currentData().toInt() == 4 ) port = a4818PID.toInt();
|
||||||
|
for( int board = 0; board < MaxNBoards; board ++){ /// max number of diasy chain
|
||||||
Digitizer dig;
|
Digitizer dig;
|
||||||
dig.OpenDigitizer(board, port);
|
dig.OpenDigitizer(board, port);
|
||||||
if( dig.IsConnected() ){
|
if( dig.IsConnected() ){
|
||||||
|
@ -584,10 +609,10 @@ void MainWindow::OpenDigitizers(){
|
||||||
logMsgHTMLMode = true;
|
logMsgHTMLMode = true;
|
||||||
|
|
||||||
if( nDigi == 0 ) {
|
if( nDigi == 0 ) {
|
||||||
LogMsg(QString("Done seraching. No digitizer found."));
|
LogMsg(QString("Done seraching. No digitizer found from port 0 to ") + QString::number(MaxNPorts) + " and board 0 to " + QString::number(MaxNBoards) + ".");
|
||||||
|
cbOpenDigitizers->setCurrentIndex(0);
|
||||||
return;
|
return;
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
if( cbOpenDigitizers->currentIndex() == 1 ) {
|
if( cbOpenDigitizers->currentIndex() == 1 ) {
|
||||||
LogMsg(QString("Done seraching. Found %1 digitizer(s). Opening digitizer(s)....").arg(nDigi));
|
LogMsg(QString("Done seraching. Found %1 digitizer(s). Opening digitizer(s)....").arg(nDigi));
|
||||||
}else{
|
}else{
|
||||||
|
@ -1389,6 +1414,8 @@ void MainWindow::SetAndLockInfluxElog(){
|
||||||
QObject::connect(&buttonBox, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
|
QObject::connect(&buttonBox, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
|
||||||
QObject::connect(&buttonBox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
|
QObject::connect(&buttonBox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
|
||||||
|
|
||||||
|
dialog.resize(400, dialog.sizeHint().height()); // Set the width to 400 pixels
|
||||||
|
|
||||||
// Show the dialog and get the result
|
// Show the dialog and get the result
|
||||||
if (dialog.exec() == QDialog::Accepted) {
|
if (dialog.exec() == QDialog::Accepted) {
|
||||||
QString username = usernameLineEdit.text();
|
QString username = usernameLineEdit.text();
|
||||||
|
|
2
macro.h
2
macro.h
|
@ -2,7 +2,7 @@
|
||||||
#define MACRO_H
|
#define MACRO_H
|
||||||
|
|
||||||
#define MaxNPorts 4 //for optical link
|
#define MaxNPorts 4 //for optical link
|
||||||
#define MaxNBoards 4 //for both optical link and usb
|
#define MaxNBoards 8 //for both optical link and usb
|
||||||
|
|
||||||
#define MaxNDigitizer MaxNPorts * MaxNBoards
|
#define MaxNDigitizer MaxNPorts * MaxNBoards
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user