fixed scope stop, only restore ch on/off for 1st digitizer, added more comment string support for Mapping.h, change color green to orange for some Combox

This commit is contained in:
Ryan Tang 2023-10-20 11:47:39 -04:00
parent f95796e4da
commit 9010673a4f
3 changed files with 22 additions and 16 deletions

View File

@ -58,6 +58,8 @@ QStringList chToolTip = { "Channel signal delay initialization status (1 = initi
"Time-energy event free space status (1 = time-energy can be written)", "Time-energy event free space status (1 = time-energy can be written)",
"Waveform event free space status (1 = waveform can be written)"}; "Waveform event free space status (1 = waveform can be written)"};
QColor orangeColor(255, 165, 0);
DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi, QString analysisPath, QWidget * parent) : QWidget(parent){ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi, QString analysisPath, QWidget * parent) : QWidget(parent){
setWindowTitle("Digitizers Settings"); setWindowTitle("Digitizers Settings");
@ -1672,12 +1674,12 @@ void DigiSettingsPanel::SetupPHAChannels(unsigned short digiID){
for( int ch = 0; ch < digi[digiID]->GetNChannels(); ch++){ for( int ch = 0; ch < digi[digiID]->GetNChannels(); ch++){
//Set color of some combox //Set color of some combox
cbbOnOff[digiID][ch]->setItemData(1, QBrush(Qt::green), Qt::ForegroundRole); cbbOnOff[digiID][ch]->setItemData(1, QBrush(orangeColor), Qt::ForegroundRole);
connect(cbbOnOff[digiID][ch], &RComboBox::currentIndexChanged, this, [=](int index){ cbbOnOff[ID][ch]->setStyleSheet(index == 1 ? "color : green;" : "");}); connect(cbbOnOff[digiID][ch], &RComboBox::currentIndexChanged, this, [=](int index){ cbbOnOff[ID][ch]->setStyleSheet(index == 1 ? "color : orange;" : "");});
cbbParity[digiID][ch]->setItemData(1, QBrush(Qt::green), Qt::ForegroundRole); cbbParity[digiID][ch]->setItemData(1, QBrush(orangeColor), Qt::ForegroundRole);
connect(cbbParity[digiID][ch], &RComboBox::currentIndexChanged, this, [=](int index){ cbbParity[ID][ch]->setStyleSheet(index == 1 ? "color : green;" : "");}); connect(cbbParity[digiID][ch], &RComboBox::currentIndexChanged, this, [=](int index){ cbbParity[ID][ch]->setStyleSheet(index == 1 ? "color : orange;" : "");});
cbbLowFilter[digiID][ch]->setItemData(1, QBrush(Qt::green), Qt::ForegroundRole); cbbLowFilter[digiID][ch]->setItemData(1, QBrush(orangeColor), Qt::ForegroundRole);
connect(cbbLowFilter[digiID][ch], &RComboBox::currentIndexChanged, this, [=](int index){ cbbLowFilter[ID][ch]->setStyleSheet(index == 1 ? "color : green;": "");}); connect(cbbLowFilter[digiID][ch], &RComboBox::currentIndexChanged, this, [=](int index){ cbbLowFilter[ID][ch]->setStyleSheet(index == 1 ? "color : orange;": "");});
} }
} }
@ -2093,10 +2095,10 @@ void DigiSettingsPanel::SetupPSDChannels(unsigned short digiID){
for( int ch = 0; ch < digi[digiID]->GetNChannels(); ch++){ for( int ch = 0; ch < digi[digiID]->GetNChannels(); ch++){
//Set color of some combox //Set color of some combox
cbbOnOff[digiID][ch]->setItemData(1, QBrush(Qt::green), Qt::ForegroundRole); cbbOnOff[digiID][ch]->setItemData(1, QBrush(orangeColor), Qt::ForegroundRole);
connect(cbbOnOff[digiID][ch], &RComboBox::currentIndexChanged, this, [=](int index){ cbbOnOff[ID][ch]->setStyleSheet(index == 1 ? "color : green;" : "");}); connect(cbbOnOff[digiID][ch], &RComboBox::currentIndexChanged, this, [=](int index){ cbbOnOff[ID][ch]->setStyleSheet(index == 1 ? "color : orange;" : "");});
cbbParity[digiID][ch]->setItemData(1, QBrush(Qt::green), Qt::ForegroundRole); cbbParity[digiID][ch]->setItemData(1, QBrush(orangeColor), Qt::ForegroundRole);
connect(cbbParity[digiID][ch], &RComboBox::currentIndexChanged, this, [=](int index){ cbbParity[ID][ch]->setStyleSheet(index == 1 ? "color : green;" : "");}); connect(cbbParity[digiID][ch], &RComboBox::currentIndexChanged, this, [=](int index){ cbbParity[ID][ch]->setStyleSheet(index == 1 ? "color : orange;" : "");});
} }
} }

View File

@ -963,8 +963,12 @@ bool MainWindow::CheckSOLARISpanelOK(){
QTextStream in(&file); QTextStream in(&file);
while (!in.atEnd()) { while (!in.atEnd()) {
QString line = in.readLine(); QString line = in.readLine();
if( line.contains("//^")) continue; if( line.contains("//^")) continue;
if( line.contains("//C=")){ if( line.contains("// //")) continue;
if( line.contains("////")) continue;
if( line.contains("//C=")){ // detType
int in1 = line.indexOf("{"); int in1 = line.indexOf("{");
int in2 = line.lastIndexOf("}"); int in2 = line.lastIndexOf("}");
if( in2 > in1){ if( in2 > in1){
@ -975,7 +979,7 @@ bool MainWindow::CheckSOLARISpanelOK(){
return false; return false;
} }
} }
if( line.contains("//C%")){ if( line.contains("//C%")){ // groupName
int in1 = line.indexOf("{"); int in1 = line.indexOf("{");
int in2 = line.lastIndexOf("}"); int in2 = line.lastIndexOf("}");
if( in2 > in1){ if( in2 > in1){
@ -986,7 +990,7 @@ bool MainWindow::CheckSOLARISpanelOK(){
return false; return false;
} }
} }
if( line.contains("//C&")){ if( line.contains("//C&")){ //groupID
int in1 = line.indexOf("{"); int in1 = line.indexOf("{");
int in2 = line.lastIndexOf("}"); int in2 = line.lastIndexOf("}");
if( in2 > in1){ if( in2 > in1){
@ -998,7 +1002,7 @@ bool MainWindow::CheckSOLARISpanelOK(){
return false; return false;
} }
} }
if( line.contains("//C#")){ if( line.contains("//C#")){ //detMaxID
int in1 = line.indexOf("{"); int in1 = line.indexOf("{");
int in2 = line.lastIndexOf("}"); int in2 = line.lastIndexOf("}");
if( in2 > in1){ if( in2 > in1){

View File

@ -569,10 +569,10 @@ void Scope::StartScope(){
ReadScopeSettings(); ReadScopeSettings();
/// the settings are the same for PHA and PSD /// the settings are the same for PHA and PSD
for( int ch2 = 0 ; ch2 < digi[iDigi]->GetNChannels(); ch2 ++){ for( int ch2 = 0 ; ch2 < digi[iDigi]->GetNChannels(); ch2 ++){
channelEnable[iDigi][ch2] = digi[iDigi]->ReadValue(PHA::CH::ChannelEnable, ch2); channelEnable[iDigi][ch2] = digi[iDigi]->ReadValue(PHA::CH::ChannelEnable, ch2);
} }
digi[iDigi]->WriteValue(PHA::CH::ChannelEnable, "False", -1); digi[iDigi]->WriteValue(PHA::CH::ChannelEnable, "False", -1);
if( iDigi == cbScopeDigi->currentIndex() ){ if( iDigi == cbScopeDigi->currentIndex() ){
@ -630,7 +630,6 @@ void Scope::StopScope(){
digi[i]->WriteValue(PHA::CH::WaveTriggerSource, waveTriggerSource, cbScopeCh->currentIndex()); digi[i]->WriteValue(PHA::CH::WaveTriggerSource, waveTriggerSource, cbScopeCh->currentIndex());
digi[i]->WriteValue(PHA::CH::WaveSaving, waveSaving, cbScopeCh->currentIndex()); digi[i]->WriteValue(PHA::CH::WaveSaving, waveSaving, cbScopeCh->currentIndex());
} }
originalValueSet = false;
} }
digiMTX[i].unlock(); digiMTX[i].unlock();
} }
@ -638,6 +637,7 @@ void Scope::StopScope(){
emit TellACQOnOff(false); emit TellACQOnOff(false);
} }
originalValueSet = false;
ScopeControlOnOff(true); ScopeControlOnOff(true);
emit TellSettingsPanelControlOnOff(); emit TellSettingsPanelControlOnOff();