added Sync Helper

This commit is contained in:
Ryan Tang 2023-09-18 12:52:15 -04:00
parent eda5aeb36d
commit 38525125c4
3 changed files with 32 additions and 15 deletions

View File

@ -61,7 +61,7 @@ QStringList chToolTip = { "Channel signal delay initialization status (1 = initi
DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi, QString analysisPath, QWidget * parent) : QWidget(parent){
setWindowTitle("Digitizers Settings");
setGeometry(0, 0, 1850, 1000);
setGeometry(0, 0, 1850, 1050);
//setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
this->digi = digi;
@ -74,7 +74,6 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
ID = 0;
enableSignalSlot = false;
QVBoxLayout * mainLayout = new QVBoxLayout(this); this->setLayout(mainLayout);
tabWidget = new QTabWidget(this); mainLayout->addWidget(tabWidget);
@ -89,11 +88,10 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
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);
QHBoxLayout * tabLayout_H = new QHBoxLayout(tab);
QVBoxLayout * tabLayout_V1 = new QVBoxLayout(); tabLayout_H->addLayout(tabLayout_V1);
QVBoxLayout * tabLayout_V2 = new QVBoxLayout(); tabLayout_H->addLayout(tabLayout_V2);
{//^====================== Group of Digitizer Info
QGroupBox * infoBox = new QGroupBox("Board Info", tab);
//infoBox->setSizePolicy(sizePolicy);

View File

@ -805,27 +805,45 @@ void MainWindow::OpenSyncHelper(){
QVBoxLayout * layout = new QVBoxLayout(&dialog);
QPushButton * bnNoSync = new QPushButton("No Sync", &dialog);
QPushButton * bnMethod1 = new QPushButton("Software TRG-OUT --> TRG-IN ", &dialog);
QPushButton * bnMethod2 = new QPushButton("Software TRG-OUT --> S-IN ", &dialog);
QPushButton * bnMethod3 = new QPushButton("External TRG-OUT --> S-IN ", &dialog);
QPushButton * bnMethod1 = new QPushButton("Software CLK-OUT --> CLK-IN\n(Master = 1st Digi)", &dialog);
layout->addWidget( bnNoSync, 1);
layout->addWidget(bnMethod1, 2);
layout->addWidget(bnMethod2, 3);
layout->addWidget(bnMethod3, 4);
bnNoSync->setFixedHeight(40);
bnMethod1->setFixedHeight(40);
bnMethod2->setFixedHeight(40);
bnMethod3->setFixedHeight(40);
connect(bnNoSync, &QPushButton::clicked, [&](){
for(unsigned int i = 0; i < nDigi; i++){
digi[i]->WriteValue(PHA::DIG::ClockSource, "Internal");
digi[i]->WriteValue(PHA::DIG::StartSource, "SWcmd");
digi[i]->WriteValue(PHA::DIG::SyncOutMode, "Disabled");
}
if( digiSetting ) digiSetting->UpdatePanelFromMemory();
dialog.accept();
});
connect(bnMethod1, &QPushButton::clicked, [&](){
digi[0]->WriteValue(PHA::DIG::ClockSource, "Internal");
digi[0]->WriteValue(PHA::DIG::EnableClockOutFrontPanel, "True");
digi[0]->WriteValue(PHA::DIG::StartSource, "SWcmd");
digi[0]->WriteValue(PHA::DIG::SyncOutMode, "Run");
for(unsigned int i = 1; i < nDigi; i++){
digi[i]->WriteValue(PHA::DIG::ClockSource, "FPClkIn");
digi[i]->WriteValue(PHA::DIG::EnableClockOutFrontPanel, "True");
digi[i]->WriteValue(PHA::DIG::StartSource, "EncodedClkIn");
digi[i]->WriteValue(PHA::DIG::SyncOutMode, "SyncIn");
}
if( digiSetting ) digiSetting->UpdatePanelFromMemory();
dialog.accept();
});
dialog.exec();
}

View File

@ -446,6 +446,7 @@ void Scope::StartScope(){
ReadScopeSettings();
digi[iDigi]->WriteValue(PHA::CH::WaveSaving, "Always", -1);
digi[iDigi]->WriteValue(PHA::CH::ChannelEnable, "False", -1);
digi[iDigi]->WriteValue(PHA::CH::ChannelEnable, "True", ch);
digi[iDigi]->SetPHADataFormat(0);