diff --git a/.gitignore b/.gitignore index d6a7efd..55f7304 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ SOLARIS_DAQ programSettings.txt test windowID +tempSettings screenshot.* *settings*.txt *settings*.dat diff --git a/ClassDigitizer2Gen.cpp b/ClassDigitizer2Gen.cpp index 2e5bbf2..e58fcf7 100644 --- a/ClassDigitizer2Gen.cpp +++ b/ClassDigitizer2Gen.cpp @@ -5,7 +5,7 @@ #include Digitizer2Gen::Digitizer2Gen(){ - printf("======== %s \n",__func__); + //printf("======== %s \n",__func__); Initialization(); } @@ -15,7 +15,7 @@ Digitizer2Gen::~Digitizer2Gen(){ } void Digitizer2Gen::Initialization(){ - printf("======== %s \n",__func__); + //printf("======== %s \n",__func__); handle = 0; ret = 0; @@ -131,10 +131,10 @@ std::string Digitizer2Gen::ReadValue(const Reg para, int ch_index, bool verbose return ans; } -bool Digitizer2Gen::WriteValue(const char * parameter, std::string value){ +bool Digitizer2Gen::WriteValue(const char * parameter, std::string value, bool verbose){ if( !isConnected ) return false; //ReadValue(parameter, 1); - printf(" %s|%d|%-45s|%s|\n", __func__, serialNumber, parameter, value.c_str()); + if( verbose) printf(" %s|%d|%-45s|%s|\n", __func__, serialNumber, parameter, value.c_str()); ret = CAEN_FELib_SetValue(handle, parameter, value.c_str()); if (ret != CAEN_FELib_Success) { printf("WriteError|%s||%s|\n", parameter, value.c_str()); @@ -185,7 +185,7 @@ bool Digitizer2Gen::WriteValue(const Reg para, std::string value, int ch_index){ void Digitizer2Gen::SendCommand(const char * parameter){ if( !isConnected ) return; - printf("Send Command : %s \n", parameter); + printf(" %s|%d|Send Command : %s \n", __func__, serialNumber, parameter); ret = CAEN_FELib_SendCommand(handle, parameter); if (ret != CAEN_FELib_Success) { ErrorMsg(__func__); @@ -201,11 +201,11 @@ void Digitizer2Gen::SendCommand(std::string shortPara){ //########################################### Open digitizer int Digitizer2Gen::OpenDigitizer(const char * url){ - printf("======== %s \n",__func__); + //printf("======== %s \n",__func__); ret = CAEN_FELib_Open(url, &handle); - printf("=== ret : %d | %d \n", ret, CAEN_FELib_Success); + //printf("=== ret : %d | %d \n", ret, CAEN_FELib_Success); if (ret != CAEN_FELib_Success) { ErrorMsg(__func__); @@ -744,7 +744,7 @@ std::string Digitizer2Gen::ErrorMsg(const char * funcName){ printf("%s failed\n", __func__); return errMsg; } - printf("Error msg (%d): %s\n", ret, msg); + if( ret != CAEN_FELib_Stop ) printf("Error msg (%d): %s\n", ret, msg); return msg; } @@ -753,10 +753,19 @@ void Digitizer2Gen::ReadAllSettings(){ if( !isConnected ) return; for(int i = 0; i < (int) boardSettings.size(); i++){ if( boardSettings[i].ReadWrite() == RW::WriteOnly) continue; + if( !(ModelName == "VX2745" && FPGAType == "DPP_PHA") && + (boardSettings[i].GetPara() == PHA::DIG::TempSensADC1.GetPara() || + boardSettings[i].GetPara() == PHA::DIG::TempSensADC2.GetPara() || + boardSettings[i].GetPara() == PHA::DIG::TempSensADC3.GetPara() || + boardSettings[i].GetPara() == PHA::DIG::TempSensADC4.GetPara() || + boardSettings[i].GetPara() == PHA::DIG::TempSensADC5.GetPara() || + boardSettings[i].GetPara() == PHA::DIG::TempSensADC6.GetPara() + ) + ) continue; ReadValue(boardSettings[i]); } - for(int i = 0; i < 4 ; i ++) ReadValue(VGASetting[i], i); + if( ModelName == "VX2745" && FPGAType == "DPP_PHA") for(int i = 0; i < 4 ; i ++) ReadValue(VGASetting[i], i); for(int ch = 0; ch < nChannels ; ch++ ){ for( int i = 0; i < (int) chSettings[ch].size(); i++){ @@ -784,14 +793,16 @@ int Digitizer2Gen::SaveSettingsToFile(const char * saveFileName, bool setReadOnl count ++; } - for(int i = 0; i < 4 ; i ++){ - totCount ++; - if( VGASetting[i].GetValue() == "" ) break; - fprintf(saveFile, "%-45s!%d!%4d!%s\n", VGASetting[i].GetFullPara(i).c_str(), - VGASetting[i].ReadWrite(), - 9000 + i, - VGASetting[i].GetValue().c_str()); - count ++; + if( ModelName == "VX2745" && FPGAType == "DPP_PHA") { + for(int i = 0; i < 4 ; i ++){ + totCount ++; + if( VGASetting[i].GetValue() == "" ) break; + fprintf(saveFile, "%-45s!%d!%4d!%s\n", VGASetting[i].GetFullPara(i).c_str(), + VGASetting[i].ReadWrite(), + 9000 + i, + VGASetting[i].GetValue().c_str()); + count ++; + } } for( int i = 0; i < (int) chSettings[0].size(); i++){ for(int ch = 0; ch < nChannels ; ch++ ){ @@ -889,7 +900,7 @@ bool Digitizer2Gen::LoadSettingsFromFile(const char * loadFileName){ VGASetting[id - 9000].SetValue(value); } //printf("%s|%s|%d|%s|\n", para, readWrite, id, value); - if( std::strcmp(readWrite, "2") == 0 && isConnected) WriteValue(para, value); + if( std::strcmp(readWrite, "2") == 0 && isConnected) WriteValue(para, value, false); } delete [] para; diff --git a/ClassDigitizer2Gen.h b/ClassDigitizer2Gen.h index d291bb6..544e280 100644 --- a/ClassDigitizer2Gen.h +++ b/ClassDigitizer2Gen.h @@ -87,7 +87,7 @@ class Digitizer2Gen { std::string ReadValue(const char * parameter, bool verbose = false); std::string ReadValue(const Reg para, int ch_index = -1, bool verbose = false); // read digitizer and save to memory - bool WriteValue(const char * parameter, std::string value); + bool WriteValue(const char * parameter, std::string value, bool verbose = true); bool WriteValue(const Reg para, std::string value, int ch_index = -1); // write digituzer and save to memory void SendCommand(const char * parameter); void SendCommand(std::string shortPara); diff --git a/CustomWidgets.h b/CustomWidgets.h index a596251..738a81f 100644 --- a/CustomWidgets.h +++ b/CustomWidgets.h @@ -38,6 +38,9 @@ class RSpinBox : public QDoubleSpinBox{ setToolTipDuration(-1); } + void SetStyleNormal() { setStyleSheet(""); } + void SetStyleGreen() { setStyleSheet("color:green"); } + signals: void returnPressed(); protected: diff --git a/SOLARISpanel.cpp b/SOLARISpanel.cpp index 388f871..5dca040 100644 --- a/SOLARISpanel.cpp +++ b/SOLARISpanel.cpp @@ -185,6 +185,9 @@ SOLARISpanel::SOLARISpanel(Digitizer2Gen **digi, unsigned short nDigi, rowIndex ++; QLabel * info = new QLabel("Only simple trigger is avalible. For complex trigger scheme, please use the setting panel.", this); mainLayout->addWidget(info, rowIndex, 0, 1, 4); + rowIndex ++; + QLabel * info2 = new QLabel("The panel is defined by " + analysisPath + "/working/Mapping.h", this); + mainLayout->addWidget(info2, rowIndex, 0, 1, 4); ///================================= rowIndex ++; diff --git a/digiSettingsPanel.cpp b/digiSettingsPanel.cpp index 010ec88..e58ec0d 100644 --- a/digiSettingsPanel.cpp +++ b/digiSettingsPanel.cpp @@ -133,7 +133,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi LEDStatus[iDigi][i]->setToolTip(QString::number(i) + " - " + LEDToolTip[i]); LEDStatus[iDigi][i]->setToolTipDuration(-1); //TODO set tooltip position on top - statusLayout->addWidget(LEDStatus[iDigi][i], 0, 1 + 19 - i); + statusLayout->addWidget(LEDStatus[iDigi][i], 0, 19 - i); } @@ -148,7 +148,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi ACQStatus[iDigi][i]->setFixedSize(QSize(30,30)); ACQStatus[iDigi][i]->setToolTip(QString::number(i) + " - " + ACQToolTip[i]); ACQStatus[iDigi][i]->setToolTipDuration(-1); - statusLayout->addWidget(ACQStatus[iDigi][i], 1, 1 + 7 - i); + statusLayout->addWidget(ACQStatus[iDigi][i], 1, 7 - i); } //------- Temperatures @@ -210,24 +210,38 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi rowId ++; bnClearData[iDigi] = new QPushButton("Clear Data", tab); bnLayout->addWidget(bnClearData[iDigi], rowId, 0, 1, 2); - connect(bnClearData[iDigi], &QPushButton::clicked, this, [=](){ digi[ID]->SendCommand(PHA::DIG::ClearData); }); + connect(bnClearData[iDigi], &QPushButton::clicked, this, [=](){ + digi[ID]->SendCommand(PHA::DIG::ClearData); + SendLogMsg("Digi-" + QString::number(digi[ID]->GetSerialNumber()) + "|Send Command : " + QString::fromStdString(PHA::DIG::ClearData.GetFullPara())); + }); bnArmACQ[iDigi] = new QPushButton("Arm ACQ", tab); bnLayout->addWidget(bnArmACQ[iDigi], rowId, 2, 1, 2); - connect(bnArmACQ[iDigi], &QPushButton::clicked, this, [=](){ digi[ID]->SendCommand(PHA::DIG::ArmACQ); }); + connect(bnArmACQ[iDigi], &QPushButton::clicked, this, [=](){ + digi[ID]->SendCommand(PHA::DIG::ArmACQ); + SendLogMsg("Digi-" + QString::number(digi[ID]->GetSerialNumber()) + "|Send Command : " + QString::fromStdString(PHA::DIG::ArmACQ.GetFullPara())); + }); bnDisarmACQ[iDigi] = new QPushButton("Disarm ACQ", tab); bnLayout->addWidget(bnDisarmACQ[iDigi], rowId, 4, 1, 2); - connect(bnDisarmACQ[iDigi], &QPushButton::clicked, this, [=](){ digi[ID]->SendCommand(PHA::DIG::DisarmACQ); }); + connect(bnDisarmACQ[iDigi], &QPushButton::clicked, this, [=](){ + digi[ID]->SendCommand(PHA::DIG::DisarmACQ); + SendLogMsg("Digi-" + QString::number(digi[ID]->GetSerialNumber()) + "|Send Command : " + QString::fromStdString(PHA::DIG::DisarmACQ.GetFullPara())); + }); bnSoftwareStart[iDigi] = new QPushButton("Software Start ACQ", tab); bnLayout->addWidget(bnSoftwareStart[iDigi], rowId, 6, 1, 2); - connect(bnSoftwareStart[iDigi], &QPushButton::clicked, this, [=](){ digi[ID]->SendCommand(PHA::DIG::SoftwareStartACQ); }); + connect(bnSoftwareStart[iDigi], &QPushButton::clicked, this, [=](){ + digi[ID]->SendCommand(PHA::DIG::SoftwareStartACQ); + SendLogMsg("Digi-" + QString::number(digi[ID]->GetSerialNumber()) + "|Send Command : " + QString::fromStdString(PHA::DIG::SoftwareStartACQ.GetFullPara())); + }); bnSoftwareStop[iDigi] = new QPushButton("Software Stop ACQ", tab); bnLayout->addWidget(bnSoftwareStop[iDigi], rowId, 8, 1, 2); - connect(bnSoftwareStop[iDigi], &QPushButton::clicked, this, [=](){ digi[ID]->SendCommand(PHA::DIG::SoftwareStopACQ); }); - + connect(bnSoftwareStop[iDigi], &QPushButton::clicked, this, [=](){ + digi[ID]->SendCommand(PHA::DIG::SoftwareStopACQ); + SendLogMsg("Digi-" + QString::number(digi[ID]->GetSerialNumber()) + "|Send Command : " + QString::fromStdString(PHA::DIG::SoftwareStopACQ.GetFullPara())); + }); //--------------- if( digi[iDigi]->IsDummy() || !digi[iDigi]->IsConnected() ){ @@ -1170,7 +1184,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi sbBdSettingsWrite = new RSpinBox(ICTab); sbBdSettingsWrite->setFixedWidth(200); inquiryLayout->addWidget(sbBdSettingsWrite, rowID, 7); - connect(sbBdSettingsWrite, &RSpinBox::valueChanged, this, [=](){ sbBdSettingsWrite->setStyleSheet("color: green;");}); + connect(sbBdSettingsWrite, &RSpinBox::valueChanged, this, [=](){if( enableSignalSlot ) sbBdSettingsWrite->setStyleSheet("color: green;");}); connect(sbBdSettingsWrite, &RSpinBox::returnPressed, this, [=](){ if( !enableSignalSlot ) return; if( sbBdSettingsWrite->decimals() == 0 && sbBdSettingsWrite->singleStep() != 1) { @@ -1201,7 +1215,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi leBdSettingsWrite->setAlignment(Qt::AlignRight); leBdSettingsWrite->setFixedWidth(200); inquiryLayout->addWidget(leBdSettingsWrite, rowID, 8); - connect(leBdSettingsWrite, &QLineEdit::textChanged, this, [=](){leBdSettingsWrite->setStyleSheet("color: green;");}); + connect(leBdSettingsWrite, &QLineEdit::textChanged, this, [=](){if( enableSignalSlot )leBdSettingsWrite->setStyleSheet("color: green;");}); connect(leBdSettingsWrite, &QLineEdit::returnPressed, this, [=](){ if( !enableSignalSlot ) return; std::string value = leBdSettingsWrite->text().toStdString(); @@ -1289,7 +1303,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi sbChSettingsWrite = new RSpinBox(ICTab); sbChSettingsWrite->setFixedWidth(200); inquiryLayout->addWidget(sbChSettingsWrite, rowID, 7); - connect(sbChSettingsWrite, &RSpinBox::valueChanged, this, [=](){ sbChSettingsWrite->setStyleSheet("color: green;");}); + connect(sbChSettingsWrite, &RSpinBox::valueChanged, this, [=](){ if( enableSignalSlot ) sbChSettingsWrite->setStyleSheet("color: green;");}); connect(sbChSettingsWrite, &RSpinBox::returnPressed, this, [=](){ if( !enableSignalSlot ) return; if( sbChSettingsWrite->decimals() == 0 && sbChSettingsWrite->singleStep() != 1) { @@ -1321,7 +1335,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi leChSettingsWrite = new QLineEdit(ICTab); leChSettingsWrite->setFixedWidth(200); inquiryLayout->addWidget(leChSettingsWrite, rowID, 8); - connect(leChSettingsWrite, &QLineEdit::textChanged, this, [=](){leChSettingsWrite->setStyleSheet("color: green;");}); + connect(leChSettingsWrite, &QLineEdit::textChanged, this, [=](){if( enableSignalSlot ) leChSettingsWrite->setStyleSheet("color: green;");}); connect(leChSettingsWrite, &QLineEdit::returnPressed, this, [=](){ if( !enableSignalSlot ) return; std::string value = leChSettingsWrite->text().toStdString(); diff --git a/mainwindow.cpp b/mainwindow.cpp index 6e1865d..1c897f0 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -116,6 +116,12 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){ QPushButton * bnEventBuilder = new QPushButton("Event Builder", this); bnEventBuilder->setEnabled(false); + + QPushButton * bnHVController = new QPushButton("HV Controller", this); + bnHVController->setEnabled(false); + + QPushButton * bnTargetFanController = new QPushButton("Target Fan", this); + bnTargetFanController->setEnabled(false); layout1->addWidget(bnProgramSettings, 0, 0); layout1->addWidget(bnNewExp, 0, 1); @@ -130,6 +136,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){ layout1->addWidget(bnSOLSettings, 2, 2, 1, 2); layout1->addWidget(bnEventBuilder, 3, 0); + layout1->addWidget(bnHVController, 3, 1); + layout1->addWidget(bnTargetFanController, 3, 2, 1, 2); layout1->setColumnStretch(0, 2); layout1->setColumnStretch(1, 2); @@ -181,6 +189,14 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){ cbAutoRun->addItem("Every 5 hrs", -300); cbAutoRun->setEnabled(false); + QComboBox * cbDataFormat = new QComboBox(this); + cbDataFormat->addItem("Everything", 0); + cbDataFormat->addItem("1 trace", 1); + cbDataFormat->addItem("No trace", 2); + cbDataFormat->addItem("Minimum", 3); + cbDataFormat->setCurrentIndex(1); + cbDataFormat->setEnabled(false); + bnStartACQ = new QPushButton("Start ACQ", this); bnStartACQ->setEnabled(false); //connect(bnStartACQ, &QPushButton::clicked, this, &MainWindow::StartACQ); @@ -214,26 +230,28 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){ bnComment->setEnabled(false); layout2->addWidget(lbRawDataPath, 0, 0); - layout2->addWidget(leRawDataPath, 0, 1, 1, 4); - layout2->addWidget(bnOpenScalar, 0, 5); + layout2->addWidget(leRawDataPath, 0, 1, 1, 5); + layout2->addWidget(bnOpenScalar, 0, 6); - layout2->addWidget(lbRunID, 1, 0); - layout2->addWidget(leRunID, 1, 1); - layout2->addWidget(chkSaveRun, 1, 2); - layout2->addWidget(cbAutoRun, 1, 3); - layout2->addWidget(bnStartACQ, 1, 4); - layout2->addWidget(bnStopACQ, 1, 5); + layout2->addWidget(lbRunID, 1, 0); + layout2->addWidget(leRunID, 1, 1); + layout2->addWidget(chkSaveRun, 1, 2); + layout2->addWidget(cbAutoRun, 1, 3); + layout2->addWidget(cbDataFormat, 1, 4); + layout2->addWidget(bnStartACQ, 1, 5); + layout2->addWidget(bnStopACQ, 1, 6); layout2->addWidget(lbRunComment, 2, 0); - layout2->addWidget(leRunComment, 2, 1, 1, 4); - layout2->addWidget(bnComment, 2, 5); + layout2->addWidget(leRunComment, 2, 1, 1, 5); + layout2->addWidget(bnComment, 2, 6); - layout2->setColumnStretch(0, 2); + layout2->setColumnStretch(0, 1); layout2->setColumnStretch(1, 1); layout2->setColumnStretch(2, 1); layout2->setColumnStretch(3, 1); - layout2->setColumnStretch(4, 3); + layout2->setColumnStretch(4, 1); layout2->setColumnStretch(5, 3); + layout2->setColumnStretch(6, 3); } @@ -717,6 +735,12 @@ void MainWindow::CloseDigitizers(){ for( int i = 0; i < nDigi; i++){ if( digi[i] == NULL) return; + + if( digi[i]->IsConnected() ){ + int digiSN = digi[i]->GetSerialNumber(); + LogMsg("Save digi-"+ QString::number(digiSN) + " Settings to " + settingFilePath + "/tempSettings/"); + digi[i]->SaveSettingsToFile((settingFilePath + "/tempSettings/Setting_" + QString::number(digiSN)).toStdString().c_str()); + } digi[i]->CloseDigitizer(); delete digi[i]; @@ -770,6 +794,11 @@ void MainWindow::OpenScope(){ influx->AddDataPoint(onOff ? "StartStop value=1" : "StartStop value=0"); influx->WriteData(DatabaseName.toStdString()); } + if( onOff){ + lbScalarACQStatus->setText("ACQ On"); + }else{ + lbScalarACQStatus->setText("ACQ Off"); + } }); if( influx ){ @@ -782,8 +811,11 @@ void MainWindow::OpenScope(){ digiSetting->EnableControl(); } + scope->StartScope(); + }else{ scope->show(); + scope->StartScope(); if( digiSetting ) digiSetting->EnableControl(); } } @@ -965,12 +997,16 @@ void MainWindow::SetUpScalar(){ scalar->setGeometry(0, 0, 10 + nDigi * 230, 1500); - lbLastUpdateTime = new QLabel("Last update : "); + if( lbLastUpdateTime == nullptr ) { // use lbLastUpdateTime as a flag + lbLastUpdateTime = new QLabel("Last update : ", scalar); + lbScalarACQStatus = new QLabel("ACQ status", scalar); + } lbLastUpdateTime->setAlignment(Qt::AlignCenter); + scalarLayout->removeWidget(lbLastUpdateTime); scalarLayout->addWidget(lbLastUpdateTime, 0, 1, 1, 1 + nDigi); - lbScalarACQStatus = new QLabel("ACQ status"); lbScalarACQStatus->setAlignment(Qt::AlignCenter); + scalarLayout->removeWidget(lbScalarACQStatus); scalarLayout->addWidget(lbScalarACQStatus, 1, 1, 1, 1 + nDigi); ///==== create the 1st row @@ -978,13 +1014,18 @@ void MainWindow::SetUpScalar(){ for( int ch = 0; ch < MaxNumberOfChannel; ch++){ if( ch == 0 ){ - QLabel * lbCH_H = new QLabel("Ch", scalar); scalarLayout->addWidget(lbCH_H, rowID, 0); + if( lbLastUpdateTime == nullptr ) { + QLabel * lbCH_H = new QLabel("Ch", scalar); + scalarLayout->addWidget(lbCH_H, rowID, 0); + } } rowID ++; - QLabel * lbCH = new QLabel(QString::number(ch), scalar); - lbCH->setAlignment(Qt::AlignCenter); - scalarLayout->addWidget(lbCH, rowID, 0); + if( lbLastUpdateTime == nullptr ) { + QLabel * lbCH = new QLabel(QString::number(ch), scalar); + lbCH->setAlignment(Qt::AlignCenter); + scalarLayout->addWidget(lbCH, rowID, 0); + } } ///===== create the trigger and accept @@ -1013,12 +1054,12 @@ void MainWindow::SetUpScalar(){ rowID ++; - leTrigger[iDigi][ch] = new QLineEdit(); + leTrigger[iDigi][ch] = new QLineEdit(scalar); leTrigger[iDigi][ch]->setReadOnly(true); leTrigger[iDigi][ch]->setAlignment(Qt::AlignRight); scalarLayout->addWidget(leTrigger[iDigi][ch], rowID, 2*iDigi+1); - leAccept[iDigi][ch] = new QLineEdit(); + leAccept[iDigi][ch] = new QLineEdit(scalar); leAccept[iDigi][ch]->setReadOnly(true); leAccept[iDigi][ch]->setAlignment(Qt::AlignRight); leAccept[iDigi][ch]->setStyleSheet("background-color: #F0F0F0;"); @@ -1028,6 +1069,7 @@ void MainWindow::SetUpScalar(){ } + void MainWindow::DeleteTriggerLineEdit(){ if( leTrigger ) return; diff --git a/scope.cpp b/scope.cpp index cb512cd..4034a14 100644 --- a/scope.cpp +++ b/scope.cpp @@ -317,17 +317,25 @@ Scope::Scope(Digitizer2Gen **digi, unsigned int nDigi, ReadDataThread ** readDat show(); - StartScope(); + //StartScope(); } Scope::~Scope(){ + + printf("------- %s \n", __func__); + + StopScope(); + + printf("------- A \n"); updateTraceThread->Stop(); updateTraceThread->quit(); updateTraceThread->wait(); delete updateTraceThread; for( int i = 0; i < 6; i++) delete dataTrace[i]; + printf("------- B \n"); delete plot; + printf("------- C \n"); } void Scope::ReadScopeSettings(){ @@ -478,7 +486,7 @@ void Scope::StopScope(){ readDataThread[i]->quit(); readDataThread[i]->wait(); } - + emit TellACQOnOff(false); } @@ -536,8 +544,7 @@ void Scope::UpdateScope(){ } void Scope::ProbeChange(RComboBox * cb[], const int size ){ - - printf("%s\n", __func__); + //printf("%s\n", __func__); QStandardItemModel * model[size] = {NULL}; for( int i = 0; i < size; i++){ model[i] = qobject_cast(cb[i]->model()); @@ -613,7 +620,7 @@ void Scope::ScopeReadComboBoxValue(int iDigi, int ch, RComboBox *cb, const Reg d } void Scope::ScopeMakeSpinBox(RSpinBox * &sb, QString str, QGridLayout *layout, int row, int col, const Reg digPara){ - printf("%s\n", __func__); + //printf("%s\n", __func__); QLabel * lb = new QLabel(str, this); lb->setAlignment(Qt::AlignRight | Qt::AlignCenter); layout->addWidget(lb, row, col); diff --git a/scope.h b/scope.h index 1eb07b4..ccaddd9 100644 --- a/scope.h +++ b/scope.h @@ -129,10 +129,10 @@ public: public slots: void ReadScopeSettings(); // read from digitizer and show; void UpdateSettingsFromMemeory(); - -private slots: void StartScope(); void StopScope(); + +private slots: void UpdateScope(); void ScopeControlOnOff(bool on); void ScopeReadSpinBoxValue(int iDigi, int ch, RSpinBox *sb, const Reg digPara);