mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-05 20:30:03 +02:00
Merge branch '3.0-rc' into developer
This commit is contained in:
commit
ae6884949b
@ -43,7 +43,8 @@ using namespace std;
|
||||
#define COULDNOT_STOP_RECEIVER 0x0000800000000000ULL
|
||||
#define RECEIVER_DET_POSID_NOT_SET 0x0000400000000000ULL
|
||||
#define RECEIVER_MULTI_DET_SIZE_NOT_SET 0x0000200000000000ULL
|
||||
|
||||
#define PREPARE_ACQUISITION 0x0000100000000000ULL
|
||||
#define CLEANUP_ACQUISITION 0x0000080000000000ULL
|
||||
// 0xFFFFFFF000000000ULL
|
||||
|
||||
// 0x0000000FFFFFFFFFULL
|
||||
@ -79,6 +80,7 @@ using namespace std;
|
||||
#define RECEIVER_FLIPPED_DATA_NOT_SET 0x0000000020000000ULL
|
||||
#define THRESHOLD_NOT_SET 0x0000000040000000ULL
|
||||
#define RECEIVER_FILE_FORMAT 0x0000000080000000ULL
|
||||
#define RECEIVER_SUBF_TIME_NOT_SET 0x0000000100000000ULL
|
||||
// 0x0000000FFFFFFFFFULL
|
||||
|
||||
/** @short class returning all error messages for error mask */
|
||||
@ -145,6 +147,12 @@ public:
|
||||
if(slsErrorMask&RECEIVER_MULTI_DET_SIZE_NOT_SET)
|
||||
retval.append("Could not set multi detector size\n");
|
||||
|
||||
if(slsErrorMask&PREPARE_ACQUISITION)
|
||||
retval.append("Could not prepare acquisition in detector\n");
|
||||
|
||||
if(slsErrorMask&CLEANUP_ACQUISITION)
|
||||
retval.append("Could not clean up after acquisition in detector\n");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -251,6 +259,9 @@ public:
|
||||
if(slsErrorMask&RECEIVER_FILE_FORMAT)
|
||||
retval.append("Could not set receiver file format\n");
|
||||
|
||||
if(slsErrorMask&RECEIVER_SUBF_TIME_NOT_SET)
|
||||
retval.append("Could not set sub exposure time in receiver.\n");
|
||||
|
||||
|
||||
//------------------------------------------------------ length of message
|
||||
|
||||
|
@ -1921,4 +1921,35 @@ int Feb_Control_GetRightFPGATemp(){
|
||||
}
|
||||
|
||||
|
||||
uint32_t Feb_Control_WriteRegister(uint32_t offset, uint32_t data) {
|
||||
uint32_t value=0;
|
||||
if(Module_TopAddressIsValid(&modules[1])){
|
||||
if(!Feb_Interface_WriteRegister(Module_GetTopRightAddress (&modules[1]),offset, data,0, 0)) {
|
||||
cprintf(RED,"Could not read value. Value read:%d\n", value);
|
||||
value = 0;
|
||||
}
|
||||
} else {
|
||||
if(!Feb_Interface_WriteRegister(Module_GetBottomRightAddress (&modules[1]),offset, data,0, 0)) {
|
||||
cprintf(RED,"Could not read value. Value read:%d\n", value);
|
||||
value = 0;
|
||||
}
|
||||
}
|
||||
return Feb_Control_ReadRegister(offset);
|
||||
}
|
||||
|
||||
|
||||
uint32_t Feb_Control_ReadRegister(uint32_t offset) {
|
||||
uint32_t value=0;
|
||||
if(Module_TopAddressIsValid(&modules[1])){
|
||||
if(!Feb_Interface_ReadRegister(Module_GetTopRightAddress (&modules[1]),offset, &value)) {
|
||||
cprintf(RED,"Could not read value. Value read:%d\n", value);
|
||||
value = 0;
|
||||
}
|
||||
} else {
|
||||
if(!Feb_Interface_ReadRegister(Module_GetBottomRightAddress (&modules[1]),offset, &value)) {
|
||||
cprintf(RED,"Could not read value. Value read:%d\n", value);
|
||||
value = 0;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
@ -198,4 +198,6 @@ int Feb_Control_GetModuleNumber();
|
||||
int Feb_Control_GetLeftFPGATemp();
|
||||
int Feb_Control_GetRightFPGATemp();
|
||||
|
||||
uint32_t Feb_Control_WriteRegister(uint32_t offset, uint32_t data);
|
||||
uint32_t Feb_Control_ReadRegister(uint32_t offset);
|
||||
#endif
|
||||
|
Binary file not shown.
@ -1,9 +1,9 @@
|
||||
Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer
|
||||
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: d3b24894af8a588e6945240c3b80c2b7024608c4
|
||||
Revision: 295
|
||||
Repsitory UUID: 2dfbd9016b501eca6ee2c00a08e49a3f7e7990d8
|
||||
Revision: 296
|
||||
Branch: 3.0-rc
|
||||
Last Changed Author: Dhanya_Maliakal
|
||||
Last Changed Rev: 1448
|
||||
Last Changed Date: 2017-07-25 13:53:46.000000002 +0200 ./Beb.c
|
||||
Last Changed Rev: 1457
|
||||
Last Changed Date: 2017-08-08 15:23:10.000000002 +0200 ./Makefile
|
||||
|
@ -1,11 +1,11 @@
|
||||
//#define SVNPATH ""
|
||||
#define SVNURL "git@git.psi.ch:sls_detectors_software/sls_detector_software.git"
|
||||
//#define SVNREPPATH ""
|
||||
#define SVNREPUUID "d3b24894af8a588e6945240c3b80c2b7024608c4"
|
||||
//#define SVNREV 0x1448
|
||||
#define SVNREPUUID "2dfbd9016b501eca6ee2c00a08e49a3f7e7990d8"
|
||||
//#define SVNREV 0x1457
|
||||
//#define SVNKIND ""
|
||||
//#define SVNSCHED ""
|
||||
#define SVNAUTH "Dhanya_Maliakal"
|
||||
#define SVNREV 0x1448
|
||||
#define SVNDATE 0x20170725
|
||||
#define SVNREV 0x1457
|
||||
#define SVNDATE 0x20170808
|
||||
//
|
||||
|
@ -30,6 +30,7 @@ dacs_t *detectorDacs=NULL;
|
||||
dacs_t *detectorAdcs=NULL;
|
||||
|
||||
int eiger_highvoltage = 0;
|
||||
int eiger_theo_highvoltage = 0;
|
||||
int eiger_iodelay = 0;
|
||||
int eiger_photonenergy = 0;
|
||||
int eiger_dynamicrange = 0;
|
||||
@ -341,7 +342,14 @@ void setupDetector() {
|
||||
|
||||
|
||||
|
||||
/* advanced read/write reg */
|
||||
uint32_t writeRegister(uint32_t offset, uint32_t data) {
|
||||
return Feb_Control_WriteRegister(offset, data);
|
||||
}
|
||||
|
||||
uint32_t readRegister(uint32_t offset) {
|
||||
return Feb_Control_ReadRegister(offset);
|
||||
}
|
||||
|
||||
|
||||
/* set parameters - nmod, dr, roi */
|
||||
@ -745,22 +753,33 @@ int getADC(enum ADCINDEX ind, int imod){
|
||||
|
||||
|
||||
int setHighVoltage(int val){
|
||||
if(val!=-1){
|
||||
eiger_highvoltage = val;
|
||||
if(master){
|
||||
if (master) {
|
||||
|
||||
// set
|
||||
if(val!=-1){
|
||||
eiger_theo_highvoltage = val;
|
||||
int ret = Feb_Control_SetHighVoltage(val);
|
||||
if(!ret) //could not set
|
||||
return -2;
|
||||
else if (ret == -1) //outside range
|
||||
return -1;
|
||||
}
|
||||
|
||||
// get
|
||||
if (!Feb_Control_GetHighVoltage(&eiger_highvoltage)) {
|
||||
cprintf(RED,"Warning: Could not read high voltage\n");
|
||||
return -3;
|
||||
}
|
||||
|
||||
// tolerance of 5
|
||||
if (abs(eiger_theo_highvoltage-eiger_highvoltage) > HIGH_VOLTAGE_TOLERANCE) {
|
||||
cprintf(BLUE, "High voltage still ramping: %d\n", eiger_highvoltage);
|
||||
return eiger_highvoltage;
|
||||
}
|
||||
return eiger_theo_highvoltage;
|
||||
}
|
||||
|
||||
if(master && !Feb_Control_GetHighVoltage(&eiger_highvoltage)){
|
||||
cprintf(RED,"Warning: Could not read high voltage\n");
|
||||
return -3;
|
||||
}
|
||||
return eiger_highvoltage;
|
||||
return SLAVE_HIGH_VOLTAGE_READ_VAL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -84,6 +84,8 @@ enum NETWORKINDEX {TXN_LEFT, TXN_RIGHT, TXN_FRAME,FLOWCTRL_10G};
|
||||
|
||||
#define MAX_SUBFRAME_EXPOSURE_VAL_IN_10NS (0x1FFFFFFF) /** 29 bit register for max subframe exposure value */
|
||||
|
||||
#define SLAVE_HIGH_VOLTAGE_READ_VAL (-999)
|
||||
#define HIGH_VOLTAGE_TOLERANCE (5)
|
||||
|
||||
|
||||
#endif /* SLSDETECTORSERVER_DEFS_H_ */
|
||||
|
@ -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: ef36cb7a54e1ae34ad1e85a46da6c121902108e6
|
||||
Revision: 1451
|
||||
Repsitory UUID: 2dfbd9016b501eca6ee2c00a08e49a3f7e7990d8
|
||||
Revision: 1452
|
||||
Branch: 3.0-rc
|
||||
Last Changed Author: Dhanya_Maliakal
|
||||
Last Changed Rev: 1456
|
||||
Last Changed Date: 2017-08-08 18:21:02.000000002 +0200 ./multiSlsDetector/multiSlsDetector.cpp
|
||||
Last Changed Rev: 1457
|
||||
Last Changed Date: 2017-08-09 11:36:51.000000002 +0200 ./multiSlsDetector/multiSlsDetector.cpp
|
||||
|
@ -1359,75 +1359,219 @@ int multiSlsDetector::getChanRegs(double* retval,bool fromDetector){
|
||||
|
||||
/* Communication to server */
|
||||
|
||||
int multiSlsDetector::prepareAcquisition(){
|
||||
|
||||
int i=0;
|
||||
int ret=OK;
|
||||
int posmin=0, posmax=thisMultiDetector->numberOfDetectors;
|
||||
|
||||
if(!threadpool){
|
||||
cout << "Error in creating threadpool. Exiting" << endl;
|
||||
return FAIL;
|
||||
}else{
|
||||
int* iret[posmax-posmin];
|
||||
for(int idet=posmin; idet<posmax; idet++){
|
||||
if((idet!=thisMultiDetector->masterPosition) && (detectors[idet])){
|
||||
iret[idet]= new int(OK);
|
||||
Task* task = new Task(new func0_t<int,slsDetector,int>(&slsDetector::prepareAcquisition,
|
||||
detectors[idet],iret[idet]));
|
||||
threadpool->add_task(task);
|
||||
}
|
||||
}
|
||||
threadpool->startExecuting();
|
||||
threadpool->wait_for_tasks_to_complete();
|
||||
for(int idet=posmin; idet<posmax; idet++){
|
||||
if((idet!=thisMultiDetector->masterPosition) && (detectors[idet])){
|
||||
if(iret[idet] != NULL){
|
||||
if(*iret[idet] != OK)
|
||||
ret = FAIL;
|
||||
delete iret[idet];
|
||||
}else ret = FAIL;
|
||||
if(detectors[idet]->getErrorMask())
|
||||
setErrorMask(getErrorMask()|(1<<idet));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//master
|
||||
int ret1=OK;
|
||||
i=thisMultiDetector->masterPosition;
|
||||
if (thisMultiDetector->masterPosition>=0) {
|
||||
if (detectors[i]) {
|
||||
ret1=detectors[i]->prepareAcquisition();
|
||||
if(detectors[i]->getErrorMask())
|
||||
setErrorMask(getErrorMask()|(1<<i));
|
||||
if (ret1!=OK)
|
||||
ret=FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int multiSlsDetector::cleanupAcquisition(){
|
||||
int i=0;
|
||||
int ret=OK,ret1=OK;
|
||||
int posmin=0, posmax=thisMultiDetector->numberOfDetectors;
|
||||
|
||||
i=thisMultiDetector->masterPosition;
|
||||
if (thisMultiDetector->masterPosition>=0) {
|
||||
if (detectors[i]) {
|
||||
ret1=detectors[i]->cleanupAcquisition();
|
||||
if(detectors[i]->getErrorMask())
|
||||
setErrorMask(getErrorMask()|(1<<i));
|
||||
if (ret1!=OK)
|
||||
ret=FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if(!threadpool){
|
||||
cout << "Error in creating threadpool. Exiting" << endl;
|
||||
return FAIL;
|
||||
}else{
|
||||
int* iret[posmax-posmin];
|
||||
for(int idet=posmin; idet<posmax; idet++){
|
||||
if((idet!=thisMultiDetector->masterPosition) && (detectors[idet])){
|
||||
iret[idet]= new int(OK);
|
||||
Task* task = new Task(new func0_t<int,slsDetector,int>(&slsDetector::cleanupAcquisition,
|
||||
detectors[idet],iret[idet]));
|
||||
threadpool->add_task(task);
|
||||
}
|
||||
}
|
||||
threadpool->startExecuting();
|
||||
threadpool->wait_for_tasks_to_complete();
|
||||
for(int idet=posmin; idet<posmax; idet++){
|
||||
if((idet!=thisMultiDetector->masterPosition) && (detectors[idet])){
|
||||
if(iret[idet] != NULL){
|
||||
if(*iret[idet] != OK)
|
||||
ret = FAIL;
|
||||
delete iret[idet];
|
||||
}else ret = FAIL;
|
||||
if(detectors[idet]->getErrorMask())
|
||||
setErrorMask(getErrorMask()|(1<<idet));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
// Acquisition functions
|
||||
/* change these funcs accepting also ok/fail */
|
||||
|
||||
int multiSlsDetector::startAcquisition(){
|
||||
|
||||
int i=0;
|
||||
int ret=OK, ret1=OK;
|
||||
|
||||
for (i=0; i<thisMultiDetector->numberOfDetectors; i++) {
|
||||
if (i!=thisMultiDetector->masterPosition)
|
||||
if (detectors[i]) {
|
||||
ret=detectors[i]->startAcquisition();
|
||||
if(detectors[i]->getErrorMask())
|
||||
setErrorMask(getErrorMask()|(1<<i));
|
||||
if (ret!=OK)
|
||||
ret1=FAIL;
|
||||
}
|
||||
}
|
||||
i=thisMultiDetector->masterPosition;
|
||||
if (thisMultiDetector->masterPosition>=0) {
|
||||
if (detectors[i]) {
|
||||
ret=detectors[i]->startAcquisition();
|
||||
if(detectors[i]->getErrorMask())
|
||||
setErrorMask(getErrorMask()|(1<<i));
|
||||
if (ret!=OK)
|
||||
ret1=FAIL;
|
||||
}
|
||||
}
|
||||
return ret1;
|
||||
|
||||
if (getDetectorsType() == EIGER) {
|
||||
if (prepareAcquisition() == FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
int i=0;
|
||||
int ret=OK;
|
||||
int posmin=0, posmax=thisMultiDetector->numberOfDetectors;
|
||||
|
||||
if(!threadpool){
|
||||
cout << "Error in creating threadpool. Exiting" << endl;
|
||||
return FAIL;
|
||||
}else{
|
||||
int* iret[posmax-posmin];
|
||||
for(int idet=posmin; idet<posmax; idet++){
|
||||
if((idet!=thisMultiDetector->masterPosition) && (detectors[idet])){
|
||||
iret[idet]= new int(OK);
|
||||
Task* task = new Task(new func0_t<int,slsDetector,int>(&slsDetector::startAcquisition,
|
||||
detectors[idet],iret[idet]));
|
||||
threadpool->add_task(task);
|
||||
}
|
||||
}
|
||||
threadpool->startExecuting();
|
||||
threadpool->wait_for_tasks_to_complete();
|
||||
for(int idet=posmin; idet<posmax; idet++){
|
||||
if((idet!=thisMultiDetector->masterPosition) && (detectors[idet])){
|
||||
if(iret[idet] != NULL){
|
||||
if(*iret[idet] != OK)
|
||||
ret = FAIL;
|
||||
delete iret[idet];
|
||||
}else ret = FAIL;
|
||||
if(detectors[idet]->getErrorMask())
|
||||
setErrorMask(getErrorMask()|(1<<idet));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//master
|
||||
int ret1=OK;
|
||||
i=thisMultiDetector->masterPosition;
|
||||
if (thisMultiDetector->masterPosition>=0) {
|
||||
if (detectors[i]) {
|
||||
ret1=detectors[i]->startAcquisition();
|
||||
if(detectors[i]->getErrorMask())
|
||||
setErrorMask(getErrorMask()|(1<<i));
|
||||
if (ret1!=OK)
|
||||
ret=FAIL;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
int multiSlsDetector::stopAcquisition(){
|
||||
int i=0;
|
||||
int ret=OK, ret1=OK;
|
||||
int i=0;
|
||||
int ret=OK,ret1=OK;
|
||||
int posmin=0, posmax=thisMultiDetector->numberOfDetectors;
|
||||
|
||||
i=thisMultiDetector->masterPosition;
|
||||
if (thisMultiDetector->masterPosition>=0) {
|
||||
if (detectors[i]) {
|
||||
ret1=detectors[i]->stopAcquisition();
|
||||
if(detectors[i]->getErrorMask())
|
||||
setErrorMask(getErrorMask()|(1<<i));
|
||||
if (ret1!=OK)
|
||||
ret=FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
i=thisMultiDetector->masterPosition;
|
||||
if (thisMultiDetector->masterPosition>=0) {
|
||||
if (detectors[i]) {
|
||||
ret=detectors[i]->stopAcquisition();
|
||||
if(detectors[i]->getErrorMask())
|
||||
setErrorMask(getErrorMask()|(1<<i));
|
||||
if (ret!=OK)
|
||||
ret1=FAIL;
|
||||
}
|
||||
}
|
||||
for (i=0; i<thisMultiDetector->numberOfDetectors; i++) {
|
||||
if (detectors[i]) {
|
||||
ret=detectors[i]->stopAcquisition();
|
||||
if(detectors[i]->getErrorMask())
|
||||
setErrorMask(getErrorMask()|(1<<i));
|
||||
if (ret!=OK)
|
||||
ret1=FAIL;
|
||||
}
|
||||
}
|
||||
*stoppedFlag=1;
|
||||
setAcquiringFlag(false);
|
||||
return ret1;
|
||||
|
||||
if(!threadpool){
|
||||
cout << "Error in creating threadpool. Exiting" << endl;
|
||||
return FAIL;
|
||||
}else{
|
||||
int* iret[posmax-posmin];
|
||||
for(int idet=posmin; idet<posmax; idet++){
|
||||
if((idet!=thisMultiDetector->masterPosition) && (detectors[idet])){
|
||||
iret[idet]= new int(OK);
|
||||
Task* task = new Task(new func0_t<int,slsDetector,int>(&slsDetector::stopAcquisition,
|
||||
detectors[idet],iret[idet]));
|
||||
threadpool->add_task(task);
|
||||
}
|
||||
}
|
||||
threadpool->startExecuting();
|
||||
threadpool->wait_for_tasks_to_complete();
|
||||
for(int idet=posmin; idet<posmax; idet++){
|
||||
if((idet!=thisMultiDetector->masterPosition) && (detectors[idet])){
|
||||
if(iret[idet] != NULL){
|
||||
if(*iret[idet] != OK)
|
||||
ret = FAIL;
|
||||
delete iret[idet];
|
||||
}else ret = FAIL;
|
||||
if(detectors[idet]->getErrorMask())
|
||||
setErrorMask(getErrorMask()|(1<<idet));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*stoppedFlag=1;
|
||||
setAcquiringFlag(false);
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
int multiSlsDetector::startReadOut(){
|
||||
|
||||
int i=0;
|
||||
@ -1633,8 +1777,12 @@ int* multiSlsDetector::startAndReadAll(){
|
||||
int* retval;
|
||||
int i=0;
|
||||
if (thisMultiDetector->onlineFlag==ONLINE_FLAG) {
|
||||
|
||||
startAndReadAllNoWait();
|
||||
|
||||
if(getDetectorsType() == EIGER) {
|
||||
if (prepareAcquisition() == FAIL)
|
||||
return NULL;
|
||||
}
|
||||
startAndReadAllNoWait();
|
||||
|
||||
while ((retval=getDataFromDetector())){
|
||||
i++;
|
||||
@ -3009,16 +3157,24 @@ dacs_t multiSlsDetector::setDAC(dacs_t val, dacIndex idac, int mV, int imod) {
|
||||
for(int idet=posmin; idet<posmax; idet++){
|
||||
if(detectors[idet]){
|
||||
if(iret[idet] != NULL){
|
||||
if (ret==-100)
|
||||
ret=*iret[idet];
|
||||
else if (ret!=*iret[idet])
|
||||
ret=-1;
|
||||
|
||||
// highvoltage of slave, ignore value
|
||||
if ((idac == HV_NEW) && (*iret[idet] == -999))
|
||||
;
|
||||
else {
|
||||
if (ret==-100)
|
||||
ret=*iret[idet];
|
||||
else if (ret!=*iret[idet])
|
||||
ret=-1;
|
||||
}
|
||||
delete iret[idet];
|
||||
}else ret=-1;
|
||||
if(detectors[idet]->getErrorMask())
|
||||
setErrorMask(getErrorMask()|(1<<idet));
|
||||
}
|
||||
}
|
||||
if (ret==-100)
|
||||
ret = -1;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -561,7 +561,17 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
|
||||
|
||||
// Acquisition functions
|
||||
/**
|
||||
prepares detector for acquisition
|
||||
\returns OK if all detectors are properly started, FAIL otherwise
|
||||
*/
|
||||
int prepareAcquisition();
|
||||
|
||||
/**
|
||||
prepares detector for acquisition
|
||||
\returns OK if all detectors are properly started, FAIL otherwise
|
||||
*/
|
||||
int cleanupAcquisition();
|
||||
|
||||
/**
|
||||
start detector acquisition (master is started as last)
|
||||
|
@ -1,11 +1,11 @@
|
||||
//#define SVNPATH ""
|
||||
#define SVNURLLIB "git@git.psi.ch:sls_detectors_software/sls_detector_software.git"
|
||||
//#define SVNREPPATH ""
|
||||
#define SVNREPUUIDLIB "ef36cb7a54e1ae34ad1e85a46da6c121902108e6"
|
||||
//#define SVNREV 0x1456
|
||||
#define SVNREPUUIDLIB "2dfbd9016b501eca6ee2c00a08e49a3f7e7990d8"
|
||||
//#define SVNREV 0x1457
|
||||
//#define SVNKIND ""
|
||||
//#define SVNSCHED ""
|
||||
#define SVNAUTHLIB "Dhanya_Maliakal"
|
||||
#define SVNREVLIB 0x1456
|
||||
#define SVNDATELIB 0x20170808
|
||||
#define SVNREVLIB 0x1457
|
||||
#define SVNDATELIB 0x20170809
|
||||
//
|
||||
|
@ -3976,6 +3976,62 @@ int slsDetector::updateDetector() {
|
||||
// Acquisition functions
|
||||
/* change these funcs accepting also ok/fail */
|
||||
|
||||
|
||||
int slsDetector::prepareAcquisition() {
|
||||
int fnum = F_PREPARE_ACQUISITION;
|
||||
int ret=FAIL;
|
||||
char mess[MAX_STR_LENGTH]="";
|
||||
|
||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Preparing Detector for Acquisition" << std::endl;
|
||||
#endif
|
||||
if (connectControl() == OK){
|
||||
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||
if (ret==FAIL){
|
||||
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||
setErrorMask((getErrorMask())|(PREPARE_ACQUISITION));
|
||||
}
|
||||
disconnectControl();
|
||||
if (ret==FORCE_UPDATE)
|
||||
updateDetector();
|
||||
}
|
||||
}else
|
||||
std::cout << "cannot connect to detector" << endl;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int slsDetector::cleanupAcquisition() {
|
||||
int fnum = F_CLEANUP_ACQUISITION;
|
||||
int ret=FAIL;
|
||||
char mess[MAX_STR_LENGTH]="";
|
||||
|
||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Cleaning up Detector after Acquisition " << std::endl;
|
||||
#endif
|
||||
if (connectControl() == OK){
|
||||
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||
if (ret==FAIL){
|
||||
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||
setErrorMask((getErrorMask())|(CLEANUP_ACQUISITION));
|
||||
}
|
||||
disconnectControl();
|
||||
if (ret==FORCE_UPDATE)
|
||||
updateDetector();
|
||||
}
|
||||
}else
|
||||
std::cout << "cannot connect to detector" << endl;
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
int slsDetector::startAcquisition(){
|
||||
|
||||
|
||||
@ -4258,6 +4314,10 @@ int* slsDetector::startAndReadAll(){
|
||||
int i=0;
|
||||
#endif
|
||||
//#endif
|
||||
if(thisDetector->myDetectorType == EIGER) {
|
||||
if (prepareAcquisition() == FAIL)
|
||||
return NULL;
|
||||
}
|
||||
startAndReadAllNoWait();
|
||||
//#ifdef VERBOSE
|
||||
// std::cout<< "started" << std::endl;
|
||||
@ -4450,7 +4510,8 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
|
||||
|
||||
|
||||
//send acquisiton period/frame number to receiver
|
||||
if((index==FRAME_NUMBER)||(index==FRAME_PERIOD)||(index==CYCLES_NUMBER)||(index==ACQUISITION_TIME)){
|
||||
if((index==FRAME_NUMBER)||(index==FRAME_PERIOD)||(index==CYCLES_NUMBER)||(index==ACQUISITION_TIME) || (index==SUBFRAME_ACQUISITION_TIME)){
|
||||
string timername = getTimerType(index);
|
||||
if(ret != FAIL){
|
||||
int64_t args[2];
|
||||
retval = -1;
|
||||
@ -4459,25 +4520,21 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
|
||||
|
||||
if(thisDetector->receiverOnlineFlag==ONLINE_FLAG){
|
||||
|
||||
//set #frames, #cycles
|
||||
//set #frames * #cycles
|
||||
if((index==FRAME_NUMBER)||(index==CYCLES_NUMBER)){
|
||||
timername.assign("(Number of Frames) * (Number of cycles)");
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Setting/Getting number of frames*cycles " << 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];
|
||||
}
|
||||
//set period/exptime
|
||||
else{
|
||||
#ifdef VERBOSE
|
||||
if(index==ACQUISITION_TIME)
|
||||
std::cout << "Setting/Getting acquisition time " << index << " to/from receiver " << args[1] << std::endl;
|
||||
else
|
||||
std::cout << "Setting/Getting acquisition period " << index << " to/from receiver " << args[1] << std::endl;
|
||||
// set period/exptime/subexptime
|
||||
else std::cout << "Setting/Getting " << timername << " " << index << " to/from receiver " << args[1] << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
char mess[MAX_STR_LENGTH]="";
|
||||
if (connectData() == OK){
|
||||
@ -4486,18 +4543,23 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
|
||||
}
|
||||
if((args[1] != retval)|| (ret==FAIL)){
|
||||
ret = FAIL;
|
||||
if(index==ACQUISITION_TIME){
|
||||
if(strstr(mess,"receiver not idle")==NULL)
|
||||
cout << "ERROR:Acquisition Time in receiver set incorrectly to " << retval << " instead of " << args[1] << endl;
|
||||
setErrorMask((getErrorMask())|(RECEIVER_ACQ_TIME_NOT_SET));
|
||||
}else if(index==FRAME_PERIOD){
|
||||
if(strstr(mess,"receiver not idle")==NULL)
|
||||
cout << "ERROR:Acquisition Period in receiver set incorrectly to " << retval << " instead of " << args[1] << endl;
|
||||
setErrorMask((getErrorMask())|(RECEIVER_ACQ_PERIOD_NOT_SET));
|
||||
}else{
|
||||
if(strstr(mess,"receiver not idle")==NULL)
|
||||
cout << "ERROR:Number of Frames (* Number of cycles) in receiver set incorrectly to " << retval << " instead of " << args[1] << endl;
|
||||
setErrorMask((getErrorMask())|(RECEIVER_FRAME_NUM_NOT_SET));
|
||||
cout << "ERROR: " << timername << " in receiver set incorrectly to " << retval << " instead of " << args[1] << endl;
|
||||
|
||||
if(strstr(mess,"receiver is not idle")==NULL) {
|
||||
switch(index) {
|
||||
case ACQUISITION_TIME:
|
||||
setErrorMask((getErrorMask())|(RECEIVER_ACQ_TIME_NOT_SET));
|
||||
break;
|
||||
case FRAME_PERIOD:
|
||||
setErrorMask((getErrorMask())|(RECEIVER_ACQ_PERIOD_NOT_SET));
|
||||
break;
|
||||
case SUBFRAME_ACQUISITION_TIME:
|
||||
setErrorMask((getErrorMask())|(RECEIVER_SUBF_TIME_NOT_SET));
|
||||
break;
|
||||
default:
|
||||
setErrorMask((getErrorMask())|(RECEIVER_FRAME_NUM_NOT_SET));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(ret==FORCE_UPDATE)
|
||||
@ -5990,6 +6052,7 @@ string slsDetector::setReceiver(string receiverIP){
|
||||
std::cout << "frame index needed:" << ((thisDetector->timerValue[FRAME_NUMBER]*thisDetector->timerValue[CYCLES_NUMBER])>1) << endl;
|
||||
std::cout << "frame period:" << thisDetector->timerValue[FRAME_PERIOD] << endl;
|
||||
std::cout << "frame number:" << thisDetector->timerValue[FRAME_NUMBER] << endl;
|
||||
std::cout << "sub exp time:" << thisDetector->timerValue[SUBFRAME_ACQUISITION_TIME] << endl;
|
||||
std::cout << "dynamic range:" << thisDetector->dynamicRange << endl << endl;
|
||||
std::cout << "flippeddatax:" << thisDetector->flippedData[d] << endl;
|
||||
std::cout << "10GbE:" << thisDetector->tenGigaEnable << endl << endl;
|
||||
@ -6026,6 +6089,7 @@ string slsDetector::setReceiver(string receiverIP){
|
||||
setTimer(FRAME_PERIOD,thisDetector->timerValue[FRAME_PERIOD]);
|
||||
setTimer(FRAME_NUMBER,thisDetector->timerValue[FRAME_NUMBER]);
|
||||
setTimer(ACQUISITION_TIME,thisDetector->timerValue[ACQUISITION_TIME]);
|
||||
setTimer(SUBFRAME_ACQUISITION_TIME,thisDetector->timerValue[SUBFRAME_ACQUISITION_TIME]);
|
||||
setDynamicRange(thisDetector->dynamicRange);
|
||||
if(thisDetector->myDetectorType == EIGER){
|
||||
setFlippedData(X,-1);
|
||||
@ -7855,12 +7919,9 @@ int slsDetector::startReceiver(){
|
||||
}
|
||||
}
|
||||
|
||||
//let detector prepare anyway even if receiver didnt work (for those not using the receiver)
|
||||
if((thisDetector->myDetectorType != JUNGFRAU)) {
|
||||
int ret1 = detectorSendToReceiver(true);
|
||||
if (ret != FAIL)
|
||||
ret = ret1;
|
||||
}
|
||||
// tell detector to send to receiver (if start receiver failed, this is not executed)
|
||||
if((thisDetector->myDetectorType != JUNGFRAU && thisDetector->myDetectorType != EIGER && ret!= FAIL))
|
||||
return prepareAcquisition(); // send data to receiver for these detectors
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -7874,7 +7935,7 @@ int slsDetector::stopReceiver(){
|
||||
char mess[MAX_STR_LENGTH] = "";
|
||||
|
||||
if(thisDetector->myDetectorType != EIGER && thisDetector->myDetectorType != JUNGFRAU)
|
||||
detectorSendToReceiver(false);
|
||||
cleanupAcquisition(); // reset (send data to receiver) for these detectors, so back to CPU (dont care about ok/fail at this point)
|
||||
|
||||
if (thisDetector->receiverOnlineFlag==ONLINE_FLAG) {
|
||||
#ifdef VERBOSE
|
||||
@ -7920,37 +7981,6 @@ slsDetectorDefs::runStatus slsDetector::startReceiverReadout(){
|
||||
}
|
||||
|
||||
|
||||
int slsDetector::detectorSendToReceiver(bool set){
|
||||
int fnum;
|
||||
if(set) fnum=F_PREPARE_ACQUISITION;
|
||||
else fnum=F_CLEANUP_ACQUISITION;
|
||||
int ret = FAIL;
|
||||
char mess[MAX_STR_LENGTH]="";
|
||||
|
||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Setting detector to send packets via client to: " << set << std::endl;
|
||||
#endif
|
||||
if (connectControl() == OK){
|
||||
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||
if (ret==FAIL){
|
||||
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||
}
|
||||
disconnectControl();
|
||||
if (ret==FORCE_UPDATE)
|
||||
updateDetector();
|
||||
}
|
||||
}else
|
||||
std::cout << "cannot connect to detector" << endl;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1063,6 +1063,17 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
||||
|
||||
// Acquisition functions
|
||||
|
||||
/**
|
||||
prepares detector for acquisition
|
||||
\returns OK/FAIL
|
||||
*/
|
||||
int prepareAcquisition();
|
||||
|
||||
/**
|
||||
prepares detector for acquisition
|
||||
\returns OK/FAIL
|
||||
*/
|
||||
int cleanupAcquisition();
|
||||
|
||||
/**
|
||||
start detector acquisition
|
||||
@ -1614,10 +1625,6 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
||||
*/
|
||||
runStatus startReceiverReadout();
|
||||
|
||||
/** Sets(false) or Resets(true) the CPU bit in detector
|
||||
\returns OK or FAIL
|
||||
*/
|
||||
int detectorSendToReceiver(bool set);
|
||||
|
||||
/** gets the status of the listening mode of receiver
|
||||
\returns status
|
||||
|
@ -751,6 +751,30 @@ virtual void readFrameFromReceiver()=0;
|
||||
default: return string("unknown"); \
|
||||
}};
|
||||
|
||||
/** 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
|
||||
*/
|
||||
static string getTimerType(timerIndex t){ \
|
||||
switch (t) { \
|
||||
case FRAME_NUMBER: return string("frame_number"); \
|
||||
case ACQUISITION_TIME: return string("acquisition_time"); \
|
||||
case FRAME_PERIOD: return string("frame_period"); \
|
||||
case DELAY_AFTER_TRIGGER: return string("delay_after_trigger"); \
|
||||
case GATES_NUMBER: return string("gates_number"); \
|
||||
case PROBES_NUMBER: return string("probes_number"); \
|
||||
case CYCLES_NUMBER: return string("cycles_number"); \
|
||||
case ACTUAL_TIME: return string("actual_time"); \
|
||||
case MEASUREMENT_TIME: return string("measurement_time"); \
|
||||
case PROGRESS: return string("progress"); \
|
||||
case MEASUREMENTS_NUMBER: return string("measurements_number"); \
|
||||
case FRAMES_FROM_START: return string("frames_from_start"); \
|
||||
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"); \
|
||||
default: return string("unknown"); \
|
||||
}};
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
@ -3359,9 +3359,9 @@ string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action) {
|
||||
return string("unknown detector size ")+cmd;
|
||||
|
||||
if (cmd=="roimask")
|
||||
sprintf(ans,"%x",ret);
|
||||
sprintf(ans,"0x%x",ret);
|
||||
else
|
||||
sprintf(ans,"%d",ret);
|
||||
sprintf(ans,"0x%d",ret);
|
||||
|
||||
return string(ans);
|
||||
|
||||
@ -3586,7 +3586,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
||||
if (retval < 0)
|
||||
sprintf(answer, "%d", -1);
|
||||
else
|
||||
sprintf(answer,"%lx", retval);
|
||||
sprintf(answer,"0x%lx", retval);
|
||||
return string(answer);
|
||||
}
|
||||
|
||||
@ -3600,7 +3600,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
||||
if (retval < 0)
|
||||
sprintf(answer, "%d", -1);
|
||||
else
|
||||
sprintf(answer,"%lx", retval);
|
||||
sprintf(answer,"0x%lx", retval);
|
||||
return string(answer);
|
||||
} else
|
||||
return string("undefined module number");
|
||||
@ -3610,7 +3610,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
||||
if (retval < 0)
|
||||
sprintf(answer, "%d", -1);
|
||||
else
|
||||
sprintf(answer,"%lx", retval);
|
||||
sprintf(answer,"0x%lx", retval);
|
||||
return string(answer);
|
||||
}
|
||||
if (cmd.find("modulenumber")!=string::npos) {
|
||||
@ -3620,7 +3620,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
||||
if (retval < 0)
|
||||
sprintf(answer, "%d", -1);
|
||||
else
|
||||
sprintf(answer,"%lx", retval);
|
||||
sprintf(answer,"0x%lx", retval);
|
||||
return string(answer);
|
||||
} else
|
||||
return string("undefined module number");
|
||||
@ -3631,7 +3631,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
||||
if (retval < 0)
|
||||
sprintf(answer, "%d", -1);
|
||||
else
|
||||
sprintf(answer,"%lx", retval);
|
||||
sprintf(answer,"0x%lx", retval);
|
||||
return string(answer);
|
||||
}
|
||||
|
||||
@ -3640,7 +3640,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
||||
if (retval < 0)
|
||||
sprintf(answer, "%d", -1);
|
||||
else
|
||||
sprintf(answer,"%lx", retval);
|
||||
sprintf(answer,"0x%lx", retval);
|
||||
return string(answer);
|
||||
}
|
||||
|
||||
@ -3650,7 +3650,7 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
||||
if (retval < 0)
|
||||
sprintf(answer, "%d", -1);
|
||||
else
|
||||
sprintf(answer,"%lx", retval);
|
||||
sprintf(answer,"0x%lx", retval);
|
||||
return string(answer);
|
||||
}
|
||||
return string("unknown id mode ")+cmd;
|
||||
@ -3689,7 +3689,7 @@ string slsDetectorCommand::cmdDigiTest(int narg, char *args[], int action) {
|
||||
if (cmd=="bustest"){
|
||||
if (action==PUT_ACTION)
|
||||
return string("cannot set ")+cmd;
|
||||
sprintf(answer,"%x",myDet->digitalTest(DETECTOR_BUS_TEST));
|
||||
sprintf(answer,"0x%x",myDet->digitalTest(DETECTOR_BUS_TEST));
|
||||
return string(answer);
|
||||
}
|
||||
|
||||
@ -3698,7 +3698,7 @@ string slsDetectorCommand::cmdDigiTest(int narg, char *args[], int action) {
|
||||
return string("cannot set ")+cmd;
|
||||
int ival=-1;
|
||||
if (sscanf(args[0],"digitest:%d",&ival)) {
|
||||
sprintf(answer,"%x",myDet->digitalTest(CHIP_TEST, ival));
|
||||
sprintf(answer,"0x%x",myDet->digitalTest(CHIP_TEST, ival));
|
||||
return string(answer);
|
||||
} else
|
||||
return string("undefined module number");
|
||||
@ -3710,7 +3710,7 @@ string slsDetectorCommand::cmdDigiTest(int narg, char *args[], int action) {
|
||||
int ival=-1;
|
||||
if (sscanf(args[1],"%d",&ival)) {
|
||||
if((ival==0)||(ival==1)){
|
||||
sprintf(answer,"%x",myDet->digitalTest(DIGITAL_BIT_TEST,ival));
|
||||
sprintf(answer,"0x%x",myDet->digitalTest(DIGITAL_BIT_TEST,ival));
|
||||
return string(answer);
|
||||
}
|
||||
else
|
||||
@ -3783,13 +3783,13 @@ string slsDetectorCommand::cmdRegister(int narg, char *args[], int action) {
|
||||
;
|
||||
else
|
||||
return string("Could not scan value (hexadecimal fomat) ")+string(args[2]);
|
||||
sprintf(answer,"%x",myDet->writeRegister(addr,val));
|
||||
sprintf(answer,"0x%x",myDet->writeRegister(addr,val));
|
||||
} else if (cmd=="adcreg") {
|
||||
if (sscanf(args[2],"%x",&val))
|
||||
;
|
||||
else
|
||||
return string("Could not scan value (hexadecimal fomat) ")+string(args[2]);
|
||||
sprintf(answer,"%x",myDet->writeAdcRegister(addr,val));
|
||||
sprintf(answer,"0x%x",myDet->writeAdcRegister(addr,val));
|
||||
} else {
|
||||
|
||||
if (sscanf(args[2],"%d",&n))
|
||||
@ -3801,9 +3801,9 @@ string slsDetectorCommand::cmdRegister(int narg, char *args[], int action) {
|
||||
return string("Bit number out of range")+string(args[2]);
|
||||
|
||||
if (cmd=="setbit")
|
||||
sprintf(answer,"%x",myDet->writeRegister(addr,myDet->readRegister(addr)| 1<<n));
|
||||
sprintf(answer,"0x%x",myDet->writeRegister(addr,myDet->readRegister(addr)| 1<<n));
|
||||
if (cmd=="clearbit")
|
||||
sprintf(answer,"%x",myDet->writeRegister(addr,myDet->readRegister(addr) & ~(1<<n)));
|
||||
sprintf(answer,"0x%x",myDet->writeRegister(addr,myDet->readRegister(addr) & ~(1<<n)));
|
||||
}
|
||||
|
||||
|
||||
@ -3824,7 +3824,7 @@ string slsDetectorCommand::cmdRegister(int narg, char *args[], int action) {
|
||||
return string("Could not scan address (hexadecimal fomat) ")+string(args[1]);
|
||||
|
||||
|
||||
sprintf(answer,"%x",myDet->readRegister(addr));
|
||||
sprintf(answer,"0x%x",myDet->readRegister(addr));
|
||||
|
||||
}
|
||||
|
||||
@ -3861,7 +3861,7 @@ string slsDetectorCommand::helpRegister(int narg, char *args[], int action) {
|
||||
|
||||
ostringstream os;
|
||||
if (action==PUT_ACTION || action==HELP_ACTION) {
|
||||
os << "reg addr val \n writes the register addr with the value val"<< std::endl;
|
||||
os << "reg addr val \n writes the register addr with the value val (hexadecimal format)"<< std::endl;
|
||||
}
|
||||
if (action==GET_ACTION || action==HELP_ACTION) {
|
||||
os << "reg addr \n reads the register addr"<< std::endl;
|
||||
|
@ -59,6 +59,9 @@ void setupDetector();
|
||||
#ifndef EIGERD
|
||||
extern u_int32_t writeRegister(u_int32_t offset, u_int32_t data); // blackfin.h
|
||||
extern u_int32_t readRegister(u_int32_t offset); // blackfin.h
|
||||
#else
|
||||
uint32_t writeRegister(uint32_t offset, uint32_t data);
|
||||
uint32_t readRegister(uint32_t offset);
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1059,7 +1059,7 @@ int set_dac(int file_des) {
|
||||
if((ind == HV_POT) || (ind == HV_NEW)) {
|
||||
retval[0] = setHighVoltage(val);
|
||||
#ifdef EIGERD
|
||||
if(retval[0] < 0){
|
||||
if ((retval[0] != SLAVE_HIGH_VOLTAGE_READ_VAL) && (retval[0] < 0)) {
|
||||
ret = FAIL;
|
||||
if(retval[0] == -1)
|
||||
sprintf(mess, "Setting high voltage failed.Bad value %d. The range is from 0 to 200 V.\n",val);
|
||||
@ -1242,15 +1242,6 @@ int write_register(int file_des) {
|
||||
int retval=-1;
|
||||
sprintf(mess,"write to register failed\n");
|
||||
|
||||
#ifdef EIGERD
|
||||
//to receive any arguments
|
||||
while (n > 0)
|
||||
n = receiveData(file_des,mess,MAX_STR_LENGTH,OTHER);
|
||||
ret = FAIL;
|
||||
sprintf(mess,"Function (Write Register) is not implemented for this detector\n");
|
||||
cprintf(RED, "Warning: %s", mess);
|
||||
#else
|
||||
|
||||
// receive arguments
|
||||
int arg[2]={-1,-1};
|
||||
n = receiveData(file_des,arg,sizeof(arg),INT32);
|
||||
@ -1282,7 +1273,6 @@ int write_register(int file_des) {
|
||||
#endif
|
||||
if (ret==OK && differentClients)
|
||||
ret=FORCE_UPDATE;
|
||||
#endif
|
||||
|
||||
// ret could be swapped during sendData
|
||||
ret1 = ret;
|
||||
@ -1310,15 +1300,6 @@ int read_register(int file_des) {
|
||||
int retval=-1;
|
||||
sprintf(mess,"read register failed\n");
|
||||
|
||||
#ifdef EIGERD
|
||||
//to receive any arguments
|
||||
while (n > 0)
|
||||
n = receiveData(file_des,mess,MAX_STR_LENGTH,OTHER);
|
||||
ret = FAIL;
|
||||
sprintf(mess,"Function (Read Register) is not implemented for this detector\n");
|
||||
cprintf(RED, "Warning: %s", mess);
|
||||
#else
|
||||
|
||||
// receive arguments
|
||||
int arg=0;
|
||||
n = receiveData(file_des,&arg,sizeof(arg),INT32);
|
||||
@ -1337,7 +1318,6 @@ int read_register(int file_des) {
|
||||
#endif
|
||||
if (ret==OK && differentClients)
|
||||
ret=FORCE_UPDATE;
|
||||
#endif
|
||||
|
||||
// ret could be swapped during sendData
|
||||
ret1 = ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user