added storage cells

This commit is contained in:
maliakal_d 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> <enum>QTabWidget::North</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>3</number> <number>4</number>
</property> </property>
<property name="elideMode"> <property name="elideMode">
<enum>Qt::ElideLeft</enum> <enum>Qt::ElideLeft</enum>
@ -77,7 +77,7 @@
<rect> <rect>
<x>25</x> <x>25</x>
<y>20</y> <y>20</y>
<width>324</width> <width>345</width>
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>
@ -142,7 +142,7 @@
<rect> <rect>
<x>230</x> <x>230</x>
<y>15</y> <y>15</y>
<width>242</width> <width>259</width>
<height>44</height> <height>44</height>
</rect> </rect>
</property> </property>
@ -198,7 +198,7 @@ Plots Trimbits from Detector. This will take time.
<rect> <rect>
<x>25</x> <x>25</x>
<y>20</y> <y>20</y>
<width>195</width> <width>211</width>
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>
@ -256,7 +256,7 @@ Plots Trimbits from Detector. This will take time.
<x>25</x> <x>25</x>
<y>25</y> <y>25</y>
<width>696</width> <width>696</width>
<height>195</height> <height>199</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
@ -977,7 +977,7 @@ An extension given by the modules serial number will be attached.
<x>25</x> <x>25</x>
<y>25</y> <y>25</y>
<width>686</width> <width>686</width>
<height>116</height> <height>128</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_8"> <layout class="QGridLayout" name="gridLayout_8">
@ -1357,7 +1357,7 @@ An extension given by the modules serial number will be attached.
<x>35</x> <x>35</x>
<y>15</y> <y>15</y>
<width>686</width> <width>686</width>
<height>116</height> <height>128</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_6"> <layout class="QGridLayout" name="gridLayout_6">
@ -1748,6 +1748,92 @@ An extension given by the modules serial number will be attached.
</layout> </layout>
</widget> </widget>
</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>
</widget> </widget>
<tabstops> <tabstops>

View File

@ -198,6 +198,9 @@ private slots:
*/ */
void SetAllTrimbits(); void SetAllTrimbits();
/** Set storage cells */
void SetNumStoragecells(int value);
private: private:
/** The multi detector object */ /** The multi detector object */
multiSlsDetector *myDet; 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 // 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 numFrames = (isFrameEnabled)*((int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,-1));
int numTriggers = (isTriggerEnabled)*((int)myDet->setTimer(slsDetectorDefs::CYCLES_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); numFrames = ((numFrames==0)?1:numFrames);
numTriggers = ((numTriggers==0)?1:numTriggers); 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; cout << "\tNumber of Frames per Scan/Measurement:" << number_of_frames << endl;
//get #scansets for level 0 and level 1 //get #scansets for level 0 and level 1
int numScan0 = myDet->getScanSteps(0); numScan0 = ((numScan0==0)?1:numScan0); int numScan0 = myDet->getScanSteps(0); numScan0 = ((numScan0==0)?1:numScan0);

View File

@ -197,16 +197,23 @@ void qTabAdvanced::SetupWidgetWindow(){
//updates roi //updates roi
cout << "Getting ROI" << endl; cout << "Getting ROI" << endl;
if (myDet->getDetectorsType() == slsDetectorDefs::GOTTHARD) if (detType == slsDetectorDefs::GOTTHARD)
updateROIList(); updateROIList();
#ifdef VERYVERBOSE #ifdef VERYVERBOSE
// print receiver configurations // print receiver configurations
if(myDet->getDetectorsType() != slsDetectorDefs::MYTHEN){ if(detType != slsDetectorDefs::MYTHEN){
cout << endl; cout << endl;
myDet->printReceiverConfiguration(); myDet->printReceiverConfiguration();
} }
#endif #endif
// jungfrau
if (detType == slsReceiverDefs::JUNGFRAU) {
lblNumStoragecells->setEnabled(true);
spinNumStoragecells->setEnabled(true);
spinNumStoragecells->setValue((int)myDet->setTimer(slsDetectorDefs::STORAGE_CELL_NUMBER,-1));
}
Initialization(); Initialization();
qDefs::checkErrorMessage(det,"qTabAdvanced::SetupWidgetWindow"); qDefs::checkErrorMessage(det,"qTabAdvanced::SetupWidgetWindow");
@ -288,11 +295,15 @@ void qTabAdvanced::Initialization(){
//roi //roi
if (myDet->getDetectorsType() == slsDetectorDefs::GOTTHARD) { if (detType == slsDetectorDefs::GOTTHARD) {
connect(btnClearRoi, SIGNAL(clicked()), this, SLOT(clearROIinDetector())); connect(btnClearRoi, SIGNAL(clicked()), this, SLOT(clearROIinDetector()));
connect(btnGetRoi, SIGNAL(clicked()), this, SLOT(updateROIList())); connect(btnGetRoi, SIGNAL(clicked()), this, SLOT(updateROIList()));
connect(btnSetRoi, SIGNAL(clicked()), this, SLOT(setROI())); 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(){ void qTabAdvanced::Refresh(){
@ -1407,13 +1435,20 @@ void qTabAdvanced::Refresh(){
#ifdef VERBOSE #ifdef VERBOSE
cout << "Getting ROI" << endl; cout << "Getting ROI" << endl;
#endif #endif
if (myDet->getDetectorsType() == slsDetectorDefs::GOTTHARD) if (detType == slsDetectorDefs::GOTTHARD)
updateROIList(); updateROIList();
//update alltirmbits from server //update alltirmbits from server
if(boxSetAllTrimbits->isEnabled()) if(boxSetAllTrimbits->isEnabled())
updateAllTrimbitsFromServer(); 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 #ifdef VERBOSE
cout << "**Updated Advanced Tab" << endl << endl; cout << "**Updated Advanced Tab" << endl << endl;
#endif #endif

View File

@ -211,7 +211,10 @@ void qTabMeasurement::GetModeFromDetector(bool startup){
if(mode==slsDetectorDefs::AUTO_TIMING){ if(mode==slsDetectorDefs::AUTO_TIMING){
int frames = spinNumFrames->value(); int frames = spinNumFrames->value();
int triggers = spinNumTriggers->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); comboTimingMode->setCurrentIndex((int)None);
SetTimingMode((int)None); SetTimingMode((int)None);
}else{ }else{
@ -630,6 +633,8 @@ void qTabMeasurement::SetTimingMode(int mode){
lblExpTime->setEnabled(true); spinExpTime->setEnabled(true); comboExpUnit->setEnabled(true); lblExpTime->setEnabled(true); spinExpTime->setEnabled(true); comboExpUnit->setEnabled(true);
spinNumTriggers->setValue(1); spinNumTriggers->setValue(1);
spinNumFrames->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) if(myDet->setExternalCommunicationMode(slsDetectorDefs::AUTO_TIMING)==slsDetectorDefs::AUTO_TIMING)
success = true; success = true;
break; break;
@ -708,6 +713,8 @@ void qTabMeasurement::SetTimingMode(int mode){
"Number of Frames \t: 1\nNumber of Triggers \t: 1","qTabMeasurement::SetTimingMode"); "Number of Frames \t: 1\nNumber of Triggers \t: 1","qTabMeasurement::SetTimingMode");
spinNumFrames->setValue(1); spinNumFrames->setValue(1);
spinNumTriggers->setValue(1); spinNumTriggers->setValue(1);
if (detType == slsReceiverDefs::JUNGFRAU)
myDet->setTimer(slsDetectorDefs::STORAGE_CELL_NUMBER, 0);
comboTimingMode->setCurrentIndex((int)None); comboTimingMode->setCurrentIndex((int)None);
return; return;
} }

View File

@ -392,7 +392,9 @@ void setupDetector() {
setSpeed(CLOCK_DIVIDER, HALF_SPEED); setSpeed(CLOCK_DIVIDER, HALF_SPEED);
cleanFifos(); cleanFifos();
resetCore(); resetCore();
configureASICTimer(); configureASICTimer();
bus_w(ADC_PORT_INVERT_REG, ADC_PORT_INVERT_VAL);
//Initialization of acquistion parameters //Initialization of acquistion parameters
setSettings(DEFAULT_SETTINGS,-1); setSettings(DEFAULT_SETTINGS,-1);
@ -411,6 +413,8 @@ void setupDetector() {
setThresholdTemperature(DEFAULT_TMP_THRSHLD); setThresholdTemperature(DEFAULT_TMP_THRSHLD);
// reset temp event // reset temp event
setTemperatureEvent(0); setTemperatureEvent(0);
} }
@ -434,7 +438,7 @@ int powerChip (int on){
} }
return ((bus_r(CHIP_POWER_REG) & CHIP_POWER_ENABLE_MSK) >> CHIP_POWER_ENABLE_OFST); return ((bus_r(CHIP_POWER_REG) & CHIP_POWER_ENABLE_MSK) >> CHIP_POWER_ENABLE_OFST);
/* temporary setup until new firmware fixes bug */ /**temporary fix until power reg status can be read */
//return ((bus_r(CHIP_POWER_REG) & CHIP_POWER_STATUS_MSK) >> CHIP_POWER_STATUS_OFST); //return ((bus_r(CHIP_POWER_REG) & CHIP_POWER_STATUS_MSK) >> CHIP_POWER_STATUS_OFST);
} }
@ -502,10 +506,9 @@ int getPhase() {
} }
void configureASICTimer() { void configureASICTimer() {
cprintf(RED," in here\n"); printf("\nConfiguring ASIC Timer\n");
//cprintf(RED,"asic reg:0x%x\n", bus_r(ASIC_CTRL_REG)); bus_w(ASIC_CTRL_REG, (bus_r(ASIC_CTRL_REG) & ~ASIC_CTRL_PRCHRG_TMR_MSK) | ASIC_CTRL_PRCHRG_TMR_VAL);
//bus_w(ASIC_CTRL_REG, (bus_r(ASIC_CTRL_REG) & ~ASIC_CTRL_PRCHRG_TMR_MSK) | ASIC_CTRL_PRCHRG_TMR_VAL); bus_w(ASIC_CTRL_REG, (bus_r(ASIC_CTRL_REG) & ~ASIC_CTRL_DS_TMR_MSK) | ASIC_CTRL_DS_TMR_VAL);
//bus_w(ASIC_CTRL_REG, (bus_r(ASIC_CTRL_REG) & ~ASIC_CTRL_DS_TMR_MSK) | ASIC_CTRL_DS_TMR_VAL);
} }
@ -644,9 +647,9 @@ int64_t setTimer(enum timerIndex ind, int64_t val) {
case ACQUISITION_TIME: case ACQUISITION_TIME:
if(val >= 0){ if(val >= 0){
printf("\nSetting exptime: %lldns\n", (long long int)val); printf("\nSetting exptime: %lldns\n", (long long int)val);
val *= (1E-3 * CLK_RUN); val *= (1E-3 * CLK_RUN); /*(-2)*/
} }
retval = set64BitReg(val, SET_EXPTIME_LSB_REG, SET_EXPTIME_MSB_REG) / (1E-3 * CLK_RUN); retval = set64BitReg(val, SET_EXPTIME_LSB_REG, SET_EXPTIME_MSB_REG) / (1E-3 * CLK_RUN);/*(+2)*/
printf("Getting exptime: %lldns\n", (long long int)retval); printf("Getting exptime: %lldns\n", (long long int)retval);
break; break;
@ -675,6 +678,16 @@ int64_t setTimer(enum timerIndex ind, int64_t val) {
printf("Getting #cycles: %lld\n", (long long int)retval); printf("Getting #cycles: %lld\n", (long long int)retval);
break; break;
case STORAGE_CELL_NUMBER:
if(val >= 0) {
printf("\nSetting #storage cells to %lld\n", (long long int)val);
bus_w(CONTROL_REG, (bus_r(CONTROL_REG) & ~CONTROL_STORAGE_CELL_NUM_MSK) |
((val << CONTROL_STORAGE_CELL_NUM_OFST) & CONTROL_STORAGE_CELL_NUM_MSK));
}
retval = ((bus_r(CONTROL_REG) & CONTROL_STORAGE_CELL_NUM_MSK) >> CONTROL_STORAGE_CELL_NUM_OFST);
printf("Getting #storage cells: %lld\n", (long long int)retval);
break;
default: default:
cprintf(RED,"Warning: Timer Index not implemented for this detector: %d\n", ind); cprintf(RED,"Warning: Timer Index not implemented for this detector: %d\n", ind);
break; break;

View File

@ -93,16 +93,18 @@ enum NETWORKINDEX { TXN_FRAME };
#define ADC_PORT_INVERT_VAL (0x453b2a9c) #define ADC_PORT_INVERT_VAL (0x453b2a9c)
#define MAX_TIMESLOT_VAL (0x1F) #define MAX_TIMESLOT_VAL (0x1F)
#define MAX_THRESHOLD_TEMP_VAL (127999) //millidegrees #define MAX_THRESHOLD_TEMP_VAL (127999) //millidegrees
#define MAX_STORAGE_CELL_VAL (15) //0xF
#define SAMPLE_ADC_HALF_SPEED (SAMPLE_DECMT_FACTOR_2_VAL + SAMPLE_DGTL_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + SAMPLE_ADC_SAMPLE_0_VAL) /* 0x1000 */ #define SAMPLE_ADC_HALF_SPEED (SAMPLE_DECMT_FACTOR_2_VAL + SAMPLE_DGTL_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + SAMPLE_ADC_SAMPLE_0_VAL) /* 0x1000 */
#define SAMPLE_ADC_QUARTER_SPEED (SAMPLE_DECMT_FACTOR_4_VAL + SAMPLE_DGTL_SAMPLE_8_VAL + SAMPLE_ADC_DECMT_FACTOR_1_VAL + SAMPLE_ADC_SAMPLE_0_VAL) /* 0x2810 */ #define SAMPLE_ADC_QUARTER_SPEED (SAMPLE_DECMT_FACTOR_4_VAL + SAMPLE_DGTL_SAMPLE_8_VAL + SAMPLE_ADC_DECMT_FACTOR_1_VAL + SAMPLE_ADC_SAMPLE_0_VAL) /* 0x2810 */
#define CONFIG_HALF_SPEED (CONFIG_TDMA_DISABLE_VAL + CONFIG_HALF_SPEED_20MHZ_VAL + CONFIG_MODE_1_X_10GBE_VAL) #define CONFIG_HALF_SPEED (CONFIG_TDMA_DISABLE_VAL + CONFIG_HALF_SPEED_20MHZ_VAL + CONFIG_MODE_1_X_10GBE_VAL)
#define CONFIG_QUARTER_SPEED (CONFIG_TDMA_DISABLE_VAL + CONFIG_QUARTER_SPEED_10MHZ_VAL + CONFIG_MODE_1_X_10GBE_VAL) #define CONFIG_QUARTER_SPEED (CONFIG_TDMA_DISABLE_VAL + CONFIG_QUARTER_SPEED_10MHZ_VAL + CONFIG_MODE_1_X_10GBE_VAL)
#define ADC_OFST_HALF_SPEED_VAL (0x20) //adc pipeline #define ADC_OFST_HALF_SPEED_VAL (0x1f) //(0x20)
#define ADC_OFST_QUARTER_SPEED_VAL (0x0f) #define ADC_OFST_QUARTER_SPEED_VAL (0x0f) //(0x0f)
#define ADC_PHASE_HALF_SPEED (0x48) //72 #define ADC_PHASE_HALF_SPEED (0x2D) //45
#define ADC_PHASE_QUARTER_SPEED (0x48) //72 #define ADC_PHASE_QUARTER_SPEED (0x2D) //45
#define ADC_PORT_INVERT_VAL (0x453b2a9c)
/* Maybe not required for jungfrau */ /* Maybe not required for jungfrau */
#define NTRIMBITS (6) #define NTRIMBITS (6)

View File

@ -1995,19 +1995,7 @@ void multiSlsDetector::resetFinalDataQueue() {
/*
set or read the acquisition timers
enum timerIndex {
FRAME_NUMBER,
ACQUISITION_TIME,
FRAME_PERIOD,
DELAY_AFTER_TRIGGER,
GATES_NUMBER,
PROBES_NUMBER
CYCLES_NUMBER,
GATE_INTEGRATED_TIME
}
*/
int64_t multiSlsDetector::setTimer(timerIndex index, int64_t t){ int64_t multiSlsDetector::setTimer(timerIndex index, int64_t t){
int64_t ret=-100; int64_t ret=-100;

View File

@ -4746,10 +4746,6 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
cout << "Changing samples: data size = " << thisDetector->dataBytes <<endl; cout << "Changing samples: data size = " << thisDetector->dataBytes <<endl;
} }
/* set progress */
if ((index==FRAME_NUMBER) || (index==CYCLES_NUMBER)) {
setTotalProgress();
}
if(t!=-1){ if(t!=-1){
if ((thisDetector->myDetectorType==MYTHEN)&&(index==PROBES_NUMBER)) { if ((thisDetector->myDetectorType==MYTHEN)&&(index==PROBES_NUMBER)) {
@ -4758,7 +4754,7 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
} }
/* set progress */ /* set progress */
if ((index==FRAME_NUMBER) || (index==CYCLES_NUMBER)) { if ((index==FRAME_NUMBER) || (index==CYCLES_NUMBER) || (index==STORAGE_CELL_NUMBER)) {
setTotalProgress(); setTotalProgress();
} }
@ -4780,7 +4776,9 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
//send acquisiton time/period/subexptime/frame/cycles/samples to receiver //send acquisiton time/period/subexptime/frame/cycles/samples to receiver
if((index==FRAME_NUMBER)||(index==FRAME_PERIOD)||(index==CYCLES_NUMBER)||(index==ACQUISITION_TIME) || (index==SUBFRAME_ACQUISITION_TIME) || (index==SAMPLES_JCTB)){ if((index==FRAME_NUMBER)||(index==FRAME_PERIOD)||(index==CYCLES_NUMBER)||
(index==ACQUISITION_TIME) || (index==SUBFRAME_ACQUISITION_TIME) ||
(index==SAMPLES_JCTB) || (index==STORAGE_CELL_NUMBER)){
string timername = getTimerType(index); string timername = getTimerType(index);
if(ret != FAIL){ if(ret != FAIL){
int64_t args[2]; int64_t args[2];
@ -4791,15 +4789,14 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
if(thisDetector->receiverOnlineFlag==ONLINE_FLAG){ if(thisDetector->receiverOnlineFlag==ONLINE_FLAG){
//set #frames * #cycles //set #frames * #cycles
if((index==FRAME_NUMBER)||(index==CYCLES_NUMBER)){ if((index==FRAME_NUMBER)||(index==CYCLES_NUMBER)||(index==STORAGE_CELL_NUMBER)){
timername.assign("(Number of Frames) * (Number of cycles)"); timername.assign("(Number of Frames) * (Number of cycles) * (Number of storage cells)");
args[1] = thisDetector->timerValue[FRAME_NUMBER] *
((thisDetector->timerValue[CYCLES_NUMBER] > 0) ? (thisDetector->timerValue[CYCLES_NUMBER]) : 1) *
((thisDetector->timerValue[STORAGE_CELL_NUMBER] > 0) ? (thisDetector->timerValue[STORAGE_CELL_NUMBER])+1 : 1);
#ifdef VERBOSE #ifdef VERBOSE
std::cout << "Setting/Getting " << timername << " " << index <<" to/from receiver " << args[1] << std::endl; std::cout << "Setting/Getting " << timername << " " << index <<" to/from receiver " << args[1] << std::endl;
#endif #endif
if(thisDetector->timerValue[CYCLES_NUMBER]==0)
args[1] = thisDetector->timerValue[FRAME_NUMBER];
else
args[1] = thisDetector->timerValue[FRAME_NUMBER]*thisDetector->timerValue[CYCLES_NUMBER];
} }
#ifdef VERBOSE #ifdef VERBOSE
// set period/exptime/subexptime // set period/exptime/subexptime
@ -5123,7 +5120,7 @@ int slsDetector::setPort(portType index, int num){
int slsDetector::setTotalProgress() { int slsDetector::setTotalProgress() {
int nf=1, npos=1, nscan[MAX_SCAN_LEVELS]={1,1}, nc=1, nm=1; int nf=1, npos=1, nscan[MAX_SCAN_LEVELS]={1,1}, nc=1, nm=1, ns=1;
if (thisDetector->timerValue[FRAME_NUMBER]) if (thisDetector->timerValue[FRAME_NUMBER])
nf=thisDetector->timerValue[FRAME_NUMBER]; nf=thisDetector->timerValue[FRAME_NUMBER];
@ -5131,6 +5128,9 @@ int slsDetector::setTotalProgress() {
if (thisDetector->timerValue[CYCLES_NUMBER]>0) if (thisDetector->timerValue[CYCLES_NUMBER]>0)
nc=thisDetector->timerValue[CYCLES_NUMBER]; nc=thisDetector->timerValue[CYCLES_NUMBER];
if (thisDetector->timerValue[STORAGE_CELL_NUMBER]>0)
ns=thisDetector->timerValue[STORAGE_CELL_NUMBER]+1;
if (thisDetector->numberOfPositions>0) if (thisDetector->numberOfPositions>0)
npos=thisDetector->numberOfPositions; npos=thisDetector->numberOfPositions;
@ -5144,12 +5144,13 @@ int slsDetector::setTotalProgress() {
if ((thisDetector->nScanSteps[1]>0) && (thisDetector->actionMask & (1 << (MAX_ACTIONS+1)))) if ((thisDetector->nScanSteps[1]>0) && (thisDetector->actionMask & (1 << (MAX_ACTIONS+1))))
nscan[1]=thisDetector->nScanSteps[1]; nscan[1]=thisDetector->nScanSteps[1];
thisDetector->totalProgress=nf*nc*npos*nm*nscan[0]*nscan[1]; thisDetector->totalProgress=nf*nc*ns*npos*nm*nscan[0]*nscan[1];
#ifdef VERBOSE #ifdef VERBOSE
cout << "nc " << nc << endl; cout << "nc " << nc << endl;
cout << "nm " << nm << endl; cout << "nm " << nm << endl;
cout << "nf " << nf << endl; cout << "nf " << nf << endl;
cout << "ns " << ns << endl;
cout << "npos " << npos << endl; cout << "npos " << npos << endl;
cout << "nscan[0] " << nscan[0] << endl; cout << "nscan[0] " << nscan[0] << endl;
cout << "nscan[1] " << nscan[1] << endl; cout << "nscan[1] " << nscan[1] << endl;

View File

@ -833,8 +833,8 @@ virtual int enableDataStreamingFromReceiver(int enable=-1)=0;
}}; }};
/** returns string from timer index /** returns string from timer index
\param s can be FRAME_NUMBER,ACQUISITION_TIME,FRAME_PERIOD, DELAY_AFTER_TRIGGER,GATES_NUMBER,PROBES_NUMBER, CYCLES_NUMBER, ACTUAL_TIME,MEASUREMENT_TIME, PROGRESS,MEASUREMENTS_NUMBER,FRAMES_FROM_START,FRAMES_FROM_START_PG,SAMPLES_JCTB,SUBFRAME_ACQUISITION_TIME \param s can be FRAME_NUMBER,ACQUISITION_TIME,FRAME_PERIOD, DELAY_AFTER_TRIGGER,GATES_NUMBER,PROBES_NUMBER, CYCLES_NUMBER, ACTUAL_TIME,MEASUREMENT_TIME, PROGRESS,MEASUREMENTS_NUMBER,FRAMES_FROM_START,FRAMES_FROM_START_PG,SAMPLES_JCTB,SUBFRAME_ACQUISITION_TIME,STORAGE_CELL_NUMBER
\returns string frame_number,acquisition_time,frame_period, delay_after_trigger,gates_number,probes_number, cycles_number, actual_time,measurement_time, progress,measurements_number,frames_from_start,frames_from_start_pg,samples_jctb,subframe_acquisition_time \returns string frame_number,acquisition_time,frame_period, delay_after_trigger,gates_number,probes_number, cycles_number, actual_time,measurement_time, progress,measurements_number,frames_from_start,frames_from_start_pg,samples_jctb,subframe_acquisition_time,storage_cell_number
*/ */
static string getTimerType(timerIndex t){ \ static string getTimerType(timerIndex t){ \
switch (t) { \ switch (t) { \
@ -853,6 +853,7 @@ virtual int enableDataStreamingFromReceiver(int enable=-1)=0;
case FRAMES_FROM_START_PG: return string("frames_from_start_pg"); \ case FRAMES_FROM_START_PG: return string("frames_from_start_pg"); \
case SAMPLES_JCTB: return string("samples_jctb"); \ case SAMPLES_JCTB: return string("samples_jctb"); \
case SUBFRAME_ACQUISITION_TIME: return string("subframe_acquisition_time"); \ case SUBFRAME_ACQUISITION_TIME: return string("subframe_acquisition_time"); \
case STORAGE_CELL_NUMBER: return string("storage_cell_number"); \
default: return string("unknown"); \ default: return string("unknown"); \
}}; }};

View File

@ -635,6 +635,14 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer;
++i; ++i;
/*! \page timing
- <b>storagecells [i]</b> sets/gets number of storage cells per acquisition. For very advanced users only! For JUNGFRAU only. Range: 0-15. The #images = #frames * #cycles * (#storagecells +1). \c Returns \c (long long int)
*/
descrToFuncMap[i].m_pFuncName="storagecells"; //
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer;
++i;
/* read only timers */ /* read only timers */
/*! \page timing /*! \page timing
@ -5621,6 +5629,8 @@ string slsDetectorCommand::cmdTimer(int narg, char *args[], int action) {
index=MEASUREMENTS_NUMBER; index=MEASUREMENTS_NUMBER;
else if (cmd=="samples") else if (cmd=="samples")
index=SAMPLES_JCTB; index=SAMPLES_JCTB;
else if (cmd=="storagecells")
index=STORAGE_CELL_NUMBER;
else else
return string("could not decode timer ")+cmd; return string("could not decode timer ")+cmd;
@ -5672,6 +5682,7 @@ string slsDetectorCommand::helpTimer(int narg, char *args[], int action) {
os << "cycles t \t sets the number of cycles (e.g. number of triggers)" << std::endl; os << "cycles t \t sets the number of cycles (e.g. number of triggers)" << std::endl;
os << "probes t \t sets the number of probes to accumulate (max 3! cycles should be set to 1, frames to the number of pump-probe events)" << std::endl; os << "probes t \t sets the number of probes to accumulate (max 3! cycles should be set to 1, frames to the number of pump-probe events)" << std::endl;
os << "samples t \t sets the number of samples expected from the jctb" << std::endl; os << "samples t \t sets the number of samples expected from the jctb" << std::endl;
os << "storagecells t \t sets number of storage cells per acquisition. For very advanced users only! For JUNGFRAU only. Range: 0-15. The #images = #frames * #cycles * (#storagecells+1)." << std::endl;
os << std::endl; os << std::endl;
@ -5685,8 +5696,8 @@ string slsDetectorCommand::helpTimer(int narg, char *args[], int action) {
os << "frames \t gets the number of frames per cycle (e.g. after each trigger)" << std::endl; os << "frames \t gets the number of frames per cycle (e.g. after each trigger)" << std::endl;
os << "cycles \t gets the number of cycles (e.g. number of triggers)" << std::endl; os << "cycles \t gets the number of cycles (e.g. number of triggers)" << std::endl;
os << "probes \t gets the number of probes to accumulate" << std::endl; os << "probes \t gets the number of probes to accumulate" << std::endl;
os << "samples t \t gets the number of samples expected from the jctb" << std::endl; os << "samples \t gets the number of samples expected from the jctb" << std::endl;
os << "storagecells \t gets number of storage cells per acquisition.For JUNGFRAU only." << std::endl;
os << std::endl; os << std::endl;
} }

View File

@ -2708,6 +2708,14 @@ int set_timer(int file_des) {
printf("setting timer %d to %lld ns\n",ind,tns); printf("setting timer %d to %lld ns\n",ind,tns);
#endif #endif
switch(ind) { switch(ind) {
#ifdef JUNGFRAUD
case STORAGE_CELL_NUMBER:
if (tns > MAX_STORAGE_CELL_VAL) {
ret=FAIL;
strcpy(mess,"Max Storage cell number should not exceed 15\n");
break;
}
#endif
#ifdef EIGERD #ifdef EIGERD
case SUBFRAME_ACQUISITION_TIME: case SUBFRAME_ACQUISITION_TIME:
if (tns > ((int64_t)MAX_SUBFRAME_EXPOSURE_VAL_IN_10NS*10) ){ if (tns > ((int64_t)MAX_SUBFRAME_EXPOSURE_VAL_IN_10NS*10) ){
@ -2740,6 +2748,8 @@ int set_timer(int file_des) {
cprintf(RED, "%s", mess); cprintf(RED, "%s", mess);
break; break;
} }
#if defined(MYTHEND) || defined(GOTTHARD) #if defined(MYTHEND) || defined(GOTTHARD)
if (ret == OK && ind==FRAME_NUMBER) { if (ret == OK && ind==FRAME_NUMBER) {
ret=allocateRAM(); ret=allocateRAM();

View File

@ -111,6 +111,7 @@ public:
FRAMES_FROM_START_PG, FRAMES_FROM_START_PG,
SAMPLES_JCTB, SAMPLES_JCTB,
SUBFRAME_ACQUISITION_TIME, /**< subframe exposure time */ SUBFRAME_ACQUISITION_TIME, /**< subframe exposure time */
STORAGE_CELL_NUMBER, /**<number of storage cells */
MAX_TIMERS MAX_TIMERS
}; };

View File

@ -1043,6 +1043,7 @@ int slsReceiverTCPIPInterface::set_timer() {
break; break;
case FRAME_NUMBER: case FRAME_NUMBER:
case CYCLES_NUMBER: case CYCLES_NUMBER:
case STORAGE_CELL_NUMBER:
receiverBase->setNumberOfFrames(index[1]); receiverBase->setNumberOfFrames(index[1]);
break; break;
case SUBFRAME_ACQUISITION_TIME: case SUBFRAME_ACQUISITION_TIME:
@ -1074,6 +1075,7 @@ int slsReceiverTCPIPInterface::set_timer() {
break; break;
case FRAME_NUMBER: case FRAME_NUMBER:
case CYCLES_NUMBER: case CYCLES_NUMBER:
case STORAGE_CELL_NUMBER:
retval=receiverBase->getNumberOfFrames(); retval=receiverBase->getNumberOfFrames();
break; break;
case SUBFRAME_ACQUISITION_TIME: case SUBFRAME_ACQUISITION_TIME: