Merge branch '3.0.1' into developer

This commit is contained in:
Dhanya Maliakal 2017-09-21 13:35:16 +02:00
commit 6eb5167c70
6 changed files with 132 additions and 163 deletions

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware
URL: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git
Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git
Repsitory UUID: 3c1eb747d1930d6d38030a5a607f72d3b58a7a21
Revision: 1544
Branch: 3.0
Repsitory UUID: 0fb1ff01209ad1aa975f39285814c2cc42db2678
Revision: 1556
Branch: 3.0.1
Last Changed Author: Dhanya_Maliakal
Last Changed Rev: 1549
Last Changed Date: 2017-09-14 17:05:04.000000002 +0200 ./threadFiles/ThreadPool.o
Last Changed Rev: 1561
Last Changed Date: 2017-09-20 18:27:25.000000002 +0200 ./slsDetectorAnalysis/postProcessing.cpp

View File

@ -1,11 +1,11 @@
//#define SVNPATH ""
#define SVNURLLIB "git@git.psi.ch:sls_detectors_software/sls_detector_software.git"
//#define SVNREPPATH ""
#define SVNREPUUIDLIB "3c1eb747d1930d6d38030a5a607f72d3b58a7a21"
//#define SVNREV 0x1549
#define SVNREPUUIDLIB "0fb1ff01209ad1aa975f39285814c2cc42db2678"
//#define SVNREV 0x1561
//#define SVNKIND ""
//#define SVNSCHED ""
#define SVNAUTHLIB "Dhanya_Maliakal"
#define SVNREVLIB 0x1549
#define SVNDATELIB 0x20170914
#define SVNREVLIB 0x1561
#define SVNDATELIB 0x20170920
//

View File

@ -396,16 +396,23 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef
\returns current flag
*/
virtual int setReadOutFlags(readOutFlags flag=GET_READOUT_FLAGS)=0;
int getContinuousReadoutFlag(){if(setReadOutFlags()&CONTINOUS_RO) return OK; return FAIL;};
void setContinuousReadoutFlag(){setReadOutFlags(CONTINOUS_RO); };
int getStoreInRamReadoutFlag(){if(setReadOutFlags()&STORE_IN_RAM) return OK; return FAIL;};
void setStoreInRamReadoutFlag(){setReadOutFlags(STORE_IN_RAM); };
int getParallelReadoutFlag(){if(setReadOutFlags()&PARALLEL) return OK; return FAIL;};
void setParallelReadoutFlag(){setReadOutFlags(PARALLEL); };
int getNonParallelReadoutFlag(){if(setReadOutFlags()&NONPARALLEL) return OK; return FAIL;};
void setNonParallelReadoutFlag(){setReadOutFlags(NONPARALLEL); };
int getSafeReadoutFlag(){if(setReadOutFlags()&SAFE) return OK; return FAIL;};
void setSafeReadoutFlag(){setReadOutFlags(SAFE); };
void setParallelMode(int value){ \
if(value>=0){ \
switch(value){ \
case 0: setReadOutFlags(NONPARALLEL);break; \
case 1: setReadOutFlags(PARALLEL);break; \
default: setReadOutFlags(SAFE);break; \
} \
} \
}; \
int getParallelMode(){ \
int ret = setReadOutFlags(); \
if (ret&NONPARALLEL) return 0; \
if (ret&PARALLEL) return 1; \
if (ret&SAFE) return 2; \
return -1; \
} \
/**
@ -829,6 +836,45 @@ virtual void readFrameFromReceiver()=0;
}};
/**
@short returns adc index from string
\param s can be temp_adc, temp_fpga, temp_fpgaext, temp_10ge, temp_dcdc, temp_sodl, temp_sodr, temp_fpgafl, temp_fpgafr
\returns TEMPERATURE_ADC, TEMPERATURE_FPGA, TEMPERATURE_FPGAEXT, TEMPERATURE_10GE, TEMPERATURE_DCDC, TEMPERATURE_SODL,
TEMPERATURE_SODR, TEMPERATURE_FPGA2, TEMPERATURE_FPGA3, -1 when unknown mode
*/
static int getADCIndex(string s){
if (s=="temp_adc") return TEMPERATURE_ADC;
if (s=="temp_fpga") return TEMPERATURE_FPGA;
if (s=="temp_fpgaext") return TEMPERATURE_FPGAEXT;
if (s=="temp_10ge") return TEMPERATURE_10GE;
if (s=="temp_dcdc") return TEMPERATURE_DCDC;
if (s=="temp_sodl") return TEMPERATURE_SODL;
if (s=="temp_sodr") return TEMPERATURE_SODR;
if (s=="temp_fpgafl") return TEMPERATURE_FPGA2;
if (s=="temp_fpgafr") return TEMPERATURE_FPGA3;
return -1;
};
/**
@short returns dac index from string
\param s can be vcmp_ll, vcmp_lr, vcmp_rl, vcmp_rr, vthreshold, vrf, vrs, vtr, vcall, vcp
\returns E_Vcmp_ll, E_Vcmp_lr, E_Vcmp_rl, E_Vcmp_rr, THRESHOLD, E_Vrf, E_Vrs, E_Vtr, E_cal, E_Vcp , -1 when unknown mode
*/
static int getDACIndex(string s){
if (s=="vcmp_ll") return E_Vcmp_ll;
if (s=="vcmp_lr") return E_Vcmp_lr;
if (s=="vcmp_rl") return E_Vcmp_rl;
if (s=="vcmp_rr") return E_Vcmp_rr;
if (s=="vthreshold") return THRESHOLD;
if (s=="vrf") return E_Vrf;
if (s=="vrs") return E_Vrs;
if (s=="vtr") return E_Vtr;
if (s=="vcall") return E_cal;
if (s=="vcp") return E_Vcp;
return -1;
};
};

View File

@ -174,8 +174,6 @@ double slsDetectorUsers::setDelayAfterTrigger(double t, bool inseconds){
return ((1E-9) * (double)myDetector->setDelayAfterTrigger(tms));
}
int64_t slsDetectorUsers::setNumberOfGates(int64_t t){
return myDetector->setNumberOfGates(t);
}
@ -208,15 +206,10 @@ string slsDetectorUsers::getDetectorType(){
return myDetector->sgetDetectorsType();
}
void slsDetectorUsers::initDataset(int refresh){
myDetector->initDataset(refresh);
}
void slsDetectorUsers::addFrame(double *data, double pos, double i0, double t, string fname, double var){
myDetector->addFrame(data,pos,i0,t,fname,var);
}
@ -226,8 +219,6 @@ void slsDetectorUsers::finalizeDataset(double *a, double *v, double *e, int &np)
myDetector->finalizeDataset(a, v, e, np);
}
int slsDetectorUsers::setReceiverMode(int n){
return myDetector->setReadReceiverFrequency(1,n);
}
@ -236,7 +227,6 @@ int slsDetectorUsers::enableDataStreamingFromReceiver(int i){
return myDetector->enableDataStreamingFromReceiver(i);
}
int64_t slsDetectorUsers::getModuleFirmwareVersion(){
return myDetector->getModuleFirmwareVersion();
}
@ -301,13 +291,14 @@ void slsDetectorUsers::registerGetI0Callback( double (*func)(int,void*),void *ar
}
string slsDetectorUsers::putCommand(int narg, char *args[], int pos){
if(narg < 2)
return string("Error: Insufficient Parameters");
return myCmd->putCommand(narg, args, pos);
}
string slsDetectorUsers::getCommand(int narg, char *args[], int pos){
if(narg < 1)
return string("Error: Insufficient Parameters");
@ -316,70 +307,41 @@ string slsDetectorUsers::getCommand(int narg, char *args[], int pos){
int slsDetectorUsers::setClockDivider(int value) {
return myDetector->setClockDivider(value);
}
int slsDetectorUsers::getContinuousReadoutFlag(){
return myDetector->getContinuousReadoutFlag();
int slsDetectorUsers::setParallelMode(int value) {
if(value >= 0)
myDetector->setParallelMode(value);
return myDetector->getParallelMode();
}
void slsDetectorUsers::setContinuousReadoutFlag(){
myDetector->setContinuousReadoutFlag();
int slsDetectorUsers::setAllTrimbits(int val, int id) {
return myDetector->setAllTrimbits(val, id);
}
int slsDetectorUsers::getStoreInRamReadoutFlag(){
return myDetector->getStoreInRamReadoutFlag();
}
void slsDetectorUsers::setStoreInRamReadoutFlag(){
myDetector->setStoreInRamReadoutFlag();
}
int slsDetectorUsers::getParallelReadoutFlag(){
return myDetector->getParallelReadoutFlag();
}
void slsDetectorUsers::setParallelReadoutFlag(){
myDetector->setParallelReadoutFlag();
}
int slsDetectorUsers::getNonParallelReadoutFlag(){
return myDetector->getNonParallelReadoutFlag();
}
void slsDetectorUsers::setNonParallelReadoutFlag(){
myDetector->setNonParallelReadoutFlag();
}
int slsDetectorUsers::getSafeReadoutFlag(){
return myDetector->getSafeReadoutFlag();
}
void slsDetectorUsers::setSafeReadoutFlag(){
myDetector->setSafeReadoutFlag();
}
int slsDetectorUsers::setAllTrimbits(int val) {
return myDetector->setAllTrimbits(val);
}
int slsDetectorUsers::setDAC(int id, int dacindex, int val) {
int slsDetectorUsers::setDAC(string dac, int val, int id) {
int dacindex = myDetector->getDACIndex(dac);
if(dacindex == -1) return -9999;
return myDetector->setDACValue(val, dacindex, id);
}
int slsDetectorUsers::getADC(int id, int adcindex) {
int slsDetectorUsers::getADC(string adc, int id) {
int adcindex = myDetector->getADCIndex(adc);
if(adcindex == -1) return -9999;
return myDetector->getADCValue(adcindex, id);
}
int slsDetectorUsers::startReceiver() {
return myDetector->startReceiver();
}
int slsDetectorUsers::stopReceiver() {
return myDetector->stopReceiver();
}
int slsDetectorUsers::startAcquisition() {
return myDetector->startAcquisition();
}

View File

@ -554,88 +554,54 @@ class slsDetectorUsers
int setClockDivider(int value);
/**
@short gets continuous readout flag
\returns gets continuous readout flag
@short sets parallel mode
\param value 0 for non parallel, 1 for parallel, 2 for safe mode (-1 gets)
\returns gets parallel mode
*/
int getContinuousReadoutFlag();
/**
@short sets continuous readout flag
\returns OK if successful, else false
*/
void setContinuousReadoutFlag();
/**
@short gets store in ram readout flag
\returns gets store in ram readout flag
*/
int getStoreInRamReadoutFlag();
/**
@short sets store in ram readout flag
\returns OK if successful, else false
*/
void setStoreInRamReadoutFlag();
/**
@short gets parallel readout flag
\returns gets parallel readout flag
*/
int getParallelReadoutFlag();
/**
@short sets parallel readout flag
\returns OK if successful, else false
*/
void setParallelReadoutFlag();
/**
@short gets non parallel readout flag
\returns gets non parallel readout flag
*/
int getNonParallelReadoutFlag();
/**
@short sets non parallel readout flag
\returns OK if successful, else false
*/
void setNonParallelReadoutFlag();
/**
@short gets safe readout flag
\returns gets safe readout flag
*/
int getSafeReadoutFlag();
/**
@short sets safe readout flag
\returns OK if successful, else false
*/
void setSafeReadoutFlag();
int setParallelMode(int value);
/**
@short sets all trimbits to value (only available for eiger)
\param val value to be set (-1 gets)
\param id module index (-1 for all)
\returns value set
*/
int setAllTrimbits(int val);
int setAllTrimbits(int val, int id = -1);
/**
@short set dac value
\param id module index (-1 for all)
\param dacindex dac index \sa dacIndex
\param dac dac as string. can be vcmp_ll, vcmp_lr, vcmp_rl, vcmp_rr, vthreshold, vrf, vrs, vtr, vcall, vcp. others not supported
\param val value to be set (-1 gets)
\returns dac value
\param id module index (-1 for all)
\returns dac value or -1 (if id=-1 & dac value is different for all modules) or -9999 if dac string does not match
*/
int setDAC(int id, int dacindex, int val);
int setDAC(string dac, int val, int id = -1);
/**
@short get adc value
\param adc adc as string. can be temp_adc, temp_fpga, temp_fpgaext, temp_10ge, temp_dcdc, temp_sodl, temp_sodr, temp_fpgafl, temp_fpgafr. others not supported
\param id module index (-1 for all)
\param adcindex adc index \sa dacIndex
\returns adc value
\returns adc value or -1 (if id=-1 & adc value is different for all modules) or -9999 if adc string does not match
*/
int getADC(int id, int adcindex);
int getADC(string adc, int id = -1);
/**
@short start receiver listening mode
\param returns OK or FAIL
*/
int startReceiver();
/**
@short stop receiver listening mode
\param returns OK or FAIL
*/
int stopReceiver();
/**
start detector acquisition in non blocking mode
\returns OK if all detectors are properly started, FAIL otherwise
*/
int startAcquisition();
/************************************************************************
@ -711,7 +677,7 @@ class slsDetectorUsers
/**
@short returns external communication mode string from index
\param f index for communication mode
\param s index for communication mode
\returns auto, trigger, ro_trigger, gating, triggered_gating, unknown when wrong mode
*/

View File

@ -521,16 +521,11 @@ void* postProcessing::processData(int delflag) {
int ifp;
while(true){
//cout.flush();
//cout<<flush;
usleep(100 * 1000); //20ms need this else connecting error to receiver (too fast)
if (checkJoinThread()){
break;
}
// set only in startThread
if (*threadedProcessing==0)
setTotalProgress();
// to exit acquire by typing q
ifp=kbhit();
if (ifp!=0){
c=fgetc(stdin);
@ -541,7 +536,6 @@ void* postProcessing::processData(int delflag) {
}
//get progress
pthread_mutex_lock(&mg);
if(setReceiverOnline() == ONLINE_FLAG){
@ -557,16 +551,17 @@ void* postProcessing::processData(int delflag) {
cout << "caught:" << caught << endl;
#endif
}
// exiting loop
if (*threadedProcessing==0)
break;
if (checkJoinThread()){
break;
}
usleep(100 * 1000); //20ms need this else connecting error to receiver (too fast)
}
}
}
return 0;