added digitizer Info
This commit is contained in:
parent
b53a32f50e
commit
26056070f0
|
@ -99,6 +99,7 @@ class Digitizer{
|
||||||
uint32_t PrintRegister(uint32_t address, std::string msg);
|
uint32_t PrintRegister(uint32_t address, std::string msg);
|
||||||
|
|
||||||
//^================ Get Board info
|
//^================ Get Board info
|
||||||
|
CAEN_DGTZ_BoardInfo_t GetBoardInfo() const {return BoardInfo;}
|
||||||
std::string GetModelName() const {return BoardInfo.ModelName;}
|
std::string GetModelName() const {return BoardInfo.ModelName;}
|
||||||
int GetSerialNumber() const {return BoardInfo.SerialNumber;}
|
int GetSerialNumber() const {return BoardInfo.SerialNumber;}
|
||||||
int GetChannelMask() const {return channelMask;}
|
int GetChannelMask() const {return channelMask;}
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
#include "DigiSettings.h"
|
|
||||||
|
|
||||||
DigiSettings::DigiSettings(Digitizer ** digi, unsigned int nDigi, QMainWindow *parent): QMainWindow(parent){
|
|
||||||
|
|
||||||
this->digi = digi;
|
|
||||||
this->nDigi = nDigi;
|
|
||||||
|
|
||||||
enableSignalSlot = false;
|
|
||||||
|
|
||||||
setWindowTitle("Digitizer Settings");
|
|
||||||
setGeometry(0, 0, 1000, 800);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
DigiSettings::~DigiSettings(){
|
|
||||||
printf("%s \n", __func__);
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
#ifndef DigiSettings_H
|
|
||||||
#define DigiSettings_H
|
|
||||||
|
|
||||||
#include <QMainWindow>
|
|
||||||
|
|
||||||
#include "macro.h"
|
|
||||||
#include "ClassDigitizer.h"
|
|
||||||
#include "CustomWidgets.h"
|
|
||||||
|
|
||||||
class DigiSettings : public QMainWindow{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
DigiSettings(Digitizer ** digi, unsigned int nDigi, QMainWindow * parent = nullptr);
|
|
||||||
~DigiSettings();
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void SendLogMsg(const QString &msg);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
Digitizer ** digi;
|
|
||||||
unsigned int nDigi;
|
|
||||||
|
|
||||||
bool enableSignalSlot;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
101
DigiSettingsPanel.cpp
Normal file
101
DigiSettingsPanel.cpp
Normal file
|
@ -0,0 +1,101 @@
|
||||||
|
#include "DigiSettingsPanel.h"
|
||||||
|
|
||||||
|
#include <QScrollArea>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QGroupBox>
|
||||||
|
|
||||||
|
DigiSettingsPanel::DigiSettingsPanel(Digitizer ** digi, unsigned int nDigi, QMainWindow *parent): QMainWindow(parent){
|
||||||
|
|
||||||
|
this->digi = digi;
|
||||||
|
this->nDigi = nDigi;
|
||||||
|
|
||||||
|
enableSignalSlot = false;
|
||||||
|
|
||||||
|
setWindowTitle("Digitizer Settings");
|
||||||
|
setGeometry(0, 0, 1000, 800);
|
||||||
|
|
||||||
|
tabWidget = new QTabWidget(this);
|
||||||
|
setCentralWidget(tabWidget);
|
||||||
|
|
||||||
|
//@===================================== tab
|
||||||
|
for( unsigned int iDigi = 0 ; iDigi < this->nDigi; iDigi ++ ){
|
||||||
|
|
||||||
|
QScrollArea * scrollArea = new QScrollArea(this);
|
||||||
|
scrollArea->setWidgetResizable(true);
|
||||||
|
scrollArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
tabWidget->addTab(scrollArea, "Digi-" + QString::number(digi[iDigi]->GetSerialNumber()));
|
||||||
|
|
||||||
|
QWidget * tab = new QWidget(tabWidget);
|
||||||
|
scrollArea->setWidget(tab);
|
||||||
|
|
||||||
|
QHBoxLayout * tabLayout_H = new QHBoxLayout(tab); //tab->setLayout(tabLayout_H);
|
||||||
|
|
||||||
|
QVBoxLayout * tabLayout_V1 = new QVBoxLayout(tab); tabLayout_H->addLayout(tabLayout_V1);
|
||||||
|
QVBoxLayout * tabLayout_V2 = new QVBoxLayout(tab); tabLayout_H->addLayout(tabLayout_V2);
|
||||||
|
|
||||||
|
{//^====================== Group of Digitizer Info
|
||||||
|
QGroupBox * infoBox = new QGroupBox("Board Info", tab);
|
||||||
|
//infoBox->setSizePolicy(sizePolicy);
|
||||||
|
|
||||||
|
QGridLayout * infoLayout = new QGridLayout(infoBox);
|
||||||
|
tabLayout_V1->addWidget(infoBox);
|
||||||
|
|
||||||
|
SetUpInfo( "Model ", digi[iDigi]->GetModelName(), infoLayout, 0, 0);
|
||||||
|
SetUpInfo( "DPP Type ", digi[iDigi]->GetDPPString(), infoLayout, 0, 2);
|
||||||
|
SetUpInfo("Link Type ", digi[iDigi]->GetLinkType() == CAEN_DGTZ_USB ? "USB" : "Optical Link" , infoLayout, 0, 4);
|
||||||
|
|
||||||
|
SetUpInfo( "S/N No. ", std::to_string(digi[iDigi]->GetSerialNumber()), infoLayout, 1, 0);
|
||||||
|
SetUpInfo( "No. Ch. ", std::to_string(digi[iDigi]->GetNChannels()), infoLayout, 1, 2);
|
||||||
|
SetUpInfo("Sampling Rate ", std::to_string(digi[iDigi]->GetCh2ns()), infoLayout, 1, 4);
|
||||||
|
|
||||||
|
SetUpInfo("ADC bit ", std::to_string(digi[iDigi]->GetADCBits()), infoLayout, 2, 0);
|
||||||
|
SetUpInfo("ROC version ", digi[iDigi]->GetROCVersion(), infoLayout, 2, 2);
|
||||||
|
SetUpInfo("AMC version ", digi[iDigi]->GetAMCVersion(), infoLayout, 2, 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
{//^======================= Board status
|
||||||
|
QGroupBox * bardStatusBox = new QGroupBox("Board Status", tab);
|
||||||
|
QGridLayout * statusLayout = new QGridLayout(bardStatusBox);
|
||||||
|
tabLayout_V1->addWidget(bardStatusBox);
|
||||||
|
}
|
||||||
|
|
||||||
|
{//^======================= Board Settings
|
||||||
|
QGroupBox * boardSettingBox = new QGroupBox("Board Settings", tab);
|
||||||
|
QGridLayout * settingLayout = new QGridLayout(boardSettingBox);
|
||||||
|
tabLayout_V1->addWidget(boardSettingBox);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
{//^======================= Channel Settings
|
||||||
|
|
||||||
|
QTabWidget * chTab = new QTabWidget(tab);
|
||||||
|
tabLayout_H->addWidget(chTab);
|
||||||
|
|
||||||
|
QScrollArea * scrollArea = new QScrollArea(this);
|
||||||
|
scrollArea->setWidgetResizable(true);
|
||||||
|
scrollArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
chTab->addTab(scrollArea, "Channel Settings");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
DigiSettingsPanel::~DigiSettingsPanel(){
|
||||||
|
printf("%s \n", __func__);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//*================================================================
|
||||||
|
//*================================================================
|
||||||
|
void DigiSettingsPanel::SetUpInfo(QString name, std::string value, QGridLayout *gLayout, int row, int col){
|
||||||
|
QLabel * lab = new QLabel(name, this);
|
||||||
|
lab->setAlignment(Qt::AlignRight | Qt::AlignCenter);
|
||||||
|
QLineEdit * leInfo = new QLineEdit(this);
|
||||||
|
leInfo->setReadOnly(true);
|
||||||
|
leInfo->setText(QString::fromStdString(value));
|
||||||
|
gLayout->addWidget(lab, row, col);
|
||||||
|
gLayout->addWidget(leInfo, row, col + 1);
|
||||||
|
}
|
39
DigiSettingsPanel.h
Normal file
39
DigiSettingsPanel.h
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
#ifndef DigiSettings_H
|
||||||
|
#define DigiSettings_H
|
||||||
|
|
||||||
|
#include <QMainWindow>
|
||||||
|
#include <QTabWidget>
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include <QGridLayout>
|
||||||
|
|
||||||
|
#include "macro.h"
|
||||||
|
#include "ClassDigitizer.h"
|
||||||
|
#include "CustomWidgets.h"
|
||||||
|
|
||||||
|
class DigiSettingsPanel : public QMainWindow{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DigiSettingsPanel(Digitizer ** digi, unsigned int nDigi, QMainWindow * parent = nullptr);
|
||||||
|
~DigiSettingsPanel();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void SendLogMsg(const QString &msg);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void SetUpInfo(QString name, std::string value, QGridLayout *gLayout, int row, int col);
|
||||||
|
|
||||||
|
Digitizer ** digi;
|
||||||
|
unsigned int nDigi;
|
||||||
|
|
||||||
|
bool enableSignalSlot;
|
||||||
|
|
||||||
|
QTabWidget * tabWidget;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
|
@ -744,7 +744,7 @@ void MainWindow::OpenScope(){
|
||||||
void MainWindow::OpenDigiSettings(){
|
void MainWindow::OpenDigiSettings(){
|
||||||
|
|
||||||
if( digiSettings == nullptr ) {
|
if( digiSettings == nullptr ) {
|
||||||
digiSettings = new DigiSettings(digi, nDigi);
|
digiSettings = new DigiSettingsPanel(digi, nDigi);
|
||||||
//connect(scope, &Scope::SendLogMsg, this, &MainWindow::LogMsg);
|
//connect(scope, &Scope::SendLogMsg, this, &MainWindow::LogMsg);
|
||||||
digiSettings->show();
|
digiSettings->show();
|
||||||
}else{
|
}else{
|
||||||
|
|
4
FSUDAQ.h
4
FSUDAQ.h
|
@ -14,7 +14,7 @@
|
||||||
#include "ClassDigitizer.h"
|
#include "ClassDigitizer.h"
|
||||||
#include "CustomThreads.h"
|
#include "CustomThreads.h"
|
||||||
#include "Scope.h"
|
#include "Scope.h"
|
||||||
#include "DigiSettings.h"
|
#include "DigiSettingsPanel.h"
|
||||||
|
|
||||||
//^#===================================================== MainWindow
|
//^#===================================================== MainWindow
|
||||||
class MainWindow : public QMainWindow{
|
class MainWindow : public QMainWindow{
|
||||||
|
@ -109,7 +109,7 @@ private:
|
||||||
Scope * scope;
|
Scope * scope;
|
||||||
|
|
||||||
//@----- DigiSettings
|
//@----- DigiSettings
|
||||||
DigiSettings * digiSettings;
|
DigiSettingsPanel * digiSettings;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -23,13 +23,13 @@ HEADERS += ClassData.h \
|
||||||
ClassDigitizer.h \
|
ClassDigitizer.h \
|
||||||
CustomThreads.h \
|
CustomThreads.h \
|
||||||
CustomWidgets.h \
|
CustomWidgets.h \
|
||||||
DigiSettings.h \
|
DigiSettingsPanel.h \
|
||||||
FSUDAQ.h \
|
FSUDAQ.h \
|
||||||
macro.h \
|
macro.h \
|
||||||
RegisterAddress.h \
|
RegisterAddress.h \
|
||||||
Scope.h
|
Scope.h
|
||||||
SOURCES += ClassDigitizer.cpp \
|
SOURCES += ClassDigitizer.cpp \
|
||||||
DigiSettings.cpp \
|
DigiSettingsPanel.cpp \
|
||||||
FSUDAQ.cpp \
|
FSUDAQ.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
Scope.cpp
|
Scope.cpp
|
||||||
|
|
3
macro.h
3
macro.h
|
@ -3,6 +3,9 @@
|
||||||
|
|
||||||
#define MaxNPorts 1
|
#define MaxNPorts 1
|
||||||
#define MaxNBoards 1
|
#define MaxNBoards 1
|
||||||
|
|
||||||
|
#define MaxNDigitizer MaxNPorts * MaxNBoards
|
||||||
|
|
||||||
#define MaxNChannels 16
|
#define MaxNChannels 16
|
||||||
#define MaxRecordLength 0x3fff * 8
|
#define MaxRecordLength 0x3fff * 8
|
||||||
#define MaxSaveFileSize 1024 * 1024 * 1024 * 2
|
#define MaxSaveFileSize 1024 * 1024 * 1024 * 2
|
||||||
|
|
Loading…
Reference in New Issue
Block a user