Compare commits
No commits in common. "8a662c3407eca3f4c5294529e9707665996660b8" and "38c4d0d992aaa85d4dbb74e13e9dbb09f22ea22a" have entirely different histories.
8a662c3407
...
38c4d0d992
|
@ -37,6 +37,25 @@ Canvas::Canvas(Digitizer ** digi, unsigned int nDigi, QMainWindow * parent) : QM
|
|||
}
|
||||
});
|
||||
|
||||
QPushButton * bnAddRandom = new QPushButton("Add Random", this);
|
||||
ctrlLayout->addWidget(bnAddRandom, 0, 1);
|
||||
connect(bnAddRandom, &QPushButton::clicked, this, [=](){
|
||||
|
||||
double mean = 2000.0; // Mean of the distribution
|
||||
double standardDeviation = 1000.0; // Standard deviation of the distribution
|
||||
|
||||
double randomNumber = QRandomGenerator::global()->generateDouble(); // Generate a random number between 0 and 1
|
||||
double gaussianNumber = qSqrt(-2 * qLn(randomNumber)) * qCos(2 * M_PI * randomNumber); // Transform the number to follow a Gaussian distribution
|
||||
|
||||
// Scale and shift the number to match the desired mean and standard deviation
|
||||
gaussianNumber = (gaussianNumber * standardDeviation) + mean;
|
||||
|
||||
int bd = cbDigi->currentIndex();
|
||||
int ch = cbCh->currentIndex();
|
||||
|
||||
hist[bd][ch]->Fill(gaussianNumber);
|
||||
});
|
||||
|
||||
cbDigi = new RComboBox(this);
|
||||
for( unsigned int i = 0; i < nDigi; i++) cbDigi->addItem("Digi-" + QString::number( digi[i]->GetSerialNumber() ), i);
|
||||
ctrlLayout->addWidget(cbDigi, 1, 0);
|
||||
|
@ -69,6 +88,7 @@ Canvas::Canvas(Digitizer ** digi, unsigned int nDigi, QMainWindow * parent) : QM
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
histLayout->addWidget(histView[0][0], 0, 0);
|
||||
oldBd = -1;
|
||||
oldCh = -1;
|
||||
|
|
|
@ -18,70 +18,47 @@ public:
|
|||
this->ID = digiID;
|
||||
isSaveData = false;
|
||||
isScope = false;
|
||||
readCount = 0;
|
||||
stop = false;
|
||||
}
|
||||
void Stop() { this->stop = true;}
|
||||
void SetSaveData(bool onOff) {this->isSaveData = onOff;}
|
||||
void SetScopeMode(bool onOff) {this->isScope = onOff;}
|
||||
void run(){
|
||||
clock_gettime(CLOCK_REALTIME, &ta);
|
||||
// clock_gettime(CLOCK_REALTIME, &t1);
|
||||
stop = false;
|
||||
do{
|
||||
|
||||
if( stop) break;
|
||||
|
||||
while(true){
|
||||
digiMTX[ID].lock();
|
||||
int ret = digi->ReadData();
|
||||
digiMTX[ID].unlock();
|
||||
readCount ++;
|
||||
|
||||
if( stop) break;
|
||||
if( ret == CAEN_DGTZ_Success && !stop){
|
||||
if( ret == CAEN_DGTZ_Success ){
|
||||
digiMTX[ID].lock();
|
||||
digi->GetData()->DecodeBuffer(!isScope, 0);
|
||||
digi->GetData()->DecodeBuffer(!isScope);
|
||||
if( isSaveData ) digi->GetData()->SaveData();
|
||||
digiMTX[ID].unlock();
|
||||
|
||||
// clock_gettime(CLOCK_REALTIME, &t2);
|
||||
// if( t2.tv_sec - t1.tv_sec > 2 ) {
|
||||
// printf("----Digi-%d read %ld / sec.\n", ID, readCount / 2);
|
||||
// readCount = 0;
|
||||
// t1 = t2;
|
||||
// }
|
||||
|
||||
}else{
|
||||
printf("ReadDataThread::%s------------ ret : %d \n", __func__, ret);
|
||||
digiMTX[ID].lock();
|
||||
digi->StopACQ();
|
||||
digiMTX[ID].unlock();
|
||||
break;
|
||||
}
|
||||
|
||||
if( isSaveData && !stop ) {
|
||||
if( isSaveData ) {
|
||||
clock_gettime(CLOCK_REALTIME, &tb);
|
||||
if( tb.tv_sec - ta.tv_sec > 2 ) {
|
||||
digiMTX[ID].lock();
|
||||
emit sendMsg("FileSize ("+ QString::number(digi->GetSerialNumber()) +"): " + QString::number(digi->GetData()->GetTotalFileSize()/1024./1024., 'f', 4) + " MB");
|
||||
digiMTX[ID].unlock();
|
||||
emit sendMsg("FileSize ("+ QString::number(digi->GetSerialNumber()) +"): " + QString::number(digi->GetData()->GetTotalFileSize()/1024./1024.) + " MB");
|
||||
ta = tb;
|
||||
}
|
||||
}
|
||||
|
||||
}while(!stop);
|
||||
|
||||
}
|
||||
printf("ReadDataThread stopped.\n");
|
||||
}
|
||||
signals:
|
||||
void sendMsg(const QString &msg);
|
||||
private:
|
||||
Digitizer * digi;
|
||||
bool stop;
|
||||
int ID;
|
||||
timespec ta, tb, t1, t2;
|
||||
timespec ta, tb;
|
||||
bool isSaveData;
|
||||
bool isScope;
|
||||
unsigned long readCount;
|
||||
};
|
||||
|
||||
//^#======================================================= Timing Thread
|
||||
|
|
|
@ -174,7 +174,6 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer ** digi, unsigned int nDigi, QStr
|
|||
leSaveFilePath[iDigi] = new QLineEdit(this);
|
||||
leSaveFilePath[iDigi]->setReadOnly(true);
|
||||
buttonLayout->addWidget(leSaveFilePath[iDigi], rowID, 1, 1, 3);
|
||||
leSaveFilePath[iDigi]->setText(QString::fromStdString(digi[ID]->GetSettingFileName()));
|
||||
|
||||
rowID ++; //---------------------------
|
||||
bnRefreshSetting = new QPushButton("Refresh Settings", this);
|
||||
|
@ -396,14 +395,6 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer ** digi, unsigned int nDigi, QStr
|
|||
});
|
||||
|
||||
cbBdReg->currentIndexChanged(0);
|
||||
|
||||
connect(cbCh, &RComboBox::currentIndexChanged, this, [=](int index){
|
||||
if( !enableSignalSlot ) return;
|
||||
int regIndex = cbChReg->currentIndex();
|
||||
|
||||
uint32_t value = digi[ cbDigi->currentIndex() ] ->ReadRegister(chRegList[regIndex], cbCh->currentIndex(), index);
|
||||
leChRegValue->setText( "0x" + QString::number(value, 16).toUpper());
|
||||
});
|
||||
|
||||
connect(cbChReg, &RComboBox::currentIndexChanged, this, [=](int index){
|
||||
if( !enableSignalSlot ) return;
|
||||
|
@ -466,8 +457,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer ** digi, unsigned int nDigi, QStr
|
|||
uint32_t value = std::stoul(text.toStdString(), nullptr, 16);
|
||||
int index = cbDigi->currentIndex();
|
||||
int regID = cbChReg->currentIndex();
|
||||
int ch = cbCh->currentIndex();
|
||||
digi[index]->WriteRegister(chRegList[regID], value, ch);
|
||||
digi[index]->WriteRegister(chRegList[regID], value);
|
||||
leChRegSet->setStyleSheet("");
|
||||
|
||||
cbChReg->currentIndexChanged(regID);
|
||||
|
@ -1211,9 +1201,6 @@ void DigiSettingsPanel::SetUpChannelMask(){
|
|||
bnChEnableMask[ID][i]->setStyleSheet("");
|
||||
digi[ID]->SetBits(DPP::ChannelEnableMask, {1, i}, 0, i);
|
||||
}
|
||||
|
||||
if( digi[ID]->GetDPPType() == V1730_DPP_PHA_CODE ) UpdatePHASetting();
|
||||
if( digi[ID]->GetDPPType() == V1730_DPP_PSD_CODE ) UpdatePSDSetting();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -2105,10 +2092,10 @@ void DigiSettingsPanel::SetUpPSDChannel(){
|
|||
QLabel * lb4 = new QLabel("Local Trig. Valid. [G]", this); lb4->setAlignment(Qt::AlignHCenter); tabLayout->addWidget(lb4, 0, 9);
|
||||
}
|
||||
SetUpCheckBox(chkDisableSelfTrigger[ID][ch], "Disable Self Trigger", tabLayout, ch + 1, 1, DPP::DPPAlgorithmControl, DPP::Bit_DPPAlgorithmControl_PHA::DisableSelfTrigger, ch);
|
||||
SetUpSpinBox(sbThreshold[ID][ch], "", tabLayout, ch + 1, 2, DPP::PSD::TriggerThreshold, ch);
|
||||
SetUpSpinBox(sbThreshold[ID][ch], "", tabLayout, ch + 1, 2, DPP::PHA::TriggerThreshold, ch);
|
||||
SetUpComboBoxBit(cbTrigMode[ID][ch], "", tabLayout, ch + 1, 4, DPP::Bit_DPPAlgorithmControl_PHA::ListTrigMode, DPP::DPPAlgorithmControl, DPP::Bit_DPPAlgorithmControl_PHA::TriggerMode, 1, ch);
|
||||
SetUpSpinBox(sbTriggerHoldOff[ID][ch], "", tabLayout, ch + 1, 6, DPP::PSD::TriggerHoldOffWidth, ch);
|
||||
SetUpComboBoxBit(cbLocalTriggerValid[ID][ch], "", tabLayout, ch + 1, 8, DPP::PSD::Bit_DPPAlgorithmControl2::ListLocalTrigValidMode, DPP::PHA::DPPAlgorithmControl2_G, DPP::PHA::Bit_DPPAlgorithmControl2::LocalTrigValidMode, 1, ch);
|
||||
SetUpSpinBox(sbTriggerHoldOff[ID][ch], "", tabLayout, ch + 1, 6, DPP::PHA::TriggerHoldOffWidth, ch);
|
||||
SetUpComboBoxBit(cbLocalTriggerValid[ID][ch], "", tabLayout, ch + 1, 8, DPP::PHA::Bit_DPPAlgorithmControl2::ListLocalTrigValidMode, DPP::PHA::DPPAlgorithmControl2_G, DPP::PHA::Bit_DPPAlgorithmControl2::LocalTrigValidMode, 1, ch);
|
||||
}
|
||||
|
||||
if( i == 1 ){
|
||||
|
@ -2118,8 +2105,9 @@ void DigiSettingsPanel::SetUpPSDChannel(){
|
|||
QLabel * lb1 = new QLabel("Trig. Counter Flag [G]", this); lb1->setAlignment(Qt::AlignHCenter); tabLayout->addWidget(lb1, 0, 6);
|
||||
}
|
||||
SetUpSpinBox(sbShapedTrigWidth[ID][ch], "", tabLayout, ch + 1, 1, DPP::PSD::ShapedTriggerWidth, ch);
|
||||
SetUpComboBoxBit(cbLocalShapedTrigger[ID][ch], "", tabLayout, ch + 1, 3, DPP::PSD::Bit_DPPAlgorithmControl2::ListLocalShapeTrigMode, DPP::PHA::DPPAlgorithmControl2_G, DPP::PHA::Bit_DPPAlgorithmControl2::LocalShapeTriggerMode, 1, ch);
|
||||
SetUpComboBoxBit(cbTrigCount[ID][ch], "", tabLayout, ch + 1, 5, DPP::PSD::Bit_DPPAlgorithmControl2::ListTrigCounter, DPP::PHA::DPPAlgorithmControl2_G, DPP::PHA::Bit_DPPAlgorithmControl2::TriggerCounterFlag, 1, ch);
|
||||
SetUpComboBoxBit(cbLocalShapedTrigger[ID][ch], "", tabLayout, ch + 1, 3, DPP::PHA::Bit_DPPAlgorithmControl2::ListLocalShapeTrigMode, DPP::PHA::DPPAlgorithmControl2_G, DPP::PHA::Bit_DPPAlgorithmControl2::LocalShapeTriggerMode, 1, ch);
|
||||
SetUpComboBoxBit(cbTrigCount[ID][ch], "", tabLayout, ch + 1, 5, DPP::PHA::Bit_DPPAlgorithmControl2::ListTrigCounter, DPP::PHA::DPPAlgorithmControl2_G, DPP::PHA::Bit_DPPAlgorithmControl2::TriggerCounterFlag, 1, ch);
|
||||
|
||||
}
|
||||
|
||||
if( i == 2 ){
|
||||
|
@ -2382,6 +2370,8 @@ void DigiSettingsPanel::UpdatePanelFromMemory(){
|
|||
chkTraceRecording[ID]->setChecked( Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::RecordTrace) );
|
||||
chkEnableExtra2[ID]->setChecked( Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::EnableExtra2) );
|
||||
|
||||
|
||||
|
||||
if( digi[ID]->GetDPPType() == V1730_DPP_PHA_CODE ) {
|
||||
chkDecimateTrace[ID]->setChecked( Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DecimateTrace) );
|
||||
chkDualTrace[ID]->setChecked( Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DualTrace) );
|
||||
|
@ -2563,6 +2553,8 @@ void DigiSettingsPanel::UpdatePanelFromMemory(){
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( digi[ID]->GetDPPType() == V1730_DPP_PHA_CODE ) UpdatePHASetting();
|
||||
if( digi[ID]->GetDPPType() == V1730_DPP_PSD_CODE ) UpdatePSDSetting();
|
||||
|
||||
|
@ -2640,8 +2632,6 @@ void DigiSettingsPanel::SyncSpinBox(RSpinBox *(&spb)[][MaxNChannels+1]){
|
|||
const int value = spb[ID][0]->value();
|
||||
for( int i = 1; i < nCh; i ++){
|
||||
if( spb[ID][i]->value() == value ) count++;
|
||||
|
||||
spb[ID][i]->setEnabled(bnChEnableMask[ID][i]->styleSheet() == "" ? false : true );
|
||||
}
|
||||
|
||||
//printf("%d =? %d , %d, %f\n", count, nCh, value, spb[ID][0]->value());
|
||||
|
@ -2673,7 +2663,6 @@ void DigiSettingsPanel::SyncComboBox(RComboBox *(&cb)[][MaxNChannels+1]){
|
|||
const QString text = cb[ID][0]->currentText();
|
||||
for( int i = 1; i < nCh; i ++){
|
||||
if( cb[ID][i]->currentText() == text ) count++;
|
||||
cb[ID][i]->setEnabled(bnChEnableMask[ID][i]->styleSheet() == "" ? false : true );
|
||||
}
|
||||
|
||||
//printf("%d =? %d , %s\n", count, nCh, text.toStdString().c_str());
|
||||
|
@ -2702,7 +2691,6 @@ void DigiSettingsPanel::SyncCheckBox(QCheckBox *(&chk)[][MaxNChannels+1]){
|
|||
const Qt::CheckState state = chk[ID][0]->checkState();
|
||||
for( int i = 1; i < nCh; i ++){
|
||||
if( chk[ID][i]->checkState() == state ) count++;
|
||||
chk[ID][i]->setEnabled(bnChEnableMask[ID][i]->styleSheet() == "" ? false : true );
|
||||
}
|
||||
|
||||
//printf("%d =? %d , %s\n", count, nCh, text.toStdString().c_str());
|
||||
|
@ -2765,7 +2753,7 @@ void DigiSettingsPanel::UpdatePHASetting(){
|
|||
|
||||
enableSignalSlot = false;
|
||||
|
||||
//printf("------ %s \n", __func__);
|
||||
printf("------ %s \n", __func__);
|
||||
|
||||
for( int ch = 0; ch < digi[ID]->GetNChannels(); ch ++){
|
||||
UpdateSpinBox(sbRecordLength[ID][ch], DPP::RecordLength_G, ch);
|
||||
|
@ -2817,9 +2805,9 @@ void DigiSettingsPanel::UpdatePHASetting(){
|
|||
uint32_t vetoBit = digi[ID]->GetSettingFromMemory(DPP::VetoWidth, ch);
|
||||
|
||||
UpdateComboBoxBit(cbVetoStep[ID][ch], vetoBit, DPP::Bit_VetoWidth::VetoStep);
|
||||
|
||||
}
|
||||
|
||||
|
||||
enableSignalSlot = true;
|
||||
|
||||
SyncAllChannelsTab_PHA();
|
||||
|
@ -2888,7 +2876,7 @@ void DigiSettingsPanel::UpdatePSDSetting(){
|
|||
|
||||
enableSignalSlot = false;
|
||||
|
||||
//printf("------ %s \n", __func__);
|
||||
printf("------ %s \n", __func__);
|
||||
|
||||
for(int ch = 0; ch < digi[ID]->GetNChannels(); ch ++){
|
||||
|
||||
|
|
38
FSUDAQ.cpp
38
FSUDAQ.cpp
|
@ -51,7 +51,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
|
|||
layout->addWidget(bnDigiSettings, 1, 1);
|
||||
connect(bnDigiSettings, &QPushButton::clicked, this, &MainWindow::OpenDigiSettings);
|
||||
|
||||
bnCanvas = new QPushButton("Online 1D Histograms", this);
|
||||
bnCanvas = new QPushButton("Online Histograms", this);
|
||||
layout->addWidget(bnCanvas, 2, 0);
|
||||
connect(bnCanvas, &QPushButton::clicked, this, &MainWindow::OpenCanvas);
|
||||
|
||||
|
@ -599,15 +599,13 @@ void MainWindow::UpdateScalar(){
|
|||
|
||||
lbLastUpdateTime->setText("Last update: " + QDateTime::currentDateTime().toString("MM.dd hh:mm:ss"));
|
||||
|
||||
//printf("----------------------\n");
|
||||
for( unsigned int iDigi = 0; iDigi < nDigi; iDigi++){
|
||||
digiMTX[iDigi].lock();
|
||||
Data * data = digi[iDigi]->GetData();
|
||||
|
||||
for( int i = 0; i < digi[iDigi]->GetNChannels(); i++){
|
||||
//printf(" %3d %2d | %7.2f %7.2f \n", digi[iDigi]->GetSerialNumber(), i, digi[iDigi]->GetData()->TriggerRate[i], digi[iDigi]->GetData()->NonPileUpRate[i]);
|
||||
leTrigger[iDigi][i]->setText(QString::number(digi[iDigi]->GetData()->TriggerRate[i], 'f', 2));
|
||||
leAccept[iDigi][i]->setText(QString::number(digi[iDigi]->GetData()->NonPileUpRate[i], 'f', 2));
|
||||
leTrigger[iDigi][i]->setText(QString::number(data->TriggerRate[i]));
|
||||
leAccept[iDigi][i]->setText(QString::number(data->NonPileUpRate[i]));
|
||||
}
|
||||
digiMTX[iDigi].unlock();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -623,9 +621,9 @@ void MainWindow::StartACQ(){
|
|||
if( commentResult == false) return;
|
||||
|
||||
if( chkSaveData->isChecked() ) {
|
||||
LogMsg("<font style=\"color: orange;\">===================== <b>Start a new Run-" + QString::number(runID) + "</b></font>");
|
||||
LogMsg("===================== Start a new Run-" + QString::number(runID));
|
||||
}else{
|
||||
LogMsg("<font style=\"color: orange;\">===================== <b>Start a non-save Run</b></font>");
|
||||
LogMsg("===================== Start a non-save Run");
|
||||
}
|
||||
|
||||
for( unsigned int i = 0; i < nDigi ; i++){
|
||||
|
@ -641,7 +639,6 @@ void MainWindow::StartACQ(){
|
|||
readDataThread[i]->start();
|
||||
}
|
||||
if( chkSaveData->isChecked() ) SaveLastRunFile();
|
||||
|
||||
scalarThread->start();
|
||||
|
||||
if( !scalar->isVisible() ) {
|
||||
|
@ -651,7 +648,7 @@ void MainWindow::StartACQ(){
|
|||
}
|
||||
lbScalarACQStatus->setText("<font style=\"color: green;\"><b>ACQ On</b></font>");
|
||||
|
||||
//if( canvas != nullptr ) histThread->start();
|
||||
if( canvas != nullptr ) histThread->start();
|
||||
|
||||
bnStartACQ->setEnabled(false);
|
||||
bnStopACQ->setEnabled(true);
|
||||
|
@ -661,28 +658,25 @@ void MainWindow::StartACQ(){
|
|||
void MainWindow::StopACQ(){
|
||||
if( digi == nullptr ) return;
|
||||
|
||||
bool commentResult = true;
|
||||
if( chkSaveData->isChecked() ) commentResult = CommentDialog(true);
|
||||
if( commentResult == false) return;
|
||||
|
||||
if( chkSaveData->isChecked() ) {
|
||||
LogMsg("===================== Stop Run-" + QString::number(runID));
|
||||
}else{
|
||||
LogMsg("===================== Stop a non-save Run");
|
||||
}
|
||||
|
||||
bool commentResult = true;
|
||||
if( chkSaveData->isChecked() ) commentResult = CommentDialog(true);
|
||||
if( commentResult == false) return;
|
||||
|
||||
for( unsigned int i = 0; i < nDigi; i++){
|
||||
LogMsg("Digi-" + QString::number(digi[i]->GetSerialNumber()) + " is stoping ACQ." );
|
||||
digi[i]->StopACQ();
|
||||
if( chkSaveData->isChecked() ) digi[i]->GetData()->CloseSaveFile();
|
||||
|
||||
if( readDataThread[i]->isRunning() ) {
|
||||
readDataThread[i]->Stop();
|
||||
readDataThread[i]->quit();
|
||||
readDataThread[i]->wait();
|
||||
}
|
||||
digiMTX[i].lock();
|
||||
digi[i]->StopACQ();
|
||||
digiMTX[i].unlock();
|
||||
if( chkSaveData->isChecked() ) digi[i]->GetData()->CloseSaveFile();
|
||||
}
|
||||
|
||||
if( scalarThread->isRunning()){
|
||||
|
@ -704,7 +698,7 @@ void MainWindow::StopACQ(){
|
|||
bnOpenScope->setEnabled(true);
|
||||
}
|
||||
|
||||
void MainWindow::AutoRun(){ //TODO
|
||||
void MainWindow::AutoRun(){
|
||||
|
||||
}
|
||||
|
||||
|
@ -889,6 +883,6 @@ void MainWindow::LogMsg(QString msg){
|
|||
}
|
||||
QScrollBar *v = logInfo->verticalScrollBar();
|
||||
v->setValue(v->maximum());
|
||||
//qDebug() << outputStr;
|
||||
//qDebug() << msg;
|
||||
logInfo->repaint();
|
||||
}
|
||||
|
|
31
Scope.cpp
31
Scope.cpp
|
@ -116,15 +116,10 @@ Scope::Scope(Digitizer ** digi, unsigned int nDigi, ReadDataThread ** readDataTh
|
|||
if( digi[ID]->GetDPPType() == V1730_DPP_PHA_CODE ) SetUpPHAPanel();
|
||||
if( digi[ID]->GetDPPType() == V1730_DPP_PSD_CODE ) SetUpPSDPanel();
|
||||
|
||||
ReadSettingsFromBoard();
|
||||
//ReadSettingsFromBoard();
|
||||
|
||||
});
|
||||
|
||||
connect(cbScopeCh, &RComboBox::currentIndexChanged, this, [=](){
|
||||
if( !enableSignalSlot ) return;
|
||||
ReadSettingsFromBoard();
|
||||
});
|
||||
|
||||
|
||||
bnReadSettingsFromBoard = new QPushButton("Refresh Settings", this);
|
||||
layout->addWidget(bnReadSettingsFromBoard, rowID, 2);
|
||||
|
@ -234,14 +229,11 @@ void Scope::StartScope(){
|
|||
|
||||
digi[iDigi]->StartACQ();
|
||||
|
||||
printf("----- readDataThread running ? %d.\n", readDataThread[iDigi]->isRunning());
|
||||
if( readDataThread[iDigi]->isRunning() ){
|
||||
readDataThread[iDigi]->quit();
|
||||
readDataThread[iDigi]->wait();
|
||||
}
|
||||
readDataThread[iDigi]->SetScopeMode(true);
|
||||
readDataThread[iDigi]->SetSaveData(false);
|
||||
|
||||
readDataThread[iDigi]->start();
|
||||
|
||||
}
|
||||
|
||||
updateTraceThread->start();
|
||||
|
@ -258,21 +250,18 @@ void Scope::StartScope(){
|
|||
void Scope::StopScope(){
|
||||
if( !digi ) return;
|
||||
|
||||
// printf("------ Scope::%s \n", __func__);
|
||||
updateTraceThread->Stop();
|
||||
updateTraceThread->quit();
|
||||
updateTraceThread->exit();
|
||||
|
||||
for( unsigned int iDigi = 0; iDigi < nDigi; iDigi ++){
|
||||
|
||||
if( readDataThread[iDigi]->isRunning() ){
|
||||
readDataThread[iDigi]->Stop();
|
||||
readDataThread[iDigi]->quit();
|
||||
readDataThread[iDigi]->wait();
|
||||
}
|
||||
for( unsigned int iDigi = 0; iDigi < nDigi; iDigi ++){
|
||||
digiMTX[iDigi].lock();
|
||||
digi[iDigi]->StopACQ();
|
||||
digiMTX[iDigi].unlock();
|
||||
|
||||
readDataThread[iDigi]->quit();
|
||||
readDataThread[iDigi]->wait();
|
||||
}
|
||||
|
||||
bnScopeStart->setEnabled(true);
|
||||
|
@ -282,21 +271,21 @@ void Scope::StopScope(){
|
|||
|
||||
TellACQOnOff(false);
|
||||
|
||||
// printf("----- end of %s\n", __func__);
|
||||
|
||||
}
|
||||
|
||||
void Scope::UpdateScope(){
|
||||
|
||||
//printf("---- %s \n", __func__);
|
||||
|
||||
if( !digi ) return;
|
||||
|
||||
int ch = cbScopeCh->currentIndex();
|
||||
int ch2ns = digi[ID]->GetCh2ns();
|
||||
int factor = digi[ID]->IsDualTrace() ? 2 : 1;
|
||||
|
||||
digiMTX[ID].lock();
|
||||
Data * data = digi[ID]->GetData();
|
||||
|
||||
digiMTX[ID].lock();
|
||||
//leTriggerRate->setText(QString::number(data->TriggerRate[ch]) + " [" + QString::number(data->NumEventsDecoded[ch]) + "]");
|
||||
leTriggerRate->setText(QString::number(data->TriggerRate[ch]));
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user