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

@ -4746,10 +4746,6 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
cout << "Changing samples: data size = " << thisDetector->dataBytes <<endl;
}
/* set progress */
if ((index==FRAME_NUMBER) || (index==CYCLES_NUMBER)) {
setTotalProgress();
}
if(t!=-1){
if ((thisDetector->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;

View File

@ -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"); \
}};

View File

@ -635,6 +635,14 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer;
++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 */
/*! \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;
}