mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
merge
This commit is contained in:
@ -521,7 +521,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
|
||||
}
|
||||
}
|
||||
else if(action==actionLoadTrimbits){
|
||||
QString fName = QString(myDet->getSettingsDir());
|
||||
QString fName = QString( (myDet->getSettingsDir()).c_str());
|
||||
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||
//gotthard
|
||||
if(actionLoadTrimbits->text().contains("Settings")){
|
||||
@ -568,7 +568,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
|
||||
cout << "Saving Settings" << endl;
|
||||
#endif
|
||||
//different output directory so as not to overwrite
|
||||
QString fName = QString(myDet->getSettingsDir());
|
||||
QString fName = QString( (myDet->getSettingsDir()).c_str() );
|
||||
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||
fName = QFileDialog::getSaveFileName(this,
|
||||
tr("Save Current Detector Settings"),fName,
|
||||
@ -585,7 +585,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
|
||||
#ifdef VERBOSE
|
||||
cout << "Saving Trimbits" << endl;
|
||||
#endif//different output directory so as not to overwrite
|
||||
QString fName = QString(myDet->getSettingsDir());
|
||||
QString fName = QString( (myDet->getSettingsDir()).c_str() );
|
||||
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||
fName = QFileDialog::getSaveFileName(this,
|
||||
tr("Save Current Detector Trimbits"),fName,
|
||||
@ -603,7 +603,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
|
||||
#ifdef VERBOSE
|
||||
cout << "Loading Calibration Data" << endl;
|
||||
#endif
|
||||
QString fName = QString(myDet->getCalDir());
|
||||
QString fName = QString( (myDet->getCalDir()).c_str() );
|
||||
qDefs::checkErrorMessage(myDet);
|
||||
|
||||
//so that even nonexisting files can be selected
|
||||
@ -626,7 +626,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
|
||||
#ifdef VERBOSE
|
||||
cout << "Saving Calibration Data" << endl;
|
||||
#endif//different output directory so as not to overwrite
|
||||
QString fName = QString(myDet->getCalDir());
|
||||
QString fName = QString( (myDet->getCalDir()).c_str() );
|
||||
qDefs::checkErrorMessage(myDet);
|
||||
fName = QFileDialog::getSaveFileName(this,
|
||||
tr("Save Current Detector Calibration Data"),fName,
|
||||
|
@ -563,9 +563,13 @@ void qDrawPlot::SetScanArgument(int scanArg){
|
||||
// Number of Exposures - must be calculated here to get npixelsy for allframes/frameindex scans
|
||||
int numFrames = (isFrameEnabled)*((int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,-1));
|
||||
int numTriggers = (isTriggerEnabled)*((int)myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,-1));
|
||||
int numStoragecells = 0;
|
||||
if (detType == slsDetectorDefs::JUNGFRAU)
|
||||
numStoragecells = (int)myDet->setTimer(slsDetectorDefs::STORAGE_CELL_NUMBER, -1);
|
||||
numFrames = ((numFrames==0)?1:numFrames);
|
||||
numTriggers = ((numTriggers==0)?1:numTriggers);
|
||||
number_of_frames = numFrames * numTriggers;
|
||||
numStoragecells = ((numStoragecells<=0)?1:numStoragecells+1);
|
||||
number_of_frames = numFrames * numTriggers * numStoragecells;
|
||||
cout << "\tNumber of Frames per Scan/Measurement:" << number_of_frames << endl;
|
||||
//get #scansets for level 0 and level 1
|
||||
int numScan0 = myDet->getScanSteps(0); numScan0 = ((numScan0==0)?1:numScan0);
|
||||
@ -2232,9 +2236,9 @@ void qDrawPlot::toDoublePixelData(double* dest, char* source,int size, int datab
|
||||
// only data plot
|
||||
else {
|
||||
for (ichan = 0; ichan < size; ++ichan) {
|
||||
if ( (*((u_int16_t*)source)) == 0xFFFF )
|
||||
/*if ( (*((u_int16_t*)source)) == 0xFFFF )
|
||||
dest[ichan] = 0xFFFF;
|
||||
else
|
||||
else*/
|
||||
dest[ichan] = ((*((u_int16_t*)source)) & 0x3FFF);
|
||||
source += 2;
|
||||
}
|
||||
|
@ -72,6 +72,14 @@ void qTabAdvanced::SetupWidgetWindow(){
|
||||
rxrOnlineTip = comboRxrOnline->toolTip();
|
||||
errOnlineTip = QString("<nobr><br><br><font color=\"red\"><nobr>It is offline!</nobr></font>");
|
||||
|
||||
acqSubPeriodTip = spinSubPeriod->toolTip();
|
||||
errSubPeriodTip = acqSubPeriodTip +
|
||||
QString("<nobr><br><br><font color=\"red\"><b>Sub Frame Period</b> "
|
||||
"should be greater than or equal to "
|
||||
"<b>Sub Frame Exposure Time</b>.</font></nobr>");
|
||||
|
||||
|
||||
|
||||
detType = myDet->getDetectorsType();
|
||||
switch(detType){
|
||||
case slsDetectorDefs::MYTHEN:
|
||||
@ -91,6 +99,12 @@ void qTabAdvanced::SetupWidgetWindow(){
|
||||
dispMAC->setEnabled(true);
|
||||
boxRxr->setEnabled(true);
|
||||
boxSetAllTrimbits->setEnabled(true);
|
||||
lblSubExpTime->setEnabled(true);
|
||||
spinSubExpTime->setEnabled(true);
|
||||
comboSubExpTimeUnit->setEnabled(true);
|
||||
lblSubPeriod->setEnabled(true);
|
||||
spinSubPeriod->setEnabled(true);
|
||||
comboSubPeriodUnit->setEnabled(true);
|
||||
break;
|
||||
case slsDetectorDefs::MOENCH:
|
||||
isEnergy = false;
|
||||
@ -197,16 +211,35 @@ void qTabAdvanced::SetupWidgetWindow(){
|
||||
|
||||
//updates roi
|
||||
cout << "Getting ROI" << endl;
|
||||
if (myDet->getDetectorsType() == slsDetectorDefs::GOTTHARD)
|
||||
if (detType == slsDetectorDefs::GOTTHARD)
|
||||
updateROIList();
|
||||
#ifdef VERYVERBOSE
|
||||
// print receiver configurations
|
||||
if(myDet->getDetectorsType() != slsDetectorDefs::MYTHEN){
|
||||
if(detType != slsDetectorDefs::MYTHEN){
|
||||
cout << endl;
|
||||
myDet->printReceiverConfiguration();
|
||||
}
|
||||
#endif
|
||||
|
||||
// jungfrau
|
||||
if (detType == slsReceiverDefs::JUNGFRAU) {
|
||||
lblNumStoragecells->setEnabled(true);
|
||||
spinNumStoragecells->setEnabled(true);
|
||||
spinNumStoragecells->setValue((int)myDet->setTimer(slsDetectorDefs::STORAGE_CELL_NUMBER,-1));
|
||||
} else if (detType == slsDetectorDefs::EIGER) {
|
||||
//subexptime
|
||||
qDefs::timeUnit unit;
|
||||
double time = qDefs::getCorrectTime(unit,((double)(myDet->setTimer(slsDetectorDefs::SUBFRAME_ACQUISITION_TIME,-1)*(1E-9))));
|
||||
spinSubExpTime->setValue(time);
|
||||
comboSubExpTimeUnit->setCurrentIndex((int)unit);
|
||||
//period
|
||||
time = qDefs::getCorrectTime(unit,((double)(myDet->setTimer(slsDetectorDefs::SUBFRAME_PERIOD,-1)*(1E-9))));
|
||||
spinSubPeriod->setValue(time);
|
||||
comboSubPeriodUnit->setCurrentIndex((int)unit);
|
||||
|
||||
CheckAcqPeriodGreaterThanExp();
|
||||
}
|
||||
|
||||
Initialization();
|
||||
|
||||
qDefs::checkErrorMessage(det,"qTabAdvanced::SetupWidgetWindow");
|
||||
@ -288,11 +321,23 @@ void qTabAdvanced::Initialization(){
|
||||
|
||||
//roi
|
||||
|
||||
if (myDet->getDetectorsType() == slsDetectorDefs::GOTTHARD) {
|
||||
if (detType == slsDetectorDefs::GOTTHARD) {
|
||||
connect(btnClearRoi, SIGNAL(clicked()), this, SLOT(clearROIinDetector()));
|
||||
connect(btnGetRoi, SIGNAL(clicked()), this, SLOT(updateROIList()));
|
||||
connect(btnSetRoi, SIGNAL(clicked()), this, SLOT(setROI()));
|
||||
}
|
||||
|
||||
if(detType == slsReceiverDefs::JUNGFRAU) {
|
||||
connect(spinNumStoragecells, SIGNAL(valueChanged(int)), this, SLOT(SetNumStoragecells(int)));
|
||||
} else if (detType == slsDetectorDefs::EIGER) {
|
||||
//Exposure Time
|
||||
connect(spinSubExpTime,SIGNAL(valueChanged(double)), this, SLOT(SetSubExposureTime()));
|
||||
connect(comboSubExpTimeUnit,SIGNAL(currentIndexChanged(int)), this, SLOT(SetSubExposureTime()));
|
||||
//Frame Period between exposures
|
||||
connect(spinSubPeriod,SIGNAL(valueChanged(double)), this, SLOT(SetSubPeriod()));
|
||||
connect(comboSubPeriodUnit,SIGNAL(currentIndexChanged(int)),this, SLOT(SetSubPeriod()));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1225,6 +1270,127 @@ void qTabAdvanced::updateAllTrimbitsFromServer(){
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabAdvanced::SetNumStoragecells(int value) {
|
||||
#ifdef VERBOSE
|
||||
cout << "Setting number of stoarge cells to " << value << endl;
|
||||
#endif
|
||||
myDet->setTimer(slsDetectorDefs::STORAGE_CELL_NUMBER,value);
|
||||
|
||||
disconnect(spinNumStoragecells,SIGNAL(valueChanged(int)),this, SLOT(SetNumStoragecells(int)));
|
||||
spinNumStoragecells->setValue((int)myDet->setTimer(slsDetectorDefs::STORAGE_CELL_NUMBER,-1));
|
||||
connect(spinNumStoragecells,SIGNAL(valueChanged(int)), this, SLOT(SetNumStoragecells(int)));
|
||||
|
||||
qDefs::checkErrorMessage(myDet,"qTabAdvanced::SetNumStoragecells");
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabAdvanced::SetSubExposureTime() {
|
||||
disconnect(spinSubExpTime,SIGNAL(valueChanged(double)), this, SLOT(SetSubExposureTime()));
|
||||
disconnect(comboSubExpTimeUnit,SIGNAL(currentIndexChanged(int)),this, SLOT(SetSubExposureTime()));
|
||||
|
||||
//Get the value of timer in ns
|
||||
double timeNS = qDefs::getNSTime(
|
||||
(qDefs::timeUnit)comboSubExpTimeUnit->currentIndex(),
|
||||
spinSubExpTime->value());
|
||||
|
||||
// set value
|
||||
#ifdef VERBOSE
|
||||
cout << "Setting sub frame acquisition time to " << timeNS << " clocks" <<
|
||||
"/" << spinSubExpTime->value() <<
|
||||
qDefs::getUnitString((qDefs::timeUnit)comboSubExpTimeUnit->currentIndex()) << endl;
|
||||
#endif
|
||||
myDet->setTimer(slsDetectorDefs::SUBFRAME_ACQUISITION_TIME,(int64_t)timeNS);
|
||||
qDefs::checkErrorMessage(myDet,"qTabAdvanced::SetSubExposureTime");
|
||||
|
||||
// update value in gui
|
||||
qDefs::timeUnit unit;
|
||||
double time = qDefs::getCorrectTime(unit,((double)(
|
||||
myDet->setTimer(slsDetectorDefs::SUBFRAME_ACQUISITION_TIME,-1)*(1E-9))));
|
||||
spinSubExpTime->setValue(time);
|
||||
comboSubExpTimeUnit->setCurrentIndex((int)unit);
|
||||
|
||||
|
||||
// highlight if period < exptime
|
||||
CheckAcqPeriodGreaterThanExp();
|
||||
|
||||
connect(spinSubExpTime,SIGNAL(valueChanged(double)), this, SLOT(SetSubExposureTime()));
|
||||
connect(comboSubExpTimeUnit,SIGNAL(currentIndexChanged(int)), this, SLOT(SetSubExposureTime()));
|
||||
|
||||
|
||||
qDefs::checkErrorMessage(myDet,"qTabAdvanced::SetSubExposureTime");
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabAdvanced::SetSubPeriod() {
|
||||
disconnect(spinSubPeriod,SIGNAL(valueChanged(double)), this, SLOT(SetSubPeriod()));
|
||||
disconnect(comboSubPeriodUnit,SIGNAL(currentIndexChanged(int)),this, SLOT(SetSubPeriod()));
|
||||
|
||||
//Get the value of timer in ns
|
||||
double timeNS = qDefs::getNSTime(
|
||||
(qDefs::timeUnit)comboSubPeriodUnit->currentIndex(),
|
||||
spinSubPeriod->value());
|
||||
|
||||
// set value
|
||||
#ifdef VERBOSE
|
||||
cout << "Setting sub frame period to " << timeNS << " clocks" <<
|
||||
"/" << spinSubPeriod->value() <<
|
||||
qDefs::getUnitString((qDefs::timeUnit)comboSubPeriodUnit->currentIndex()) << endl;
|
||||
#endif
|
||||
myDet->setTimer(slsDetectorDefs::SUBFRAME_PERIOD,(int64_t)timeNS);
|
||||
qDefs::checkErrorMessage(myDet,"qTabAdvanced::SetSubPeriod");
|
||||
|
||||
// update value in gui
|
||||
qDefs::timeUnit unit;
|
||||
double time = qDefs::getCorrectTime(unit,((double)(
|
||||
myDet->setTimer(slsDetectorDefs::SUBFRAME_PERIOD,-1)*(1E-9))));
|
||||
spinSubPeriod->setValue(time);
|
||||
comboSubPeriodUnit->setCurrentIndex((int)unit);
|
||||
|
||||
// highlight if period < exptime
|
||||
CheckAcqPeriodGreaterThanExp();
|
||||
|
||||
connect(spinSubPeriod,SIGNAL(valueChanged(double)), this, SLOT(SetSubPeriod()));
|
||||
connect(comboSubPeriodUnit,SIGNAL(currentIndexChanged(int)),this, SLOT(SetSubPeriod()));
|
||||
|
||||
|
||||
qDefs::checkErrorMessage(myDet,"qTabAdvanced::SetSubPeriod");
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabAdvanced::CheckAcqPeriodGreaterThanExp(){
|
||||
double exptimeNS = qDefs::getNSTime(
|
||||
(qDefs::timeUnit)comboSubExpTimeUnit->currentIndex(),
|
||||
spinSubExpTime->value());
|
||||
double acqtimeNS = qDefs::getNSTime(
|
||||
(qDefs::timeUnit)comboSubPeriodUnit->currentIndex(),
|
||||
spinSubPeriod->value());
|
||||
if(exptimeNS>acqtimeNS && acqtimeNS > 0) {
|
||||
spinSubPeriod->setToolTip(errSubPeriodTip);
|
||||
lblSubPeriod->setToolTip(errSubPeriodTip);
|
||||
lblSubPeriod->setPalette(red);
|
||||
lblSubPeriod->setText("Sub Frame Period:*");
|
||||
}
|
||||
else {
|
||||
spinSubPeriod->setToolTip(acqSubPeriodTip);
|
||||
lblSubPeriod->setToolTip(acqSubPeriodTip);
|
||||
lblSubPeriod->setPalette(lblExpTime->palette());
|
||||
lblSubPeriod->setText("Sub Frame Period:");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabAdvanced::Refresh(){
|
||||
|
||||
|
||||
@ -1407,13 +1573,52 @@ void qTabAdvanced::Refresh(){
|
||||
#ifdef VERBOSE
|
||||
cout << "Getting ROI" << endl;
|
||||
#endif
|
||||
if (myDet->getDetectorsType() == slsDetectorDefs::GOTTHARD)
|
||||
if (detType == slsDetectorDefs::GOTTHARD)
|
||||
updateROIList();
|
||||
|
||||
//update alltirmbits from server
|
||||
if(boxSetAllTrimbits->isEnabled())
|
||||
updateAllTrimbitsFromServer();
|
||||
|
||||
// storage cells
|
||||
if (detType == slsReceiverDefs::JUNGFRAU) {
|
||||
disconnect(spinNumStoragecells,SIGNAL(valueChanged(int)),this, SLOT(SetNumStoragecells(int)));
|
||||
spinNumStoragecells->setValue((int)myDet->setTimer(slsDetectorDefs::STORAGE_CELL_NUMBER,-1));
|
||||
connect(spinNumStoragecells,SIGNAL(valueChanged(int)), this, SLOT(SetNumStoragecells(int)));
|
||||
}
|
||||
|
||||
// sub exptime and sub period
|
||||
else if (detType == slsReceiverDefs::EIGER) {
|
||||
disconnect(spinSubExpTime,SIGNAL(valueChanged(double)), this, SLOT(SetSubExposureTime()));
|
||||
disconnect(comboSubExpTimeUnit,SIGNAL(currentIndexChanged(int)),this, SLOT(SetSubExposureTime()));
|
||||
disconnect(spinSubPeriod,SIGNAL(valueChanged(double)), this, SLOT(SetSubPeriod()));
|
||||
disconnect(comboSubPeriodUnit,SIGNAL(currentIndexChanged(int)),this, SLOT(SetSubPeriod()));
|
||||
|
||||
#ifdef VERBOSE
|
||||
cout << "Getting Sub Exposure time and Sub Period" << endl;
|
||||
#endif
|
||||
// subexptime
|
||||
qDefs::timeUnit unit;
|
||||
double time = qDefs::getCorrectTime(unit,((double)(
|
||||
myDet->setTimer(slsDetectorDefs::SUBFRAME_ACQUISITION_TIME,-1)*(1E-9))));
|
||||
spinSubExpTime->setValue(time);
|
||||
comboSubExpTimeUnit->setCurrentIndex((int)unit);
|
||||
|
||||
// subperiod
|
||||
time = qDefs::getCorrectTime(unit,((double)(myDet->setTimer(slsDetectorDefs::SUBFRAME_PERIOD,-1)*(1E-9))));
|
||||
spinSubPeriod->setValue(time);
|
||||
comboSubPeriodUnit->setCurrentIndex((int)unit);
|
||||
|
||||
|
||||
// highlight if period < exptime
|
||||
CheckAcqPeriodGreaterThanExp();
|
||||
|
||||
connect(spinSubExpTime,SIGNAL(valueChanged(double)), this, SLOT(SetSubExposureTime()));
|
||||
connect(comboSubExpTimeUnit,SIGNAL(currentIndexChanged(int)), this, SLOT(SetSubExposureTime()));
|
||||
connect(spinSubPeriod,SIGNAL(valueChanged(double)), this, SLOT(SetSubPeriod()));
|
||||
connect(comboSubPeriodUnit,SIGNAL(currentIndexChanged(int)),this, SLOT(SetSubPeriod()));
|
||||
}
|
||||
|
||||
#ifdef VERBOSE
|
||||
cout << "**Updated Advanced Tab" << endl << endl;
|
||||
#endif
|
||||
|
@ -211,7 +211,10 @@ void qTabMeasurement::GetModeFromDetector(bool startup){
|
||||
if(mode==slsDetectorDefs::AUTO_TIMING){
|
||||
int frames = spinNumFrames->value();
|
||||
int triggers = spinNumTriggers->value();
|
||||
if((frames==1)&&(triggers==1)){
|
||||
int storagecells = 0;
|
||||
if (detType == slsDetectorDefs::JUNGFRAU)
|
||||
storagecells = myDet->setTimer(slsDetectorDefs::STORAGE_CELL_NUMBER, -1);
|
||||
if((frames==1)&&(triggers==1)&&(storagecells==0)){
|
||||
comboTimingMode->setCurrentIndex((int)None);
|
||||
SetTimingMode((int)None);
|
||||
}else{
|
||||
@ -630,6 +633,8 @@ void qTabMeasurement::SetTimingMode(int mode){
|
||||
lblExpTime->setEnabled(true); spinExpTime->setEnabled(true); comboExpUnit->setEnabled(true);
|
||||
spinNumTriggers->setValue(1);
|
||||
spinNumFrames->setValue(1);
|
||||
if (detType == slsDetectorDefs::JUNGFRAU)
|
||||
myDet->setTimer(slsReceiverDefs::STORAGE_CELL_NUMBER, 0);
|
||||
if(myDet->setExternalCommunicationMode(slsDetectorDefs::AUTO_TIMING)==slsDetectorDefs::AUTO_TIMING)
|
||||
success = true;
|
||||
break;
|
||||
@ -708,6 +713,8 @@ void qTabMeasurement::SetTimingMode(int mode){
|
||||
"Number of Frames \t: 1\nNumber of Triggers \t: 1","qTabMeasurement::SetTimingMode");
|
||||
spinNumFrames->setValue(1);
|
||||
spinNumTriggers->setValue(1);
|
||||
if (detType == slsReceiverDefs::JUNGFRAU)
|
||||
myDet->setTimer(slsDetectorDefs::STORAGE_CELL_NUMBER, 0);
|
||||
comboTimingMode->setCurrentIndex((int)None);
|
||||
return;
|
||||
}
|
||||
|
@ -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:"<<sett<<endl;
|
||||
qDefs::checkErrorMessage(myDet,"qTabSettings::SetupDetectorSettings");
|
||||
if(sett==-1) sett = Undefined;
|
||||
if(detType == slsDetectorDefs::JUNGFRAUCTB) 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);
|
||||
@ -209,7 +210,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
|
||||
@ -227,8 +229,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)));
|
||||
@ -321,7 +322,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()));
|
||||
|
||||
@ -340,35 +342,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()));
|
||||
|
||||
|
Reference in New Issue
Block a user