added storage cells

This commit is contained in:
2018-04-13 15:05:43 +02:00
parent bdcccb7732
commit e024774323
14 changed files with 218 additions and 56 deletions

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>199</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>128</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>128</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_6">
@ -1748,6 +1748,92 @@ An extension given by the modules serial number will be attached.
</layout>
</widget>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Others</string>
</attribute>
<widget class="QWidget" name="gridLayoutWidget_2">
<property name="geometry">
<rect>
<x>14</x>
<y>13</y>
<width>367</width>
<height>39</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<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="0" column="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>
</layout>
</widget>
</widget>
</widget>
</widget>
<tabstops>

View File

@ -198,6 +198,9 @@ private slots:
*/
void SetAllTrimbits();
/** Set storage cells */
void SetNumStoragecells(int value);
private:
/** The multi detector object */
multiSlsDetector *myDet;

View File

@ -563,9 +563,11 @@ 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 = (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);

View File

@ -197,16 +197,23 @@ 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));
}
Initialization();
qDefs::checkErrorMessage(det,"qTabAdvanced::SetupWidgetWindow");
@ -288,11 +295,15 @@ 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)));
}
}
@ -1225,6 +1236,23 @@ 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::Refresh(){
@ -1407,13 +1435,20 @@ 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)));
}
#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;
}