use a dumb way to solve the pointer problem in SOLARIS Panel
This commit is contained in:
parent
a0861130af
commit
38f6cc41cb
110
SOLARISpanel.cpp
110
SOLARISpanel.cpp
|
@ -28,13 +28,6 @@ SOLARISpanel::SOLARISpanel(Digitizer2Gen **digi, unsigned short nDigi,
|
||||||
this->detType = detType;
|
this->detType = detType;
|
||||||
this->detMaxID = detMaxID;
|
this->detMaxID = detMaxID;
|
||||||
|
|
||||||
nDigiMapping = mapping.size();
|
|
||||||
for( int i = 0; i < nDigiMapping; i++) {
|
|
||||||
int count = 0;
|
|
||||||
for( int j = 0; j < (int )mapping[i].size(); j++) if( mapping[i][j] >= 0) count ++;
|
|
||||||
nChMapping.push_back(count);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Check number of detector type; Array 0-199, Recoil 200-299, other 300-
|
//Check number of detector type; Array 0-199, Recoil 200-299, other 300-
|
||||||
int nDetType = detType.size();
|
int nDetType = detType.size();
|
||||||
for( int k = 0 ; k < nDetType; k++) nDet.push_back(0);
|
for( int k = 0 ; k < nDetType; k++) nDet.push_back(0);
|
||||||
|
@ -42,7 +35,7 @@ SOLARISpanel::SOLARISpanel(Digitizer2Gen **digi, unsigned short nDigi,
|
||||||
QList<QList<int>> detIDListTemp; // store { detID, (Digi << 8 ) + ch}, making mapping into 1-D array to be consolidated
|
QList<QList<int>> detIDListTemp; // store { detID, (Digi << 8 ) + ch}, making mapping into 1-D array to be consolidated
|
||||||
|
|
||||||
printf("################################# \n");
|
printf("################################# \n");
|
||||||
for( int i = 0; i < nDigiMapping ; i++){
|
for( int i = 0; i < (int) mapping.size() ; i++){
|
||||||
for( int j = 0; j < (int) mapping[i].size(); j++ ){
|
for( int j = 0; j < (int) mapping[i].size(); j++ ){
|
||||||
printf("%3d,", mapping[i][j]);
|
printf("%3d,", mapping[i][j]);
|
||||||
QList<int> haha ;
|
QList<int> haha ;
|
||||||
|
@ -88,8 +81,6 @@ SOLARISpanel::SOLARISpanel(Digitizer2Gen **digi, unsigned short nDigi,
|
||||||
return a.at(0) < b.at(0);
|
return a.at(0) < b.at(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//------------- display detector summary
|
//------------- display detector summary
|
||||||
//qDebug() << detIDList;
|
//qDebug() << detIDList;
|
||||||
printf("---------- num. of det. Type : %d\n", nDetType);
|
printf("---------- num. of det. Type : %d\n", nDetType);
|
||||||
|
@ -97,33 +88,6 @@ SOLARISpanel::SOLARISpanel(Digitizer2Gen **digi, unsigned short nDigi,
|
||||||
printf(" Type-%d (%6s) : %3d det. (%3d - %3d)\n", i, detType[i].toStdString().c_str(), nDet[i], (i==0 ? 0 : detMaxID[i-1]), detMaxID[i]-1);
|
printf(" Type-%d (%6s) : %3d det. (%3d - %3d)\n", i, detType[i].toStdString().c_str(), nDet[i], (i==0 ? 0 : detMaxID[i-1]), detMaxID[i]-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------ create Widgets
|
|
||||||
leDisplay = new QLineEdit ***[(int) SettingItems.size()];
|
|
||||||
sbSetting = new RSpinBox ***[(int) SettingItems.size()];
|
|
||||||
chkOnOff = new QCheckBox ***[(int) SettingItems.size()];
|
|
||||||
for( int k = 0; k < (int) SettingItems.size() ; k ++){
|
|
||||||
leDisplay[k] = new QLineEdit **[nDigiMapping];
|
|
||||||
sbSetting[k] = new RSpinBox **[nDigiMapping];
|
|
||||||
chkOnOff[k] = new QCheckBox **[nDigiMapping];
|
|
||||||
for( int i = 0; i < nDigiMapping; i++){
|
|
||||||
leDisplay[k][i] = new QLineEdit *[(int) mapping[i].size()];
|
|
||||||
sbSetting[k][i] = new RSpinBox *[(int) mapping[i].size()];
|
|
||||||
chkOnOff[k][i] = new QCheckBox *[(int) mapping[i].size()];
|
|
||||||
for( int j = 0 ; j < (int) mapping[i].size() ; j++){
|
|
||||||
leDisplay[k][i][j] = nullptr;
|
|
||||||
sbSetting[k][i][j] = nullptr;
|
|
||||||
chkOnOff[k][i][j] = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cbTrigger = new RComboBox ** [nDetType];
|
|
||||||
for(int i = 0; i < nDetType; i++){
|
|
||||||
cbTrigger[i] = new RComboBox *[nDet[i]]; /// nDet[0] store the number of det. for the Array
|
|
||||||
for( int j = 0; j < nDet[i]; j ++){
|
|
||||||
cbTrigger[i][j] = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//---------- Set Panel
|
//---------- Set Panel
|
||||||
QGridLayout * mainLayout = new QGridLayout(this); this->setLayout(mainLayout);
|
QGridLayout * mainLayout = new QGridLayout(this); this->setLayout(mainLayout);
|
||||||
|
|
||||||
|
@ -137,17 +101,17 @@ SOLARISpanel::SOLARISpanel(Digitizer2Gen **digi, unsigned short nDigi,
|
||||||
QTabWidget * tabWidget = new QTabWidget(this); mainLayout->addWidget(tabWidget, 1, 0, 1, 5);
|
QTabWidget * tabWidget = new QTabWidget(this); mainLayout->addWidget(tabWidget, 1, 0, 1, 5);
|
||||||
for( int detTypeID = 0; detTypeID < nDetType; detTypeID ++ ){
|
for( int detTypeID = 0; detTypeID < nDetType; detTypeID ++ ){
|
||||||
|
|
||||||
QTabWidget * tab2 = new QTabWidget(tabWidget);
|
QTabWidget * tabSetting = new QTabWidget(tabWidget);
|
||||||
tabWidget->addTab(tab2, detType[detTypeID]);
|
tabWidget->addTab(tabSetting, detType[detTypeID]);
|
||||||
|
|
||||||
for( int SettingID = 0; SettingID < (int) SettingItems.size(); SettingID ++){
|
for( int SettingID = 0; SettingID < (int) SettingItems.size(); SettingID ++){
|
||||||
|
|
||||||
QScrollArea * scrollArea = new QScrollArea(this);
|
QScrollArea * scrollArea = new QScrollArea(this);
|
||||||
scrollArea->setWidgetResizable(true);
|
scrollArea->setWidgetResizable(true);
|
||||||
scrollArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
scrollArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
tab2->addTab(scrollArea, QString::fromStdString(SettingItems[SettingID]));
|
tabSetting->addTab(scrollArea, QString::fromStdString(SettingItems[SettingID]));
|
||||||
|
|
||||||
QWidget * tab = new QWidget(tab2);
|
QWidget * tab = new QWidget(tabSetting);
|
||||||
scrollArea->setWidget(tab);
|
scrollArea->setWidget(tab);
|
||||||
|
|
||||||
QGridLayout * layout = new QGridLayout(tab);
|
QGridLayout * layout = new QGridLayout(tab);
|
||||||
|
@ -183,45 +147,19 @@ SOLARISpanel::SOLARISpanel(Digitizer2Gen **digi, unsigned short nDigi,
|
||||||
int lowID = (detTypeID == 0 ? 0 : detMaxID[detTypeID-1]);
|
int lowID = (detTypeID == 0 ? 0 : detMaxID[detTypeID-1]);
|
||||||
|
|
||||||
for(int i = 0; i < detIDList.size(); i++){
|
for(int i = 0; i < detIDList.size(); i++){
|
||||||
|
|
||||||
if( detIDList[i][0] >= detMaxID[detTypeID] || lowID > detIDList[i][0] ) continue;
|
if( detIDList[i][0] >= detMaxID[detTypeID] || lowID > detIDList[i][0] ) continue;
|
||||||
CreateDetGroup(SettingID, detIDList[i], layout, i/NCOL + 2, i%NCOL);
|
CreateDetGroup(SettingID, detIDList[i], layout, i/NCOL + 2, i%NCOL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO ========== when digiSettingPanel or Scope change setting, reflect in solarisPanel
|
|
||||||
|
|
||||||
//TODO ========== when tab change, update panel
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SOLARISpanel::~SOLARISpanel(){
|
SOLARISpanel::~SOLARISpanel(){
|
||||||
|
|
||||||
printf("%s\n", __func__);
|
|
||||||
|
|
||||||
for( int k = 0; k < (int) SettingItems.size() ; k ++){
|
|
||||||
for( int i = 0; i < nDigiMapping; i++){
|
|
||||||
delete [] leDisplay[k][i] ;
|
|
||||||
delete [] sbSetting[k][i] ;
|
|
||||||
delete [] chkOnOff[k][i] ;
|
|
||||||
}
|
|
||||||
delete [] leDisplay[k];
|
|
||||||
delete [] sbSetting[k];
|
|
||||||
delete [] chkOnOff[k] ;
|
|
||||||
}
|
|
||||||
|
|
||||||
delete [] leDisplay;
|
|
||||||
delete [] sbSetting;
|
|
||||||
delete [] chkOnOff;
|
|
||||||
|
|
||||||
for( int k = 0; k < (int) detType.size() ; k++){
|
|
||||||
delete [] cbTrigger[k];
|
|
||||||
}
|
|
||||||
delete [] cbTrigger;
|
|
||||||
|
|
||||||
printf("end of %s\n", __func__);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//^######################################################################
|
//^######################################################################
|
||||||
|
@ -305,6 +243,7 @@ void SOLARISpanel::CreateDetGroup(int SettingID, QList<int> detID, QGridLayout *
|
||||||
SendLogMsg(msg + "|Fail.");
|
SendLogMsg(msg + "|Fail.");
|
||||||
spb->setStyleSheet("color:red;");
|
spb->setStyleSheet("color:red;");
|
||||||
}
|
}
|
||||||
|
emit UpdateOtherPanels();
|
||||||
});
|
});
|
||||||
|
|
||||||
///===================== for the OnOff CheckBox
|
///===================== for the OnOff CheckBox
|
||||||
|
@ -321,6 +260,8 @@ void SOLARISpanel::CreateDetGroup(int SettingID, QList<int> detID, QGridLayout *
|
||||||
}
|
}
|
||||||
enableSignalSlot = true;
|
enableSignalSlot = true;
|
||||||
|
|
||||||
|
emit UpdateOtherPanels();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
layout0->setColumnStretch(0, 1);
|
layout0->setColumnStretch(0, 1);
|
||||||
|
@ -370,7 +311,9 @@ void SOLARISpanel::CreateDetGroup(int SettingID, QList<int> detID, QGridLayout *
|
||||||
digi[digiID]->WriteValue(PHA::CH::EventTriggerSource, "ChSelfTrigger", chID);
|
digi[digiID]->WriteValue(PHA::CH::EventTriggerSource, "ChSelfTrigger", chID);
|
||||||
digi[digiID]->WriteValue(PHA::CH::WaveTriggerSource, "ChSelfTrigger", chID);
|
digi[digiID]->WriteValue(PHA::CH::WaveTriggerSource, "ChSelfTrigger", chID);
|
||||||
|
|
||||||
if( i > 1 ) {
|
if( i == 1 ){
|
||||||
|
digi[digiID]->WriteValue(PHA::CH::CoincidenceMask, "Disabled", chID);
|
||||||
|
}else {
|
||||||
digi[digiID]->WriteValue(PHA::CH::CoincidenceMask, "Ch64Trigger", chID);
|
digi[digiID]->WriteValue(PHA::CH::CoincidenceMask, "Ch64Trigger", chID);
|
||||||
digi[digiID]->WriteValue(PHA::CH::CoincidenceLength, "100", chID);
|
digi[digiID]->WriteValue(PHA::CH::CoincidenceLength, "100", chID);
|
||||||
|
|
||||||
|
@ -395,6 +338,8 @@ void SOLARISpanel::CreateDetGroup(int SettingID, QList<int> detID, QGridLayout *
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UpdateOtherPanels();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -459,8 +404,12 @@ void SOLARISpanel::UpdatePanel(){
|
||||||
int detTypeID = FindDetTypID(detIDList[k]);
|
int detTypeID = FindDetTypID(detIDList[k]);
|
||||||
//Check the 0-index
|
//Check the 0-index
|
||||||
bool isAcceptableSetting = true;
|
bool isAcceptableSetting = true;
|
||||||
|
bool isTriggerE = false;
|
||||||
|
|
||||||
if( eventTriggerSource[0] != waveTriggerSource[0] || coincidentMask[0] != antiCoincidentMask[0] ) isAcceptableSetting = false;
|
if( eventTriggerSource[0] != waveTriggerSource[0] || coincidentMask[0] != antiCoincidentMask[0] ) isAcceptableSetting = false;
|
||||||
|
if( antiCoincidentMask[0] != "Disabled") isAcceptableSetting = false;
|
||||||
|
|
||||||
|
if( !(coincidentMask[0] == "Disabled" || coincidentMask[0] == "TRGIN") ) isAcceptableSetting = false;
|
||||||
|
|
||||||
//check 0-index settings
|
//check 0-index settings
|
||||||
if( isAcceptableSetting ){
|
if( isAcceptableSetting ){
|
||||||
|
@ -470,19 +419,24 @@ void SOLARISpanel::UpdatePanel(){
|
||||||
cbTrigger[detTypeID][detIDList[k][0]]->setCurrentText("Disabled");
|
cbTrigger[detTypeID][detIDList[k][0]]->setCurrentText("Disabled");
|
||||||
}else if( eventTriggerSource[0] == "TRGIN" && coincidentMask[0] == "TRGIN") {
|
}else if( eventTriggerSource[0] == "TRGIN" && coincidentMask[0] == "TRGIN") {
|
||||||
cbTrigger[detTypeID][detIDList[k][0]]->setCurrentText("Ext. Trigger");
|
cbTrigger[detTypeID][detIDList[k][0]]->setCurrentText("Ext. Trigger");
|
||||||
}else if( eventTriggerSource[0] == "ChSelfTrigger" && coincidentMask[0] == "Ch64Trigger") {
|
}else if( eventTriggerSource[0] == "ChSelfTrigger" && coincidentMask[0] == "Disabled") {
|
||||||
//Check trigger map
|
|
||||||
//TODO;
|
unsigned long mask = 1ULL << (detIDList[k][1] & 0xFF);
|
||||||
for( int p = 0; p < (int) triggerMap.size(); p ++ ){
|
|
||||||
printf("ch-%d, trigger : 0x%s \n", detIDList[k][p+1] & 0xFF, QString::number(triggerMap[p], 16).toStdString().c_str() );
|
for( int p = 1; p < (int) triggerMap.size(); p ++){
|
||||||
|
if( coincidentMask[p] != "Ch64Trigger") isAcceptableSetting = false;
|
||||||
|
if( triggerMap[p] != mask) isAcceptableSetting = false;
|
||||||
|
}
|
||||||
|
if( isAcceptableSetting ) {
|
||||||
|
cbTrigger[detTypeID][detIDList[k][0]]->setCurrentText("Trigger e");
|
||||||
|
isTriggerE = true;
|
||||||
}
|
}
|
||||||
cbTrigger[detTypeID][detIDList[k][0]]->setCurrentText("Trigger e");
|
|
||||||
}else{
|
}else{
|
||||||
isAcceptableSetting = false;
|
isAcceptableSetting = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( isAcceptableSetting ){
|
if( isAcceptableSetting){
|
||||||
//Check if eventTriggerSource or coincidentMask compare to the 0-index
|
//Check if eventTriggerSource or coincidentMask compare to the 0-index
|
||||||
for( int h = 2; h < detIDList[k].size(); h++){
|
for( int h = 2; h < detIDList[k].size(); h++){
|
||||||
if( eventTriggerSource[h-1] != eventTriggerSource[0]){
|
if( eventTriggerSource[h-1] != eventTriggerSource[0]){
|
||||||
|
@ -493,7 +447,7 @@ void SOLARISpanel::UpdatePanel(){
|
||||||
isAcceptableSetting = false;
|
isAcceptableSetting = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if( coincidentMask[h-1] != coincidentMask[0]){
|
if( !isTriggerE && coincidentMask[h-1] != coincidentMask[0]){
|
||||||
isAcceptableSetting = false;
|
isAcceptableSetting = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,10 @@
|
||||||
#include "CustomWidgets.h"
|
#include "CustomWidgets.h"
|
||||||
#include "macro.h"
|
#include "macro.h"
|
||||||
|
|
||||||
|
#define MaxSettingItem 3
|
||||||
|
#define MaxDetType 10
|
||||||
|
#define MaxDetID 60
|
||||||
|
|
||||||
class SOLARISpanel : public QWidget{
|
class SOLARISpanel : public QWidget{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@ -43,9 +47,7 @@ public slots:
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
//TODO
|
void UpdateOtherPanels();
|
||||||
void UpdateSettingsPanel();
|
|
||||||
void UpdateScopePanel();
|
|
||||||
void SendLogMsg(const QString str);
|
void SendLogMsg(const QString str);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -55,25 +57,22 @@ private:
|
||||||
unsigned short nDigi;
|
unsigned short nDigi;
|
||||||
std::vector<std::vector<int>> mapping;
|
std::vector<std::vector<int>> mapping;
|
||||||
QStringList detType;
|
QStringList detType;
|
||||||
std::vector<int> nDet; // number of disting detector
|
std::vector<int> nDet; // number of distgish detector
|
||||||
std::vector<int> detMaxID;
|
std::vector<int> detMaxID;
|
||||||
QList<QList<int>> detIDList; // 1-D array of { detID, (Digi << 8 ) + ch}
|
QList<QList<int>> detIDList; // 1-D array of { detID, (Digi << 8 ) + ch}
|
||||||
|
|
||||||
int FindDetTypID(QList<int> detIDListElement);
|
int FindDetTypID(QList<int> detIDListElement);
|
||||||
|
|
||||||
int nDigiMapping; /// mapping.size()
|
|
||||||
std::vector<int> nChMapping; /// mapping[i].size(), NON -1
|
|
||||||
|
|
||||||
QCheckBox * chkAll; // checkBox for all setting on that tab;
|
QCheckBox * chkAll; // checkBox for all setting on that tab;
|
||||||
QCheckBox * chkAlle;
|
QCheckBox * chkAlle;
|
||||||
QCheckBox * chkAllxf;
|
QCheckBox * chkAllxf;
|
||||||
QCheckBox * chkAllxn;
|
QCheckBox * chkAllxn;
|
||||||
|
|
||||||
QLineEdit **** leDisplay; // [SettingID][DigiID][ChID]
|
QLineEdit * leDisplay[MaxSettingItem][MaxNumberOfDigitizer][MaxNumberOfChannel]; // [SettingID][DigiID][ChID]
|
||||||
RSpinBox **** sbSetting;
|
RSpinBox * sbSetting[MaxSettingItem][MaxNumberOfDigitizer][MaxNumberOfChannel];
|
||||||
QCheckBox **** chkOnOff;
|
QCheckBox * chkOnOff[MaxSettingItem][MaxNumberOfDigitizer][MaxNumberOfChannel];
|
||||||
|
|
||||||
RComboBox *** cbTrigger; //[detTypeID][detID] for array only
|
RComboBox * cbTrigger[MaxDetType][MaxDetID]; //[detTypeID][detID] for array only
|
||||||
|
|
||||||
bool enableSignalSlot;
|
bool enableSignalSlot;
|
||||||
|
|
||||||
|
|
|
@ -843,32 +843,32 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
|
||||||
}
|
}
|
||||||
|
|
||||||
for( int ch = 0; ch < digi[ID]->GetNChannels() + 1; ch++) {
|
for( int ch = 0; ch < digi[ID]->GetNChannels() + 1; ch++) {
|
||||||
//send UpdateScopeSetting signal
|
//send UpdateOtherPanels signal
|
||||||
connect(spbDCOffset[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(spbDCOffset[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(spbRecordLength[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(spbRecordLength[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(spbPreTrigger[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(spbPreTrigger[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(spbThreshold[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(spbThreshold[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(spbTrapRiseTime[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(spbTrapRiseTime[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(spbTrapFlatTop[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(spbTrapFlatTop[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(spbTrapPoleZero[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(spbTrapPoleZero[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(spbPeaking[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(spbPeaking[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(spbTriggerGuard[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(spbTriggerGuard[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(spbTrapRiseTime[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(spbTrapRiseTime[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(spbFineGain[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(spbFineGain[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(spbBaselineGuard[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(spbBaselineGuard[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(spbPileupGuard[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(spbPileupGuard[iDigi][ch], &RSpinBox::returnPressed, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(cbbParity[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(cbbParity[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(cbbWaveRes[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(cbbWaveRes[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(cbbPeakingAvg[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(cbbPeakingAvg[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(cbbLowFilter[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(cbbLowFilter[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(cbbBaselineAvg[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(cbbBaselineAvg[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
|
|
||||||
connect(cbbAnaProbe0[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(cbbAnaProbe0[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(cbbAnaProbe1[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(cbbAnaProbe1[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(cbbDigProbe0[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(cbbDigProbe0[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(cbbDigProbe1[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(cbbDigProbe1[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(cbbDigProbe2[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(cbbDigProbe2[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
connect(cbbDigProbe3[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateScopeSetting);
|
connect(cbbDigProbe3[iDigi][ch], &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::UpdateOtherPanels);
|
||||||
|
|
||||||
//----- SyncBox
|
//----- SyncBox
|
||||||
connect(cbbOnOff[iDigi][ch], &RComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbOnOff, ch);});
|
connect(cbbOnOff[iDigi][ch], &RComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbOnOff, ch);});
|
||||||
|
@ -1438,7 +1438,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
|
||||||
|
|
||||||
DigiSettingsPanel::~DigiSettingsPanel(){
|
DigiSettingsPanel::~DigiSettingsPanel(){
|
||||||
|
|
||||||
printf("%s\n", __func__);
|
//printf("%s\n", __func__);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1547,7 +1547,7 @@ void DigiSettingsPanel::EnableControl(){
|
||||||
|
|
||||||
if( digi[ID]->GetFPGAType() != "DPP_PHA" || digi[ID]->GetModelName() != "VX2745" ) VGABox[ID]->setEnabled(false);
|
if( digi[ID]->GetFPGAType() != "DPP_PHA" || digi[ID]->GetModelName() != "VX2745" ) VGABox[ID]->setEnabled(false);
|
||||||
|
|
||||||
QVector<QTabWidget*> tempArray = {inputTab[ID], trapTab[ID], probeTab[ID], otherTab[ID], triggerTab[ID] };
|
QVector<QTabWidget*> tempArray = {inputTab[ID], trapTab[ID], probeTab[ID], otherTab[ID] };
|
||||||
|
|
||||||
for( int k = 0; k < tempArray.size(); k++){
|
for( int k = 0; k < tempArray.size(); k++){
|
||||||
for( int i = 0; i < tempArray[k]->count(); i++) {
|
for( int i = 0; i < tempArray[k]->count(); i++) {
|
||||||
|
@ -1561,7 +1561,8 @@ void DigiSettingsPanel::EnableControl(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
triggerMapTab[ID]->setEnabled(enable);
|
|
||||||
|
//triggerMapTab[ID]->setEnabled(enable);
|
||||||
|
|
||||||
icBox1->setEnabled(enable);
|
icBox1->setEnabled(enable);
|
||||||
icBox2->setEnabled(enable);
|
icBox2->setEnabled(enable);
|
||||||
|
|
|
@ -47,7 +47,7 @@ public slots:
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
void SendLogMsg(const QString &msg);
|
void SendLogMsg(const QString &msg);
|
||||||
void UpdateScopeSetting();
|
void UpdateOtherPanels();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
//------ static memeber
|
//------ static memeber
|
||||||
Digitizer2Gen ** MainWindow::digi = NULL;
|
Digitizer2Gen ** MainWindow::digi = nullptr;
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
|
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
|
||||||
|
|
||||||
|
@ -34,10 +34,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
|
||||||
setWindowIcon(icon);
|
setWindowIcon(icon);
|
||||||
|
|
||||||
nDigi = 0;
|
nDigi = 0;
|
||||||
digiSetting = NULL;
|
digiSetting = nullptr;
|
||||||
influx = NULL;
|
influx = nullptr;
|
||||||
readDataThread = NULL;
|
readDataThread = nullptr;
|
||||||
scope = NULL;
|
|
||||||
runTimer = new QTimer();
|
runTimer = new QTimer();
|
||||||
needManualComment = true;
|
needManualComment = true;
|
||||||
|
|
||||||
|
@ -58,15 +58,21 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
|
||||||
scalarLayout->setSpacing(0);
|
scalarLayout->setSpacing(0);
|
||||||
scalarLayout->setAlignment(Qt::AlignTop);
|
scalarLayout->setAlignment(Qt::AlignTop);
|
||||||
|
|
||||||
leTrigger = NULL;
|
leTrigger = nullptr;
|
||||||
leAccept = NULL;
|
leAccept = nullptr;
|
||||||
|
|
||||||
scalarThread = new ScalarThread();
|
scalarThread = new ScalarThread();
|
||||||
connect(scalarThread, &ScalarThread::updataScalar, this, &MainWindow::UpdateScalar);
|
connect(scalarThread, &ScalarThread::updataScalar, this, &MainWindow::UpdateScalar);
|
||||||
|
|
||||||
solarisSetting = nullptr;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
solarisSetting = nullptr;
|
||||||
|
scope = nullptr;
|
||||||
|
digiSetting = nullptr;
|
||||||
|
|
||||||
|
ConnectScopeAndSetting = false;
|
||||||
|
ConnectScopeAndSolaris = false;
|
||||||
|
ConnectSettingAndSolaris = false;
|
||||||
|
|
||||||
QWidget * mainLayoutWidget = new QWidget(this);
|
QWidget * mainLayoutWidget = new QWidget(this);
|
||||||
setCentralWidget(mainLayoutWidget);
|
setCentralWidget(mainLayoutWidget);
|
||||||
|
@ -262,17 +268,17 @@ MainWindow::~MainWindow(){
|
||||||
remove(DAQLockFile);
|
remove(DAQLockFile);
|
||||||
|
|
||||||
printf("-------- delete Solaris panel\n");
|
printf("-------- delete Solaris panel\n");
|
||||||
if( solarisSetting != NULL ) {
|
if( solarisSetting ) {
|
||||||
delete solarisSetting;
|
delete solarisSetting;
|
||||||
solarisSetting = nullptr;
|
solarisSetting = nullptr;
|
||||||
}
|
}
|
||||||
printf("-------- delete scope\n");
|
printf("-------- delete scope\n");
|
||||||
if( scope != NULL ) {
|
if( scope ) {
|
||||||
delete scope;
|
delete scope;
|
||||||
scope = nullptr;
|
scope = nullptr;
|
||||||
}
|
}
|
||||||
printf("-------- delete digiSetting\n");
|
printf("-------- delete digiSetting\n");
|
||||||
if( digiSetting != NULL ) {
|
if( digiSetting ) {
|
||||||
delete digiSetting;
|
delete digiSetting;
|
||||||
digiSetting = nullptr;
|
digiSetting = nullptr;
|
||||||
}
|
}
|
||||||
|
@ -635,16 +641,18 @@ void MainWindow::CloseDigitizers(){
|
||||||
|
|
||||||
if( digi == NULL) return;
|
if( digi == NULL) return;
|
||||||
|
|
||||||
scalar->close();
|
if(scalar ){ // scalar is child of this
|
||||||
DeleteTriggerLineEdit(); // this use digi->GetNChannels();
|
scalar->close();
|
||||||
|
DeleteTriggerLineEdit(); // this use digi->GetNChannels();
|
||||||
|
}
|
||||||
|
|
||||||
if( scope != NULL ){
|
if( scope ){
|
||||||
scope->close();
|
scope->close();
|
||||||
delete scope;
|
delete scope;
|
||||||
scope = NULL;
|
scope = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( digiSetting != NULL ){
|
if( digiSetting ){
|
||||||
digiSetting->close();
|
digiSetting->close();
|
||||||
delete digiSetting;
|
delete digiSetting;
|
||||||
digiSetting = NULL;
|
digiSetting = NULL;
|
||||||
|
@ -719,11 +727,18 @@ void MainWindow::OpenScope(){
|
||||||
influx->WriteData(DatabaseName.toStdString());
|
influx->WriteData(DatabaseName.toStdString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if( digiSetting ) {
|
if( digiSetting && ConnectScopeAndSetting ) {
|
||||||
connect(scope, &Scope::UpdateSettingsPanel, digiSetting, &DigiSettingsPanel::ShowSettingsToPanel);
|
connect(scope, &Scope::UpdateOtherPanels, digiSetting, &DigiSettingsPanel::ShowSettingsToPanel);
|
||||||
connect(scope, &Scope::TellSettingsPanelControlOnOff, digiSetting, &DigiSettingsPanel::EnableControl);
|
connect(scope, &Scope::TellSettingsPanelControlOnOff, digiSetting, &DigiSettingsPanel::EnableControl);
|
||||||
connect(digiSetting, &DigiSettingsPanel::UpdateScopeSetting, scope, &Scope::ReadScopeSettings);
|
connect(digiSetting, &DigiSettingsPanel::UpdateOtherPanels, scope, &Scope::ReadScopeSettings);
|
||||||
digiSetting->EnableControl();
|
ConnectScopeAndSetting = true;
|
||||||
|
}
|
||||||
|
if( digiSetting) digiSetting->EnableControl();
|
||||||
|
|
||||||
|
if( solarisSetting && !ConnectScopeAndSolaris ){
|
||||||
|
connect(scope, &Scope::UpdateOtherPanels, solarisSetting, &SOLARISpanel::UpdatePanel);
|
||||||
|
connect(solarisSetting, &SOLARISpanel::UpdateOtherPanels, scope, &Scope::ReadScopeSettings);
|
||||||
|
ConnectScopeAndSolaris = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
@ -743,10 +758,17 @@ void MainWindow::OpenDigitizersSettings(){
|
||||||
digiSetting = new DigiSettingsPanel(digi, nDigi);
|
digiSetting = new DigiSettingsPanel(digi, nDigi);
|
||||||
connect(digiSetting, &DigiSettingsPanel::SendLogMsg, this, &MainWindow::LogMsg);
|
connect(digiSetting, &DigiSettingsPanel::SendLogMsg, this, &MainWindow::LogMsg);
|
||||||
|
|
||||||
if( scope ) {
|
if( scope && !ConnectScopeAndSetting) {
|
||||||
connect(scope, &Scope::UpdateSettingsPanel, digiSetting, &DigiSettingsPanel::ShowSettingsToPanel);
|
connect(scope, &Scope::UpdateOtherPanels, digiSetting, &DigiSettingsPanel::ShowSettingsToPanel);
|
||||||
connect(scope, &Scope::TellSettingsPanelControlOnOff, digiSetting, &DigiSettingsPanel::EnableControl);
|
connect(scope, &Scope::TellSettingsPanelControlOnOff, digiSetting, &DigiSettingsPanel::EnableControl);
|
||||||
connect(digiSetting, &DigiSettingsPanel::UpdateScopeSetting, scope, &Scope::ReadScopeSettings);
|
connect(digiSetting, &DigiSettingsPanel::UpdateOtherPanels, scope, &Scope::ReadScopeSettings);
|
||||||
|
ConnectScopeAndSetting = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( solarisSetting && !ConnectSettingAndSolaris){
|
||||||
|
connect(digiSetting, &DigiSettingsPanel::UpdateOtherPanels, solarisSetting, &SOLARISpanel::UpdatePanel);
|
||||||
|
connect(solarisSetting, &SOLARISpanel::UpdateOtherPanels, digiSetting, &DigiSettingsPanel::ShowSettingsToPanel);
|
||||||
|
ConnectSettingAndSolaris = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
@ -758,6 +780,19 @@ void MainWindow::OpenDigitizersSettings(){
|
||||||
void MainWindow::OpenSOLARISpanel(){
|
void MainWindow::OpenSOLARISpanel(){
|
||||||
solarisSetting->show();
|
solarisSetting->show();
|
||||||
solarisSetting->UpdatePanel();
|
solarisSetting->UpdatePanel();
|
||||||
|
|
||||||
|
if( digiSetting && !ConnectSettingAndSolaris){
|
||||||
|
connect(digiSetting, &DigiSettingsPanel::UpdateOtherPanels, solarisSetting, &SOLARISpanel::UpdatePanel);
|
||||||
|
connect(solarisSetting, &SOLARISpanel::UpdateOtherPanels, digiSetting, &DigiSettingsPanel::ShowSettingsToPanel);
|
||||||
|
ConnectSettingAndSolaris = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( scope && !ConnectScopeAndSolaris){
|
||||||
|
connect(scope, &Scope::UpdateOtherPanels, solarisSetting, &SOLARISpanel::UpdatePanel);
|
||||||
|
connect(solarisSetting, &SOLARISpanel::UpdateOtherPanels, scope, &Scope::ReadScopeSettings);
|
||||||
|
ConnectScopeAndSolaris = true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MainWindow::CheckSOLARISpanelOK(){
|
bool MainWindow::CheckSOLARISpanelOK(){
|
||||||
|
@ -855,6 +890,8 @@ bool MainWindow::CheckSOLARISpanelOK(){
|
||||||
solarisSetting = new SOLARISpanel(digi, nDigi, mapping, detType, detMaxID);
|
solarisSetting = new SOLARISpanel(digi, nDigi, mapping, detType, detMaxID);
|
||||||
connect(solarisSetting, &SOLARISpanel::SendLogMsg, this, &MainWindow::LogMsg);
|
connect(solarisSetting, &SOLARISpanel::SendLogMsg, this, &MainWindow::LogMsg);
|
||||||
|
|
||||||
|
if( solarisSetting == nullptr) return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -932,7 +969,7 @@ void MainWindow::SetUpScalar(){
|
||||||
|
|
||||||
void MainWindow::DeleteTriggerLineEdit(){
|
void MainWindow::DeleteTriggerLineEdit(){
|
||||||
|
|
||||||
if( leTrigger == NULL ) return;
|
if( leTrigger ) return;
|
||||||
|
|
||||||
for( int i = 0; i < nDigi; i++){
|
for( int i = 0; i < nDigi; i++){
|
||||||
for( int ch = 0; ch < digi[i]->GetNChannels(); ch ++){
|
for( int ch = 0; ch < digi[i]->GetNChannels(); ch ++){
|
||||||
|
|
|
@ -182,6 +182,10 @@ private:
|
||||||
unsigned long oldSavedCount[MaxNumberOfDigitizer][MaxNumberOfChannel];
|
unsigned long oldSavedCount[MaxNumberOfDigitizer][MaxNumberOfChannel];
|
||||||
unsigned long oldTimeStamp[MaxNumberOfDigitizer][MaxNumberOfChannel];
|
unsigned long oldTimeStamp[MaxNumberOfDigitizer][MaxNumberOfChannel];
|
||||||
|
|
||||||
|
//@------ connection between pannels
|
||||||
|
bool ConnectScopeAndSetting;
|
||||||
|
bool ConnectScopeAndSolaris;
|
||||||
|
bool ConnectSettingAndSolaris;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
10
scope.cpp
10
scope.cpp
|
@ -85,7 +85,7 @@ Scope::Scope(Digitizer2Gen **digi, unsigned int nDigi, ReadDataThread ** readDat
|
||||||
digi[iDigi]->WriteValue(PHA::CH::ChannelEnable, "False", -1);
|
digi[iDigi]->WriteValue(PHA::CH::ChannelEnable, "False", -1);
|
||||||
digi[iDigi]->WriteValue(PHA::CH::ChannelEnable, "True", ch);
|
digi[iDigi]->WriteValue(PHA::CH::ChannelEnable, "True", ch);
|
||||||
ReadScopeSettings();
|
ReadScopeSettings();
|
||||||
UpdateSettingsPanel();
|
UpdateOtherPanels();
|
||||||
digiMTX[iDigi].unlock();
|
digiMTX[iDigi].unlock();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -597,8 +597,8 @@ void Scope::ScopeMakeSpinBox(RSpinBox * &sb, QString str, QGridLayout *layout, i
|
||||||
sb->setStyleSheet("");
|
sb->setStyleSheet("");
|
||||||
|
|
||||||
//TODO digiSettingPanel update setting
|
//TODO digiSettingPanel update setting
|
||||||
printf("UpdateSettingsPanel \n");
|
printf("UpdateOtherPanels \n");
|
||||||
emit UpdateSettingsPanel();
|
emit UpdateOtherPanels();
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
SendLogMsg(msg + "|Fail.");
|
SendLogMsg(msg + "|Fail.");
|
||||||
|
@ -633,8 +633,8 @@ void Scope::ScopeMakeComoBox(RComboBox * &cb, QString str, QGridLayout *layout,
|
||||||
SendLogMsg(msg + "|OK.");
|
SendLogMsg(msg + "|OK.");
|
||||||
cb->setStyleSheet("");
|
cb->setStyleSheet("");
|
||||||
//TODO digiSettingPanel update setting
|
//TODO digiSettingPanel update setting
|
||||||
printf("UpdateSettingsPanel \n");
|
printf("UpdateOtherPanels \n");
|
||||||
emit UpdateSettingsPanel();
|
emit UpdateOtherPanels();
|
||||||
}else{
|
}else{
|
||||||
SendLogMsg(msg + "|Fail.");
|
SendLogMsg(msg + "|Fail.");
|
||||||
cb->setStyleSheet("color:red;");
|
cb->setStyleSheet("color:red;");
|
||||||
|
|
2
scope.h
2
scope.h
|
@ -132,7 +132,7 @@ signals:
|
||||||
void CloseWindow();
|
void CloseWindow();
|
||||||
void SendLogMsg(const QString &msg);
|
void SendLogMsg(const QString &msg);
|
||||||
void UpdateScalar();
|
void UpdateScalar();
|
||||||
void UpdateSettingsPanel();
|
void UpdateOtherPanels();
|
||||||
void TellSettingsPanelControlOnOff();
|
void TellSettingsPanelControlOnOff();
|
||||||
void TellACQOnOff(const bool onOff);
|
void TellACQOnOff(const bool onOff);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user