mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-16 06:47:14 +02:00
client multi is updated with argument c++11 threading, need to update sls detector with arguments and removing imod
This commit is contained in:
@ -26,6 +26,8 @@
|
||||
#define MULTI_HAVE_DIFFERENT_VALUES 0x4000000000000000ULL
|
||||
#define MULTI_CONFIG_FILE_ERROR 0x2000000000000000ULL
|
||||
#define MULTI_POS_EXCEEDS_LIST 0x1000000000000000ULL
|
||||
#define MUST_BE_MULTI_CMD 0x0800000000000000ULL
|
||||
#define MULTI_OTHER_ERROR 0x0400000000000000ULL
|
||||
|
||||
// sls errors
|
||||
#define CRITICAL_ERROR_MASK 0xFFFFFFF
|
||||
@ -69,31 +71,30 @@
|
||||
#define COULD_NOT_SET_READOUT_FLAGS 0x0000000000001000ULL
|
||||
#define COULD_NOT_SET_FIFO_DEPTH 0x0000000000002000ULL
|
||||
#define COULD_NOT_SET_COUNTER_BIT 0x0000000000004000ULL
|
||||
#define COULD_NOT_PULSE_PIXEL 0x0000000000008000ULL
|
||||
#define COULD_NOT_PULSE_PIXEL_NMOVE 0x0000000000010000ULL
|
||||
#define COULD_NOT_PULSE_CHIP 0x0000000000020000ULL
|
||||
#define COULD_NOT_SET_RATE_CORRECTION 0x0000000000040000ULL
|
||||
#define DETECTOR_NETWORK_PARAMETER 0x0000000000080000ULL
|
||||
#define RATE_CORRECTION_NOT_32or16BIT 0x0000000000100000ULL
|
||||
#define RATE_CORRECTION_NO_TAU_PROVIDED 0x0000000000200000ULL
|
||||
#define PROGRAMMING_ERROR 0x0000000000400000ULL
|
||||
#define RECEIVER_ACTIVATE 0x0000000000800000ULL
|
||||
#define DATA_STREAMING 0x0000000001000000ULL
|
||||
#define RESET_ERROR 0x0000000002000000ULL
|
||||
#define POWER_CHIP 0x0000000004000000ULL
|
||||
#define RECEIVER_READ_TIMER 0x0000000008000000ULL
|
||||
#define RECEIVER_ACQ_TIME_NOT_SET 0x0000000010000000ULL
|
||||
#define RECEIVER_FLIPPED_DATA_NOT_SET 0x0000000020000000ULL
|
||||
#define THRESHOLD_NOT_SET 0x0000000040000000ULL
|
||||
#define RECEIVER_FILE_FORMAT 0x0000000080000000ULL
|
||||
#define RECEIVER_PARAMETER_NOT_SET 0x0000000100000000ULL
|
||||
#define RECEIVER_TIMER_NOT_SET 0x0000000200000000ULL
|
||||
#define RECEIVER_ENABLE_GAPPIXELS_NOT_SET 0x0000000400000000ULL
|
||||
#define RESTREAM_STOP_FROM_RECEIVER 0x0000000800000000ULL
|
||||
#define TEMPERATURE_CONTROL 0x0000001000000000ULL
|
||||
#define AUTO_COMP_DISABLE 0x0000002000000000ULL
|
||||
#define CONFIG_FILE 0x0000004000000000ULL
|
||||
#define STORAGE_CELL_START 0x0000008000000000ULL
|
||||
#define COULD_NOT_PULSE 0x0000000000008000ULL
|
||||
#define COULD_NOT_SET_RATE_CORRECTION 0x0000000000010000ULL
|
||||
#define DETECTOR_NETWORK_PARAMETER 0x0000000000020000ULL
|
||||
#define RATE_CORRECTION_NOT_32or16BIT 0x0000000000040000ULL
|
||||
#define RATE_CORRECTION_NO_TAU_PROVIDED 0x0000000000080000ULL
|
||||
#define PROGRAMMING_ERROR 0x0000000000100000ULL
|
||||
#define RECEIVER_ACTIVATE 0x0000000000200000ULL
|
||||
#define DATA_STREAMING 0x0000000000400000ULL
|
||||
#define RESET_ERROR 0x0000000000800000ULL
|
||||
#define POWER_CHIP 0x0000000001000000ULL
|
||||
#define RECEIVER_READ_TIMER 0x0000000002000000ULL
|
||||
#define RECEIVER_ACQ_TIME_NOT_SET 0x0000000004000000ULL
|
||||
#define RECEIVER_FLIPPED_DATA_NOT_SET 0x0000000008000000ULL
|
||||
#define THRESHOLD_NOT_SET 0x0000000010000000ULL
|
||||
#define RECEIVER_FILE_FORMAT 0x0000000020000000ULL
|
||||
#define RECEIVER_PARAMETER_NOT_SET 0x0000000040000000ULL
|
||||
#define RECEIVER_TIMER_NOT_SET 0x0000000080000000ULL
|
||||
#define RECEIVER_ENABLE_GAPPIXELS_NOT_SET 0x0000000100000000ULL
|
||||
#define RESTREAM_STOP_FROM_RECEIVER 0x0000000200000000ULL
|
||||
#define TEMPERATURE_CONTROL 0x0000000400000000ULL
|
||||
#define AUTO_COMP_DISABLE 0x0000000800000000ULL
|
||||
#define CONFIG_FILE 0x0000001000000000ULL
|
||||
#define STORAGE_CELL_START 0x0000002000000000ULL
|
||||
#define OTHER_ERROR_CODE 0x0000004000000000ULL
|
||||
// 0x000000FFFFFFFFFFULL
|
||||
|
||||
|
||||
@ -223,14 +224,8 @@ public:
|
||||
if(slsErrorMask&COULD_NOT_SET_COUNTER_BIT)
|
||||
retval.append("Could not set/reset counter bit\n");
|
||||
|
||||
if(slsErrorMask&COULD_NOT_PULSE_PIXEL)
|
||||
retval.append("Could not pulse pixel\n");
|
||||
|
||||
if(slsErrorMask&COULD_NOT_PULSE_PIXEL_NMOVE)
|
||||
retval.append("Could not pulse pixel and move\n");
|
||||
|
||||
if(slsErrorMask&COULD_NOT_PULSE_CHIP)
|
||||
retval.append("Could not pulse chip\n");
|
||||
if(slsErrorMask&COULD_NOT_PULSE)
|
||||
retval.append("Could not pulse pixel or chip\n");
|
||||
|
||||
if(slsErrorMask&COULD_NOT_SET_RATE_CORRECTION)
|
||||
retval.append("Could not set rate correction\n");
|
||||
@ -292,6 +287,9 @@ public:
|
||||
if(slsErrorMask&CONFIG_FILE)
|
||||
retval.append("Could not load/write config file\n");
|
||||
|
||||
if(slsErrorMask&OTHER_ERROR_CODE)
|
||||
retval.append("Some error occured.\n");
|
||||
|
||||
//------------------------------------------------------ length of message
|
||||
|
||||
|
||||
|
@ -110,7 +110,7 @@ int readDataFile(std::string fname, short int *data, int nch) {
|
||||
iline=readDataFile(infile, data, nch, 0);
|
||||
infile.close();
|
||||
} else {
|
||||
std::cout<< "Could not read file " << fname << std::endl;
|
||||
FILE_LOG(logERROR) << "Could not read file " << fname;
|
||||
return -1;
|
||||
}
|
||||
return iline;
|
||||
@ -137,7 +137,7 @@ int writeDataFile(std::string fname,int nch, short int *data) {
|
||||
outfile.close();
|
||||
return slsReceiverDefs::OK;
|
||||
} else {
|
||||
std::cout<< "Could not open file " << fname << "for writing"<< std::endl;
|
||||
FILE_LOG(logERROR) << "Could not open file " << fname << "for writing";
|
||||
return slsReceiverDefs::FAIL;
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -101,9 +101,6 @@ private:
|
||||
* file in a separate thread) */
|
||||
int threadedProcessing;
|
||||
|
||||
/** dead time (in ns) for rate corrections */
|
||||
double tDead;
|
||||
|
||||
/** flag for acquiring */
|
||||
bool acquiringFlag;
|
||||
|
||||
@ -825,9 +822,8 @@ public:
|
||||
* Ensures that min is less than max in both dimensions (Gotthard)
|
||||
* @param n number of rois
|
||||
* @param r array of rois
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
*/
|
||||
void verifyMinMaxROI(int n, ROI r[], int detPos = -1);
|
||||
void verifyMinMaxROI(int n, ROI r[]);
|
||||
|
||||
/**
|
||||
* Set ROI (Gotthard)
|
||||
@ -1047,23 +1043,8 @@ public:
|
||||
|
||||
/**
|
||||
* Get rate correction ( Eiger)
|
||||
* @param t reference for dead time
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns 0 if rate correction disabled, > 0 otherwise
|
||||
*/
|
||||
int getRateCorrection(double &t, int detPos = -1);
|
||||
|
||||
/**
|
||||
* Get rate correction tau ( Eiger)
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns 0 if rate correction disabled, otherwise the tau used for the correction
|
||||
*/
|
||||
double getRateCorrectionTau(int detPos = -1);
|
||||
|
||||
/**
|
||||
* Get rate correction ( Eiger)
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns 0 if rate correction disabled, > 0 otherwise
|
||||
* @returns 0 if rate correction disabled, > 0 otherwise (ns)
|
||||
*/
|
||||
int getRateCorrection(int detPos = -1);
|
||||
|
||||
@ -1388,20 +1369,18 @@ public:
|
||||
* @param fname file to read from
|
||||
* @param level if 2 reads also reads trimbits, angular conversion coefficients etc.
|
||||
* from files with default extensions as generated by dumpDetectorSetup
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns OK or FAIL
|
||||
*/
|
||||
int retrieveDetectorSetup(std::string const fname, int level=0, int detPos = -1);
|
||||
int retrieveDetectorSetup(std::string const fname, int level=0);
|
||||
|
||||
/**
|
||||
* Saves the detector setup to file
|
||||
* @param fname file to write to
|
||||
* @param level if 2 reads also trimbits, flat field, angular correction etc.
|
||||
* and writes them to files with automatically added extension
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns OK or FAIL
|
||||
*/
|
||||
int dumpDetectorSetup(std::string const fname, int level=0, int detPos = -1);
|
||||
int dumpDetectorSetup(std::string const fname, int level=0);
|
||||
|
||||
/**
|
||||
* register callback for accessing acquisition final data
|
||||
|
@ -5184,7 +5184,7 @@ int slsDetector::pulsePixel(int n,int x,int y) {
|
||||
if (ret==FAIL){
|
||||
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||
setErrorMask((getErrorMask())|(COULD_NOT_PULSE_PIXEL));
|
||||
setErrorMask((getErrorMask())|(COULD_NOT_PULSE));
|
||||
}
|
||||
disconnectControl();
|
||||
if (ret==FORCE_UPDATE)
|
||||
@ -5216,7 +5216,7 @@ int slsDetector::pulsePixelNMove(int n,int x,int y) {
|
||||
if (ret==FAIL){
|
||||
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||
setErrorMask((getErrorMask())|(COULD_NOT_PULSE_PIXEL_NMOVE));
|
||||
setErrorMask((getErrorMask())|(COULD_NOT_PULSE));
|
||||
}
|
||||
disconnectControl();
|
||||
if (ret==FORCE_UPDATE)
|
||||
@ -5247,7 +5247,7 @@ int slsDetector::pulseChip(int n) {
|
||||
if (ret==FAIL){
|
||||
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||
setErrorMask((getErrorMask())|(COULD_NOT_PULSE_CHIP));
|
||||
setErrorMask((getErrorMask())|(COULD_NOT_PULSE));
|
||||
}
|
||||
disconnectControl();
|
||||
if (ret==FORCE_UPDATE)
|
||||
@ -5768,7 +5768,7 @@ int slsDetector::setAutoComparatorDisableMode(int ival) {
|
||||
int slsDetector::getChanRegs(double* retval,bool fromDetector) {
|
||||
int n=getTotalNumberOfChannels();
|
||||
if(fromDetector){
|
||||
getModule(0);
|
||||
getModule(0);//FIXME: check if it worked
|
||||
}
|
||||
//the original array has 0 initialized
|
||||
if(chanregs){
|
||||
@ -6094,18 +6094,8 @@ int slsDetector::setRateCorrection(double t) {
|
||||
}
|
||||
|
||||
|
||||
int slsDetector::getRateCorrection(double &t) {
|
||||
|
||||
if (thisDetector->myDetectorType == EIGER){
|
||||
t = getRateCorrectionTau();
|
||||
return t;
|
||||
}
|
||||
|
||||
printf("unknown detector\n");
|
||||
return -1;
|
||||
};
|
||||
|
||||
double slsDetector::getRateCorrectionTau() {
|
||||
int slsDetector::getRateCorrection() {
|
||||
|
||||
if(thisDetector->myDetectorType == EIGER){
|
||||
int fnum=F_GET_RATE_CORRECT;
|
||||
@ -6139,21 +6129,11 @@ double slsDetector::getRateCorrectionTau() {
|
||||
}
|
||||
|
||||
|
||||
int slsDetector::getRateCorrection() {
|
||||
|
||||
if (thisDetector->myDetectorType == EIGER){
|
||||
double t = getRateCorrectionTau();
|
||||
return (int)t;
|
||||
}
|
||||
|
||||
printf("unknown detector\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int slsDetector::printReceiverConfiguration() {
|
||||
|
||||
std::cout << std::endl
|
||||
<< "#Detector " << idet << ":" << std::endl;
|
||||
std::cout << "Detector IP:\t\t" << getNetworkParameter(DETECTOR_IP) << std::endl;
|
||||
std::cout << "Detector MAC:\t\t" << getNetworkParameter(DETECTOR_MAC) << std::endl;
|
||||
|
||||
|
Reference in New Issue
Block a user