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();
// Settings
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:"<<sett<<endl;
qDefs::checkErrorMessage(myDet,"qTabSettings::SetupDetectorSettings");
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;
// To be able to index items on a combo box
model = qobject_cast<QStandardItemModel*>(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,6 +209,7 @@ void qTabSettings::SetupDetectorSettings(){
void qTabSettings::Initialization(){
// Settings
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)));
@ -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,6 +321,7 @@ void qTabSettings::Refresh(){
cout << endl << "**Updating Settings Tab" << endl;
#endif
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,17 +341,16 @@ void qTabSettings::Refresh(){
GetDynamicRange();
// Settings
if (detType != slsReceiverDefs::JUNGFRAUCTB) {
#ifdef VERBOSE
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;
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)){
@ -365,8 +366,9 @@ void qTabSettings::Refresh(){
spinThreshold->setValue(myDet->getThresholdEnergy());
}
}
}
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()));