diff --git a/slsDetectorGui/forms/form_tab_advanced.ui b/slsDetectorGui/forms/form_tab_advanced.ui index 6dfde0513..e523966c0 100644 --- a/slsDetectorGui/forms/form_tab_advanced.ui +++ b/slsDetectorGui/forms/form_tab_advanced.ui @@ -51,7 +51,7 @@ QTabWidget::North - 3 + 4 Qt::ElideLeft @@ -77,7 +77,7 @@ 25 20 - 324 + 345 31 @@ -142,7 +142,7 @@ 230 15 - 242 + 259 44 @@ -198,7 +198,7 @@ Plots Trimbits from Detector. This will take time. 25 20 - 195 + 211 31 @@ -256,7 +256,7 @@ Plots Trimbits from Detector. This will take time. 25 25 696 - 195 + 199 @@ -977,7 +977,7 @@ An extension given by the modules serial number will be attached. 25 25 686 - 116 + 128 @@ -1357,7 +1357,7 @@ An extension given by the modules serial number will be attached. 35 15 686 - 116 + 128 @@ -1748,6 +1748,92 @@ An extension given by the modules serial number will be attached. + + + Others + + + + + 14 + 13 + 367 + 39 + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + false + + + <html><head/><body><p>Number of storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #cycles * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html> + + + Number of Storage cells: + + + + + + + false + + + + 0 + 0 + + + + <html><head/><body><p>Number of storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #cycles * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html> + + + + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + false + + + + + + -1 + + + 15 + + + 0 + + + + + + diff --git a/slsDetectorGui/include/qTabAdvanced.h b/slsDetectorGui/include/qTabAdvanced.h index a871d5649..9017b5644 100644 --- a/slsDetectorGui/include/qTabAdvanced.h +++ b/slsDetectorGui/include/qTabAdvanced.h @@ -198,6 +198,9 @@ private slots: */ void SetAllTrimbits(); + /** Set storage cells */ + void SetNumStoragecells(int value); + private: /** The multi detector object */ multiSlsDetector *myDet; diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index 6ad3e2ec8..826343d95 100644 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -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); diff --git a/slsDetectorGui/src/qTabAdvanced.cpp b/slsDetectorGui/src/qTabAdvanced.cpp index f5226957b..92d5d05f3 100644 --- a/slsDetectorGui/src/qTabAdvanced.cpp +++ b/slsDetectorGui/src/qTabAdvanced.cpp @@ -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 diff --git a/slsDetectorGui/src/qTabMeasurement.cpp b/slsDetectorGui/src/qTabMeasurement.cpp index fa246e84a..caa3995c9 100644 --- a/slsDetectorGui/src/qTabMeasurement.cpp +++ b/slsDetectorGui/src/qTabMeasurement.cpp @@ -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; } diff --git a/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c b/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c index 66cb6581c..20e177cfb 100644 --- a/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c @@ -392,7 +392,9 @@ void setupDetector() { setSpeed(CLOCK_DIVIDER, HALF_SPEED); cleanFifos(); resetCore(); + configureASICTimer(); + bus_w(ADC_PORT_INVERT_REG, ADC_PORT_INVERT_VAL); //Initialization of acquistion parameters setSettings(DEFAULT_SETTINGS,-1); @@ -411,6 +413,8 @@ void setupDetector() { setThresholdTemperature(DEFAULT_TMP_THRSHLD); // reset temp event setTemperatureEvent(0); + + } @@ -434,7 +438,7 @@ int powerChip (int on){ } 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); } @@ -502,10 +506,9 @@ int getPhase() { } void configureASICTimer() { -cprintf(RED," in here\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_DS_TMR_MSK) | ASIC_CTRL_DS_TMR_VAL); + printf("\nConfiguring ASIC Timer\n"); + 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); } @@ -644,9 +647,9 @@ int64_t setTimer(enum timerIndex ind, int64_t val) { case ACQUISITION_TIME: if(val >= 0){ 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); break; @@ -675,6 +678,16 @@ int64_t setTimer(enum timerIndex ind, int64_t val) { printf("Getting #cycles: %lld\n", (long long int)retval); 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: cprintf(RED,"Warning: Timer Index not implemented for this detector: %d\n", ind); break; diff --git a/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorServer_defs.h b/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorServer_defs.h index d8a744229..e451cd431 100644 --- a/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorServer_defs.h @@ -93,16 +93,18 @@ enum NETWORKINDEX { TXN_FRAME }; #define ADC_PORT_INVERT_VAL (0x453b2a9c) #define MAX_TIMESLOT_VAL (0x1F) #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_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_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_QUARTER_SPEED_VAL (0x0f) -#define ADC_PHASE_HALF_SPEED (0x48) //72 -#define ADC_PHASE_QUARTER_SPEED (0x48) //72 +#define ADC_OFST_HALF_SPEED_VAL (0x1f) //(0x20) +#define ADC_OFST_QUARTER_SPEED_VAL (0x0f) //(0x0f) +#define ADC_PHASE_HALF_SPEED (0x2D) //45 +#define ADC_PHASE_QUARTER_SPEED (0x2D) //45 +#define ADC_PORT_INVERT_VAL (0x453b2a9c) /* Maybe not required for jungfrau */ #define NTRIMBITS (6) diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp index b4c4d216b..0cdcf5435 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp @@ -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 ret=-100; diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index edf1edc93..b53763094 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -4746,10 +4746,6 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){ cout << "Changing samples: data size = " << thisDetector->dataBytes <myDetectorType==MYTHEN)&&(index==PROBES_NUMBER)) { @@ -4758,7 +4754,7 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){ } /* set progress */ - if ((index==FRAME_NUMBER) || (index==CYCLES_NUMBER)) { + if ((index==FRAME_NUMBER) || (index==CYCLES_NUMBER) || (index==STORAGE_CELL_NUMBER)) { setTotalProgress(); } @@ -4780,7 +4776,9 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){ //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); if(ret != FAIL){ int64_t args[2]; @@ -4791,15 +4789,14 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){ if(thisDetector->receiverOnlineFlag==ONLINE_FLAG){ //set #frames * #cycles - if((index==FRAME_NUMBER)||(index==CYCLES_NUMBER)){ - timername.assign("(Number of Frames) * (Number of cycles)"); + if((index==FRAME_NUMBER)||(index==CYCLES_NUMBER)||(index==STORAGE_CELL_NUMBER)){ + 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 - 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 - 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 // set period/exptime/subexptime @@ -5123,7 +5120,7 @@ int slsDetector::setPort(portType index, int num){ 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]) nf=thisDetector->timerValue[FRAME_NUMBER]; @@ -5131,6 +5128,9 @@ int slsDetector::setTotalProgress() { if (thisDetector->timerValue[CYCLES_NUMBER]>0) nc=thisDetector->timerValue[CYCLES_NUMBER]; + if (thisDetector->timerValue[STORAGE_CELL_NUMBER]>0) + ns=thisDetector->timerValue[STORAGE_CELL_NUMBER]+1; + if (thisDetector->numberOfPositions>0) npos=thisDetector->numberOfPositions; @@ -5144,12 +5144,13 @@ int slsDetector::setTotalProgress() { if ((thisDetector->nScanSteps[1]>0) && (thisDetector->actionMask & (1 << (MAX_ACTIONS+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 cout << "nc " << nc << endl; cout << "nm " << nm << endl; cout << "nf " << nf << endl; + cout << "ns " << ns << endl; cout << "npos " << npos << endl; cout << "nscan[0] " << nscan[0] << endl; cout << "nscan[1] " << nscan[1] << endl; diff --git a/slsDetectorSoftware/slsDetector/slsDetectorBase.h b/slsDetectorSoftware/slsDetector/slsDetectorBase.h index d30c3be9a..2936760a5 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorBase.h +++ b/slsDetectorSoftware/slsDetector/slsDetectorBase.h @@ -833,8 +833,8 @@ virtual int enableDataStreamingFromReceiver(int enable=-1)=0; }}; /** 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 - \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 + \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,storage_cell_number */ static string getTimerType(timerIndex 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 SAMPLES_JCTB: return string("samples_jctb"); \ case SUBFRAME_ACQUISITION_TIME: return string("subframe_acquisition_time"); \ + case STORAGE_CELL_NUMBER: return string("storage_cell_number"); \ default: return string("unknown"); \ }}; diff --git a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp index 48507bc0d..87ffe3387 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp @@ -635,6 +635,14 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) { descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; ++i; + /*! \page timing + - storagecells [i] 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 */ /*! \page timing @@ -5621,6 +5629,8 @@ string slsDetectorCommand::cmdTimer(int narg, char *args[], int action) { index=MEASUREMENTS_NUMBER; else if (cmd=="samples") index=SAMPLES_JCTB; + else if (cmd=="storagecells") + index=STORAGE_CELL_NUMBER; else 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 << "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 << "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; @@ -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 << "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 << "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; } diff --git a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c index fab206e9b..df8a3e7a8 100755 --- a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c +++ b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c @@ -2708,6 +2708,14 @@ int set_timer(int file_des) { printf("setting timer %d to %lld ns\n",ind,tns); #endif 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 case SUBFRAME_ACQUISITION_TIME: 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); break; } + + #if defined(MYTHEND) || defined(GOTTHARD) if (ret == OK && ind==FRAME_NUMBER) { ret=allocateRAM(); diff --git a/slsReceiverSoftware/include/sls_receiver_defs.h b/slsReceiverSoftware/include/sls_receiver_defs.h index 6548157c7..403b8c86e 100755 --- a/slsReceiverSoftware/include/sls_receiver_defs.h +++ b/slsReceiverSoftware/include/sls_receiver_defs.h @@ -111,6 +111,7 @@ public: FRAMES_FROM_START_PG, SAMPLES_JCTB, SUBFRAME_ACQUISITION_TIME, /**< subframe exposure time */ + STORAGE_CELL_NUMBER, /**setNumberOfFrames(index[1]); break; case SUBFRAME_ACQUISITION_TIME: @@ -1074,6 +1075,7 @@ int slsReceiverTCPIPInterface::set_timer() { break; case FRAME_NUMBER: case CYCLES_NUMBER: + case STORAGE_CELL_NUMBER: retval=receiverBase->getNumberOfFrames(); break; case SUBFRAME_ACQUISITION_TIME: