change digi to be pointer of pointer
This commit is contained in:
parent
8ffdc2d75c
commit
100c9c9feb
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
|
||||||
DigiSettings::DigiSettings(Digitizer2Gen * digi, unsigned short nDigi, QWidget * parent) : QWidget(parent){
|
DigiSettings::DigiSettings(Digitizer2Gen ** digi, unsigned short nDigi, QWidget * parent) : QWidget(parent){
|
||||||
|
|
||||||
qDebug() << "DigiSettings constructor";
|
qDebug() << "DigiSettings constructor";
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ DigiSettings::DigiSettings(Digitizer2Gen * digi, unsigned short nDigi, QWidget *
|
||||||
scrollArea->setWidgetResizable(true);
|
scrollArea->setWidgetResizable(true);
|
||||||
scrollArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
scrollArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
|
||||||
tabWidget->addTab(scrollArea, "Digi-" + QString::number(digi->GetSerialNumber()));
|
tabWidget->addTab(scrollArea, "Digi-" + QString::number(digi[iDigi]->GetSerialNumber()));
|
||||||
|
|
||||||
QGridLayout *tabLayout = new QGridLayout(tab); tab->setLayout(tabLayout);
|
QGridLayout *tabLayout = new QGridLayout(tab); tab->setLayout(tabLayout);
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ DigiSettings::DigiSettings(Digitizer2Gen * digi, unsigned short nDigi, QWidget *
|
||||||
lab->setAlignment(Qt::AlignRight);
|
lab->setAlignment(Qt::AlignRight);
|
||||||
QLineEdit * txt = new QLineEdit(tab);
|
QLineEdit * txt = new QLineEdit(tab);
|
||||||
txt->setReadOnly(true);
|
txt->setReadOnly(true);
|
||||||
txt->setText(QString::fromStdString(digi->ReadValue(info[j][1].c_str())));
|
txt->setText(QString::fromStdString(digi[iDigi]->ReadValue(info[j][1].c_str())));
|
||||||
infoLayout->addWidget(lab, j%nRow, 2*(j/nRow));
|
infoLayout->addWidget(lab, j%nRow, 2*(j/nRow));
|
||||||
infoLayout->addWidget(txt, j%nRow, 2*(j/nRow) +1);
|
infoLayout->addWidget(txt, j%nRow, 2*(j/nRow) +1);
|
||||||
}
|
}
|
||||||
|
@ -301,7 +301,7 @@ DigiSettings::DigiSettings(Digitizer2Gen * digi, unsigned short nDigi, QWidget *
|
||||||
allLayout->setHorizontalSpacing(0);
|
allLayout->setHorizontalSpacing(0);
|
||||||
allLayout->setVerticalSpacing(0);
|
allLayout->setVerticalSpacing(0);
|
||||||
|
|
||||||
unsigned short ch = digi->GetNChannels();
|
unsigned short ch = digi[iDigi]->GetNChannels();
|
||||||
|
|
||||||
cbCh[iDigi][ch] = new QCheckBox("On/Off", tab); allLayout->addWidget(cbCh[iDigi][ch], 0, 0);
|
cbCh[iDigi][ch] = new QCheckBox("On/Off", tab); allLayout->addWidget(cbCh[iDigi][ch], 0, 0);
|
||||||
onOffMapper->setMapping(cbCh[iDigi][ch], (iDigi << 12) + ch);
|
onOffMapper->setMapping(cbCh[iDigi][ch], (iDigi << 12) + ch);
|
||||||
|
@ -327,7 +327,7 @@ DigiSettings::DigiSettings(Digitizer2Gen * digi, unsigned short nDigi, QWidget *
|
||||||
allLayout->setVerticalSpacing(0);
|
allLayout->setVerticalSpacing(0);
|
||||||
|
|
||||||
|
|
||||||
for( int ch = 0; ch < digi->GetNChannels(); ch++){
|
for( int ch = 0; ch < digi[iDigi]->GetNChannels(); ch++){
|
||||||
cbCh[iDigi][ch] = new QCheckBox(QString::number(ch)); allLayout->addWidget(cbCh[iDigi][ch], ch/8, ch%8);
|
cbCh[iDigi][ch] = new QCheckBox(QString::number(ch)); allLayout->addWidget(cbCh[iDigi][ch], ch/8, ch%8);
|
||||||
cbCh[iDigi][ch]->setLayoutDirection(Qt::RightToLeft);
|
cbCh[iDigi][ch]->setLayoutDirection(Qt::RightToLeft);
|
||||||
|
|
||||||
|
@ -605,9 +605,9 @@ DigiSettings::DigiSettings(Digitizer2Gen * digi, unsigned short nDigi, QWidget *
|
||||||
|
|
||||||
int rowID = 1;
|
int rowID = 1;
|
||||||
int colID = 0;
|
int colID = 0;
|
||||||
for(int i = 0; i < digi->GetNChannels(); i++){
|
for(int i = 0; i < digi[iDigi]->GetNChannels(); i++){
|
||||||
colID = 0;
|
colID = 0;
|
||||||
for(int j = 0; j < digi->GetNChannels(); j++){
|
for(int j = 0; j < digi[iDigi]->GetNChannels(); j++){
|
||||||
|
|
||||||
bn[i][j] = new QPushButton(tab);
|
bn[i][j] = new QPushButton(tab);
|
||||||
bn[i][j]->setFixedSize(QSize(10,10));
|
bn[i][j]->setFixedSize(QSize(10,10));
|
||||||
|
@ -624,7 +624,7 @@ DigiSettings::DigiSettings(Digitizer2Gen * digi, unsigned short nDigi, QWidget *
|
||||||
|
|
||||||
colID ++;
|
colID ++;
|
||||||
|
|
||||||
if( j%4 == 3 && j!= digi->GetNChannels() - 1){
|
if( j%4 == 3 && j!= digi[iDigi]->GetNChannels() - 1){
|
||||||
QFrame * vSeparator = new QFrame(tab);
|
QFrame * vSeparator = new QFrame(tab);
|
||||||
vSeparator->setFrameShape(QFrame::VLine);
|
vSeparator->setFrameShape(QFrame::VLine);
|
||||||
triggerLayout->addWidget(vSeparator, rowID, colID);
|
triggerLayout->addWidget(vSeparator, rowID, colID);
|
||||||
|
@ -634,10 +634,10 @@ DigiSettings::DigiSettings(Digitizer2Gen * digi, unsigned short nDigi, QWidget *
|
||||||
|
|
||||||
rowID++;
|
rowID++;
|
||||||
|
|
||||||
if( i%4 == 3 && i != digi->GetNChannels() - 1){
|
if( i%4 == 3 && i != digi[iDigi]->GetNChannels() - 1){
|
||||||
QFrame * hSeparator = new QFrame(tab);
|
QFrame * hSeparator = new QFrame(tab);
|
||||||
hSeparator->setFrameShape(QFrame::HLine);
|
hSeparator->setFrameShape(QFrame::HLine);
|
||||||
triggerLayout->addWidget(hSeparator, rowID, 0, 1, digi->GetNChannels() + 15);
|
triggerLayout->addWidget(hSeparator, rowID, 0, 1, digi[iDigi]->GetNChannels() + 15);
|
||||||
rowID++;
|
rowID++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,18 +25,18 @@ class DigiSettings : public QWidget{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DigiSettings(Digitizer2Gen * digi, unsigned short nDigi, QWidget * parent = nullptr);
|
DigiSettings(Digitizer2Gen ** digi, unsigned short nDigi, QWidget * parent = nullptr);
|
||||||
~DigiSettings();
|
~DigiSettings();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void onReset(){
|
void onReset(int id){
|
||||||
emit sendLogMsg("Reset Digitizer-" + QString::number(digi->GetSerialNumber()));
|
emit sendLogMsg("Reset Digitizer-" + QString::number(digi[id]->GetSerialNumber()));
|
||||||
digi->Reset();
|
digi[id]->Reset();
|
||||||
}
|
}
|
||||||
void onDefault(){
|
void onDefault(int id){
|
||||||
emit sendLogMsg("Program Digitizer-" + QString::number(digi->GetSerialNumber()) + " to default PHA.");
|
emit sendLogMsg("Program Digitizer-" + QString::number(digi[id]->GetSerialNumber()) + " to default PHA.");
|
||||||
digi->ProgramPHA();
|
digi[id]->ProgramPHA();
|
||||||
}
|
}
|
||||||
|
|
||||||
void onTriggerClick(int haha){
|
void onTriggerClick(int haha){
|
||||||
|
@ -64,17 +64,17 @@ private slots:
|
||||||
if( (haha & 0xFF) == 64){
|
if( (haha & 0xFF) == 64){
|
||||||
|
|
||||||
if( cbCh[iDig][64]->isChecked() ){
|
if( cbCh[iDig][64]->isChecked() ){
|
||||||
for( int i = 0 ; i < digi->GetNChannels() ; i++){
|
for( int i = 0 ; i < digi[iDig]->GetNChannels() ; i++){
|
||||||
cbCh[iDig][i]->setChecked(true);
|
cbCh[iDig][i]->setChecked(true);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
for( int i = 0 ; i < digi->GetNChannels() ; i++){
|
for( int i = 0 ; i < digi[iDig]->GetNChannels() ; i++){
|
||||||
cbCh[iDig][i]->setChecked(false);
|
cbCh[iDig][i]->setChecked(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
unsigned int nOn = 0;
|
unsigned int nOn = 0;
|
||||||
for( int i = 0; i < digi->GetNChannels(); i++){
|
for( int i = 0; i < digi[iDig]->GetNChannels(); i++){
|
||||||
nOn += (cbCh[iDig][i]->isChecked() ? 1 : 0);
|
nOn += (cbCh[iDig][i]->isChecked() ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,14 +93,13 @@ signals:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Digitizer2Gen * digi;
|
Digitizer2Gen ** digi;
|
||||||
unsigned short nDigi;
|
unsigned short nDigi;
|
||||||
|
|
||||||
QPushButton *bn[MaxNumberOfChannel][MaxNumberOfChannel];
|
QPushButton *bn[MaxNumberOfChannel][MaxNumberOfChannel];
|
||||||
bool bnClickStatus[MaxNumberOfChannel][MaxNumberOfChannel];
|
bool bnClickStatus[MaxNumberOfChannel][MaxNumberOfChannel];
|
||||||
|
|
||||||
QCheckBox * cbCh[MaxNumberOfDigitizer][MaxNumberOfChannel + 1]; // index = 64 is for all channels
|
QCheckBox * cbCh[MaxNumberOfDigitizer][MaxNumberOfChannel + 1]; // index = 64 is for all channels
|
||||||
//QCheckBox * cbCh[MaxNumberOfChannel + 1]; // index = 64 is for all channels
|
|
||||||
|
|
||||||
QSpinBox * sbRecordLength[MaxNumberOfChannel + 1];
|
QSpinBox * sbRecordLength[MaxNumberOfChannel + 1];
|
||||||
QSpinBox * sbPreTrigger[MaxNumberOfChannel + 1];
|
QSpinBox * sbPreTrigger[MaxNumberOfChannel + 1];
|
||||||
|
|
168
mainwindow.cpp
168
mainwindow.cpp
|
@ -12,7 +12,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
//------ static memeber
|
//------ static memeber
|
||||||
Digitizer2Gen * MainWindow::digi = NULL;
|
Digitizer2Gen ** MainWindow::digi = NULL;
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
|
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
|
||||||
|
|
||||||
|
@ -55,11 +55,11 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
|
||||||
bnOpenScope->setEnabled(false);
|
bnOpenScope->setEnabled(false);
|
||||||
|
|
||||||
bnOpenDigitizers = new QPushButton("Open Digitizers", this);
|
bnOpenDigitizers = new QPushButton("Open Digitizers", this);
|
||||||
connect(bnOpenDigitizers, SIGNAL(clicked()), this, SLOT(bnOpenDigitizers_clicked()));
|
connect(bnOpenDigitizers, SIGNAL(clicked()), this, SLOT(OpenDigitizers()));
|
||||||
|
|
||||||
bnCloseDigitizers = new QPushButton("Close Digitizers", this);
|
bnCloseDigitizers = new QPushButton("Close Digitizers", this);
|
||||||
bnCloseDigitizers->setEnabled(false);
|
bnCloseDigitizers->setEnabled(false);
|
||||||
connect(bnCloseDigitizers, SIGNAL(clicked()), this, SLOT(bnCloseDigitizers_clicked()));
|
connect(bnCloseDigitizers, SIGNAL(clicked()), this, SLOT(CloseDigitizers()));
|
||||||
|
|
||||||
bnDigiSettings = new QPushButton("Digitizers Settings", this);
|
bnDigiSettings = new QPushButton("Digitizers Settings", this);
|
||||||
bnDigiSettings->setEnabled(false);
|
bnDigiSettings->setEnabled(false);
|
||||||
|
@ -181,15 +181,21 @@ MainWindow::~MainWindow(){
|
||||||
if( digiSetting != NULL ) delete digiSetting;
|
if( digiSetting != NULL ) delete digiSetting;
|
||||||
|
|
||||||
if( digi != NULL ){
|
if( digi != NULL ){
|
||||||
digi->CloseDigitizer();
|
for( int i = 0 ; i < nDigi; i++) {
|
||||||
delete digi;
|
digi[i]->CloseDigitizer();
|
||||||
|
delete digi[i];
|
||||||
|
}
|
||||||
|
delete [] digi;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( readDataThread != NULL){
|
if( readDataThread != NULL){
|
||||||
readDataThread->Stop();
|
for( int i = 0; i < nDigi; i++){
|
||||||
readDataThread->quit();
|
readDataThread[i]->Stop();
|
||||||
readDataThread->wait();
|
readDataThread[i]->quit();
|
||||||
delete readDataThread;
|
readDataThread[i]->wait();
|
||||||
|
delete readDataThread[i];
|
||||||
|
}
|
||||||
|
delete [] readDataThread;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -197,16 +203,19 @@ MainWindow::~MainWindow(){
|
||||||
//^################################################################ ACQ control
|
//^################################################################ ACQ control
|
||||||
void MainWindow::StartACQ(){
|
void MainWindow::StartACQ(){
|
||||||
|
|
||||||
digi->Reset();
|
|
||||||
digi->ProgramPHA(false);
|
|
||||||
digi->SetPHADataFormat(1);// only save 1 trace
|
|
||||||
remove("haha_000.sol"); // remove file
|
|
||||||
digi->OpenOutFile("haha");// haha_000.sol
|
|
||||||
digi->StartACQ();
|
|
||||||
|
|
||||||
LogMsg("Start Run....");
|
LogMsg("Start Run....");
|
||||||
|
for( int i =0 ; i < nDigi; i ++){
|
||||||
|
digi[i]->Reset();
|
||||||
|
digi[i]->ProgramPHA(false);
|
||||||
|
digi[i]->SetPHADataFormat(1);// only save 1 trace
|
||||||
|
|
||||||
readDataThread->start();
|
//TODO :: save file
|
||||||
|
remove("haha_000.sol"); // remove file
|
||||||
|
digi[i]->OpenOutFile("haha");// haha_000.sol
|
||||||
|
digi[i]->StartACQ();
|
||||||
|
|
||||||
|
readDataThread[i]->start();
|
||||||
|
}
|
||||||
|
|
||||||
bnStartACQ->setEnabled(false);
|
bnStartACQ->setEnabled(false);
|
||||||
bnStopACQ->setEnabled(true);
|
bnStopACQ->setEnabled(true);
|
||||||
|
@ -216,80 +225,101 @@ void MainWindow::StartACQ(){
|
||||||
|
|
||||||
void MainWindow::StopACQ(){
|
void MainWindow::StopACQ(){
|
||||||
|
|
||||||
digi->StopACQ();
|
for( int i = 0; i < nDigi; i++){
|
||||||
|
digi[i]->StopACQ();
|
||||||
|
|
||||||
//readDataThread->Stop();
|
//readDataThread->Stop();
|
||||||
|
|
||||||
readDataThread->quit();
|
readDataThread[i]->quit();
|
||||||
readDataThread->wait();
|
readDataThread[i]->wait();
|
||||||
|
digi[i]->CloseOutFile();
|
||||||
|
|
||||||
digi->CloseOutFile();
|
}
|
||||||
|
|
||||||
LogMsg("Stop Run");
|
LogMsg("Stop Run");
|
||||||
|
|
||||||
bnStartACQ->setEnabled(true);
|
bnStartACQ->setEnabled(true);
|
||||||
bnStopACQ->setEnabled(false);
|
bnStopACQ->setEnabled(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//^###################################################################### open and close digitizer
|
||||||
|
void MainWindow::OpenDigitizers(){
|
||||||
|
|
||||||
|
//------- decode IPList
|
||||||
|
|
||||||
|
nDigi = 1;
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::bnOpenDigitizers_clicked(){
|
|
||||||
LogMsg("Opening digitizer.....");
|
LogMsg("Opening digitizer.....");
|
||||||
|
|
||||||
digi = new Digitizer2Gen();
|
digi = new Digitizer2Gen*[nDigi];
|
||||||
|
readDataThread = new ReadDataThread*[nDigi];
|
||||||
|
|
||||||
digi->OpenDigitizer("dig2://192.168.0.100/");
|
for( int i = 0; i < nDigi; i++){
|
||||||
|
|
||||||
if(digi->IsConnected()){
|
printf("=============================== %d/%d\n" , i, nDigi);
|
||||||
|
|
||||||
digiSerialNum.push_back(digi->GetSerialNumber());
|
digi[i] = new Digitizer2Gen();
|
||||||
nDigi ++;
|
digi[i]->OpenDigitizer("dig2://192.168.0.100/");
|
||||||
|
|
||||||
LogMsg("Opened digitizer : " + QString::number(digi->GetSerialNumber()));
|
if(digi[i]->IsConnected()){
|
||||||
bnOpenDigitizers->setEnabled(false);
|
|
||||||
bnOpenDigitizers->setStyleSheet("");
|
|
||||||
bnCloseDigitizers->setEnabled(true);
|
|
||||||
bnDigiSettings->setEnabled(true);
|
|
||||||
bnStartACQ->setEnabled(true);
|
|
||||||
bnStopACQ->setEnabled(false);
|
|
||||||
|
|
||||||
readDataThread = new ReadDataThread(digi, this);
|
digiSerialNum.push_back(digi[i]->GetSerialNumber());
|
||||||
connect(readDataThread, &ReadDataThread::sendMsg, this, &MainWindow::LogMsg);
|
|
||||||
|
|
||||||
}else{
|
LogMsg("Opened digitizer : " + QString::number(digi[i]->GetSerialNumber()));
|
||||||
LogMsg("Cannot open digitizer");
|
bnOpenDigitizers->setEnabled(false);
|
||||||
|
bnOpenDigitizers->setStyleSheet("");
|
||||||
|
bnCloseDigitizers->setEnabled(true);
|
||||||
|
bnDigiSettings->setEnabled(true);
|
||||||
|
bnStartACQ->setEnabled(true);
|
||||||
|
bnStopACQ->setEnabled(false);
|
||||||
|
|
||||||
//LogMsg("use a dummy.");
|
readDataThread[i] = new ReadDataThread(digi[i], this);
|
||||||
//digi->SetDummy();
|
connect(readDataThread[i], &ReadDataThread::sendMsg, this, &MainWindow::LogMsg);
|
||||||
//digiSerialNum.push_back(0000);
|
|
||||||
//nDigi ++;
|
|
||||||
|
|
||||||
delete digi;
|
}else{
|
||||||
|
LogMsg("Cannot open digitizer");
|
||||||
|
|
||||||
|
//LogMsg("use a dummy.");
|
||||||
|
//digi->SetDummy();
|
||||||
|
//digiSerialNum.push_back(0000);
|
||||||
|
//nDigi ++;
|
||||||
|
|
||||||
|
delete digi;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//^###################################################################### open and close digitizer
|
void MainWindow::CloseDigitizers(){
|
||||||
void MainWindow::bnCloseDigitizers_clicked(){
|
|
||||||
if( digi != NULL ){
|
|
||||||
digi->CloseDigitizer();
|
|
||||||
delete digi;
|
|
||||||
digi = NULL;
|
|
||||||
LogMsg("Closed Digitizer : " + QString::number(digiSerialNum[0]));
|
|
||||||
|
|
||||||
nDigi = 0;
|
for( int i = 0; i < nDigi; i++){
|
||||||
digiSerialNum.clear();
|
if( digi[i] != NULL ){
|
||||||
|
digi[i]->CloseDigitizer();
|
||||||
|
delete digi[i];
|
||||||
|
LogMsg("Closed Digitizer : " + QString::number(digiSerialNum[0]));
|
||||||
|
|
||||||
bnOpenDigitizers->setEnabled(true);
|
nDigi = 0;
|
||||||
bnCloseDigitizers->setEnabled(false);
|
digiSerialNum.clear();
|
||||||
bnDigiSettings->setEnabled(false);
|
|
||||||
bnStartACQ->setEnabled(false);
|
|
||||||
bnStopACQ->setEnabled(false);
|
|
||||||
|
|
||||||
if( digiSetting != NULL ) digiSetting->close();
|
bnOpenDigitizers->setEnabled(true);
|
||||||
|
bnCloseDigitizers->setEnabled(false);
|
||||||
|
bnDigiSettings->setEnabled(false);
|
||||||
|
bnStartACQ->setEnabled(false);
|
||||||
|
bnStopACQ->setEnabled(false);
|
||||||
|
|
||||||
|
if( digiSetting != NULL ) digiSetting->close();
|
||||||
|
|
||||||
|
readDataThread[i]->Stop();
|
||||||
|
readDataThread[i]->quit();
|
||||||
|
readDataThread[i]->wait();
|
||||||
|
delete readDataThread[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
delete [] digi;
|
||||||
|
delete [] readDataThread;
|
||||||
|
digi = NULL;
|
||||||
|
readDataThread = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::OpenDigitizersSettings(){
|
void MainWindow::OpenDigitizersSettings(){
|
||||||
|
@ -336,8 +366,8 @@ void MainWindow::ProgramSettings(){
|
||||||
helpInfo->appendHtml("<p></p>");
|
helpInfo->appendHtml("<p></p>");
|
||||||
helpInfo->appendHtml("These 2 paths will be used when <font style=\"color : blue;\"> New/Change/Reload Exp </font>");
|
helpInfo->appendHtml("These 2 paths will be used when <font style=\"color : blue;\"> New/Change/Reload Exp </font>");
|
||||||
helpInfo->appendHtml("<p></p>");
|
helpInfo->appendHtml("<p></p>");
|
||||||
helpInfo->appendHtml("<font style=\"color : blue;\"> Digitizers IP Domain </font> is the frist 6 \
|
helpInfo->appendHtml("<font style=\"color : blue;\"> Digitizers IP List </font> is the list of IP \
|
||||||
digi of the digitizers IP. The program will search for all digitizers under this domain.");
|
digi of the digitizers IP. e.g. 192.168.0.100,102 for 2 digitizers, or 192.168.0.100-102 for 3 digitizers.");
|
||||||
helpInfo->appendHtml("<p></p>");
|
helpInfo->appendHtml("<p></p>");
|
||||||
helpInfo->appendHtml("<font style=\"color : blue;\"> Database IP </font> or <font style=\"color : blue;\"> Elog IP </font> can be empty. In that case, no database and elog will be used.");
|
helpInfo->appendHtml("<font style=\"color : blue;\"> Database IP </font> or <font style=\"color : blue;\"> Elog IP </font> can be empty. In that case, no database and elog will be used.");
|
||||||
|
|
||||||
|
@ -376,10 +406,10 @@ void MainWindow::ProgramSettings(){
|
||||||
|
|
||||||
//-------- IP Domain
|
//-------- IP Domain
|
||||||
rowID ++;
|
rowID ++;
|
||||||
QLabel *lbIPDomain = new QLabel("Digitizers IP Domain", &dialog);
|
QLabel *lbIPDomain = new QLabel("Digitizers IP List", &dialog);
|
||||||
lbIPDomain->setAlignment(Qt::AlignRight | Qt::AlignCenter);
|
lbIPDomain->setAlignment(Qt::AlignRight | Qt::AlignCenter);
|
||||||
layout->addWidget(lbIPDomain, rowID, 0);
|
layout->addWidget(lbIPDomain, rowID, 0);
|
||||||
lIPDomain = new QLineEdit("192.168.0", &dialog); layout->addWidget(lIPDomain, rowID, 1, 1, 2);
|
lIPDomain = new QLineEdit("192.168.0.100", &dialog); layout->addWidget(lIPDomain, rowID, 1, 1, 2);
|
||||||
//-------- DataBase IP
|
//-------- DataBase IP
|
||||||
rowID ++;
|
rowID ++;
|
||||||
QLabel *lbDatbaseIP = new QLabel("Database IP", &dialog);
|
QLabel *lbDatbaseIP = new QLabel("Database IP", &dialog);
|
||||||
|
@ -459,7 +489,7 @@ bool MainWindow::OpenProgramSettings(){
|
||||||
case 0 : settingFilePath = line; break;
|
case 0 : settingFilePath = line; break;
|
||||||
case 1 : analysisPath = line; break;
|
case 1 : analysisPath = line; break;
|
||||||
case 2 : dataPath = line; break;
|
case 2 : dataPath = line; break;
|
||||||
case 3 : IPDomain = line; break;
|
case 3 : IPList = line; break;
|
||||||
case 4 : DatabaseIP = line; break;
|
case 4 : DatabaseIP = line; break;
|
||||||
case 5 : DatabaseName = line; break;
|
case 5 : DatabaseName = line; break;
|
||||||
case 6 : ElogIP = line; break;
|
case 6 : ElogIP = line; break;
|
||||||
|
@ -474,7 +504,7 @@ bool MainWindow::OpenProgramSettings(){
|
||||||
LogMsg("Setting File Path : " + settingFilePath);
|
LogMsg("Setting File Path : " + settingFilePath);
|
||||||
LogMsg(" Analysis Path : " + analysisPath);
|
LogMsg(" Analysis Path : " + analysisPath);
|
||||||
LogMsg(" Data Path : " + dataPath);
|
LogMsg(" Data Path : " + dataPath);
|
||||||
LogMsg(" Digi. IP Domain : " + IPDomain);
|
LogMsg(" Digi. IP Domain : " + IPList);
|
||||||
LogMsg(" Database IP : " + DatabaseIP);
|
LogMsg(" Database IP : " + DatabaseIP);
|
||||||
LogMsg(" Database Name : " + DatabaseName);
|
LogMsg(" Database Name : " + DatabaseName);
|
||||||
LogMsg(" ElogIP : " + ElogIP);
|
LogMsg(" ElogIP : " + ElogIP);
|
||||||
|
@ -503,7 +533,7 @@ bool MainWindow::OpenProgramSettings(){
|
||||||
|
|
||||||
void MainWindow::SaveProgramSettings(){
|
void MainWindow::SaveProgramSettings(){
|
||||||
|
|
||||||
IPDomain = lIPDomain->text();
|
IPList = lIPDomain->text();
|
||||||
DatabaseIP = lDatbaseIP->text();
|
DatabaseIP = lDatbaseIP->text();
|
||||||
DatabaseName = lDatbaseName->text();
|
DatabaseName = lDatbaseName->text();
|
||||||
ElogIP = lElogIP->text();
|
ElogIP = lElogIP->text();
|
||||||
|
@ -519,7 +549,7 @@ void MainWindow::SaveProgramSettings(){
|
||||||
file.write((settingFilePath+"\n").toStdString().c_str());
|
file.write((settingFilePath+"\n").toStdString().c_str());
|
||||||
file.write((analysisPath+"\n").toStdString().c_str());
|
file.write((analysisPath+"\n").toStdString().c_str());
|
||||||
file.write((dataPath+"\n").toStdString().c_str());
|
file.write((dataPath+"\n").toStdString().c_str());
|
||||||
file.write((IPDomain+"\n").toStdString().c_str());
|
file.write((IPList+"\n").toStdString().c_str());
|
||||||
file.write((DatabaseIP+"\n").toStdString().c_str());
|
file.write((DatabaseIP+"\n").toStdString().c_str());
|
||||||
file.write((DatabaseName+"\n").toStdString().c_str());
|
file.write((DatabaseName+"\n").toStdString().c_str());
|
||||||
file.write((ElogIP+"\n").toStdString().c_str());
|
file.write((ElogIP+"\n").toStdString().c_str());
|
||||||
|
|
10
mainwindow.h
10
mainwindow.h
|
@ -94,8 +94,8 @@ public:
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void bnOpenDigitizers_clicked();
|
void OpenDigitizers();
|
||||||
void bnCloseDigitizers_clicked();
|
void CloseDigitizers();
|
||||||
|
|
||||||
void OpenDigitizersSettings();
|
void OpenDigitizersSettings();
|
||||||
|
|
||||||
|
@ -133,14 +133,14 @@ private:
|
||||||
|
|
||||||
QPlainTextEdit * logInfo;
|
QPlainTextEdit * logInfo;
|
||||||
|
|
||||||
static Digitizer2Gen * digi;
|
static Digitizer2Gen ** digi;
|
||||||
unsigned short nDigi;
|
unsigned short nDigi;
|
||||||
std::vector<unsigned short> digiSerialNum;
|
std::vector<unsigned short> digiSerialNum;
|
||||||
|
|
||||||
void StartACQ();
|
void StartACQ();
|
||||||
void StopACQ();
|
void StopACQ();
|
||||||
|
|
||||||
ReadDataThread * readDataThread;
|
ReadDataThread ** readDataThread;
|
||||||
|
|
||||||
void LogMsg(QString msg);
|
void LogMsg(QString msg);
|
||||||
bool logMsgHTMLMode = true;
|
bool logMsgHTMLMode = true;
|
||||||
|
@ -158,7 +158,7 @@ private:
|
||||||
QString settingFilePath;
|
QString settingFilePath;
|
||||||
QString analysisPath;
|
QString analysisPath;
|
||||||
QString dataPath;
|
QString dataPath;
|
||||||
QString IPDomain;
|
QString IPList;
|
||||||
QString DatabaseIP;
|
QString DatabaseIP;
|
||||||
QString DatabaseName;
|
QString DatabaseName;
|
||||||
QString ElogIP;
|
QString ElogIP;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user