This commit is contained in:
2018-08-08 12:06:14 +02:00
216 changed files with 23718 additions and 22233 deletions

View File

@ -105,11 +105,6 @@ set_target_properties(slsDetectorGui PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
add_library(zmq STATIC IMPORTED )
set_target_properties(zmq PROPERTIES
IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../slsReceiverSoftware/include/libzmq.a
)
target_link_libraries(slsDetectorGui
slsDetectorShared

View File

@ -51,7 +51,7 @@
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>3</number>
<number>4</number>
</property>
<property name="elideMode">
<enum>Qt::ElideLeft</enum>
@ -77,7 +77,7 @@
<rect>
<x>25</x>
<y>20</y>
<width>324</width>
<width>345</width>
<height>31</height>
</rect>
</property>
@ -142,7 +142,7 @@
<rect>
<x>230</x>
<y>15</y>
<width>242</width>
<width>259</width>
<height>44</height>
</rect>
</property>
@ -198,7 +198,7 @@ Plots Trimbits from Detector. This will take time.
<rect>
<x>25</x>
<y>20</y>
<width>195</width>
<width>211</width>
<height>31</height>
</rect>
</property>
@ -256,7 +256,7 @@ Plots Trimbits from Detector. This will take time.
<x>25</x>
<y>25</y>
<width>696</width>
<height>195</height>
<height>208</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_3">
@ -977,7 +977,7 @@ An extension given by the modules serial number will be attached.
<x>25</x>
<y>25</y>
<width>686</width>
<height>116</height>
<height>148</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_8">
@ -1357,7 +1357,7 @@ An extension given by the modules serial number will be attached.
<x>35</x>
<y>15</y>
<width>686</width>
<height>116</height>
<height>146</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_6">
@ -1748,6 +1748,320 @@ An extension given by the modules serial number will be attached.
</layout>
</widget>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Acquisition</string>
</attribute>
<widget class="QWidget" name="gridLayoutWidget_2">
<property name="geometry">
<rect>
<x>14</x>
<y>13</y>
<width>367</width>
<height>110</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="2">
<widget class="QDoubleSpinBox" name="spinSubExpTime">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Exposure Time of a sub frame. Only for Eiger in 32 bit mode
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
#subexptime#
&lt;/nobr&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="decimals">
<number>9</number>
</property>
<property name="minimum">
<double>-1.000000000000000</double>
</property>
<property name="maximum">
<double>2000000000.000000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblNumStoragecells">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Number of storage cells. For Jungfrau only. &lt;/p&gt;&lt;p&gt;Default: 0. &lt;/p&gt;&lt;p&gt;Number of Images received: #frames * #cycles * (#storagecells+1) &lt;/p&gt;&lt;p&gt; #storagecells#&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Number of Storage cells:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lblSubExpTime">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Exposure Time of a sub frame. Only for Eiger in 32 bit mode
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
#subexptime#
&lt;/nobr&gt;</string>
</property>
<property name="text">
<string>Sub Frame Exposure Time:</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QComboBox" name="comboSubExpTimeUnit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Exposure Time of a sub frame. Only for Eiger in 32 bit mode
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
#subexptime#
&lt;/nobr&gt;</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="currentIndex">
<number>2</number>
</property>
<item>
<property name="text">
<string>hr</string>
</property>
</item>
<item>
<property name="text">
<string>min</string>
</property>
</item>
<item>
<property name="text">
<string>s</string>
</property>
</item>
<item>
<property name="text">
<string>ms</string>
</property>
</item>
<item>
<property name="text">
<string>us</string>
</property>
</item>
<item>
<property name="text">
<string>ns</string>
</property>
</item>
</widget>
</item>
<item row="0" column="2" colspan="2">
<widget class="QSpinBox" name="spinNumStoragecells">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Number of storage cells. For Jungfrau only. &lt;/p&gt;&lt;p&gt;Default: 0. &lt;/p&gt;&lt;p&gt;Number of Images received: #frames * #cycles * (#storagecells+1) &lt;/p&gt;&lt;p&gt; #storagecells#&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string/>
</property>
<property name="minimum">
<number>-1</number>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lblSubPeriod">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Period between sub frames. Only for Eiger in 32 bit mode.
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
Default value is 0. A value less than the required minimum is ignored.
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
#subperiod#
&lt;/nobr&gt;</string>
</property>
<property name="text">
<string>Sub Frame Period:</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QDoubleSpinBox" name="spinSubPeriod">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Period between sub frames. Only for Eiger in 32 bit mode.
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
Default value is 0. A value less than the required minimum is ignored.
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
#subperiod#
&lt;/nobr&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="decimals">
<number>9</number>
</property>
<property name="minimum">
<double>-1.000000000000000</double>
</property>
<property name="maximum">
<double>2000000000.000000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QComboBox" name="comboSubPeriodUnit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Period between sub frames. Only for Eiger in 32 bit mode.
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
Default value is 0. A value less than the required minimum is ignored.
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
#subperiod#
&lt;/nobr&gt;</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="currentIndex">
<number>2</number>
</property>
<item>
<property name="text">
<string>hr</string>
</property>
</item>
<item>
<property name="text">
<string>min</string>
</property>
</item>
<item>
<property name="text">
<string>s</string>
</property>
</item>
<item>
<property name="text">
<string>ms</string>
</property>
</item>
<item>
<property name="text">
<string>us</string>
</property>
</item>
<item>
<property name="text">
<string>ns</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
</widget>
<tabstops>

View File

@ -151,9 +151,9 @@
<widget class="QWidget" name="gridLayoutWidget">
<property name="geometry">
<rect>
<x>35</x>
<x>0</x>
<y>10</y>
<width>326</width>
<width>357</width>
<height>321</height>
</rect>
</property>
@ -965,9 +965,9 @@ Frame period between exposures.
<property name="geometry">
<rect>
<x>30</x>
<y>297</y>
<y>298</y>
<width>318</width>
<height>30</height>
<height>31</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
@ -1049,9 +1049,6 @@ Frame period between exposures.
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/stop.png</normaloff>:/icons/images/stop.png</iconset>
</property>
<property name="shortcut">
<string>Shift+Space</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>

View File

@ -1,18 +1,9 @@
Path: slsDetectorsPackage/slsDetectorGui
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
<<<<<<< HEAD
Repsitory UUID: ab06c33107ecfeb4741d49407903ff80286cf75b
Revision: 492
Branch: developer
Last Changed Author: Anna_Bergamaschi
Last Changed Rev: 3731
Last Changed Date: 2018-03-15 12:27:06.000000002 +0100 ./src/qTabMeasurement.cpp
=======
Repsitory UUID: fe2ba8621b33bc00f51c8cd4d33e98b7d4ebfa41
Revision: 493
Branch: developer
Repsitory UUID: 6bb7195a2c7dc9526088882e0244a7455d3c15b2
Revision: 511
Branch: 3.3.0-rc
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3747
Last Changed Date: 2018-03-27 17:30:53.000000002 +0200 ./include/qTabMeasurement.h
>>>>>>> 7cd35f24b87501374fbaf45693a2adf16dfae3e3
Last Changed Rev: 3941
Last Changed Date: 2018-07-17 16:15:43.000000002 +0200 ./src/qTabSettings.cpp

View File

@ -1,7 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "fe2ba8621b33bc00f51c8cd4d33e98b7d4ebfa41"
#define GITREPUUID "6bb7195a2c7dc9526088882e0244a7455d3c15b2"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x3747
#define GITDATE 0x20180327
#define GITBRANCH "developer"
#define GITREV 0x3941
#define GITDATE 0x20180717
#define GITBRANCH "3.3.0-rc"

View File

@ -198,6 +198,16 @@ private slots:
*/
void SetAllTrimbits();
/** Set storage cells */
void SetNumStoragecells(int value);
/** Set sub frame exposure time */
void SetSubExposureTime();
/** Set sub frame period */
void SetSubPeriod();
private:
/** The multi detector object */
multiSlsDetector *myDet;
@ -242,7 +252,11 @@ private:
vector <QSpinBox*> spinToY;
int numRois;
/** sub period tool tip variables*/
QString acqSubPeriodTip;
QString errSubPeriodTip;
void CheckAcqPeriodGreaterThanExp();
};

View File

@ -137,13 +137,13 @@ void SlsQtNumberEntry::SetupNumberField(int type, int which_number_field){
num_field[i]->setAlignment(Qt::AlignRight);
if(i==0){
connect(num_field[i],SIGNAL(lostFocus()),this,SLOT(RefreshFirstNumberEntry()));
connect(num_field[i],SIGNAL(editingFinished()),this,SLOT(RefreshFirstNumberEntry()));
connect(num_field[i],SIGNAL(returnPressed()),this,SLOT(FirstValueEntered()));
connect(num_field[i],SIGNAL(lostFocus()),this,SLOT(FirstValueEntered()));
connect(num_field[i],SIGNAL(editingFinished()),this,SLOT(FirstValueEntered()));
}else{
connect(num_field[i],SIGNAL(lostFocus()),this,SLOT(RefreshSecondNumberEntry()));
connect(num_field[i],SIGNAL(editingFinished()),this,SLOT(RefreshSecondNumberEntry()));
connect(num_field[i],SIGNAL(returnPressed()),this,SLOT(SecondValueEntered()));
connect(num_field[i],SIGNAL(lostFocus()),this,SLOT(SecondValueEntered()));
connect(num_field[i],SIGNAL(editingFinished()),this,SLOT(SecondValueEntered()));
}
}else if(type==3){
spin_box[i] = new QSpinBox();

View File

@ -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,

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}

View File

@ -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()));