fixed VGA setting crash; remove unless buttons in the main panel

This commit is contained in:
Ryan Tang 2024-04-08 13:42:13 -04:00
parent 79a8fc548b
commit c921d75620
2 changed files with 17 additions and 10 deletions

View File

@ -609,7 +609,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
vgaLayout->setAlignment(Qt::AlignTop| Qt::AlignLeft); vgaLayout->setAlignment(Qt::AlignTop| Qt::AlignLeft);
for( int k = 0; k < 4; k ++){ for( int k = 0; k < 4; k ++){
SetupSpinBox(VGA[iDigi][k], PHA::VGA::VGAGain, -1, false, "VGA-" + QString::number(k) + " [dB] :", vgaLayout, k, 0); SetupSpinBox(VGA[iDigi][k], PHA::VGA::VGAGain, k, false, "VGA-" + QString::number(k) + " [dB] :", vgaLayout, k, 0);
VGA[iDigi][k]->setSingleStep(0.5); VGA[iDigi][k]->setSingleStep(0.5);
VGA[iDigi][k]->setFixedWidth(100); VGA[iDigi][k]->setFixedWidth(100);
VGA[iDigi][k]->SetToolTip(); VGA[iDigi][k]->SetToolTip();

View File

@ -121,14 +121,14 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
bnSyncHelper->setEnabled(false); bnSyncHelper->setEnabled(false);
connect(bnSyncHelper, &QPushButton::clicked, this, &MainWindow::OpenSyncHelper); connect(bnSyncHelper, &QPushButton::clicked, this, &MainWindow::OpenSyncHelper);
QPushButton * bnEventBuilder = new QPushButton("Event Builder", this); // QPushButton * bnEventBuilder = new QPushButton("Event Builder", this);
bnEventBuilder->setEnabled(false); // bnEventBuilder->setEnabled(false);
QPushButton * bnHVController = new QPushButton("HV Controller", this); // QPushButton * bnHVController = new QPushButton("HV Controller", this);
bnHVController->setEnabled(false); // bnHVController->setEnabled(false);
QPushButton * bnTargetFanController = new QPushButton("Target Fan", this); // QPushButton * bnTargetFanController = new QPushButton("Target Fan", this);
bnTargetFanController->setEnabled(false); // bnTargetFanController->setEnabled(false);
layout1->addWidget(bnProgramSettings, 0, 0); layout1->addWidget(bnProgramSettings, 0, 0);
layout1->addWidget(bnNewExp, 0, 1); layout1->addWidget(bnNewExp, 0, 1);
@ -143,9 +143,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
layout1->addWidget(bnDigiSettings, 2, 1); layout1->addWidget(bnDigiSettings, 2, 1);
layout1->addWidget(bnSOLSettings, 2, 2, 1, 2); layout1->addWidget(bnSOLSettings, 2, 2, 1, 2);
layout1->addWidget(bnEventBuilder, 3, 0); // layout1->addWidget(bnEventBuilder, 3, 0);
layout1->addWidget(bnHVController, 3, 1); // layout1->addWidget(bnHVController, 3, 1);
layout1->addWidget(bnTargetFanController, 3, 2, 1, 2); // layout1->addWidget(bnTargetFanController, 3, 2, 1, 2);
layout1->setColumnStretch(0, 2); layout1->setColumnStretch(0, 2);
layout1->setColumnStretch(1, 2); layout1->setColumnStretch(1, 2);
@ -430,6 +430,12 @@ int MainWindow::StartACQ(){
int dataFormatID = cbDataFormat->currentData().toInt(); int dataFormatID = cbDataFormat->currentData().toInt();
digi[i]->SetDataFormat(dataFormatID); digi[i]->SetDataFormat(dataFormatID);
if( dataFormatID == DataFormat::ALL || dataFormatID == DataFormat::OneTrace ){
digi[i]->WriteValue(PHA::CH::WaveSaving, "Always", -1);
}else{
digi[i]->WriteValue(PHA::CH::WaveSaving, "OnRequest", -1);
}
//Additional settings, it is better user to control //Additional settings, it is better user to control
//if( cbDataFormat->currentIndex() < 2 ) { //if( cbDataFormat->currentIndex() < 2 ) {
// digi[i]->WriteValue("/ch/0..63/par/WaveAnalogProbe0", "ADCInput"); // digi[i]->WriteValue("/ch/0..63/par/WaveAnalogProbe0", "ADCInput");
@ -540,6 +546,7 @@ void MainWindow::StopACQ(){
if( digi[i]->IsDummy () ) continue; if( digi[i]->IsDummy () ) continue;
digi[i]->StopACQ(); digi[i]->StopACQ();
readDataThread[i]->SuppressFileSizeMsg(); readDataThread[i]->SuppressFileSizeMsg();
digi[i]->WriteValue(PHA::CH::WaveSaving, "OnRequest", -1);
} }
isACQRunning = false; isACQRunning = false;
lbScalarACQStatus->setText("<font style=\"color: red;\"><b>ACQ Off</b></font>"); lbScalarACQStatus->setText("<font style=\"color: red;\"><b>ACQ Off</b></font>");