Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer

This commit is contained in:
Erik Frojdh 2018-05-28 12:22:35 +02:00
commit 22ef1cee8b

View File

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