diff --git a/slsDetectorGui/src/qTabSettings.cpp b/slsDetectorGui/src/qTabSettings.cpp index 4a4dcea3d..ff31e780c 100644 --- a/slsDetectorGui/src/qTabSettings.cpp +++ b/slsDetectorGui/src/qTabSettings.cpp @@ -38,7 +38,10 @@ void qTabSettings::SetupWidgetWindow(){ detType=myDet->getDetectorsType(); // Settings - SetupDetectorSettings(); + if (detType != slsReceiverDefs::JUNGFRAUCTB) { + SetupDetectorSettings(); + } else + comboSettings->setEnabled(false); //threshold if((detType == slsDetectorDefs::MYTHEN) || (detType == slsDetectorDefs::EIGER)) @@ -104,8 +107,7 @@ void qTabSettings::SetupDetectorSettings(){ int sett = (int)myDet->getSettings();cout<<"sett:"< slsDetectorDefs::UNDEFINED) sett = Uninitialized; - else if(sett == slsDetectorDefs::UNDEFINED) sett = Undefined; + if(sett == slsDetectorDefs::UNDEFINED) sett = Undefined; else if(sett == slsDetectorDefs::UNINITIALIZED) sett = Uninitialized; // To be able to index items on a combo box model = qobject_cast(comboSettings->model()); @@ -167,7 +169,6 @@ void qTabSettings::SetupDetectorSettings(){ item[(int)VeryLowGain]->setEnabled(false); break; case slsDetectorDefs::JUNGFRAU: - case slsDetectorDefs::JUNGFRAUCTB: item[(int)Standard]->setEnabled(false); item[(int)Fast]->setEnabled(false); item[(int)HighGain]->setEnabled(false); @@ -208,7 +209,8 @@ void qTabSettings::SetupDetectorSettings(){ void qTabSettings::Initialization(){ // Settings - connect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setSettings(int))); + if (detType != slsReceiverDefs::JUNGFRAUCTB) + connect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setSettings(int))); // Number of Modules connect(spinNumModules, SIGNAL(valueChanged(int)), this, SLOT(SetNumberOfModules(int))); // Dynamic Range @@ -226,8 +228,7 @@ void qTabSettings::setSettings(int index){ disconnect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setSettings(int))); int sett = (int)myDet->getSettings(); if(sett==-1) sett = Undefined; - if(detType == slsDetectorDefs::JUNGFRAUCTB && sett > slsDetectorDefs::UNDEFINED) sett = Uninitialized; - else if(sett == slsDetectorDefs::UNDEFINED) sett = Undefined; + if(sett == slsDetectorDefs::UNDEFINED) sett = Undefined; else if(sett == slsDetectorDefs::UNINITIALIZED) sett = Uninitialized; comboSettings->setCurrentIndex(sett); connect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setSettings(int))); @@ -320,7 +321,8 @@ void qTabSettings::Refresh(){ cout << endl << "**Updating Settings Tab" << endl; #endif - disconnect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setSettings(int))); + if (detType != slsReceiverDefs::JUNGFRAUCTB) + disconnect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setSettings(int))); disconnect(spinNumModules, SIGNAL(valueChanged(int)), this, SLOT(SetNumberOfModules(int))); disconnect(spinThreshold, SIGNAL(valueChanged(int)), this, SLOT(SetEnergy())); @@ -339,35 +341,35 @@ void qTabSettings::Refresh(){ GetDynamicRange(); // Settings + if (detType != slsReceiverDefs::JUNGFRAUCTB) { #ifdef VERBOSE - cout << "Getting settings" << endl; + cout << "Getting settings" << endl; #endif - int sett = (int)myDet->getSettings(); - if(sett==-1) sett = Undefined;//slsDetectorDefs::UNDEFINED; - if(detType == slsDetectorDefs::JUNGFRAUCTB && sett > slsDetectorDefs::UNDEFINED) sett = Uninitialized; - else if(sett == slsDetectorDefs::UNDEFINED) sett = Undefined; - else if(sett == slsDetectorDefs::UNINITIALIZED) sett = Uninitialized; - comboSettings->setCurrentIndex(sett); + int sett = (int)myDet->getSettings(); + if(sett==-1) sett = Undefined;//slsDetectorDefs::UNDEFINED; + if(sett == slsDetectorDefs::UNDEFINED) sett = Undefined; + else if(sett == slsDetectorDefs::UNINITIALIZED) sett = Uninitialized; + comboSettings->setCurrentIndex(sett); - - //threshold - sett = comboSettings->currentIndex(); - if((detType==slsDetectorDefs::MYTHEN)||(detType==slsDetectorDefs::EIGER)){ - if((sett==Undefined)||(sett==Uninitialized)){ - lblThreshold->setEnabled(false); - spinThreshold->setEnabled(false); - }else{ - lblThreshold->setEnabled(true); - spinThreshold->setEnabled(true); + //threshold + sett = comboSettings->currentIndex(); + if((detType==slsDetectorDefs::MYTHEN)||(detType==slsDetectorDefs::EIGER)){ + if((sett==Undefined)||(sett==Uninitialized)){ + lblThreshold->setEnabled(false); + spinThreshold->setEnabled(false); + }else{ + lblThreshold->setEnabled(true); + spinThreshold->setEnabled(true); #ifdef VERBOSE - cout << "Getting threshold energy" << endl; + cout << "Getting threshold energy" << endl; #endif - spinThreshold->setValue(myDet->getThresholdEnergy()); + spinThreshold->setValue(myDet->getThresholdEnergy()); + } } - } +} - - connect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setSettings(int))); + if (detType != slsReceiverDefs::JUNGFRAUCTB) + connect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setSettings(int))); connect(spinNumModules, SIGNAL(valueChanged(int)), this, SLOT(SetNumberOfModules(int))); connect(spinThreshold, SIGNAL(valueChanged(int)), this, SLOT(SetEnergy()));