mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-25 07:40:03 +02:00
slsdetector and users updated to reflect new signatures, not yet compiled
This commit is contained in:
parent
ab8b07f2ee
commit
b5c35ddeac
@ -58,7 +58,7 @@
|
|||||||
// 0x000000FFFFFFFFFFULL
|
// 0x000000FFFFFFFFFFULL
|
||||||
#define COULDNOT_SET_NETWORK_PARAMETER 0x0000000000000001ULL
|
#define COULDNOT_SET_NETWORK_PARAMETER 0x0000000000000001ULL
|
||||||
#define COULDNOT_SET_ROI 0x0000000000000002ULL
|
#define COULDNOT_SET_ROI 0x0000000000000002ULL
|
||||||
#define RECEIVER_READ_FREQUENCY 0x0000000000000004ULL
|
#define RECEIVER_STREAMING_FREQUENCY 0x0000000000000004ULL
|
||||||
#define SETTINGS_NOT_SET 0x0000000000000008ULL
|
#define SETTINGS_NOT_SET 0x0000000000000008ULL
|
||||||
#define SETTINGS_FILE_NOT_OPEN 0x0000000000000010ULL
|
#define SETTINGS_FILE_NOT_OPEN 0x0000000000000010ULL
|
||||||
#define DETECTOR_TIMER_VALUE_NOT_SET 0x0000000000000020ULL
|
#define DETECTOR_TIMER_VALUE_NOT_SET 0x0000000000000020ULL
|
||||||
@ -81,7 +81,7 @@
|
|||||||
#define DATA_STREAMING 0x0000000000400000ULL
|
#define DATA_STREAMING 0x0000000000400000ULL
|
||||||
#define RESET_ERROR 0x0000000000800000ULL
|
#define RESET_ERROR 0x0000000000800000ULL
|
||||||
#define POWER_CHIP 0x0000000001000000ULL
|
#define POWER_CHIP 0x0000000001000000ULL
|
||||||
#define RECEIVER_READ_TIMER 0x0000000002000000ULL
|
#define RECEIVER_STREAMING_TIMER 0x0000000002000000ULL
|
||||||
#define RECEIVER_ACQ_TIME_NOT_SET 0x0000000004000000ULL
|
#define RECEIVER_ACQ_TIME_NOT_SET 0x0000000004000000ULL
|
||||||
#define RECEIVER_FLIPPED_DATA_NOT_SET 0x0000000008000000ULL
|
#define RECEIVER_FLIPPED_DATA_NOT_SET 0x0000000008000000ULL
|
||||||
#define THRESHOLD_NOT_SET 0x0000000010000000ULL
|
#define THRESHOLD_NOT_SET 0x0000000010000000ULL
|
||||||
@ -179,7 +179,7 @@ public:
|
|||||||
if(slsErrorMask&COULDNOT_SET_ROI)
|
if(slsErrorMask&COULDNOT_SET_ROI)
|
||||||
retval.append("Could not set the exact region of interest. Verify ROI set by detector.\n");
|
retval.append("Could not set the exact region of interest. Verify ROI set by detector.\n");
|
||||||
|
|
||||||
if(slsErrorMask&RECEIVER_READ_FREQUENCY)
|
if(slsErrorMask&RECEIVER_STREAMING_FREQUENCY)
|
||||||
retval.append("Could not set receiver read frequency.\n");
|
retval.append("Could not set receiver read frequency.\n");
|
||||||
|
|
||||||
if(slsErrorMask&SETTINGS_NOT_SET)
|
if(slsErrorMask&SETTINGS_NOT_SET)
|
||||||
@ -254,7 +254,7 @@ public:
|
|||||||
if(slsErrorMask&POWER_CHIP)
|
if(slsErrorMask&POWER_CHIP)
|
||||||
retval.append("Could not power on/off/get the chip\n");
|
retval.append("Could not power on/off/get the chip\n");
|
||||||
|
|
||||||
if(slsErrorMask&RECEIVER_READ_TIMER)
|
if(slsErrorMask&RECEIVER_STREAMING_TIMER)
|
||||||
retval.append("Could not set receiver read timer\n");
|
retval.append("Could not set receiver read timer\n");
|
||||||
|
|
||||||
if(slsErrorMask&RECEIVER_FLIPPED_DATA_NOT_SET)
|
if(slsErrorMask&RECEIVER_FLIPPED_DATA_NOT_SET)
|
||||||
|
@ -22,8 +22,6 @@
|
|||||||
|
|
||||||
typedef char mystring[MAX_STR_LENGTH];
|
typedef char mystring[MAX_STR_LENGTH];
|
||||||
|
|
||||||
typedef int dacs_t;
|
|
||||||
|
|
||||||
|
|
||||||
#define DEFAULT_DET_MAC "00:aa:bb:cc:dd:ee"
|
#define DEFAULT_DET_MAC "00:aa:bb:cc:dd:ee"
|
||||||
#define DEFAULT_DET_IP "129.129.202.46"
|
#define DEFAULT_DET_IP "129.129.202.46"
|
||||||
@ -80,8 +78,8 @@ typedef struct {
|
|||||||
int nadc; /**< is the number of adcs on the module */
|
int nadc; /**< is the number of adcs on the module */
|
||||||
int reg; /**< is the module register (e.g. dynamic range?)
|
int reg; /**< is the module register (e.g. dynamic range?)
|
||||||
\see moduleRegisterBit */
|
\see moduleRegisterBit */
|
||||||
dacs_t *dacs; /**< is the pointer to the array of the dac values (in V) */
|
int *dacs; /**< is the pointer to the array of the dac values (in V) */
|
||||||
dacs_t *adcs; /**< is the pointer to the array of the adc values (in V) FLAT_FIELD_CORRECTION*/
|
int *adcs; /**< is the pointer to the array of the adc values (in V) FLAT_FIELD_CORRECTION*/
|
||||||
int *chipregs; /**< is the pointer to the array of the chip registers
|
int *chipregs; /**< is the pointer to the array of the chip registers
|
||||||
\see ::chipRegisterBit */
|
\see ::chipRegisterBit */
|
||||||
int *chanregs; /**< is the pointer to the array of the channel registers
|
int *chanregs; /**< is the pointer to the array of the channel registers
|
||||||
|
@ -28,7 +28,7 @@ enum recFuncs{
|
|||||||
//Acquisition setup functions
|
//Acquisition setup functions
|
||||||
F_SET_RECEIVER_TIMER, /**< set/get timer value */
|
F_SET_RECEIVER_TIMER, /**< set/get timer value */
|
||||||
F_SET_RECEIVER_DYNAMIC_RANGE, /**< set/get detector dynamic range */
|
F_SET_RECEIVER_DYNAMIC_RANGE, /**< set/get detector dynamic range */
|
||||||
F_READ_RECEIVER_FREQUENCY, /**< sets the frequency of receiver sending frames to gui */
|
F_RECEIVER_STREAMING_FREQUENCY, /**< sets the frequency of receiver sending frames to gui */
|
||||||
|
|
||||||
// Acquisition functions
|
// Acquisition functions
|
||||||
F_GET_RECEIVER_STATUS, /**< gets the status of receiver listening mode */
|
F_GET_RECEIVER_STATUS, /**< gets the status of receiver listening mode */
|
||||||
@ -51,7 +51,7 @@ enum recFuncs{
|
|||||||
|
|
||||||
F_RECEIVER_ACTIVATE, /** < activate/deactivate readout */
|
F_RECEIVER_ACTIVATE, /** < activate/deactivate readout */
|
||||||
F_STREAM_DATA_FROM_RECEIVER, /**< stream data from receiver to client */
|
F_STREAM_DATA_FROM_RECEIVER, /**< stream data from receiver to client */
|
||||||
F_READ_RECEIVER_TIMER, /** < sets the timer between each data stream in receiver */
|
F_RECEIVER_STREAMING_TIMER, /** < sets the timer between each data stream in receiver */
|
||||||
F_SET_FLIPPED_DATA_RECEIVER, /** < sets the enable to flip data across x/y axis (bottom/top) */
|
F_SET_FLIPPED_DATA_RECEIVER, /** < sets the enable to flip data across x/y axis (bottom/top) */
|
||||||
F_SET_RECEIVER_FILE_FORMAT, /** < sets the receiver file format */
|
F_SET_RECEIVER_FILE_FORMAT, /** < sets the receiver file format */
|
||||||
|
|
||||||
|
@ -5,9 +5,6 @@ set(SOURCES
|
|||||||
slsDetector/slsDetectorCommand.cpp
|
slsDetector/slsDetectorCommand.cpp
|
||||||
slsDetector/slsDetector.cpp
|
slsDetector/slsDetector.cpp
|
||||||
slsReceiverInterface/receiverInterface.cpp
|
slsReceiverInterface/receiverInterface.cpp
|
||||||
threadFiles/CondVar.cpp
|
|
||||||
threadFiles/Mutex.cpp
|
|
||||||
threadFiles/ThreadPool.cpp
|
|
||||||
../commonFiles/utilities.cpp
|
../commonFiles/utilities.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -20,11 +17,6 @@ multiSlsDetector
|
|||||||
sharedMemory
|
sharedMemory
|
||||||
slsDetector
|
slsDetector
|
||||||
slsReceiverInterface
|
slsReceiverInterface
|
||||||
threadFiles
|
|
||||||
)
|
|
||||||
|
|
||||||
add_definitions(
|
|
||||||
-DDACS_INT
|
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(slsDetectorStatic STATIC
|
add_library(slsDetectorStatic STATIC
|
||||||
|
@ -9,15 +9,15 @@ CFLAGS= -g -DC_ONLY -fPIC
|
|||||||
|
|
||||||
DFLAGS= -g -DDACS_INT
|
DFLAGS= -g -DDACS_INT
|
||||||
|
|
||||||
INCLUDES?= -I../commonFiles -IslsDetector -I../slsReceiverSoftware/MySocketTCP -ImultiSlsDetector -IslsReceiverInterface -I../slsReceiverSoftware/include -IthreadFiles -IsharedMemory -I$(ASM)
|
INCLUDES?= -I../commonFiles -IslsDetector -ImultiSlsDetector -IslsReceiverInterface -IsharedMemory -I$(ASM)
|
||||||
|
|
||||||
#EPICSFLAGS=-D EPICS -I/usr/local/epics/base/include/ -I /usr/local/epics/base/include/os/Linux/ -L /usr/local/epics/base/lib/$(EPICS_HOST_ARCH) -Wl,-R/usr/local/epics/base/lib/$(EPICS_HOST_ARCH) -lca -lCom
|
#EPICSFLAGS=-D EPICS -I/usr/local/epics/base/include/ -I /usr/local/epics/base/include/os/Linux/ -L /usr/local/epics/base/lib/$(EPICS_HOST_ARCH) -Wl,-R/usr/local/epics/base/lib/$(EPICS_HOST_ARCH) -lca -lCom
|
||||||
|
|
||||||
LIBZMQDIR = ../commonFiles
|
LIBZMQDIR = ../commonFiles
|
||||||
LIBZMQ = -L$(LIBZMQDIR) -Wl,-rpath=$(LIBZMQDIR) -lzmq
|
LIBZMQ = -L$(LIBZMQDIR) -Wl,-rpath=$(LIBZMQDIR) -lzmq
|
||||||
|
|
||||||
SRC_CLNT= slsDetector/slsDetectorCommand.cpp slsDetector/slsDetector.cpp multiSlsDetector/multiSlsDetector.cpp slsReceiverInterface/receiverInterface.cpp slsDetector/slsDetectorUsers.cpp threadFiles/CondVar.cpp threadFiles/Mutex.cpp threadFiles/ThreadPool.cpp sharedMemory/SharedMemory.cpp ../commonFiles/utilities.cpp#../slsReceiverSoftware/MySocketTCP/MySocketTCP.cpp
|
SRC_CLNT= slsDetector/slsDetectorCommand.cpp slsDetector/slsDetector.cpp multiSlsDetector/multiSlsDetector.cpp slsReceiverInterface/receiverInterface.cpp slsDetector/slsDetectorUsers.cpp sharedMemory/SharedMemory.cpp ../commonFiles/utilities.cpp#../slsReceiverSoftware/MySocketTCP/MySocketTCP.cpp
|
||||||
DEPSINCLUDES = ../commonFiles/sls_receiver_defs.h ../commonFiles/sls_receiver_funcs.h ../commonFiles/ansi.h ../commonFiles/sls_detector_defs.h ../commonFiles/sls_detector_funcs.h ../commonFiles/error_defs.h slsDetector/slsDetectorBase.h slsDetector/detectorData.h threadFiles/Global.h threadFiles/Task.h sharedMemory/SharedMemory.h ../commonFiles/sls_receiver_exceptions.h ../commonFiles/versionAPI.h ../commonFiles/utilities.h
|
DEPSINCLUDES = ../commonFiles/sls_receiver_defs.h ../commonFiles/sls_receiver_funcs.h ../commonFiles/ansi.h ../commonFiles/sls_detector_defs.h ../commonFiles/sls_detector_funcs.h ../commonFiles/error_defs.h slsDetector/slsDetectorBase.h slsDetector/detectorData.h sharedMemory/SharedMemory.h ../commonFiles/sls_receiver_exceptions.h ../commonFiles/versionAPI.h ../commonFiles/utilities.h
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -36,12 +36,6 @@ OBJS = $(SRC_CLNT:%.cpp=%.o)
|
|||||||
|
|
||||||
all: package $(SRC_CLNT)
|
all: package $(SRC_CLNT)
|
||||||
|
|
||||||
mythenVirtualServer: $(SRC_MYTHEN_SVC)
|
|
||||||
cd mythenDetectorServer && make -f Makefile.virtual DESTDIR=$(DESTDIR)
|
|
||||||
|
|
||||||
gotthardVirtualServer: $(SRC_MYTHEN_SVC)
|
|
||||||
cd gotthardDetectorServer && make -f Makefile.virtual DESTDIR=$(DESTDIR)
|
|
||||||
|
|
||||||
|
|
||||||
%.o : %.cpp %.h $(DEPSINCLUDES) Makefile
|
%.o : %.cpp %.h $(DEPSINCLUDES) Makefile
|
||||||
$(CXX) -o $@ -c $< $(INCLUDES) $(DFLAGS) -fPIC $(EPICSFLAGS) -pthread -lrt $(LIBZMQ) $(FLAGS)
|
$(CXX) -o $@ -c $< $(INCLUDES) $(DFLAGS) -fPIC $(EPICSFLAGS) -pthread -lrt $(LIBZMQ) $(FLAGS)
|
||||||
|
@ -101,13 +101,6 @@ INPUT = ../commonfiles/communication_funcs.h \
|
|||||||
slsDetector/slsDetectorUsers.h \
|
slsDetector/slsDetectorUsers.h \
|
||||||
slsDetector/detectorData.h \
|
slsDetector/detectorData.h \
|
||||||
slsReceiverInterface/receiverInterface.h \
|
slsReceiverInterface/receiverInterface.h \
|
||||||
threadFiles/CondVar.h \
|
|
||||||
threadFiles/Global.h \
|
|
||||||
threadFiles/Multi.h \
|
|
||||||
threadFiles/Mutex.h \
|
|
||||||
threadFiles/Single.h \
|
|
||||||
threadFiles/Task.h \
|
|
||||||
threadFiles/ThreadPool.h \
|
|
||||||
../slsReceiverSoftware/include/BinaryFile.h \
|
../slsReceiverSoftware/include/BinaryFile.h \
|
||||||
../slsReceiverSoftware/include/BinaryFileStatic.h \
|
../slsReceiverSoftware/include/BinaryFileStatic.h \
|
||||||
../slsReceiverSoftware/include/circularFifo.h \
|
../slsReceiverSoftware/include/circularFifo.h \
|
||||||
|
@ -486,7 +486,7 @@ void multiSlsDetector::initializeMembers(bool verify) {
|
|||||||
// get objects from single det shared memory (open)
|
// get objects from single det shared memory (open)
|
||||||
for (int i = 0; i < thisMultiDetector->numberOfDetectors; i++) {
|
for (int i = 0; i < thisMultiDetector->numberOfDetectors; i++) {
|
||||||
try {
|
try {
|
||||||
slsDetector* sdet = new slsDetector(detId, i, verify, this);
|
slsDetector* sdet = new slsDetector(detId, i, verify);
|
||||||
detectors.push_back(sdet);
|
detectors.push_back(sdet);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
// clear detectors list
|
// clear detectors list
|
||||||
@ -620,7 +620,7 @@ void multiSlsDetector::addSlsDetector (std::string s) {
|
|||||||
|
|
||||||
|
|
||||||
int pos = (int)detectors.size();
|
int pos = (int)detectors.size();
|
||||||
slsDetector* sdet = new slsDetector(type, detId, pos, false, this);
|
slsDetector* sdet = new slsDetector(type, detId, pos, false);
|
||||||
detectors.push_back(sdet);
|
detectors.push_back(sdet);
|
||||||
thisMultiDetector->numberOfDetectors = detectors.size();
|
thisMultiDetector->numberOfDetectors = detectors.size();
|
||||||
|
|
||||||
@ -724,13 +724,13 @@ int multiSlsDetector::setMaxNumberOfChannelsPerDetector(dimension d,int i) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int multiSlsDetector::getDetectorOffset(dimension d, int pos) {
|
int multiSlsDetector::getDetectorOffset(dimension d, int detPos) {
|
||||||
return detectors[pos]->getDetectorOffset(d);
|
return detectors[detPos]->getDetectorOffset(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void multiSlsDetector::setDetectorOffset(dimension d, int off, int pos) {
|
void multiSlsDetector::setDetectorOffset(dimension d, int off, int detPos) {
|
||||||
detectors[pos]->setDetectorOffset(d, off);
|
detectors[detPos]->setDetectorOffset(d, off);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -871,6 +871,10 @@ void multiSlsDetector::updateOffsets() {
|
|||||||
thisMultiDetector->numberOfChannelInclGapPixels[Y] << std::endl
|
thisMultiDetector->numberOfChannelInclGapPixels[Y] << std::endl
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
serialCall(&slsDetector::updateMultiSize,
|
||||||
|
thisMultiDetector->numberOfDetector[0],
|
||||||
|
thisMultiDetector->numberOfDetector[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1215,43 +1219,6 @@ std::string multiSlsDetector::setSettingsDir(std::string s, int detPos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string multiSlsDetector::getCalDir(int detPos) {
|
|
||||||
// single
|
|
||||||
if (detPos >= 0) {
|
|
||||||
return detectors[detPos]->getCalDir();
|
|
||||||
}
|
|
||||||
|
|
||||||
// multi
|
|
||||||
auto r = serialCall(&slsDetector::getCalDir);
|
|
||||||
return sls::concatenateIfDifferent(r);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::string multiSlsDetector::setCalDir(std::string s, int detPos) {
|
|
||||||
// single
|
|
||||||
if (detPos >= 0) {
|
|
||||||
return detectors[detPos]->setCalDir(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
// multi
|
|
||||||
size_t p1 = 0;
|
|
||||||
size_t p2 = s.find('+', p1);
|
|
||||||
int id = 0;
|
|
||||||
while (p2 != std::string::npos) {
|
|
||||||
detectors[id]->setCalDir(s.substr(p1, p2 - p1));
|
|
||||||
if (detectors[id]->getErrorMask())
|
|
||||||
setErrorMask(getErrorMask() | (1 << id));
|
|
||||||
++id;
|
|
||||||
s = s.substr(p2 + 1);
|
|
||||||
p2 = s.find('+');
|
|
||||||
if (id >= (int)detectors.size())
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return getCalDir();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int multiSlsDetector::loadSettingsFile(std::string fname, int detPos) {
|
int multiSlsDetector::loadSettingsFile(std::string fname, int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
@ -1275,30 +1242,6 @@ int multiSlsDetector::saveSettingsFile(std::string fname, int detPos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int multiSlsDetector::loadCalibrationFile(std::string fname, int detPos) {
|
|
||||||
// single
|
|
||||||
if (detPos >= 0) {
|
|
||||||
return detectors[detPos]->loadCalibrationFile(fname);
|
|
||||||
}
|
|
||||||
|
|
||||||
// multi
|
|
||||||
auto r = parallelCall(&slsDetector::loadCalibrationFile, fname);
|
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
int multiSlsDetector::saveCalibrationFile(std::string fname, int detPos) {
|
|
||||||
// single
|
|
||||||
if (detPos >= 0) {
|
|
||||||
return detectors[detPos]->saveCalibrationFile(fname);
|
|
||||||
}
|
|
||||||
|
|
||||||
// multi
|
|
||||||
auto r = parallelCall(&slsDetector::saveCalibrationFile, fname);
|
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
slsDetectorDefs::runStatus multiSlsDetector::getRunStatus(int detPos) {
|
slsDetectorDefs::runStatus multiSlsDetector::getRunStatus(int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
@ -1442,11 +1385,11 @@ int multiSlsDetector::readAll(int detPos) {
|
|||||||
int multiSlsDetector::configureMAC(int detPos) {
|
int multiSlsDetector::configureMAC(int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->configureMAC();
|
return detectors[detPos]->configureMAC(getNumberOfDetectors(Y));
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::configureMAC);
|
auto r = parallelCall(&slsDetector::configureMAC, getNumberOfDetectors(Y));
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1501,6 +1444,122 @@ int64_t multiSlsDetector::setTimer(timerIndex index, int64_t t, int detPos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
double multiSlsDetector::setExposureTime(double t, bool inseconds, int detPos){
|
||||||
|
if(!inseconds)
|
||||||
|
return setTimer(ACQUISITION_TIME, (int64_t)t, detPos);
|
||||||
|
|
||||||
|
// + 0.5 to round for precision lost from converting double to int64_t
|
||||||
|
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
|
||||||
|
if (t < 0) tms = -1;
|
||||||
|
tms = setTimer(ACQUISITION_TIME, tms, detPos);
|
||||||
|
if (tms < 0)
|
||||||
|
return -1;
|
||||||
|
return ((1E-9) * (double)tms);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
double multiSlsDetector::setExposurePeriod(double t, bool inseconds, int detPos){
|
||||||
|
if(!inseconds)
|
||||||
|
return setTimer(FRAME_PERIOD, (int64_t)t, detPos);
|
||||||
|
|
||||||
|
// + 0.5 to round for precision lost from converting double to int64_t
|
||||||
|
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
|
||||||
|
if (t < 0) tms = -1;
|
||||||
|
tms = setTimer(FRAME_PERIOD, tms, detPos);
|
||||||
|
if (tms < 0)
|
||||||
|
return -1;
|
||||||
|
return ((1E-9) * (double)tms);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
double multiSlsDetector::setDelayAfterTrigger(double t, bool inseconds, int detPos){
|
||||||
|
if(!inseconds)
|
||||||
|
return setTimer(DELAY_AFTER_TRIGGER, (int64_t)t, detPos);
|
||||||
|
|
||||||
|
// + 0.5 to round for precision lost from converting double to int64_t
|
||||||
|
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
|
||||||
|
if (t < 0) tms = -1;
|
||||||
|
tms = setTimer(DELAY_AFTER_TRIGGER, tms, detPos);
|
||||||
|
if (tms < 0)
|
||||||
|
return -1;
|
||||||
|
return ((1E-9) * (double)tms);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
double multiSlsDetector::setSubFrameExposureTime(double t, bool inseconds, int detPos){
|
||||||
|
if(!inseconds)
|
||||||
|
return setTimer(SUBFRAME_ACQUISITION_TIME, (int64_t)t, detPos);
|
||||||
|
else {
|
||||||
|
// + 0.5 to round for precision lost from converting double to int64_t
|
||||||
|
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
|
||||||
|
if (t < 0) tms = -1;
|
||||||
|
tms = setTimer(SUBFRAME_ACQUISITION_TIME, tms, detPos);
|
||||||
|
if (tms < 0)
|
||||||
|
return -1;
|
||||||
|
return ((1E-9) * (double)tms);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
double multiSlsDetector::setSubFrameExposureDeadTime(double t, bool inseconds, int detPos){
|
||||||
|
if(!inseconds)
|
||||||
|
return setTimer(SUBFRAME_DEADTIME, (int64_t)t, detPos);
|
||||||
|
else {
|
||||||
|
// + 0.5 to round for precision lost from converting double to int64_t
|
||||||
|
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
|
||||||
|
if (t < 0) tms = -1;
|
||||||
|
tms = setTimer(SUBFRAME_DEADTIME, tms, detPos);
|
||||||
|
if (tms < 0)
|
||||||
|
return -1;
|
||||||
|
return ((1E-9) * (double)tms);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int64_t multiSlsDetector::setNumberOfFrames(int64_t t, int detPos){
|
||||||
|
return setTimer(FRAME_NUMBER, t, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int64_t multiSlsDetector::setNumberOfCycles(int64_t t, int detPos){
|
||||||
|
return setTimer(CYCLES_NUMBER, t, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int64_t multiSlsDetector::setNumberOfGates(int64_t t, int detPos){
|
||||||
|
return setTimer(GATES_NUMBER, t, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int64_t multiSlsDetector::setNumberOfStorageCells(int64_t t, int detPos) {
|
||||||
|
return setTimer(STORAGE_CELL_NUMBER, t, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
double multiSlsDetector::getMeasuredPeriod(bool inseconds, int detPos){
|
||||||
|
if(!inseconds)
|
||||||
|
return getTimeLeft(MEASURED_PERIOD, detPos);
|
||||||
|
else {
|
||||||
|
int64_t tms = getTimeLeft(MEASURED_PERIOD, detPos);
|
||||||
|
if (tms < 0)
|
||||||
|
return -1;
|
||||||
|
return ((1E-9) * (double)tms);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
double multiSlsDetector::getMeasuredSubFramePeriod(bool inseconds, int detPos){
|
||||||
|
if(!inseconds)
|
||||||
|
return getTimeLeft(MEASURED_SUBPERIOD, detPos);
|
||||||
|
else {
|
||||||
|
int64_t tms = getTimeLeft(MEASURED_SUBPERIOD, detPos);
|
||||||
|
if (tms < 0)
|
||||||
|
return -1;
|
||||||
|
return ((1E-9) * (double)tms);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int64_t multiSlsDetector::getTimeLeft(timerIndex index, int detPos) {
|
int64_t multiSlsDetector::getTimeLeft(timerIndex index, int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
@ -1585,7 +1644,7 @@ int multiSlsDetector::getDataBytes(int detPos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dacs_t multiSlsDetector::setDAC(dacs_t val, dacIndex idac, int mV, int detPos) {
|
int multiSlsDetector::setDAC(int val, dacIndex idac, int mV, int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->setDAC(val, idac, mV);
|
return detectors[detPos]->setDAC(val, idac, mV);
|
||||||
@ -1597,7 +1656,7 @@ dacs_t multiSlsDetector::setDAC(dacs_t val, dacIndex idac, int mV, int detPos) {
|
|||||||
return sls::minusOneIfDifferent(r);
|
return sls::minusOneIfDifferent(r);
|
||||||
|
|
||||||
// ignore slave values for hv (-999)
|
// ignore slave values for hv (-999)
|
||||||
dacs_t firstValue = r.front();
|
int firstValue = r.front();
|
||||||
for (const auto& value : r) {
|
for (const auto& value : r) {
|
||||||
if ((value != -999) && (value != firstValue))
|
if ((value != -999) && (value != firstValue))
|
||||||
return -1;
|
return -1;
|
||||||
@ -1607,7 +1666,7 @@ dacs_t multiSlsDetector::setDAC(dacs_t val, dacIndex idac, int mV, int detPos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dacs_t multiSlsDetector::getADC(dacIndex idac, int detPos) {
|
int multiSlsDetector::getADC(dacIndex idac, int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->getADC(val, idac);
|
return detectors[detPos]->getADC(val, idac);
|
||||||
@ -1733,6 +1792,7 @@ uint32_t multiSlsDetector::clearBit(uint32_t addr, int n, int detPos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::string multiSlsDetector::setNetworkParameter(networkParameter p, std::string s, int detPos) {
|
std::string multiSlsDetector::setNetworkParameter(networkParameter p, std::string s, int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
@ -1789,6 +1849,71 @@ std::string multiSlsDetector::getNetworkParameter(networkParameter p, int detPos
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int multiSlsDetector::setReceiverDataStreamingOutPort(int i, int detPos) {
|
||||||
|
if (i >= 0) {
|
||||||
|
std::string s = to_string(i);
|
||||||
|
int prev_streaming = enableDataStreamingFromReceiver(-1, detPos);
|
||||||
|
setNetworkParameter(RECEIVER_STREAMING_PORT, s, detPos);
|
||||||
|
if (prev_streaming) {
|
||||||
|
enableDataStreamingFromReceiver(0, detPos);
|
||||||
|
enableDataStreamingFromReceiver(1, detPos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return stoi(getNetworkParameter(RECEIVER_STREAMING_PORT, detPos));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int multiSlsDetector::setClientDataStreamingInPort(int i, int detPos) {
|
||||||
|
if (i >= 0) {
|
||||||
|
std::string s = to_string(i);
|
||||||
|
int prev_streaming = enableDataStreamingToClient();
|
||||||
|
setNetworkParameter(CLIENT_STREAMING_PORT, s, detPos);
|
||||||
|
if (prev_streaming) {
|
||||||
|
enableDataStreamingToClient(0);
|
||||||
|
enableDataStreamingToClient(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return stoi(getNetworkParameter(CLIENT_STREAMING_PORT, detPos));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::string multiSlsDetector::setReceiverDataStreamingOutIP(std::string ip, int detPos) {
|
||||||
|
if (ip.length()) {
|
||||||
|
int prev_streaming = enableDataStreamingFromReceiver(-1, detPos);
|
||||||
|
setNetworkParameter(RECEIVER_STREAMING_SRC_IP, ip, detPos);
|
||||||
|
if (prev_streaming) {
|
||||||
|
enableDataStreamingFromReceiver(0, detPos);
|
||||||
|
enableDataStreamingFromReceiver(1, detPos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getNetworkParameter(RECEIVER_STREAMING_SRC_IP, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::string multiSlsDetector::setClientDataStreamingInIP(std::string ip, int detPos) {
|
||||||
|
if (ip.length()) {
|
||||||
|
int prev_streaming = enableDataStreamingToClient(-1);
|
||||||
|
setNetworkParameter(CLIENT_STREAMING_SRC_IP, ip, detPos);
|
||||||
|
if (prev_streaming) {
|
||||||
|
enableDataStreamingToClient(0);
|
||||||
|
enableDataStreamingToClient(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getNetworkParameter(CLIENT_STREAMING_SRC_IP, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int multiSlsDetector::setFlowControl10G(int enable, int detPos) {
|
||||||
|
std::string s;
|
||||||
|
if (i != -1) {
|
||||||
|
s = to_string((enable >= 1) ? 1 : 0);
|
||||||
|
s = setNetworkParameter(FLOW_CONTROL_10G, s);
|
||||||
|
} else
|
||||||
|
s = getNetworkParameter(FLOW_CONTROL_10G);
|
||||||
|
return stoi(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int multiSlsDetector::digitalTest(digitalTestMode mode, int ival, int detPos) {
|
int multiSlsDetector::digitalTest(digitalTestMode mode, int ival, int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
@ -3234,31 +3359,31 @@ int multiSlsDetector::overwriteFile(int enable, int detPos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int multiSlsDetector::setReadReceiverFrequency(int freq, int detPos) {
|
int multiSlsDetector::setReceiverStreamingFrequency(int freq, int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->setReadReceiverFrequency(freq);
|
return detectors[detPos]->setReceiverStreamingFrequency(freq);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::setReadReceiverFrequency, freq);
|
auto r = parallelCall(&slsDetector::setReceiverStreamingFrequency, freq);
|
||||||
return sls::minusOneIfDifferent(r);
|
return sls::minusOneIfDifferent(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int multiSlsDetector::setReceiverReadTimer(int time_in_ms, int detPos) {
|
int multiSlsDetector::setReceiverStreamingTimer(int time_in_ms, int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->setReceiverReadTimer(time_in_ms);
|
return detectors[detPos]->setReceiverStreamingTimer(time_in_ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::setReceiverReadTimer, time_in_ms);
|
auto r = parallelCall(&slsDetector::setReceiverStreamingTimer, time_in_ms);
|
||||||
return sls::minusOneIfDifferent(r);
|
return sls::minusOneIfDifferent(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int multiSlsDetector::enableDataStreamingToClient(int enable, int detPos) {
|
int multiSlsDetector::enableDataStreamingToClient(int enable) {
|
||||||
if (enable >= 0) {
|
if (enable >= 0) {
|
||||||
//destroy data threads
|
//destroy data threads
|
||||||
if (!enable)
|
if (!enable)
|
||||||
|
@ -308,9 +308,7 @@ public:
|
|||||||
std::string sgetDetectorsType(int detPos = -1);
|
std::string sgetDetectorsType(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Just to overload getDetectorType from users
|
* Gets Detector type (concatenates if different)
|
||||||
* Concatenates string types of all sls detectors or
|
|
||||||
* returns the detector type of the first sls detector
|
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns detector type of sls detector in position pos, if -1, concatenates
|
* @returns detector type of sls detector in position pos, if -1, concatenates
|
||||||
*/
|
*/
|
||||||
@ -336,7 +334,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
void getNumberOfDetectors(int& nx, int& ny);
|
void getNumberOfDetectors(int& nx, int& ny);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the total number of channels of all sls detectors from shared memory
|
* Returns the total number of channels of all sls detectors from shared memory
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
@ -385,16 +382,18 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Get Detector offset from shared memory in dimension d
|
* Get Detector offset from shared memory in dimension d
|
||||||
* @param d dimension d
|
* @param d dimension d
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns offset in dimension d, -1 if pos is not an actual position in list
|
* @returns offset in dimension d, -1 if pos is not an actual position in list
|
||||||
*/
|
*/
|
||||||
int getDetectorOffset(dimension d);
|
int getDetectorOffset(dimension d, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Detector offset in shared memory in dimension d
|
* Set Detector offset in shared memory in dimension d
|
||||||
* @param d dimension d
|
* @param d dimension d
|
||||||
* @param off offset for detector
|
* @param off offset for detector
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
*/
|
*/
|
||||||
void setDetectorOffset(dimension d, int off);
|
void setDetectorOffset(dimension d, int off, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the channel offsets in X and Y dimension for all the sls detectors
|
* Updates the channel offsets in X and Y dimension for all the sls detectors
|
||||||
@ -522,21 +521,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
std::string setSettingsDir(std::string s, int detPos = -1);
|
std::string setSettingsDir(std::string s, int detPos = -1);
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the calibration files directory \sa sharedSlsDetector
|
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
|
||||||
* @returns the calibration files directory
|
|
||||||
*/
|
|
||||||
std::string getCalDir(int detPos = -1);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the calibration files directory \sa sharedSlsDetector (
|
|
||||||
* @param s the calibration files directory
|
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
|
||||||
* @returns the calibration files directory
|
|
||||||
*/
|
|
||||||
std::string setCalDir(std::string s, int detPos = -1);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the modules settings/trimbits reading from a specific file
|
* Loads the modules settings/trimbits reading from a specific file
|
||||||
* file name extension is automatically generated.
|
* file name extension is automatically generated.
|
||||||
@ -555,24 +539,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
int saveSettingsFile(std::string fname, int detPos = -1);
|
int saveSettingsFile(std::string fname, int detPos = -1);
|
||||||
|
|
||||||
/**
|
|
||||||
* Loads the modules calibration data reading from a specific file (Mythen)
|
|
||||||
* file name extension is automatically generated.
|
|
||||||
* @param fname specific calibration file
|
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
|
||||||
* returns OK or FAIL
|
|
||||||
*/
|
|
||||||
int loadCalibrationFile(std::string fname, int detPos = -1);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Saves the modules calibration data to a specific file (Mythen)
|
|
||||||
* file name extension is automatically generated.
|
|
||||||
* @param fname specific calibration file
|
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
|
||||||
* returns OK or FAIL
|
|
||||||
*/
|
|
||||||
int saveCalibrationFile(std::string fname, int detPos = -1);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Detector run status
|
* Get Detector run status
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
@ -645,6 +611,103 @@ public:
|
|||||||
*/
|
*/
|
||||||
int64_t setTimer(timerIndex index, int64_t t=-1, int detPos = -1);
|
int64_t setTimer(timerIndex index, int64_t t=-1, int detPos = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set/get exposure time
|
||||||
|
* @param t time (-1 gets)
|
||||||
|
* @param inseconds true if the value is in s, else ns
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns exposure time in ns, or s if specified
|
||||||
|
*/
|
||||||
|
double setExposureTime(double t = -1, bool inseconds = false, int detPos = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set/get exposure period
|
||||||
|
* @param t time (-1 gets)
|
||||||
|
* @param inseconds true if the value is in s, else ns
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns exposure period in ns, or s if specified
|
||||||
|
*/
|
||||||
|
double setExposurePeriod(double t = -1, bool inseconds = false, int detPos = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set/get delay after trigger (Gotthard, Jungfrau(not for this release))
|
||||||
|
* @param t time (-1 gets)
|
||||||
|
* @param inseconds true if the value is in s, else ns
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns delay after trigger in ns, or s if specified
|
||||||
|
*/
|
||||||
|
double setDelayAfterTrigger(double t = -1, bool inseconds = false, int detPos = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (Advanced users)
|
||||||
|
* Set/get sub frame exposure time (Eiger in 32 bit mode)
|
||||||
|
* @param t time (-1 gets)
|
||||||
|
* @param inseconds true if the value is in s, else ns
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns sub frame exposure time in ns, or s if specified
|
||||||
|
*/
|
||||||
|
double setSubFrameExposureTime(double t = -1, bool inseconds = false, int detPos = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (Advanced users)
|
||||||
|
* Set/get sub frame dead time (Eiger in 32 bit mode)
|
||||||
|
* @param t time (-1 gets)
|
||||||
|
* @param inseconds true if the value is in s, else ns
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns sub frame dead time in ns, or s if specified
|
||||||
|
*/
|
||||||
|
double setSubFrameDeadTime(double t = -1, bool inseconds = false, int detPos = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set/get number of frames
|
||||||
|
* @param t number of frames (-1 gets)
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns number of frames
|
||||||
|
*/
|
||||||
|
int64_t setNumberOfFrames(int64_t t = -1, int detPos = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set/get number of cycles
|
||||||
|
* @param t number of cycles (-1 gets)
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns number of cycles
|
||||||
|
*/
|
||||||
|
int64_t setNumberOfCycles(int64_t t = -1, int detPos = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set/get number of gates (none of the detectors at the moment)
|
||||||
|
* @param t number of gates (-1 gets)
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns number of gates
|
||||||
|
*/
|
||||||
|
int64_t setNumberOfGates(int64_t t = -1, int detPos = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set/get number of additional storage cells (Jungfrau)
|
||||||
|
* @param t number of additional storage cells. Default is 0. (-1 gets)
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns number of additional storage cells
|
||||||
|
*/
|
||||||
|
int64_t setNumberOfStorageCells(int64_t t = -1, int detPos = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get measured period between previous two frames (EIGER)
|
||||||
|
* @param t time (-1 gets)
|
||||||
|
* @param inseconds true if the value is in s, else ns
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns sub frame dead time in ns, or s if specified
|
||||||
|
*/
|
||||||
|
double getMeasuredPeriod(bool inseconds = false, int detPos = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get sub period between previous two sub frames in 32 bit mode (EIGER)
|
||||||
|
* @param t time (-1 gets)
|
||||||
|
* @param inseconds true if the value is in s, else ns
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns sub frame dead time in ns, or s if specified
|
||||||
|
*/
|
||||||
|
double getMeasuredSubFramePeriod(bool inseconds = false, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/get timer value left in acquisition (not all implemented for all detectors)
|
* Set/get timer value left in acquisition (not all implemented for all detectors)
|
||||||
* @param index timer index
|
* @param index timer index
|
||||||
@ -688,7 +751,7 @@ public:
|
|||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns current DAC value
|
* @returns current DAC value
|
||||||
*/
|
*/
|
||||||
dacs_t setDAC(dacs_t val, dacIndex index , int mV, int detPos = -1);
|
int setDAC(int val, dacIndex index , int mV, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get adc value
|
* Get adc value
|
||||||
@ -696,7 +759,7 @@ public:
|
|||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns current adc value (temperature for eiger and jungfrau in millidegrees)
|
* @returns current adc value (temperature for eiger and jungfrau in millidegrees)
|
||||||
*/
|
*/
|
||||||
dacs_t getADC(dacIndex index, int detPos = -1);
|
int getADC(dacIndex index, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/get timing mode
|
* Set/get timing mode
|
||||||
@ -758,6 +821,21 @@ public:
|
|||||||
*/
|
*/
|
||||||
uint32_t clearBit(uint32_t addr, int n, int detPos = -1);
|
uint32_t clearBit(uint32_t addr, int n, int detPos = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set up Receiver and update it from shm
|
||||||
|
* @param s hostname
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns hostname
|
||||||
|
*/
|
||||||
|
std::string setReceiverHostname(std::string s, int detPos = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get receiver hostname
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns hostname
|
||||||
|
*/
|
||||||
|
std::string getReceiverHostname(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set network parameter
|
* Set network parameter
|
||||||
* @param p network parameter type
|
* @param p network parameter type
|
||||||
@ -775,6 +853,54 @@ public:
|
|||||||
*/
|
*/
|
||||||
std::string getNetworkParameter(networkParameter p, int detPos = -1);
|
std::string getNetworkParameter(networkParameter p, int detPos = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (advanced users)
|
||||||
|
* Set/Get receiver streaming out ZMQ port and restarts receiver sockets
|
||||||
|
* @param i sets, -1 gets
|
||||||
|
* If detPos is -1(multi module), port calculated (increments) for all the individual detectors using i
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns receiver streaming out ZMQ port (if multiple, of first receiver socket)
|
||||||
|
*/
|
||||||
|
int setReceiverDataStreamingOutPort(int i = -1, int detPos = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (advanced users)
|
||||||
|
* Set/Get client streaming in ZMQ port and restarts client sockets
|
||||||
|
* @param i sets, -1 gets
|
||||||
|
* If detPos is -1(multi module), port calculated (increments) for all the individual detectors using i
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns receiver streaming out ZMQ port (if multiple, of first receiver socket)
|
||||||
|
*/
|
||||||
|
int setClientDataStreamingInPort(int i = -1, int detPos = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (advanced users)
|
||||||
|
* Set/Get receiver streaming out ZMQ IP and restarts receiver sockets
|
||||||
|
* @param i sets, empty string gets
|
||||||
|
* By default, it is the IP of receiver hostname
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns receiver streaming out ZMQ IP
|
||||||
|
*/
|
||||||
|
std::string setReceiverDataStreamingOutIP(std::string ip="", int detPos = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (advanced users)
|
||||||
|
* Set/Get client streaming in ZMQ IP and restarts client sockets
|
||||||
|
* @param i sets, empty string gets
|
||||||
|
* By default, it is the IP of receiver hostname
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns client streaming in ZMQ IP
|
||||||
|
*/
|
||||||
|
std::string setClientDataStreamingInIP(std::string ip="", int detPos = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set 10GbE Flow Control (Eiger)
|
||||||
|
* @param enable 1 to set, 0 to unset, -1 gets
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns 10GbE flow Control
|
||||||
|
*/
|
||||||
|
int setFlowControl10G(int enable = -1, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute a digital test (Gotthard)
|
* Execute a digital test (Gotthard)
|
||||||
* @param mode testmode type
|
* @param mode testmode type
|
||||||
@ -1257,33 +1383,31 @@ public:
|
|||||||
int overwriteFile(int enable=-1, int detPos = -1);
|
int overwriteFile(int enable=-1, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the read receiver frequency
|
* (previously setReadReceiverFrequency)
|
||||||
* if data required from receiver randomly readRxrFrequency=0,
|
* Sets the receiver streaming frequency
|
||||||
* else every nth frame to be sent to gui/callback
|
* @param freq nth frame streamed out, if 0, streamed out at a timer of 200 ms
|
||||||
* @param freq is the receiver read frequency. Value 0 is 200 ms timer (other
|
|
||||||
* frames not sent), 1 is every frame, 2 is every second frame etc.
|
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns read receiver frequency
|
* @returns receiver streaming frequency
|
||||||
*/
|
*/
|
||||||
int setReadReceiverFrequency(int freq=-1, int detPos = -1);
|
int setReceiverStreamingFrequency(int freq = -1, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the read receiver timer
|
* (previously setReceiverReadTimer)
|
||||||
* if data required from receiver randomly readRxrFrequency=0,
|
* Sets the receiver streaming timer
|
||||||
* then the timer between each data stream is set with time_in_ms
|
* If receiver streaming frequency is 0, then this timer between each
|
||||||
|
* data stream is set. Default is 200 ms.
|
||||||
* @param time_in_ms timer between frames
|
* @param time_in_ms timer between frames
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns read receiver timer
|
* @returns receiver streaming timer in ms
|
||||||
*/
|
*/
|
||||||
int setReceiverReadTimer(int time_in_ms=500, int detPos = -1);
|
int setReceiverStreamingTimer(int time_in_ms=500, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable data streaming to client
|
* Enable data streaming to client
|
||||||
* @param enable 0 to disable, 1 to enable, -1 to get the value
|
* @param enable 0 to disable, 1 to enable, -1 to get the value
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
|
||||||
* @returns data streaming to client enable
|
* @returns data streaming to client enable
|
||||||
*/
|
*/
|
||||||
int enableDataStreamingToClient(int enable=-1, int detPos = -1);
|
int enableDataStreamingToClient(int enable=-1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable or disable streaming data from receiver to client
|
* Enable or disable streaming data from receiver to client
|
||||||
|
@ -24,12 +24,11 @@ using namespace std;
|
|||||||
#define DEFAULT_HOSTNAME "localhost"
|
#define DEFAULT_HOSTNAME "localhost"
|
||||||
|
|
||||||
|
|
||||||
slsDetector::slsDetector(detectorType type, int multiId, int id, bool verify, multiSlsDetector* m)
|
slsDetector::slsDetector(detectorType type, int multiId, int id, bool verify)
|
||||||
: slsDetectorUtils(),
|
: slsDetectorUtils(),
|
||||||
detId(id),
|
detId(id),
|
||||||
sharedMemory(0),
|
sharedMemory(0),
|
||||||
thisDetector(0),
|
thisDetector(0),
|
||||||
multiDet(m),
|
|
||||||
thisReceiver(0),
|
thisReceiver(0),
|
||||||
controlSocket(0),
|
controlSocket(0),
|
||||||
stopSocket(0),
|
stopSocket(0),
|
||||||
@ -59,12 +58,11 @@ slsDetector::slsDetector(detectorType type, int multiId, int id, bool verify, mu
|
|||||||
initializeDetectorStructurePointers();
|
initializeDetectorStructurePointers();
|
||||||
}
|
}
|
||||||
|
|
||||||
slsDetector::slsDetector(int multiId, int id, bool verify, multiSlsDetector* m)
|
slsDetector::slsDetector(int multiId, int id, bool verify)
|
||||||
: slsDetectorUtils(),
|
: slsDetectorUtils(),
|
||||||
detId(id),
|
detId(id),
|
||||||
sharedMemory(0),
|
sharedMemory(0),
|
||||||
thisDetector(0),
|
thisDetector(0),
|
||||||
multiDet(m),
|
|
||||||
thisReceiver(0),
|
thisReceiver(0),
|
||||||
controlSocket(0),
|
controlSocket(0),
|
||||||
stopSocket(0),
|
stopSocket(0),
|
||||||
@ -108,20 +106,6 @@ slsDetector::~slsDetector() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void slsDetector::setAcquiringFlag(bool b) {
|
|
||||||
multiDet->setAcquiringFlag(b);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool slsDetector::getAcquiringFlag() {
|
|
||||||
return multiDet->getAcquiringFlag();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool slsDetector::isAcquireReady() {
|
|
||||||
return multiDet->isAcquireReady();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::checkVersionCompatibility(portType t) {
|
int slsDetector::checkVersionCompatibility(portType t) {
|
||||||
int fnum = F_CHECK_VERSION;
|
int fnum = F_CHECK_VERSION;
|
||||||
if (t == DATA_PORT)
|
if (t == DATA_PORT)
|
||||||
@ -226,7 +210,7 @@ int slsDetector::checkVersionCompatibility(portType t) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int64_t slsDetector::getId( idMode mode, int imod) {
|
int64_t slsDetector::getId( idMode mode) {
|
||||||
|
|
||||||
int64_t retval=-1;
|
int64_t retval=-1;
|
||||||
int fnum=F_GET_ID,fnum2 = F_GET_RECEIVER_ID;
|
int fnum=F_GET_ID,fnum2 = F_GET_RECEIVER_ID;
|
||||||
@ -297,10 +281,7 @@ void slsDetector::freeSharedMemory() {
|
|||||||
thisDetector = 0;
|
thisDetector = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
string slsDetector::getUserDetails() {
|
|
||||||
cprintf(RED, "Error: Get User details should not be called at this level\n");
|
|
||||||
return string("");
|
|
||||||
}
|
|
||||||
|
|
||||||
void slsDetector::setHostname(const char *name) {
|
void slsDetector::setHostname(const char *name) {
|
||||||
setTCPSocket(string(name));
|
setTCPSocket(string(name));
|
||||||
@ -312,9 +293,7 @@ string slsDetector::getHostname(int pos) {
|
|||||||
return string(thisDetector->hostname);
|
return string(thisDetector->hostname);
|
||||||
}
|
}
|
||||||
|
|
||||||
void slsDetector::addMultipleDetectors(const char* name) {
|
|
||||||
cprintf(RED, "Error: Add Multiple Detectors should not be called at this level\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* pre: sharedMemory=0, thisDetector = 0
|
* pre: sharedMemory=0, thisDetector = 0
|
||||||
@ -438,7 +417,7 @@ int slsDetector::calculateSharedMemorySize(detectorType type) {
|
|||||||
2 * nch * nc * sizeof(double) +
|
2 * nch * nc * sizeof(double) +
|
||||||
sizeof(sls_detector_module) +
|
sizeof(sls_detector_module) +
|
||||||
sizeof(int) * nc +
|
sizeof(int) * nc +
|
||||||
sizeof(dacs_t) * nd +
|
sizeof(int) * nd +
|
||||||
sizeof(int) * nch * nc +
|
sizeof(int) * nch * nc +
|
||||||
sizeof(int) * ng +
|
sizeof(int) * ng +
|
||||||
sizeof(int) * no;
|
sizeof(int) * no;
|
||||||
@ -455,20 +434,19 @@ void slsDetector::initializeDetectorStructure(detectorType type) {
|
|||||||
thisDetector->stoppedFlag = 0;
|
thisDetector->stoppedFlag = 0;
|
||||||
strncpy(thisDetector->hostname, DEFAULT_HOSTNAME, MAX_STR_LENGTH-1);
|
strncpy(thisDetector->hostname, DEFAULT_HOSTNAME, MAX_STR_LENGTH-1);
|
||||||
thisDetector->hostname[MAX_STR_LENGTH-1] = 0;
|
thisDetector->hostname[MAX_STR_LENGTH-1] = 0;
|
||||||
|
thisDetector->myDetectorType = type;
|
||||||
thisDetector->offset[X] = 0;
|
thisDetector->offset[X] = 0;
|
||||||
thisDetector->offset[Y] = 0;
|
thisDetector->offset[Y] = 0;
|
||||||
|
thisDetector->multiSize[X] = 0;
|
||||||
|
thisDetector->multiSize[Y] = 0;
|
||||||
thisDetector->controlPort = DEFAULT_PORTNO;
|
thisDetector->controlPort = DEFAULT_PORTNO;
|
||||||
thisDetector->stopPort = DEFAULT_PORTNO + 1;
|
thisDetector->stopPort = DEFAULT_PORTNO + 1;
|
||||||
thisDetector->myDetectorType = type;
|
|
||||||
strncpy(thisDetector->settingsDir, getenv("HOME"), MAX_STR_LENGTH-1);
|
strncpy(thisDetector->settingsDir, getenv("HOME"), MAX_STR_LENGTH-1);
|
||||||
thisDetector->settingsDir[MAX_STR_LENGTH-1] = 0;
|
thisDetector->settingsDir[MAX_STR_LENGTH-1] = 0;
|
||||||
strncpy(thisDetector->calDir, getenv("HOME"), MAX_STR_LENGTH-1);
|
|
||||||
thisDetector->calDir[MAX_STR_LENGTH-1] = 0;
|
|
||||||
thisDetector->nTrimEn = 0;
|
thisDetector->nTrimEn = 0;
|
||||||
for(int i = 0; i < MAX_TRIMEN; ++i)
|
for(int i = 0; i < MAX_TRIMEN; ++i)
|
||||||
thisDetector->trimEnergies[i] = 0;
|
thisDetector->trimEnergies[i] = 0;
|
||||||
thisDetector->threadedProcessing = 1;
|
thisDetector->threadedProcessing = 1;
|
||||||
thisDetector->tDead = 0;
|
|
||||||
thisDetector->nROI = 0;
|
thisDetector->nROI = 0;
|
||||||
memset(thisDetector->roiLimits, 0, MAX_ROIS * sizeof(ROI));
|
memset(thisDetector->roiLimits, 0, MAX_ROIS * sizeof(ROI));
|
||||||
thisDetector->roFlags = NORMAL_READOUT;
|
thisDetector->roFlags = NORMAL_READOUT;
|
||||||
@ -588,9 +566,9 @@ void slsDetector::initializeDetectorStructure(detectorType type) {
|
|||||||
thisDetector->dacoff = thisDetector->modoff +
|
thisDetector->dacoff = thisDetector->modoff +
|
||||||
sizeof(sls_detector_module);
|
sizeof(sls_detector_module);
|
||||||
thisDetector->adcoff = thisDetector->dacoff +
|
thisDetector->adcoff = thisDetector->dacoff +
|
||||||
sizeof(dacs_t) * thisDetector->nDacs;
|
sizeof(int) * thisDetector->nDacs;
|
||||||
thisDetector->chipoff = thisDetector->adcoff +
|
thisDetector->chipoff = thisDetector->adcoff +
|
||||||
sizeof(dacs_t) * thisDetector->nAdcs;
|
sizeof(int) * thisDetector->nAdcs;
|
||||||
thisDetector->chanoff = thisDetector->chipoff +
|
thisDetector->chanoff = thisDetector->chipoff +
|
||||||
sizeof(int) * thisDetector->nChips;
|
sizeof(int) * thisDetector->nChips;
|
||||||
thisDetector->gainoff = thisDetector->chanoff +
|
thisDetector->gainoff = thisDetector->chanoff +
|
||||||
@ -606,8 +584,8 @@ void slsDetector::initializeMembers() {
|
|||||||
// assign addresses
|
// assign addresses
|
||||||
char *goff = (char*)thisDetector;
|
char *goff = (char*)thisDetector;
|
||||||
detectorModules = (sls_detector_module*)(goff + thisDetector->modoff);
|
detectorModules = (sls_detector_module*)(goff + thisDetector->modoff);
|
||||||
dacs = (dacs_t*)(goff + thisDetector->dacoff);
|
dacs = (int*)(goff + thisDetector->dacoff);
|
||||||
adcs = (dacs_t*)(goff + thisDetector->adcoff);
|
adcs = (int*)(goff + thisDetector->adcoff);
|
||||||
chipregs = (int*)(goff + thisDetector->chipoff);
|
chipregs = (int*)(goff + thisDetector->chipoff);
|
||||||
chanregs = (int*)(goff + thisDetector->chanoff);
|
chanregs = (int*)(goff + thisDetector->chanoff);
|
||||||
gain = (int*)(goff + thisDetector->gainoff);
|
gain = (int*)(goff + thisDetector->gainoff);
|
||||||
@ -617,12 +595,6 @@ void slsDetector::initializeMembers() {
|
|||||||
thisReceiver = 0;
|
thisReceiver = 0;
|
||||||
}
|
}
|
||||||
thisReceiver = new receiverInterface(dataSocket);
|
thisReceiver = new receiverInterface(dataSocket);
|
||||||
|
|
||||||
//postProcessing
|
|
||||||
threadedProcessing = &thisDetector->threadedProcessing;
|
|
||||||
fdata = NULL;
|
|
||||||
thisData = NULL;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -670,7 +642,6 @@ void slsDetector::initializeDetectorStructurePointers() {
|
|||||||
for (int i = 0; i < thisDetector->nOffset; ++i) {
|
for (int i = 0; i < thisDetector->nOffset; ++i) {
|
||||||
*(offset + i) = 0;
|
*(offset + i) = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -692,8 +663,8 @@ slsDetectorDefs::sls_detector_module* slsDetector::createModule(detectorType ty
|
|||||||
} catch(...) {
|
} catch(...) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
dacs_t *dacs=new dacs_t[nd];
|
int *dacs=new int[nd];
|
||||||
dacs_t *adcs=new dacs_t[na];
|
int *adcs=new int[na];
|
||||||
int *chipregs=new int[nc];
|
int *chipregs=new int[nc];
|
||||||
int *chanregs=new int[nch*nc];
|
int *chanregs=new int[nch*nc];
|
||||||
|
|
||||||
@ -793,8 +764,8 @@ int slsDetector::sendModule(sls_detector_module *myMod) {
|
|||||||
ts+=controlSocket->SendDataOnly(&(myMod->offset), sizeof(myMod->offset));
|
ts+=controlSocket->SendDataOnly(&(myMod->offset), sizeof(myMod->offset));
|
||||||
|
|
||||||
// actual data to the pointers
|
// actual data to the pointers
|
||||||
ts+=controlSocket->SendDataOnly(myMod->dacs,sizeof(dacs_t)*(myMod->ndac));
|
ts+=controlSocket->SendDataOnly(myMod->dacs,sizeof(int)*(myMod->ndac));
|
||||||
ts+=controlSocket->SendDataOnly(myMod->adcs,sizeof(dacs_t)*(myMod->nadc));
|
ts+=controlSocket->SendDataOnly(myMod->adcs,sizeof(int)*(myMod->nadc));
|
||||||
if(thisDetector->myDetectorType != JUNGFRAU){
|
if(thisDetector->myDetectorType != JUNGFRAU){
|
||||||
ts+=controlSocket->SendDataOnly(myMod->chipregs,sizeof(int)*(myMod->nchip));
|
ts+=controlSocket->SendDataOnly(myMod->chipregs,sizeof(int)*(myMod->nchip));
|
||||||
ts+=controlSocket->SendDataOnly(myMod->chanregs,sizeof(int)*(myMod->nchan));
|
ts+=controlSocket->SendDataOnly(myMod->chanregs,sizeof(int)*(myMod->nchan));
|
||||||
@ -805,8 +776,8 @@ int slsDetector::sendModule(sls_detector_module *myMod) {
|
|||||||
|
|
||||||
int slsDetector::receiveModule(sls_detector_module* myMod) {
|
int slsDetector::receiveModule(sls_detector_module* myMod) {
|
||||||
|
|
||||||
dacs_t *dacptr=myMod->dacs;
|
int *dacptr=myMod->dacs;
|
||||||
dacs_t *adcptr=myMod->adcs;
|
int *adcptr=myMod->adcs;
|
||||||
int *chipptr=myMod->chipregs;
|
int *chipptr=myMod->chipregs;
|
||||||
int *chanptr=myMod->chanregs;
|
int *chanptr=myMod->chanregs;
|
||||||
int ts=0;
|
int ts=0;
|
||||||
@ -830,11 +801,11 @@ int slsDetector::receiveModule(sls_detector_module* myMod) {
|
|||||||
std::cout<< "received module of size "<< ts
|
std::cout<< "received module of size "<< ts
|
||||||
<< " register " << myMod->reg << std::endl;
|
<< " register " << myMod->reg << std::endl;
|
||||||
#endif
|
#endif
|
||||||
ts+=controlSocket->ReceiveDataOnly(myMod->dacs,sizeof(dacs_t)*(myMod->ndac));
|
ts+=controlSocket->ReceiveDataOnly(myMod->dacs,sizeof(int)*(myMod->ndac));
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< "received dacs of size "<< ts << std::endl;
|
std::cout<< "received dacs of size "<< ts << std::endl;
|
||||||
#endif
|
#endif
|
||||||
ts+=controlSocket->ReceiveDataOnly(myMod->adcs,sizeof(dacs_t)*(myMod->nadc));
|
ts+=controlSocket->ReceiveDataOnly(myMod->adcs,sizeof(int)*(myMod->nadc));
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< "received adc of size "<< ts << std::endl;
|
std::cout<< "received adc of size "<< ts << std::endl;
|
||||||
#endif
|
#endif
|
||||||
@ -1025,12 +996,12 @@ int slsDetector::setDetectorType(string const stype) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
slsDetectorDefs::detectorType slsDetector::getDetectorsType(int pos) {
|
slsDetectorDefs::detectorType slsDetector::getDetectorsType() {
|
||||||
return thisDetector->myDetectorType;
|
return thisDetector->myDetectorType;
|
||||||
}
|
}
|
||||||
|
|
||||||
string slsDetector::sgetDetectorsType(int pos) {
|
string slsDetector::sgetDetectorsType() {
|
||||||
return getDetectorType(getDetectorsType(pos));
|
return getDetectorType(getDetectorsType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1114,6 +1085,12 @@ void slsDetector::setDetectorOffset(dimension d, int off) {
|
|||||||
thisDetector->offset[d] = off;
|
thisDetector->offset[d] = off;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void slsDetector::updateMultiSize(int detx, int dety) {
|
||||||
|
thisDetector->multiSize[0] = detx;
|
||||||
|
thisDetector->multiSize[1] = dety;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::setOnline(int off) {
|
int slsDetector::setOnline(int off) {
|
||||||
int old=thisDetector->onlineFlag;
|
int old=thisDetector->onlineFlag;
|
||||||
if (off!=GET_ONLINE_FLAG) {
|
if (off!=GET_ONLINE_FLAG) {
|
||||||
@ -1746,9 +1723,6 @@ int slsDetector::updateDetector() {
|
|||||||
|
|
||||||
|
|
||||||
int slsDetector::readConfigurationFile(string const fname) {
|
int slsDetector::readConfigurationFile(string const fname) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
string ans;
|
string ans;
|
||||||
string str;
|
string str;
|
||||||
ifstream infile;
|
ifstream infile;
|
||||||
@ -1783,9 +1757,6 @@ int slsDetector::readConfigurationFile(string const fname) {
|
|||||||
|
|
||||||
int slsDetector::readConfigurationFile(ifstream &infile) {
|
int slsDetector::readConfigurationFile(ifstream &infile) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
slsDetectorCommand *cmd=new slsDetectorCommand(this);
|
slsDetectorCommand *cmd=new slsDetectorCommand(this);
|
||||||
|
|
||||||
string ans;
|
string ans;
|
||||||
@ -1893,7 +1864,6 @@ int slsDetector::writeConfigurationFile(ofstream &outfile, int id) {
|
|||||||
names[nvar++] = "port";
|
names[nvar++] = "port";
|
||||||
names[nvar++] = "stopport";
|
names[nvar++] = "stopport";
|
||||||
names[nvar++] = "settingsdir";
|
names[nvar++] = "settingsdir";
|
||||||
names[nvar++] = "caldir";
|
|
||||||
names[nvar++] = "ffdir";
|
names[nvar++] = "ffdir";
|
||||||
names[nvar++] = "outdir";
|
names[nvar++] = "outdir";
|
||||||
names[nvar++] = "lock";
|
names[nvar++] = "lock";
|
||||||
@ -1990,26 +1960,25 @@ string slsDetector::getSettingsFile() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::writeSettingsFile(string fname, int imod, int iodelay, int tau) {
|
int slsDetector::writeSettingsFile(string fname, int iodelay, int tau) {
|
||||||
|
|
||||||
return writeSettingsFile(fname, detectorModules[imod], iodelay, tau);
|
return writeSettingsFile(fname, detectorModules, iodelay, tau);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
slsDetectorDefs::detectorSettings slsDetector::getSettings(int imod) {
|
slsDetectorDefs::detectorSettings slsDetector::getSettings() {
|
||||||
|
|
||||||
return sendSettingsOnly(GET_SETTINGS, imod);
|
return sendSettingsOnly(GET_SETTINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
slsDetectorDefs::detectorSettings slsDetector::setSettings( detectorSettings isettings,
|
slsDetectorDefs::detectorSettings slsDetector::setSettings( detectorSettings isettings) {
|
||||||
int imod) {
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< "slsDetector setSettings " << isettings << std::endl;
|
std::cout<< "slsDetector setSettings " << isettings << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (isettings == -1)
|
if (isettings == -1)
|
||||||
return getSettings(imod);
|
return getSettings();
|
||||||
|
|
||||||
detectorType detType = thisDetector->myDetectorType;
|
detectorType detType = thisDetector->myDetectorType;
|
||||||
switch (detType) {
|
switch (detType) {
|
||||||
@ -2047,23 +2016,21 @@ slsDetectorDefs::detectorSettings slsDetector::setSettings( detectorSettings ise
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
slsDetectorDefs::detectorSettings slsDetector::sendSettingsOnly(detectorSettings isettings,
|
slsDetectorDefs::detectorSettings slsDetector::sendSettingsOnly(detectorSettings isettings) {
|
||||||
int imod) {
|
|
||||||
int fnum = F_SET_SETTINGS;
|
int fnum = F_SET_SETTINGS;
|
||||||
int ret = FAIL;
|
int ret = FAIL;
|
||||||
char mess[MAX_STR_LENGTH];
|
char mess[MAX_STR_LENGTH];
|
||||||
memset(mess, 0, MAX_STR_LENGTH);
|
memset(mess, 0, MAX_STR_LENGTH);
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
int arg[2];
|
int arg;
|
||||||
arg[0] = isettings;
|
arg = isettings;
|
||||||
arg[1] = imod;
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< "Setting settings of module " << arg[1] << " to " << arg[0] << std::endl;
|
std::cout<< "Setting settings to " << arg << std::endl;
|
||||||
#endif
|
#endif
|
||||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||||
if (connectControl() == OK){
|
if (connectControl() == OK){
|
||||||
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||||
controlSocket->SendDataOnly(arg,sizeof(arg));
|
controlSocket->SendDataOnly(&arg,sizeof(arg));
|
||||||
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||||
if (ret==FAIL) {
|
if (ret==FAIL) {
|
||||||
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||||
@ -2086,7 +2053,7 @@ slsDetectorDefs::detectorSettings slsDetector::sendSettingsOnly(detectorSettings
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::getThresholdEnergy(int imod) {
|
int slsDetector::getThresholdEnergy() {
|
||||||
|
|
||||||
int fnum= F_GET_THRESHOLD_ENERGY;
|
int fnum= F_GET_THRESHOLD_ENERGY;
|
||||||
int retval;
|
int retval;
|
||||||
@ -2099,7 +2066,6 @@ int slsDetector::getThresholdEnergy(int imod) {
|
|||||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||||
if (connectControl() == OK){
|
if (connectControl() == OK){
|
||||||
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||||
controlSocket->SendDataOnly(&imod,sizeof(imod));
|
|
||||||
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||||
if (ret==FAIL) {
|
if (ret==FAIL) {
|
||||||
std::cout<< "Detector returned error: "<< std::endl;
|
std::cout<< "Detector returned error: "<< std::endl;
|
||||||
@ -2117,7 +2083,7 @@ int slsDetector::getThresholdEnergy(int imod) {
|
|||||||
return thisDetector->currentThresholdEV;
|
return thisDetector->currentThresholdEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetector::setThresholdEnergy(int e_eV, int imod, detectorSettings isettings, int tb) {
|
int slsDetector::setThresholdEnergy(int e_eV, detectorSettings isettings, int tb) {
|
||||||
|
|
||||||
//currently only for eiger
|
//currently only for eiger
|
||||||
if (thisDetector->myDetectorType == EIGER) {
|
if (thisDetector->myDetectorType == EIGER) {
|
||||||
@ -2136,7 +2102,6 @@ int slsDetector::setThresholdEnergy(int e_eV, int imod, detectorSettings isetti
|
|||||||
if (connectControl() == OK){
|
if (connectControl() == OK){
|
||||||
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||||
controlSocket->SendDataOnly(&e_eV,sizeof(e_eV));
|
controlSocket->SendDataOnly(&e_eV,sizeof(e_eV));
|
||||||
controlSocket->SendDataOnly(&imod,sizeof(imod));
|
|
||||||
controlSocket->SendDataOnly(&isettings,sizeof(isettings));
|
controlSocket->SendDataOnly(&isettings,sizeof(isettings));
|
||||||
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||||
if (ret==FAIL) {
|
if (ret==FAIL) {
|
||||||
@ -2331,18 +2296,8 @@ string slsDetector::getSettingsDir() {
|
|||||||
string slsDetector::setSettingsDir(string s) {
|
string slsDetector::setSettingsDir(string s) {
|
||||||
sprintf(thisDetector->settingsDir, s.c_str()); return thisDetector->settingsDir;
|
sprintf(thisDetector->settingsDir, s.c_str()); return thisDetector->settingsDir;
|
||||||
}
|
}
|
||||||
string slsDetector::getCalDir() {
|
|
||||||
return thisDetector->calDir;
|
|
||||||
}
|
|
||||||
string slsDetector::setCalDir(string s) {
|
|
||||||
sprintf(thisDetector->calDir, s.c_str()); return thisDetector->calDir;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
int slsDetector::loadSettingsFile(string fname) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::loadSettingsFile(string fname, int imod) {
|
|
||||||
|
|
||||||
sls_detector_module *myMod=NULL;
|
sls_detector_module *myMod=NULL;
|
||||||
|
|
||||||
@ -2379,7 +2334,7 @@ int slsDetector::loadSettingsFile(string fname, int imod) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::saveSettingsFile(string fname, int imod) {
|
int slsDetector::saveSettingsFile(string fname) {
|
||||||
|
|
||||||
sls_detector_module *myMod=NULL;
|
sls_detector_module *myMod=NULL;
|
||||||
int ret=FAIL;
|
int ret=FAIL;
|
||||||
@ -2402,7 +2357,7 @@ int slsDetector::saveSettingsFile(string fname, int imod) {
|
|||||||
if ((myMod=getModule(0))) {
|
if ((myMod=getModule(0))) {
|
||||||
|
|
||||||
if(thisDetector->myDetectorType == EIGER){
|
if(thisDetector->myDetectorType == EIGER){
|
||||||
iodelay = (int)setDAC((dacs_t)-1,IO_DELAY,0,-1);
|
iodelay = (int)setDAC((int)-1,IO_DELAY,0,-1);
|
||||||
tau = (int64_t)getRateCorrectionTau();
|
tau = (int64_t)getRateCorrectionTau();
|
||||||
}
|
}
|
||||||
ret=writeSettingsFile(fn, *myMod, iodelay, tau);
|
ret=writeSettingsFile(fn, *myMod, iodelay, tau);
|
||||||
@ -2414,103 +2369,6 @@ int slsDetector::saveSettingsFile(string fname, int imod) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::loadCalibrationFile(string fname, int imod) {
|
|
||||||
|
|
||||||
if(thisDetector->myDetectorType == EIGER) {
|
|
||||||
std::cout << "Not required for this detector!" << std::endl;
|
|
||||||
return FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
sls_detector_module *myMod=NULL;
|
|
||||||
string fn=fname;
|
|
||||||
|
|
||||||
int* gainval=0; int* offsetval=0;
|
|
||||||
if(thisDetector->nGain){
|
|
||||||
gainval=new int[thisDetector->nGain];
|
|
||||||
for(int i=0;i<thisDetector->nGain;++i)
|
|
||||||
gainval[i] = -1;
|
|
||||||
}
|
|
||||||
if(thisDetector->nOffset){
|
|
||||||
offsetval=new int[thisDetector->nOffset];
|
|
||||||
for(int i=0;i<thisDetector->nOffset;++i)
|
|
||||||
offsetval[i] = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn=fname;
|
|
||||||
ostringstream ostfn;
|
|
||||||
ostfn << fname ;
|
|
||||||
switch (thisDetector->myDetectorType) {
|
|
||||||
case EIGER:
|
|
||||||
if (fname.find(".sn")==string::npos && fname.find(".cal")==string::npos) {
|
|
||||||
ostfn << "." << setfill('0') << setw(3) << dec <<
|
|
||||||
getId(DETECTOR_SERIAL_NUMBER);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
printf("Unknown detector!\n");
|
|
||||||
return FAIL;
|
|
||||||
}
|
|
||||||
fn=ostfn.str();
|
|
||||||
if((myMod=getModule(0))){
|
|
||||||
//extra gain and offset
|
|
||||||
if(thisDetector->nGain){
|
|
||||||
if(readCalibrationFile(fn, gainval, offsetval)==FAIL)
|
|
||||||
return FAIL;
|
|
||||||
} //normal gain and offset inside sls_detector_module
|
|
||||||
else{
|
|
||||||
if(readCalibrationFile(fn,myMod->gain, myMod->offset)==FAIL)
|
|
||||||
return FAIL;
|
|
||||||
}
|
|
||||||
setModule(*myMod,-1,-1,-1,gainval,offsetval);
|
|
||||||
|
|
||||||
deleteModule(myMod);
|
|
||||||
if(gainval) delete[]gainval;
|
|
||||||
if(offsetval) delete[] offsetval;
|
|
||||||
} else
|
|
||||||
return FAIL;
|
|
||||||
|
|
||||||
return OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::saveCalibrationFile(string fname, int imod) {
|
|
||||||
|
|
||||||
|
|
||||||
sls_detector_module *myMod=NULL;
|
|
||||||
int ret=FAIL;
|
|
||||||
|
|
||||||
string fn=fname;
|
|
||||||
ostringstream ostfn;
|
|
||||||
ostfn << fname;
|
|
||||||
switch (thisDetector->myDetectorType) {
|
|
||||||
case EIGER:
|
|
||||||
ostfn << ".sn" << setfill('0') << setw(3) << dec <<
|
|
||||||
getId(DETECTOR_SERIAL_NUMBER);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
printf("Unknown detector!\n");
|
|
||||||
return FAIL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
fn=ostfn.str();
|
|
||||||
if ((myMod=getModule(0))) {
|
|
||||||
//extra gain and offset
|
|
||||||
if(thisDetector->nGain)
|
|
||||||
ret=writeCalibrationFile(fn,gain, offset);
|
|
||||||
//normal gain and offset inside sls_detector_module
|
|
||||||
else
|
|
||||||
ret=writeCalibrationFile(fn,myMod->gain, myMod->offset);
|
|
||||||
|
|
||||||
deleteModule(myMod);
|
|
||||||
}else
|
|
||||||
return FAIL;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
slsDetectorDefs::runStatus slsDetector::getRunStatus() {
|
slsDetectorDefs::runStatus slsDetector::getRunStatus() {
|
||||||
int fnum=F_GET_RUN_STATUS;
|
int fnum=F_GET_RUN_STATUS;
|
||||||
int ret=FAIL;
|
int ret=FAIL;
|
||||||
@ -2765,7 +2623,7 @@ int slsDetector::readAll() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::configureMAC() {
|
int slsDetector::configureMAC(int ndety) {
|
||||||
int i;
|
int i;
|
||||||
int ret=FAIL;
|
int ret=FAIL;
|
||||||
int fnum=F_CONFIGURE_MAC;
|
int fnum=F_CONFIGURE_MAC;
|
||||||
@ -2781,7 +2639,7 @@ int slsDetector::configureMAC() {
|
|||||||
if (thisDetector->myDetectorType == JUNGFRAU ||
|
if (thisDetector->myDetectorType == JUNGFRAU ||
|
||||||
thisDetector->myDetectorType == EIGER) {
|
thisDetector->myDetectorType == EIGER) {
|
||||||
sendpos = true;
|
sendpos = true;
|
||||||
int max = multiDet->getNumberOfDetectors(Y);
|
int max = ndety;
|
||||||
|
|
||||||
pos[0] = (detId % max); // row
|
pos[0] = (detId % max); // row
|
||||||
pos[1] = (detId / max) * ((thisDetector->myDetectorType == EIGER) ? 2 : 1);// col for horiz. udp ports
|
pos[1] = (detId / max) * ((thisDetector->myDetectorType == EIGER) ? 2 : 1);// col for horiz. udp ports
|
||||||
@ -2975,7 +2833,7 @@ int slsDetector::configureMAC() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int64_t slsDetector::setTimer(timerIndex index, int64_t t, int imod) {
|
int64_t slsDetector::setTimer(timerIndex index, int64_t t) {
|
||||||
|
|
||||||
|
|
||||||
int fnum=F_SET_TIMER,fnum2=F_SET_RECEIVER_TIMER;
|
int fnum=F_SET_TIMER,fnum2=F_SET_RECEIVER_TIMER;
|
||||||
@ -3131,7 +2989,7 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t, int imod) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int64_t slsDetector::getTimeLeft(timerIndex index, int imod) {
|
int64_t slsDetector::getTimeLeft(timerIndex index) {
|
||||||
|
|
||||||
|
|
||||||
int fnum=F_GET_TIME_LEFT;
|
int fnum=F_GET_TIME_LEFT;
|
||||||
@ -3312,30 +3170,28 @@ int slsDetector::getDataBytesInclGapPixels() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dacs_t slsDetector::setDAC(dacs_t val, dacIndex index, int mV, int imod) {
|
int slsDetector::setDAC(int val, dacIndex index, int mV) {
|
||||||
|
|
||||||
|
|
||||||
dacs_t retval[2];
|
int retval[2];
|
||||||
retval[0] = -1;
|
retval[0] = -1;
|
||||||
retval[1] = -1;
|
retval[1] = -1;
|
||||||
int fnum=F_SET_DAC;
|
int fnum=F_SET_DAC;
|
||||||
int ret=FAIL;
|
int ret=FAIL;
|
||||||
char mess[MAX_STR_LENGTH]="";
|
char mess[MAX_STR_LENGTH]="";
|
||||||
int arg[3];
|
int arg[2];
|
||||||
|
|
||||||
|
|
||||||
if ( (index==HV_NEW) &&(thisDetector->myDetectorType == GOTTHARD))
|
if ( (index==HV_NEW) &&(thisDetector->myDetectorType == GOTTHARD))
|
||||||
index=HV_POT;
|
index=HV_POT;
|
||||||
|
|
||||||
arg[0]=index;
|
arg[0]=index;
|
||||||
arg[1]=imod;
|
arg[1]=mV;
|
||||||
arg[2]=mV;
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< std::endl;
|
std::cout<< std::endl;
|
||||||
std::cout<< "Setting DAC "<< index << " of module " << imod << " to " <<
|
std::cout<< "Setting DAC "<< index << " to " << val << std::endl;
|
||||||
val << std::endl;
|
|
||||||
#endif
|
#endif
|
||||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||||
if (connectControl() == OK){
|
if (connectControl() == OK){
|
||||||
@ -3367,8 +3223,7 @@ dacs_t slsDetector::setDAC(dacs_t val, dacIndex index, int mV, int imod) {
|
|||||||
<< std::endl;
|
<< std::endl;
|
||||||
#endif
|
#endif
|
||||||
if (ret==FAIL) {
|
if (ret==FAIL) {
|
||||||
std::cout<< "Set dac " << index << " of module " << imod << " to " <<
|
std::cout<< "Set dac " << index << " to " << val << " failed." << std::endl;
|
||||||
val << " failed." << std::endl;
|
|
||||||
}
|
}
|
||||||
if(mV)
|
if(mV)
|
||||||
return retval[1];
|
return retval[1];
|
||||||
@ -3379,32 +3234,31 @@ dacs_t slsDetector::setDAC(dacs_t val, dacIndex index, int mV, int imod) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
dacs_t slsDetector::getADC(dacIndex index, int imod) {
|
int slsDetector::getADC(dacIndex index) {
|
||||||
|
|
||||||
dacs_t retval;
|
int retval;
|
||||||
int fnum=F_GET_ADC;
|
int fnum=F_GET_ADC;
|
||||||
int ret=FAIL;
|
int ret=FAIL;
|
||||||
char mess[MAX_STR_LENGTH]="";
|
char mess[MAX_STR_LENGTH]="";
|
||||||
|
|
||||||
int arg[2];
|
int arg;
|
||||||
arg[0]=index;
|
arg=index;
|
||||||
arg[1]=imod;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< std::endl;
|
std::cout<< std::endl;
|
||||||
std::cout<< "Getting ADC "<< index << " of module " << imod << std::endl;
|
std::cout<< "Getting ADC "<< index << std::endl;
|
||||||
#endif
|
#endif
|
||||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||||
if (connectStop() == OK){
|
if (connectStop() == OK){
|
||||||
stopSocket->SendDataOnly(&fnum,sizeof(fnum));
|
stopSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||||
stopSocket->SendDataOnly(arg,sizeof(arg));
|
stopSocket->SendDataOnly(&arg,sizeof(arg));
|
||||||
stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||||
if (ret!=FAIL) {
|
if (ret!=FAIL) {
|
||||||
stopSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
stopSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||||
if (adcs) {
|
if (adcs) {
|
||||||
*(adcs+index+imod*thisDetector->nAdcs)=retval;
|
*(adcs+index)=retval;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stopSocket->ReceiveDataOnly(mess,sizeof(mess));
|
stopSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||||
@ -3944,7 +3798,7 @@ string slsDetector::setDetectorIP(string detectorIP) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
string slsDetector::setReceiver(string receiverIP) {
|
string slsDetector::setReceiverHostname(string receiverIP) {
|
||||||
|
|
||||||
if(receiverIP == "none") {
|
if(receiverIP == "none") {
|
||||||
memset(thisDetector->receiver_hostname, 0, MAX_STR_LENGTH);
|
memset(thisDetector->receiver_hostname, 0, MAX_STR_LENGTH);
|
||||||
@ -4041,7 +3895,7 @@ string slsDetector::setReceiver(string receiverIP) {
|
|||||||
enableGapPixels(thisDetector->gappixels);
|
enableGapPixels(thisDetector->gappixels);
|
||||||
|
|
||||||
// data streaming
|
// data streaming
|
||||||
setReadReceiverFrequency(thisDetector->receiver_read_freq);
|
setReceiverStreamingFrequency(thisDetector->receiver_read_freq);
|
||||||
setReceiverStreamingPort(getReceiverStreamingPort());
|
setReceiverStreamingPort(getReceiverStreamingPort());
|
||||||
setReceiverStreamingIP(getReceiverStreamingIP());
|
setReceiverStreamingIP(getReceiverStreamingIP());
|
||||||
setAdditionalJsonHeader(getAdditionalJsonHeader());
|
setAdditionalJsonHeader(getAdditionalJsonHeader());
|
||||||
@ -4156,14 +4010,6 @@ string slsDetector::setClientStreamingPort(string port) {
|
|||||||
int numsockets = (thisDetector->myDetectorType == EIGER) ? 2:1;
|
int numsockets = (thisDetector->myDetectorType == EIGER) ? 2:1;
|
||||||
int arg = 0;
|
int arg = 0;
|
||||||
|
|
||||||
//multi command, calculate individual ports
|
|
||||||
size_t found = port.find("multi");
|
|
||||||
if(found != string::npos) {
|
|
||||||
port.erase(found,5);
|
|
||||||
sscanf(port.c_str(),"%d",&defaultport);
|
|
||||||
arg = defaultport + (detId * numsockets);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
sscanf(port.c_str(),"%d",&arg);
|
sscanf(port.c_str(),"%d",&arg);
|
||||||
thisDetector->zmqport = arg;
|
thisDetector->zmqport = arg;
|
||||||
|
|
||||||
@ -4178,14 +4024,6 @@ string slsDetector::setReceiverStreamingPort(string port) {
|
|||||||
int numsockets = (thisDetector->myDetectorType == EIGER) ? 2:1;
|
int numsockets = (thisDetector->myDetectorType == EIGER) ? 2:1;
|
||||||
int arg = 0;
|
int arg = 0;
|
||||||
|
|
||||||
//multi command, calculate individual ports
|
|
||||||
size_t found = port.find("multi");
|
|
||||||
if(found != string::npos) {
|
|
||||||
port.erase(found,5);
|
|
||||||
sscanf(port.c_str(),"%d",&defaultport);
|
|
||||||
arg = defaultport + (detId * numsockets);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
sscanf(port.c_str(),"%d",&arg);
|
sscanf(port.c_str(),"%d",&arg);
|
||||||
|
|
||||||
thisDetector->receiver_zmqport = arg;
|
thisDetector->receiver_zmqport = arg;
|
||||||
@ -4488,7 +4326,7 @@ int slsDetector::setUDPConnection() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::digitalTest( digitalTestMode mode, int imod) {
|
int slsDetector::digitalTest( digitalTestMode mode) {
|
||||||
|
|
||||||
|
|
||||||
int retval;
|
int retval;
|
||||||
@ -4505,8 +4343,6 @@ int slsDetector::digitalTest( digitalTestMode mode, int imod) {
|
|||||||
if (connectControl() == OK){
|
if (connectControl() == OK){
|
||||||
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||||
controlSocket->SendDataOnly(&mode,sizeof(mode));
|
controlSocket->SendDataOnly(&mode,sizeof(mode));
|
||||||
if ((mode==CHIP_TEST)|| (mode==DIGITAL_BIT_TEST))
|
|
||||||
controlSocket->SendDataOnly(&imod,sizeof(imod));
|
|
||||||
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||||
if (ret!=FAIL)
|
if (ret!=FAIL)
|
||||||
controlSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
controlSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||||
@ -5054,7 +4890,7 @@ int slsDetector::setFlippedData(dimension d, int value) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::setAllTrimbits(int val, int imod) {
|
int slsDetector::setAllTrimbits(int val) {
|
||||||
int fnum=F_SET_ALL_TRIMBITS;
|
int fnum=F_SET_ALL_TRIMBITS;
|
||||||
int retval;
|
int retval;
|
||||||
char mess[MAX_STR_LENGTH]="";
|
char mess[MAX_STR_LENGTH]="";
|
||||||
@ -5261,27 +5097,24 @@ int slsDetector::pulseChip(int n) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::setThresholdTemperature(int val, int imod) {
|
int slsDetector::setThresholdTemperature(int val) {
|
||||||
|
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
int fnum = F_THRESHOLD_TEMP;
|
int fnum = F_THRESHOLD_TEMP;
|
||||||
int ret = FAIL;
|
int ret = FAIL;
|
||||||
char mess[MAX_STR_LENGTH] = "";
|
char mess[MAX_STR_LENGTH] = "";
|
||||||
|
|
||||||
int arg[2];
|
int arg=val;
|
||||||
arg[0]=val;
|
|
||||||
arg[1]=imod;
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< std::endl;
|
std::cout<< std::endl;
|
||||||
std::cout<< "Setting/Getting Threshold Temperature to "<< val << " of module "
|
std::cout<< "Setting/Getting Threshold Temperature to "<< val << std::endl;
|
||||||
<< imod << std::endl;
|
|
||||||
#endif
|
#endif
|
||||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||||
if (connectStop() == OK){
|
if (connectStop() == OK){
|
||||||
stopSocket->SendDataOnly(&fnum,sizeof(fnum));
|
stopSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||||
stopSocket->SendDataOnly(arg,sizeof(arg));
|
stopSocket->SendDataOnly(&arg,sizeof(arg));
|
||||||
stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||||
if (ret!=FAIL) {
|
if (ret!=FAIL) {
|
||||||
stopSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
stopSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||||
@ -5302,27 +5135,24 @@ std::cout<< "Threshold Temperature returned "<< retval << std::endl;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::setTemperatureControl(int val, int imod) {
|
int slsDetector::setTemperatureControl(int val) {
|
||||||
|
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
int fnum = F_TEMP_CONTROL;
|
int fnum = F_TEMP_CONTROL;
|
||||||
int ret = FAIL;
|
int ret = FAIL;
|
||||||
char mess[MAX_STR_LENGTH] = "";
|
char mess[MAX_STR_LENGTH] = "";
|
||||||
|
|
||||||
int arg[2];
|
int arg=val;
|
||||||
arg[0]=val;
|
|
||||||
arg[1]=imod;
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< std::endl;
|
std::cout<< std::endl;
|
||||||
std::cout<< "Setting/Getting Threshold Temperature to "<< val << " of module "
|
std::cout<< "Setting/Getting Threshold Temperature to "<< val << std::endl;
|
||||||
<< imod << std::endl;
|
|
||||||
#endif
|
#endif
|
||||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||||
if (connectStop() == OK){
|
if (connectStop() == OK){
|
||||||
stopSocket->SendDataOnly(&fnum,sizeof(fnum));
|
stopSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||||
stopSocket->SendDataOnly(arg,sizeof(arg));
|
stopSocket->SendDataOnly(&arg,sizeof(arg));
|
||||||
stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||||
if (ret!=FAIL) {
|
if (ret!=FAIL) {
|
||||||
stopSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
stopSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||||
@ -5344,27 +5174,24 @@ std::cout<< "Threshold Temperature returned "<< retval << std::endl;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::setTemperatureEvent(int val, int imod) {
|
int slsDetector::setTemperatureEvent(int val) {
|
||||||
|
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
int fnum = F_TEMP_EVENT;
|
int fnum = F_TEMP_EVENT;
|
||||||
int ret = FAIL;
|
int ret = FAIL;
|
||||||
char mess[MAX_STR_LENGTH] = "";
|
char mess[MAX_STR_LENGTH] = "";
|
||||||
|
|
||||||
int arg[2];
|
int arg=val;
|
||||||
arg[0]=val;
|
|
||||||
arg[1]=imod;
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< std::endl;
|
std::cout<< std::endl;
|
||||||
std::cout<< "Setting/Getting Threshold Temperature to "<< val << " of module "
|
std::cout<< "Setting/Getting Threshold Temperature to "<< val << std::endl;
|
||||||
<< imod << std::endl;
|
|
||||||
#endif
|
#endif
|
||||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||||
if (connectStop() == OK){
|
if (connectStop() == OK){
|
||||||
stopSocket->SendDataOnly(&fnum,sizeof(fnum));
|
stopSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||||
stopSocket->SendDataOnly(arg,sizeof(arg));
|
stopSocket->SendDataOnly(&arg,sizeof(arg));
|
||||||
stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||||
if (ret!=FAIL) {
|
if (ret!=FAIL) {
|
||||||
stopSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
stopSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||||
@ -5787,8 +5614,6 @@ int slsDetector::setModule(sls_detector_module module, int iodelay, int tau,
|
|||||||
int ret=FAIL;
|
int ret=FAIL;
|
||||||
char mess[MAX_STR_LENGTH]="";
|
char mess[MAX_STR_LENGTH]="";
|
||||||
|
|
||||||
int imod=0;
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout << "slsDetector set module " << std::endl;
|
std::cout << "slsDetector set module " << std::endl;
|
||||||
@ -5851,28 +5676,27 @@ int slsDetector::setModule(sls_detector_module module, int iodelay, int tau,
|
|||||||
if(tb) {
|
if(tb) {
|
||||||
for (int ichip=0; ichip<thisDetector->nChips; ++ichip) {
|
for (int ichip=0; ichip<thisDetector->nChips; ++ichip) {
|
||||||
if (chipregs)
|
if (chipregs)
|
||||||
chipregs[ichip+thisDetector->nChips*imod]=
|
chipregs[ichip]=
|
||||||
module.chipregs[ichip];
|
module.chipregs[ichip];
|
||||||
|
|
||||||
if (chanregs) {
|
if (chanregs) {
|
||||||
for (int i=0; i<thisDetector->nChans; ++i) {
|
for (int i=0; i<thisDetector->nChans; ++i) {
|
||||||
chanregs[i+ichip*
|
chanregs[i+ichip*
|
||||||
thisDetector->nChans+
|
thisDetector->nChans]=
|
||||||
thisDetector->nChips*thisDetector->nChans*
|
module.chanregs[ichip*thisDetector->nChans+i];
|
||||||
imod]=module.chanregs[ichip*thisDetector->nChans+i];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (adcs) {
|
if (adcs) {
|
||||||
for (int i=0; i<thisDetector->nAdcs; ++i)
|
for (int i=0; i<thisDetector->nAdcs; ++i)
|
||||||
adcs[i+imod*thisDetector->nAdcs]=module.adcs[i];
|
adcs[i]=module.adcs[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dacs) {
|
if (dacs) {
|
||||||
for (int i=0; i<thisDetector->nDacs; ++i)
|
for (int i=0; i<thisDetector->nDacs; ++i)
|
||||||
dacs[i+imod*thisDetector->nDacs]=module.dacs[i];
|
dacs[i]=module.dacs[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
(detectorModules)->gain=module.gain;
|
(detectorModules)->gain=module.gain;
|
||||||
@ -5883,12 +5707,12 @@ int slsDetector::setModule(sls_detector_module module, int iodelay, int tau,
|
|||||||
|
|
||||||
if ((thisDetector->nGain) && (gainval) && (gain)) {
|
if ((thisDetector->nGain) && (gainval) && (gain)) {
|
||||||
for (int i=0; i<thisDetector->nGain; ++i)
|
for (int i=0; i<thisDetector->nGain; ++i)
|
||||||
gain[i+imod*thisDetector->nGain]=gainval[i];
|
gain[i]=gainval[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((thisDetector->nOffset) && (offsetval) && (offset)) {
|
if ((thisDetector->nOffset) && (offsetval) && (offset)) {
|
||||||
for (int i=0; i<thisDetector->nOffset; ++i)
|
for (int i=0; i<thisDetector->nOffset; ++i)
|
||||||
offset[i+imod*thisDetector->nOffset]=offsetval[i];
|
offset[i]=offsetval[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e_eV != -1)
|
if (e_eV != -1)
|
||||||
@ -5907,7 +5731,7 @@ int slsDetector::setModule(sls_detector_module module, int iodelay, int tau,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
slsDetectorDefs::sls_detector_module *slsDetector::getModule(int imod) {
|
slsDetectorDefs::sls_detector_module *slsDetector::getModule() {
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout << "slsDetector get module " << std::endl;
|
std::cout << "slsDetector get module " << std::endl;
|
||||||
@ -5969,13 +5793,12 @@ slsDetectorDefs::sls_detector_module *slsDetector::getModule(int imod) {
|
|||||||
if(thisDetector->myDetectorType != JUNGFRAU){
|
if(thisDetector->myDetectorType != JUNGFRAU){
|
||||||
for (int ichip=0; ichip<thisDetector->nChips; ++ichip) {
|
for (int ichip=0; ichip<thisDetector->nChips; ++ichip) {
|
||||||
if (chipregs)
|
if (chipregs)
|
||||||
chipregs[ichip+thisDetector->nChips*imod]=
|
chipregs[ichip]=
|
||||||
myMod->chipregs[ichip];
|
myMod->chipregs[ichip];
|
||||||
|
|
||||||
if (chanregs) {
|
if (chanregs) {
|
||||||
for (int i=0; i<thisDetector->nChans; ++i) {
|
for (int i=0; i<thisDetector->nChans; ++i) {
|
||||||
chanregs[i+ichip*thisDetector->nChans+
|
chanregs[i+ichip*thisDetector->nChans]=
|
||||||
thisDetector->nChips*thisDetector->nChans*imod]=
|
|
||||||
myMod->chanregs[ichip*thisDetector->nChans+i];
|
myMod->chanregs[ichip*thisDetector->nChans+i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5983,13 +5806,13 @@ slsDetectorDefs::sls_detector_module *slsDetector::getModule(int imod) {
|
|||||||
|
|
||||||
if (adcs) {
|
if (adcs) {
|
||||||
for (int i=0; i<thisDetector->nAdcs; ++i)
|
for (int i=0; i<thisDetector->nAdcs; ++i)
|
||||||
adcs[i+imod*thisDetector->nAdcs]=myMod->adcs[i];
|
adcs[i]=myMod->adcs[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dacs) {
|
if (dacs) {
|
||||||
for (int i=0; i<thisDetector->nDacs; ++i) {
|
for (int i=0; i<thisDetector->nDacs; ++i) {
|
||||||
dacs[i+imod*thisDetector->nDacs]=myMod->dacs[i];
|
dacs[i]=myMod->dacs[i];
|
||||||
//cprintf(BLUE,"dac%d:%d\n",i, myMod->dacs[i]);
|
//cprintf(BLUE,"dac%d:%d\n",i, myMod->dacs[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6493,19 +6316,15 @@ void slsDetector::sendMultiDetectorSize() {
|
|||||||
int fnum=F_SEND_RECEIVER_MULTIDETSIZE;
|
int fnum=F_SEND_RECEIVER_MULTIDETSIZE;
|
||||||
int ret = FAIL;
|
int ret = FAIL;
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
int arg[2];
|
|
||||||
|
|
||||||
pthread_mutex_lock(&ms);
|
|
||||||
multiDet->getNumberOfDetectors(arg[0],arg[1]);
|
|
||||||
pthread_mutex_unlock(&ms);
|
|
||||||
|
|
||||||
if(thisDetector->receiverOnlineFlag==ONLINE_FLAG){
|
if(thisDetector->receiverOnlineFlag==ONLINE_FLAG){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout << "Sending multi detector size to Receiver (" << arg[0] << ","
|
std::cout << "Sending multi detector size to Receiver (" <<
|
||||||
<< arg[1] << ")" << std::endl;
|
thisDetector->multiSize[0] << ","
|
||||||
|
<< thisDetector->multiSize[1] << ")" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
if (connectData() == OK){
|
if (connectData() == OK){
|
||||||
ret=thisReceiver->sendIntArray(fnum,retval,arg);
|
ret=thisReceiver->sendIntArray(fnum,retval,thisDetector->multiSize);
|
||||||
disconnectData();
|
disconnectData();
|
||||||
}
|
}
|
||||||
if((ret==FAIL)){
|
if((ret==FAIL)){
|
||||||
@ -7033,12 +6852,12 @@ int slsDetector::overwriteFile(int enable) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::setReadReceiverFrequency(int freq) {
|
int slsDetector::setReceiverStreamingFrequency(int freq) {
|
||||||
|
|
||||||
if (freq >= 0) {
|
if (freq >= 0) {
|
||||||
thisDetector->receiver_read_freq = freq;
|
thisDetector->receiver_read_freq = freq;
|
||||||
|
|
||||||
int fnum=F_READ_RECEIVER_FREQUENCY;
|
int fnum=F_RECEIVER_STREAMING_FREQUENCY;
|
||||||
int ret = FAIL;
|
int ret = FAIL;
|
||||||
int retval=-1;
|
int retval=-1;
|
||||||
int arg = freq;
|
int arg = freq;
|
||||||
@ -7054,7 +6873,7 @@ int slsDetector::setReadReceiverFrequency(int freq) {
|
|||||||
if((ret == FAIL) || (retval != freq)) {
|
if((ret == FAIL) || (retval != freq)) {
|
||||||
cout << "could not set receiver read frequency to " << freq
|
cout << "could not set receiver read frequency to " << freq
|
||||||
<<" Returned:" << retval << endl;
|
<<" Returned:" << retval << endl;
|
||||||
setErrorMask((getErrorMask())|(RECEIVER_READ_FREQUENCY));
|
setErrorMask((getErrorMask())|(RECEIVER_STREAMING_FREQUENCY));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ret==FORCE_UPDATE)
|
if(ret==FORCE_UPDATE)
|
||||||
@ -7067,8 +6886,8 @@ int slsDetector::setReadReceiverFrequency(int freq) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::setReceiverReadTimer(int time_in_ms) {
|
int slsDetector::setReceiverStreamingTimer(int time_in_ms) {
|
||||||
int fnum=F_READ_RECEIVER_TIMER;
|
int fnum=F_RECEIVER_STREAMING_TIMER;
|
||||||
int ret = FAIL;
|
int ret = FAIL;
|
||||||
int arg = time_in_ms;
|
int arg = time_in_ms;
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
@ -7088,7 +6907,7 @@ int slsDetector::setReceiverReadTimer(int time_in_ms) {
|
|||||||
if ((time_in_ms > 0) && (retval != time_in_ms)){
|
if ((time_in_ms > 0) && (retval != time_in_ms)){
|
||||||
cout << "could not set receiver read timer to " << time_in_ms
|
cout << "could not set receiver read timer to " << time_in_ms
|
||||||
<<" Returned:" << retval << endl;
|
<<" Returned:" << retval << endl;
|
||||||
setErrorMask((getErrorMask())|(RECEIVER_READ_TIMER));
|
setErrorMask((getErrorMask())|(RECEIVER_STREAMING_TIMER));
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@ -7600,7 +7419,7 @@ slsDetectorDefs::sls_detector_module* slsDetector::interpolateTrim(
|
|||||||
|
|
||||||
//Copy other dacs
|
//Copy other dacs
|
||||||
int dacs_to_copy[] = {SVP,VTR,SVN,VTGSTV,RXB_RB,RXB_LB,VCN,VIS};
|
int dacs_to_copy[] = {SVP,VTR,SVN,VTGSTV,RXB_RB,RXB_LB,VCN,VIS};
|
||||||
int num_dacs_to_copy = sizeof(dacs_to_copy) / sizeof(dacs_to_copy[0]);
|
int num_dacs_toint= sizeof(dacs_to_copy) / sizeof(dacs_to_copy[0]);
|
||||||
for (int i = 0; i < num_dacs_to_copy; ++i) {
|
for (int i = 0; i < num_dacs_to_copy; ++i) {
|
||||||
if(a->dacs[dacs_to_copy[i]] != b->dacs[dacs_to_copy[i]]) {
|
if(a->dacs[dacs_to_copy[i]] != b->dacs[dacs_to_copy[i]]) {
|
||||||
deleteModule(myMod);
|
deleteModule(myMod);
|
||||||
@ -7709,7 +7528,7 @@ slsDetectorDefs::sls_detector_module* slsDetector::readSettingsFile(std::string
|
|||||||
case EIGER:
|
case EIGER:
|
||||||
infile.open(myfname.c_str(),std::ifstream::binary);
|
infile.open(myfname.c_str(),std::ifstream::binary);
|
||||||
if (infile.is_open()) {
|
if (infile.is_open()) {
|
||||||
infile.read((char*) myMod->dacs,sizeof(dacs_t)*(myMod->ndac));
|
infile.read((char*) myMod->dacs,sizeof(int)*(myMod->ndac));
|
||||||
infile.read((char*)&iodelay,sizeof(iodelay));
|
infile.read((char*)&iodelay,sizeof(iodelay));
|
||||||
infile.read((char*)&tau,sizeof(tau));
|
infile.read((char*)&tau,sizeof(tau));
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
@ -7855,7 +7674,7 @@ int slsDetector::writeSettingsFile(std::string fname, sls_detector_module mod,
|
|||||||
std::cout << "iodelay: " << iodelay << std::endl;
|
std::cout << "iodelay: " << iodelay << std::endl;
|
||||||
std::cout << "tau: " << tau << std::endl;
|
std::cout << "tau: " << tau << std::endl;
|
||||||
#endif
|
#endif
|
||||||
outfile.write((char*)mod.dacs, sizeof(dacs_t)*(mod.ndac));
|
outfile.write((char*)mod.dacs, sizeof(int)*(mod.ndac));
|
||||||
outfile.write(reinterpret_cast<char*>(&iodelay), sizeof(iodelay));
|
outfile.write(reinterpret_cast<char*>(&iodelay), sizeof(iodelay));
|
||||||
outfile.write(reinterpret_cast<char*>(&tau), sizeof(tau));
|
outfile.write(reinterpret_cast<char*>(&tau), sizeof(tau));
|
||||||
outfile.write((char*)mod.chanregs, sizeof(int)*(mod.nchan));
|
outfile.write((char*)mod.chanregs, sizeof(int)*(mod.nchan));
|
||||||
|
@ -16,7 +16,7 @@ class multiSlsDetector;
|
|||||||
class SharedMemory;
|
class SharedMemory;
|
||||||
class receiverInterface;
|
class receiverInterface;
|
||||||
|
|
||||||
#define SLS_SHMVERSION 0x181002
|
#define SLS_SHMVERSION 0x181005
|
||||||
#define NCHIPSMAX 10
|
#define NCHIPSMAX 10
|
||||||
#define NCHANSMAX 65536
|
#define NCHANSMAX 65536
|
||||||
#define NDACSMAX 16
|
#define NDACSMAX 16
|
||||||
@ -63,6 +63,9 @@ private:
|
|||||||
* before starting the communication */
|
* before starting the communication */
|
||||||
char hostname[MAX_STR_LENGTH];
|
char hostname[MAX_STR_LENGTH];
|
||||||
|
|
||||||
|
/** detector type \ see :: detectorType*/
|
||||||
|
detectorType myDetectorType;
|
||||||
|
|
||||||
/** END OF FIXED PATTERN -----------------------------------------------*/
|
/** END OF FIXED PATTERN -----------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
@ -71,21 +74,18 @@ private:
|
|||||||
/** Detector offset in the X & Y direction in the multi detector structure */
|
/** Detector offset in the X & Y direction in the multi detector structure */
|
||||||
int offset[2];
|
int offset[2];
|
||||||
|
|
||||||
|
/** Number of detectors in multi list in x dir and y dir */
|
||||||
|
int multiSize[2];
|
||||||
|
|
||||||
/** is the port used for control functions */
|
/** is the port used for control functions */
|
||||||
int controlPort;
|
int controlPort;
|
||||||
|
|
||||||
/** is the port used to stop the acquisition */
|
/** is the port used to stop the acquisition */
|
||||||
int stopPort;
|
int stopPort;
|
||||||
|
|
||||||
/** detector type \ see :: detectorType*/
|
|
||||||
detectorType myDetectorType;
|
|
||||||
|
|
||||||
/** path of the trimbits/settings files */
|
/** path of the trimbits/settings files */
|
||||||
char settingsDir[MAX_STR_LENGTH];
|
char settingsDir[MAX_STR_LENGTH];
|
||||||
|
|
||||||
/** path of the calibration files */
|
|
||||||
char calDir[MAX_STR_LENGTH];
|
|
||||||
|
|
||||||
/** number of energies at which the detector has been trimmed */
|
/** number of energies at which the detector has been trimmed */
|
||||||
int nTrimEn;
|
int nTrimEn;
|
||||||
|
|
||||||
@ -126,9 +126,6 @@ private:
|
|||||||
* (i.e. if data are processed in a separate thread) */
|
* (i.e. if data are processed in a separate thread) */
|
||||||
int threadedProcessing;
|
int threadedProcessing;
|
||||||
|
|
||||||
/** dead time (in ns) for rate corrections */
|
|
||||||
double tDead;
|
|
||||||
|
|
||||||
/** number of rois defined */
|
/** number of rois defined */
|
||||||
int nROI;
|
int nROI;
|
||||||
|
|
||||||
@ -289,51 +286,28 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
//FIXME: all pos or id arguments needed only for same multi signature
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor called when creating new shared memory
|
* Constructor called when creating new shared memory
|
||||||
* @param type detector type
|
* @param type detector type
|
||||||
* @param multiId multi detector shared memory id
|
* @param multiId multi detector shared memory id
|
||||||
* @param id sls detector id (position in detectors list)
|
* @param id sls detector id (position in detectors list)
|
||||||
* @param verify true to verify if shared memory version matches existing one
|
* @param verify true to verify if shared memory version matches existing one
|
||||||
* @param m multiSlsDetector reference
|
|
||||||
*/
|
*/
|
||||||
slsDetector(detectorType type, int multiId = 0, int id = 0, bool verify = true, multiSlsDetector* m = NULL);
|
slsDetector(detectorType type, int multiId = 0, int id = 0, bool verify = true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor called when opening existing shared memory
|
* Constructor called when opening existing shared memory
|
||||||
* @param multiId multi detector shared memory id
|
* @param multiId multi detector shared memory id
|
||||||
* @param id sls detector id (position in detectors list)
|
* @param id sls detector id (position in detectors list)
|
||||||
* @param verify true to verify if shared memory version matches existing one
|
* @param verify true to verify if shared memory version matches existing one
|
||||||
* @param m multiSlsDetector reference
|
|
||||||
*/
|
*/
|
||||||
slsDetector(int multiId = 0, int id = 0, bool verify = true, multiSlsDetector* m = NULL);
|
slsDetector(int multiId = 0, int id = 0, bool verify = true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
*/
|
*/
|
||||||
virtual ~slsDetector();
|
virtual ~slsDetector();
|
||||||
|
|
||||||
/**
|
|
||||||
* Set acquiring flag in shared memory
|
|
||||||
* @param b acquiring flag
|
|
||||||
*/
|
|
||||||
void setAcquiringFlag(bool b=false);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get acquiring flag from shared memory
|
|
||||||
* @returns acquiring flag
|
|
||||||
*/
|
|
||||||
bool getAcquiringFlag();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if acquiring flag is set, set error if set
|
|
||||||
* @returns FAIL if not ready, OK if ready
|
|
||||||
*/
|
|
||||||
bool isAcquireReady();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check version compatibility with detector/receiver software
|
* Check version compatibility with detector/receiver software
|
||||||
* (if hostname/rx_hostname has been set/ sockets created)
|
* (if hostname/rx_hostname has been set/ sockets created)
|
||||||
@ -345,10 +319,9 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Get ID or version numbers
|
* Get ID or version numbers
|
||||||
* @param mode version type
|
* @param mode version type
|
||||||
* @param imod module number in entire module list (gets decoded) (-1 for all)
|
|
||||||
* @returns Id or version number of that type
|
* @returns Id or version number of that type
|
||||||
*/
|
*/
|
||||||
int64_t getId(idMode mode, int imod=0);
|
int64_t getId(idMode mode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Free shared memory without creating objects
|
* Free shared memory without creating objects
|
||||||
@ -368,13 +341,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
void freeSharedMemory();
|
void freeSharedMemory();
|
||||||
|
|
||||||
/**
|
|
||||||
* Get user details of shared memory
|
|
||||||
* Should only be called from multi detector level
|
|
||||||
* @returns string with user details
|
|
||||||
*/
|
|
||||||
std::string getUserDetails();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the hostname of all sls detectors in shared memory
|
* Sets the hostname of all sls detectors in shared memory
|
||||||
* Connects to them to set up online flag
|
* Connects to them to set up online flag
|
||||||
@ -389,14 +355,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
std::string getHostname(int pos = -1);
|
std::string getHostname(int pos = -1);
|
||||||
|
|
||||||
/**
|
|
||||||
* Appends detectors to the end of the list in shared memory
|
|
||||||
* Connects to them to set up online flag
|
|
||||||
* Should only be called from multi detector level
|
|
||||||
* @param name concatenated hostname of the sls detectors to be appended to the list
|
|
||||||
*/
|
|
||||||
void addMultipleDetectors(const char* name);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connect to the control port
|
* Connect to the control port
|
||||||
* @returns OK, FAIL or undefined
|
* @returns OK, FAIL or undefined
|
||||||
@ -456,17 +414,15 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Detector type from shared memory variable
|
* Get Detector type from shared memory variable
|
||||||
* @param pos insignificant
|
|
||||||
* @returns detector type from shared memory variable
|
* @returns detector type from shared memory variable
|
||||||
*/
|
*/
|
||||||
detectorType getDetectorsType(int pos = -1);
|
detectorType getDetectorsType();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets string version of detector type from shared memory variable
|
* Gets string version of detector type from shared memory variable
|
||||||
* @param pos insignificant
|
|
||||||
* @returns string version of detector type from shared memory variable
|
* @returns string version of detector type from shared memory variable
|
||||||
*/
|
*/
|
||||||
std::string sgetDetectorsType(int pos=-1);
|
std::string sgetDetectorsType();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Just to overload getDetectorType from users
|
* Just to overload getDetectorType from users
|
||||||
@ -537,6 +493,13 @@ public:
|
|||||||
*/
|
*/
|
||||||
void setDetectorOffset(dimension d, int off);
|
void setDetectorOffset(dimension d, int off);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set Detector offset in shared memory in dimension d
|
||||||
|
* @param detx number of detectors in X dir in multi list
|
||||||
|
* @param dety number of detectors in Y dir in multi list
|
||||||
|
*/
|
||||||
|
void updateMultiSize(int detx, int dety);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the detector is online and sets the online flag
|
* Checks if the detector is online and sets the online flag
|
||||||
* @param online if GET_ONLINE_FLAG, only returns shared memory online flag,
|
* @param online if GET_ONLINE_FLAG, only returns shared memory online flag,
|
||||||
@ -564,7 +527,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
int setTCPSocket(std::string const name="", int const control_port=-1, int const stop_port=-1);
|
int setTCPSocket(std::string const name="", int const control_port=-1, int const stop_port=-1);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/Gets TCP Port of detector or receiver
|
* Set/Gets TCP Port of detector or receiver
|
||||||
* @param t port type
|
* @param t port type
|
||||||
@ -670,23 +632,21 @@ public:
|
|||||||
std::string getSettingsFile();
|
std::string getSettingsFile();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes a trim/settings file for module number imod,
|
* Writes a trim/settings file for module number
|
||||||
* the values will be read from the current detector structure
|
* the values will be read from the current detector structure
|
||||||
* @param fname name of the file to be written
|
* @param fname name of the file to be written
|
||||||
* @param imod module number
|
|
||||||
* @param iodelay io delay (detector specific)
|
* @param iodelay io delay (detector specific)
|
||||||
* @param tau tau (detector specific)
|
* @param tau tau (detector specific)
|
||||||
* @returns OK or FAIL if the file could not be written
|
* @returns OK or FAIL if the file could not be written
|
||||||
* \sa ::sls_detector_module sharedSlsDetector mythenDetector::writeSettingsFile(string, int)
|
* \sa ::sls_detector_module sharedSlsDetector mythenDetector::writeSettingsFile(string, int)
|
||||||
*/
|
*/
|
||||||
int writeSettingsFile(std::string fname, int imod, int iodelay, int tau);
|
int writeSettingsFile(std::string fname, int iodelay, int tau);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get detector settings
|
* Get detector settings
|
||||||
* @param imod module number (-1 all)
|
|
||||||
* @returns current settings
|
* @returns current settings
|
||||||
*/
|
*/
|
||||||
detectorSettings getSettings(int imod=-1);
|
detectorSettings getSettings();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load detector settings from the settings file picked from the trimdir/settingsdir
|
* Load detector settings from the settings file picked from the trimdir/settingsdir
|
||||||
@ -694,39 +654,35 @@ public:
|
|||||||
* For Eiger, one must use threshold
|
* For Eiger, one must use threshold
|
||||||
* Gotthard, Propix, Jungfrau and Moench only sends the settings enum to the detector
|
* Gotthard, Propix, Jungfrau and Moench only sends the settings enum to the detector
|
||||||
* @param isettings settings
|
* @param isettings settings
|
||||||
* @param imod module number (-1 all)
|
|
||||||
* @returns current settings
|
* @returns current settings
|
||||||
*/
|
*/
|
||||||
detectorSettings setSettings(detectorSettings isettings, int imod=-1);
|
detectorSettings setSettings(detectorSettings isettings);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send detector settings only (set only for Jungfrau, Gotthard, Moench, get for all)
|
* Send detector settings only (set only for Jungfrau, Gotthard, Moench, get for all)
|
||||||
* Only the settings enum is sent to the detector, where it will
|
* Only the settings enum is sent to the detector, where it will
|
||||||
* initialize al the dacs already hard coded in the detector server
|
* initialize al the dacs already hard coded in the detector server
|
||||||
* @param isettings settings
|
* @param isettings settings
|
||||||
* @param imod module number (-1 all)
|
|
||||||
* @returns current settings
|
* @returns current settings
|
||||||
*/
|
*/
|
||||||
detectorSettings sendSettingsOnly(detectorSettings isettings, int imod=-1);
|
detectorSettings sendSettingsOnly(detectorSettings isettings);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get threshold energy (Mythen and Eiger)
|
* Get threshold energy (Mythen and Eiger)
|
||||||
* @param imod module number (-1 all)
|
* @returns current threshold value in ev (-1 failed)
|
||||||
* @returns current threshold value for imod in ev (-1 failed)
|
|
||||||
*/
|
*/
|
||||||
int getThresholdEnergy(int imod=-1);
|
int getThresholdEnergy();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set threshold energy (Mythen and Eiger)
|
* Set threshold energy (Mythen and Eiger)
|
||||||
* For Eiger, calls setThresholdEneryAndSettings
|
* For Eiger, calls setThresholdEneryAndSettings
|
||||||
* @param e_eV threshold in eV
|
* @param e_eV threshold in eV
|
||||||
* @param imod module number (-1 all)
|
|
||||||
* @param isettings ev. change settings
|
* @param isettings ev. change settings
|
||||||
* @param tb 1 to include trimbits, 0 to exclude
|
* @param tb 1 to include trimbits, 0 to exclude
|
||||||
* @returns current threshold value for imod in ev (-1 failed)
|
* @returns current threshold value in ev (-1 failed)
|
||||||
*/
|
*/
|
||||||
int setThresholdEnergy(int e_eV, int imod=-1, detectorSettings isettings=GET_SETTINGS, int tb=1);
|
int setThresholdEnergy(int e_eV, detectorSettings isettings=GET_SETTINGS, int tb=1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set threshold energy and settings (Eiger only)
|
* Set threshold energy and settings (Eiger only)
|
||||||
@ -750,55 +706,21 @@ public:
|
|||||||
*/
|
*/
|
||||||
std::string setSettingsDir(std::string s);
|
std::string setSettingsDir(std::string s);
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the calibration files directory \sa sharedSlsDetector (Mythen)
|
|
||||||
* @returns the calibration files directory
|
|
||||||
*/
|
|
||||||
std::string getCalDir();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the calibration files directory \sa sharedSlsDetector (Mythen)
|
|
||||||
* @param s the calibration files directory
|
|
||||||
* @returns the calibration files directory
|
|
||||||
*/
|
|
||||||
std::string setCalDir(std::string s);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the modules settings/trimbits reading from a specific file
|
* Loads the modules settings/trimbits reading from a specific file
|
||||||
* file name extension is automatically generated.
|
* file name extension is automatically generated.
|
||||||
* @param fname specific settings/trimbits file
|
* @param fname specific settings/trimbits file
|
||||||
* @param imod module index of the entire list,
|
|
||||||
* from which will be calculated the detector index and the module index (-1 for all)
|
|
||||||
* returns OK or FAIL
|
* returns OK or FAIL
|
||||||
*/
|
*/
|
||||||
int loadSettingsFile(std::string fname, int imod=-1);
|
int loadSettingsFile(std::string fname);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the modules settings/trimbits to a specific file
|
* Saves the modules settings/trimbits to a specific file
|
||||||
* file name extension is automatically generated.
|
* file name extension is automatically generated.
|
||||||
* @param fname specific settings/trimbits file
|
* @param fname specific settings/trimbits file
|
||||||
* @param imod module number (-1 for all)
|
|
||||||
* returns OK or FAIL
|
* returns OK or FAIL
|
||||||
*/
|
*/
|
||||||
int saveSettingsFile(std::string fname, int imod=-1);
|
int saveSettingsFile(std::string fname);
|
||||||
|
|
||||||
/**
|
|
||||||
* Loads the modules calibration data reading from a specific file (Mythen)
|
|
||||||
* file name extension is automatically generated.
|
|
||||||
* @param fname specific calibration file
|
|
||||||
* @param imod module number (-1 for all)
|
|
||||||
* returns OK or FAIL
|
|
||||||
*/
|
|
||||||
int loadCalibrationFile(std::string fname, int imod=-1);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Saves the modules calibration data to a specific file (Mythen)
|
|
||||||
* file name extension is automatically generated.
|
|
||||||
* @param fname specific calibration file
|
|
||||||
* @param imod module number (-1 for all)
|
|
||||||
* returns OK or FAIL
|
|
||||||
*/
|
|
||||||
int saveCalibrationFile(std::string fname, int imod=-1);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get run status of the detector
|
* Get run status of the detector
|
||||||
@ -849,28 +771,27 @@ public:
|
|||||||
int readAll();
|
int readAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configures in detector the destination for UDP packets (Not Mythen)
|
* Configures in detector the destination for UDP packets
|
||||||
|
* @param ndety number of detectors in y dir
|
||||||
* @returns OK or FAIL
|
* @returns OK or FAIL
|
||||||
*/
|
*/
|
||||||
int configureMAC();
|
int configureMAC(int ndety);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/get timer value (not all implemented for all detectors)
|
* Set/get timer value (not all implemented for all detectors)
|
||||||
* @param index timer index
|
* @param index timer index
|
||||||
* @param t time in ns or number of...(e.g. frames, gates, probes)
|
* @param t time in ns or number of...(e.g. frames, gates, probes)
|
||||||
* \param imod module number (pointless in slsDetector)
|
|
||||||
* @returns timer set value in ns or number of...(e.g. frames, gates, probes)
|
* @returns timer set value in ns or number of...(e.g. frames, gates, probes)
|
||||||
*/
|
*/
|
||||||
int64_t setTimer(timerIndex index, int64_t t=-1, int imod = -1);
|
int64_t setTimer(timerIndex index, int64_t t=-1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/get timer value left in acquisition (not all implemented for all detectors)
|
* Set/get timer value left in acquisition (not all implemented for all detectors)
|
||||||
* @param index timer index
|
* @param index timer index
|
||||||
* @param t time in ns or number of...(e.g. frames, gates, probes)
|
* @param t time in ns or number of...(e.g. frames, gates, probes)
|
||||||
* @param imod module number
|
|
||||||
* @returns timer set value in ns or number of...(e.g. frames, gates, probes)
|
* @returns timer set value in ns or number of...(e.g. frames, gates, probes)
|
||||||
*/
|
*/
|
||||||
int64_t getTimeLeft(timerIndex index, int imod = -1);
|
int64_t getTimeLeft(timerIndex index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set speed
|
* Set speed
|
||||||
@ -906,18 +827,16 @@ public:
|
|||||||
* @param val value (in V)
|
* @param val value (in V)
|
||||||
* @param index DAC index
|
* @param index DAC index
|
||||||
* @param mV 0 in dac units or 1 in mV
|
* @param mV 0 in dac units or 1 in mV
|
||||||
* @param imod module number (if -1 all modules)
|
|
||||||
* @returns current DAC value
|
* @returns current DAC value
|
||||||
*/
|
*/
|
||||||
dacs_t setDAC(dacs_t val, dacIndex index , int mV, int imod=-1);
|
int setDAC(int val, dacIndex index , int mV);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get adc value
|
* Get adc value
|
||||||
* @param index adc(DAC) index
|
* @param index adc(DAC) index
|
||||||
* @param imod module number (if -1 all modules)
|
|
||||||
* @returns current adc value (temperature for eiger and jungfrau in millidegrees)
|
* @returns current adc value (temperature for eiger and jungfrau in millidegrees)
|
||||||
*/
|
*/
|
||||||
dacs_t getADC(dacIndex index, int imod=0);
|
int getADC(dacIndex index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/get timing mode
|
* Set/get timing mode
|
||||||
@ -1137,10 +1056,9 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Execute a digital test (Gotthard, Mythen)
|
* Execute a digital test (Gotthard, Mythen)
|
||||||
* @param mode testmode type
|
* @param mode testmode type
|
||||||
* @param imod module index (-1 for all)
|
|
||||||
* @returns result of test
|
* @returns result of test
|
||||||
*/
|
*/
|
||||||
int digitalTest(digitalTestMode mode, int imod=0);
|
int digitalTest(digitalTestMode mode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load dark or gain image to detector (Gotthard)
|
* Load dark or gain image to detector (Gotthard)
|
||||||
@ -1260,10 +1178,9 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Sets all the trimbits to a particular value (Eiger)
|
* Sets all the trimbits to a particular value (Eiger)
|
||||||
* @param val trimbit value
|
* @param val trimbit value
|
||||||
* @param imod module number, -1 means all modules
|
|
||||||
* @returns OK or FAIL
|
* @returns OK or FAIL
|
||||||
*/
|
*/
|
||||||
int setAllTrimbits(int val, int imod=-1);
|
int setAllTrimbits(int val);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable gap pixels, only for Eiger and for 8,16 and 32 bit mode. (Eiger)
|
* Enable gap pixels, only for Eiger and for 8,16 and 32 bit mode. (Eiger)
|
||||||
@ -1318,26 +1235,23 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Set/gets threshold temperature (Jungfrau)
|
* Set/gets threshold temperature (Jungfrau)
|
||||||
* @param val value in millidegrees, -1 gets
|
* @param val value in millidegrees, -1 gets
|
||||||
* @param imod module number, -1 is all
|
|
||||||
* @returns threshold temperature in millidegrees
|
* @returns threshold temperature in millidegrees
|
||||||
*/
|
*/
|
||||||
int setThresholdTemperature(int val=-1, int imod=-1);
|
int setThresholdTemperature(int val=-1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables/disables temperature control (Jungfrau)
|
* Enables/disables temperature control (Jungfrau)
|
||||||
* @param val value, -1 gets
|
* @param val value, -1 gets
|
||||||
* @param imod module number, -1 is all
|
|
||||||
* @returns temperature control enable
|
* @returns temperature control enable
|
||||||
*/
|
*/
|
||||||
int setTemperatureControl(int val=-1, int imod=-1);
|
int setTemperatureControl(int val=-1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets/ gets over-temperature event (Jungfrau)
|
* Resets/ gets over-temperature event (Jungfrau)
|
||||||
* @param val value, -1 gets
|
* @param val value, -1 gets
|
||||||
* @param imod module number, -1 is all
|
|
||||||
* @returns over-temperature event
|
* @returns over-temperature event
|
||||||
*/
|
*/
|
||||||
int setTemperatureEvent(int val=-1, int imod=-1);
|
int setTemperatureEvent(int val=-1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set storage cell that stores first acquisition of the series (Jungfrau)
|
* Set storage cell that stores first acquisition of the series (Jungfrau)
|
||||||
@ -1403,10 +1317,9 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get module structure from detector (all detectors)
|
* Get module structure from detector (all detectors)
|
||||||
* @param imod module number
|
|
||||||
* @returns pointer to module structure (which has been created and must then be deleted)
|
* @returns pointer to module structure (which has been created and must then be deleted)
|
||||||
*/
|
*/
|
||||||
sls_detector_module *getModule(int imod);
|
sls_detector_module *getModule();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calibrate Pedestal (ChipTestBoard)
|
* Calibrate Pedestal (ChipTestBoard)
|
||||||
@ -1506,6 +1419,8 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Send the multi detector size to the detector
|
* Send the multi detector size to the detector
|
||||||
|
* @param detx number of detectors in x dir
|
||||||
|
* @param dety number of detectors in y dir
|
||||||
*/
|
*/
|
||||||
void sendMultiDetectorSize();
|
void sendMultiDetectorSize();
|
||||||
|
|
||||||
@ -1658,23 +1573,23 @@ public:
|
|||||||
int overwriteFile(int enable=-1);
|
int overwriteFile(int enable=-1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the read receiver frequency
|
* (previously setReadReceiverFrequency)
|
||||||
* if data required from receiver randomly readRxrFrequency=0,
|
* Sets the receiver streaming frequency
|
||||||
* else every nth frame to be sent to gui/callback
|
* @param freq nth frame streamed out, if 0, streamed out at a timer of 200 ms
|
||||||
* @param freq is the receiver read frequency. Value 0 is 200 ms timer (other
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* frames not sent), 1 is every frame, 2 is every second frame etc.
|
* @returns receiver streaming frequency
|
||||||
* @returns read receiver frequency
|
|
||||||
*/
|
*/
|
||||||
int setReadReceiverFrequency(int freq=-1);
|
int setReceiverStreamingFrequency(int freq=-1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the read receiver timer
|
* (previously setReceiverReadTimer)
|
||||||
* if data required from receiver randomly readRxrFrequency=0,
|
* Sets the receiver streaming timer
|
||||||
* then the timer between each data stream is set with time_in_ms
|
* If receiver streaming frequency is 0, then this timer between each
|
||||||
|
* data stream is set. Default is 200 ms.
|
||||||
* @param time_in_ms timer between frames
|
* @param time_in_ms timer between frames
|
||||||
* @returns read receiver timer
|
* @returns receiver streaming timer in ms
|
||||||
*/
|
*/
|
||||||
int setReceiverReadTimer(int time_in_ms=500);
|
int setReceiverStreamingTimer(int time_in_ms=500);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable data streaming to client
|
* Enable data streaming to client
|
||||||
@ -1996,9 +1911,7 @@ private:
|
|||||||
/** Shared memory structure */
|
/** Shared memory structure */
|
||||||
sharedSlsDetector *thisDetector;
|
sharedSlsDetector *thisDetector;
|
||||||
|
|
||||||
/** multiSlsDetector referece */
|
/** receiver interface */
|
||||||
multiSlsDetector *multiDet;
|
|
||||||
|
|
||||||
receiverInterface *thisReceiver;
|
receiverInterface *thisReceiver;
|
||||||
|
|
||||||
/** socket for control commands */
|
/** socket for control commands */
|
||||||
@ -2014,10 +1927,10 @@ private:
|
|||||||
sls_detector_module *detectorModules;
|
sls_detector_module *detectorModules;
|
||||||
|
|
||||||
/** pointer to dac valuse in shared memory */
|
/** pointer to dac valuse in shared memory */
|
||||||
dacs_t *dacs;
|
int *dacs;
|
||||||
|
|
||||||
/** pointer to adc valuse in shared memory */
|
/** pointer to adc valuse in shared memory */
|
||||||
dacs_t *adcs;
|
int *adcs;
|
||||||
|
|
||||||
/** pointer to chip registers in shared memory */
|
/** pointer to chip registers in shared memory */
|
||||||
int *chipregs;
|
int *chipregs;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -852,13 +852,6 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
|
|||||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettingsDir;
|
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettingsDir;
|
||||||
++i;
|
++i;
|
||||||
|
|
||||||
/*! \page settings
|
|
||||||
- <b>caldir [dir]</b> Sets/gets the directory where the calibration files are located. \c Returns \c (string) dir
|
|
||||||
*/
|
|
||||||
descrToFuncMap[i].m_pFuncName="caldir"; //OK
|
|
||||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdCalDir;
|
|
||||||
++i;
|
|
||||||
|
|
||||||
/*! \page settings
|
/*! \page settings
|
||||||
- <b>trimen [n e0 e1...e(n-1)]</b> Sets/gets the number of energies n at which the detector has default trim file and their values in eV (int). \c Returns \c (int int...) n e0 e1...e(n-1)
|
- <b>trimen [n e0 e1...e(n-1)]</b> Sets/gets the number of energies n at which the detector has default trim file and their values in eV (int). \c Returns \c (int int...) n e0 e1...e(n-1)
|
||||||
*/
|
*/
|
||||||
@ -2476,32 +2469,6 @@ string slsDetectorCommand::helpSettingsDir(int action){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
string slsDetectorCommand::cmdCalDir(int narg, char *args[], int action, int detPos){
|
|
||||||
|
|
||||||
if (action==HELP_ACTION) {
|
|
||||||
return helpCalDir(action);
|
|
||||||
}
|
|
||||||
if (action==PUT_ACTION) {
|
|
||||||
myDet->setCalDir(string(args[1]), detPos);
|
|
||||||
}
|
|
||||||
if ( (myDet->getCalDir(detPos)).empty() )
|
|
||||||
return string("undefined");
|
|
||||||
return myDet->getCalDir(detPos);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
string slsDetectorCommand::helpCalDir(int action){
|
|
||||||
ostringstream os;
|
|
||||||
if (action==GET_ACTION || action==HELP_ACTION)
|
|
||||||
os << string("caldir \t gets the directory where the calibration files are located\n");
|
|
||||||
if (action==PUT_ACTION || action==HELP_ACTION)
|
|
||||||
os << string("caldir dir \t sets the directory where the calibration files are located\n");
|
|
||||||
return os.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
string slsDetectorCommand::cmdTrimEn(int narg, char *args[], int action, int detPos){
|
string slsDetectorCommand::cmdTrimEn(int narg, char *args[], int action, int detPos){
|
||||||
int ival;
|
int ival;
|
||||||
int ip;
|
int ip;
|
||||||
@ -3890,7 +3857,7 @@ string slsDetectorCommand::cmdDAC(int narg, char *args[], int action, int detPos
|
|||||||
return helpDAC(action);
|
return helpDAC(action);
|
||||||
|
|
||||||
dacIndex dac;
|
dacIndex dac;
|
||||||
dacs_t val=-1;
|
int val=-1;
|
||||||
char answer[1000];
|
char answer[1000];
|
||||||
int mode=0;
|
int mode=0;
|
||||||
|
|
||||||
@ -5047,9 +5014,9 @@ string slsDetectorCommand::cmdReceiver(int narg, char *args[], int action, int d
|
|||||||
if (!sscanf(args[1],"%d",&ival))
|
if (!sscanf(args[1],"%d",&ival))
|
||||||
return string("Could not scan read frequency mode ")+string(args[1]);
|
return string("Could not scan read frequency mode ")+string(args[1]);
|
||||||
if(ival>=0)
|
if(ival>=0)
|
||||||
myDet->setReadReceiverFrequency(ival, detPos);
|
myDet->setReceiverStreamingFrequency(ival, detPos);
|
||||||
}
|
}
|
||||||
sprintf(answer,"%d",myDet->setReadReceiverFrequency(-1, detPos));
|
sprintf(answer,"%d",myDet->setReceiverStreamingFrequency(-1, detPos));
|
||||||
return string(answer);
|
return string(answer);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,6 @@ class slsDetectorCommand : public virtual slsDetectorDefs {
|
|||||||
static std::string helpUser(int action);
|
static std::string helpUser(int action);
|
||||||
static std::string helpExitServer(int action);
|
static std::string helpExitServer(int action);
|
||||||
static std::string helpSettingsDir(int action);
|
static std::string helpSettingsDir(int action);
|
||||||
static std::string helpCalDir(int action);
|
|
||||||
static std::string helpTrimEn(int action);
|
static std::string helpTrimEn(int action);
|
||||||
static std::string helpOutDir(int action);
|
static std::string helpOutDir(int action);
|
||||||
static std::string helpFileName(int action);
|
static std::string helpFileName(int action);
|
||||||
@ -109,7 +108,6 @@ class slsDetectorCommand : public virtual slsDetectorDefs {
|
|||||||
std::string cmdHelp(int narg, char *args[], int action, int detPos = -1);
|
std::string cmdHelp(int narg, char *args[], int action, int detPos = -1);
|
||||||
std::string cmdExitServer(int narg, char *args[], int action, int detPos = -1);
|
std::string cmdExitServer(int narg, char *args[], int action, int detPos = -1);
|
||||||
std::string cmdSettingsDir(int narg, char *args[], int action, int detPos = -1);
|
std::string cmdSettingsDir(int narg, char *args[], int action, int detPos = -1);
|
||||||
std::string cmdCalDir(int narg, char *args[], int action, int detPos = -1);
|
|
||||||
std::string cmdTrimEn(int narg, char *args[], int action, int detPos = -1);
|
std::string cmdTrimEn(int narg, char *args[], int action, int detPos = -1);
|
||||||
std::string cmdOutDir(int narg, char *args[], int action, int detPos = -1);
|
std::string cmdOutDir(int narg, char *args[], int action, int detPos = -1);
|
||||||
std::string cmdFileName(int narg, char *args[], int action, int detPos = -1);
|
std::string cmdFileName(int narg, char *args[], int action, int detPos = -1);
|
||||||
|
@ -18,74 +18,13 @@ slsDetectorUsers::slsDetectorUsers(int& ret, int id) : myDetector(0), myCmd(0){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
slsDetectorUsers::~slsDetectorUsers() {
|
slsDetectorUsers::~slsDetectorUsers() {
|
||||||
if (myDetector)
|
if (myDetector)
|
||||||
delete myDetector;
|
delete myDetector;
|
||||||
}
|
}
|
||||||
|
|
||||||
string slsDetectorUsers::getDetectorDeveloper(){
|
int slsDetectorUsers::getNumberOfDetectors() {
|
||||||
return myDetector->getDetectorDeveloper();
|
return myDetector->getNumberOfDetectors();
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::setOnline(int const online){
|
|
||||||
return myDetector->setOnline(online);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::setReceiverOnline(int const online){
|
|
||||||
return myDetector->setReceiverOnline(online);
|
|
||||||
}
|
|
||||||
|
|
||||||
void slsDetectorUsers::startMeasurement(){
|
|
||||||
myDetector->acquire(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::stopMeasurement(){
|
|
||||||
return myDetector->stopAcquisition();
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::getDetectorStatus(){
|
|
||||||
return (int)myDetector->getRunStatus();
|
|
||||||
}
|
|
||||||
|
|
||||||
string slsDetectorUsers::getFilePath(){
|
|
||||||
return myDetector->getFilePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
string slsDetectorUsers::setFilePath(string s){
|
|
||||||
return myDetector->setFilePath(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
string slsDetectorUsers::getFileName(){
|
|
||||||
return myDetector->getFileName();
|
|
||||||
}
|
|
||||||
|
|
||||||
string slsDetectorUsers::setFileName(string s){
|
|
||||||
return myDetector->setFileName(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::getFileIndex(){
|
|
||||||
return (int)myDetector->getFileIndex();
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::setFileIndex(int i){
|
|
||||||
return (int)myDetector->setFileIndex(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::enableCountRateCorrection(int i){
|
|
||||||
return myDetector->enableCountRateCorrection(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::enableWriteToFile(int i){
|
|
||||||
return myDetector->enableWriteToFile(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::getDetectorSize(int &x0, int &y0, int &nx, int &ny){
|
|
||||||
y0=0;
|
|
||||||
x0=0;
|
|
||||||
nx=myDetector->getTotalNumberOfChannels(slsDetectorDefs::X);
|
|
||||||
ny=myDetector->getTotalNumberOfChannels(slsDetectorDefs::Y);
|
|
||||||
return nx*ny;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::getMaximumDetectorSize(int &nx, int &ny){
|
int slsDetectorUsers::getMaximumDetectorSize(int &nx, int &ny){
|
||||||
@ -94,182 +33,343 @@ int slsDetectorUsers::getMaximumDetectorSize(int &nx, int &ny){
|
|||||||
return nx*ny;
|
return nx*ny;
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::setBitDepth(int i){
|
int slsDetectorUsers::getDetectorSize(int &x, int &y, int &nx, int &ny, int detPos){
|
||||||
return myDetector->setDynamicRange(i);
|
if (detPos < 0) {
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
} else {
|
||||||
|
x = myDetector->getDetectorOffset(slsDetectorDefs::X, detPos);
|
||||||
|
y = myDetector->getDetectorOffset(slsDetectorDefs::Y, detPos);
|
||||||
|
}
|
||||||
|
nx=myDetector->getTotalNumberOfChannels(slsDetectorDefs::X, detPos);
|
||||||
|
ny=myDetector->getTotalNumberOfChannels(slsDetectorDefs::Y, detPos);
|
||||||
|
return nx*ny;
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::setSettings(int isettings){
|
string slsDetectorUsers::getDetectorType(int detPos){
|
||||||
return myDetector->slsDetectorBase::setSettings(isettings);
|
return myDetector->sgetDetectorsType(detPos);
|
||||||
|
}
|
||||||
|
int slsDetectorUsers::setOnline(int const online, int detPos){
|
||||||
|
return myDetector->setOnline(online, detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::getThresholdEnergy(){
|
int slsDetectorUsers::setReceiverOnline(int const online, int detPos){
|
||||||
return myDetector->getThresholdEnergy(-1);
|
return myDetector->setReceiverOnline(online, detPos);
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::setThresholdEnergy(int e_eV){
|
|
||||||
return myDetector->setThresholdEnergy(e_eV);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::setThresholdEnergy(int e_ev, int tb, int isettings, int id) {
|
|
||||||
return myDetector->slsDetectorBase::setThresholdEnergy(e_ev, tb, isettings, id);
|
|
||||||
}
|
|
||||||
|
|
||||||
double slsDetectorUsers::setExposureTime(double t, bool inseconds, int imod){
|
|
||||||
if(!inseconds)
|
|
||||||
return myDetector->setExposureTime((int64_t)t,imod);
|
|
||||||
|
|
||||||
// + 0.5 to round for precision lost from converting double to int64_t
|
|
||||||
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
|
|
||||||
if (t < 0) tms = -1;
|
|
||||||
tms = myDetector->setExposureTime(tms,imod);
|
|
||||||
if (tms < 0)
|
|
||||||
return -1;
|
|
||||||
return ((1E-9) * (double)tms);
|
|
||||||
}
|
|
||||||
|
|
||||||
double slsDetectorUsers::setExposurePeriod(double t, bool inseconds, int imod){
|
|
||||||
if(!inseconds)
|
|
||||||
return myDetector->setExposurePeriod((int64_t)t,imod);
|
|
||||||
|
|
||||||
// + 0.5 to round for precision lost from converting double to int64_t
|
|
||||||
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
|
|
||||||
if (t < 0) tms = -1;
|
|
||||||
tms = myDetector->setExposurePeriod(tms,imod);
|
|
||||||
if (tms < 0)
|
|
||||||
return -1;
|
|
||||||
return ((1E-9) * (double)tms);
|
|
||||||
}
|
|
||||||
|
|
||||||
double slsDetectorUsers::setDelayAfterTrigger(double t, bool inseconds, int imod){
|
|
||||||
if(!inseconds)
|
|
||||||
return myDetector->setDelayAfterTrigger((int64_t)t,imod);
|
|
||||||
|
|
||||||
// + 0.5 to round for precision lost from converting double to int64_t
|
|
||||||
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
|
|
||||||
if (t < 0) tms = -1;
|
|
||||||
tms = myDetector->setDelayAfterTrigger(tms,imod);
|
|
||||||
if (tms < 0)
|
|
||||||
return -1;
|
|
||||||
return ((1E-9) * (double)tms);
|
|
||||||
}
|
|
||||||
|
|
||||||
int64_t slsDetectorUsers::setNumberOfGates(int64_t t, int imod){
|
|
||||||
return myDetector->setNumberOfGates(t,imod);
|
|
||||||
}
|
|
||||||
|
|
||||||
int64_t slsDetectorUsers::setNumberOfFrames(int64_t t, int imod){
|
|
||||||
return myDetector->setNumberOfFrames(t,imod);
|
|
||||||
}
|
|
||||||
|
|
||||||
int64_t slsDetectorUsers::setNumberOfCycles(int64_t t, int imod){
|
|
||||||
return myDetector->setNumberOfCycles(t,imod);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::setTimingMode(int pol){
|
|
||||||
return myDetector->setTimingMode(pol);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::readConfigurationFile(string const fname){
|
int slsDetectorUsers::readConfigurationFile(string const fname){
|
||||||
return myDetector->readConfigurationFile(fname);
|
return myDetector->readConfigurationFile(fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::dumpDetectorSetup(string const fname){
|
int slsDetectorUsers::writeConfigurationFile(string const fname){
|
||||||
return myDetector->dumpDetectorSetup(fname);
|
return myDetector->writeConfigurationFile(fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::retrieveDetectorSetup(string const fname){
|
int slsDetectorUsers::retrieveDetectorSetup(string const fname){
|
||||||
return myDetector->retrieveDetectorSetup(fname);
|
return myDetector->retrieveDetectorSetup(fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
string slsDetectorUsers::getDetectorType(){
|
int slsDetectorUsers::dumpDetectorSetup(string const fname){
|
||||||
return myDetector->sgetDetectorsType();
|
return myDetector->dumpDetectorSetup(fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::setReceiverMode(int n){
|
int64_t slsDetectorUsers::getDetectorFirmwareVersion(int detPos){
|
||||||
return myDetector->setReadReceiverFrequency(n);
|
return myDetector->getId(slsDetectorDefs::DETECTOR_FIRMWARE_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::enableDataStreamingFromReceiver(int i){
|
int64_t slsDetectorUsers::getDetectorSerialNumber(int detPos){
|
||||||
return myDetector->enableDataStreamingFromReceiver(i);
|
return myDetector->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int64_t slsDetectorUsers::getDetectorSoftwareVersion(int detPos){
|
||||||
|
return myDetector->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int64_t slsDetectorUsers::getClientSoftwareVersion(int detPos){
|
||||||
|
return myDetector->getId(slsDetectorDefs::THIS_SOFTWARE_VERSION, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int64_t slsDetectorUsers::getReceiverSoftwareVersion(int detPos){
|
||||||
|
return myDetector->getId(slsDetectorDefs::RECEIVER_VERSION, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isDetectorVersionCompatible(int detPos) {
|
||||||
|
return (myDetector->checkVersionCompatibility(slsDetectorDefs::CONTROL_PORT, detPos) == OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isReceiverVersionCompatible(int detPos) {
|
||||||
|
return (myDetector->checkVersionCompatibility(slsDetectorDefs::DATA_PORT, detPos) == OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::startMeasurement(){
|
||||||
|
return myDetector->acquire();
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::stopMeasurement(int detPos){
|
||||||
|
return myDetector->stopAcquisition(detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::getDetectorStatus(int detPos){
|
||||||
|
return (int)myDetector->getRunStatus(detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::startAcquisition(int detPos) {
|
||||||
|
return myDetector->startAcquisition(detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::stopAcquisition(int detPos) {
|
||||||
|
return myDetector->stopAcquisition(detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::sendSoftwareTrigger(int detPos) {
|
||||||
|
return myDetector->sendSoftwareTrigger(detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::enableCountRateCorrection(int i, int detPos){
|
||||||
|
if (i == 0)
|
||||||
|
myDetector->setRateCorrection(0, detPos);
|
||||||
|
else
|
||||||
|
myDetector->setRateCorrection(-1, detPos);
|
||||||
|
|
||||||
|
return myDetector->getRateCorrection(detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setBitDepth(int i, int detPos){
|
||||||
|
return myDetector->setDynamicRange(i, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setSettings(int isettings, int detPos){
|
||||||
|
return myDetector->slsDetectorBase::setSettings(isettings, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::getThresholdEnergy(int detPos){
|
||||||
|
return myDetector->getThresholdEnergy(detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setThresholdEnergy(int e_eV){
|
||||||
|
return myDetector->setThresholdEnergy(e_eV);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setThresholdEnergy(int e_ev, int tb, int isettings, int detPos) {
|
||||||
|
return myDetector->setThresholdEnergy(e_ev, tb,
|
||||||
|
(isettings == -1) ? slsDetectorDefs::GET_SETTINGS : isettings,
|
||||||
|
detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
double slsDetectorUsers::setExposureTime(double t, bool inseconds, int detPos){
|
||||||
|
return myDetector->setExposureTime(t, inseconds, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
double slsDetectorUsers::setExposurePeriod(double t, bool inseconds, int detPos){
|
||||||
|
return myDetector->setExposurePeriod(t, inseconds, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
double slsDetectorUsers::setDelayAfterTrigger(double t, bool inseconds, int detPos){
|
||||||
|
return myDetector->setDelayAfterTrigger(t, inseconds, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
double slsDetectorUsers::setSubFrameExposureTime(double t, bool inseconds, int detPos){
|
||||||
|
return myDetector->setSubFrameExposureTime(t, inseconds, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
double slsDetectorUsers::setSubFrameExposureDeadTime(double t, bool inseconds, int detPos){
|
||||||
|
return myDetector->setSubFrameExposureDeadTime(t, inseconds, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int64_t slsDetectorUsers::setNumberOfFrames(int64_t t, int detPos){
|
||||||
|
return myDetector->setNumberOfFrames(t, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int64_t slsDetectorUsers::setNumberOfCycles(int64_t t, int detPos){
|
||||||
|
return myDetector->setNumberOfCycles(t, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int64_t slsDetectorUsers::setNumberOfGates(int64_t t, int detPos){
|
||||||
|
return myDetector->setNumberOfGates(t, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int64_t slsDetectorUsers::setNumberOfStorageCells(int64_t t, int detPos) {
|
||||||
|
return myDetector->setNumberOfStorageCells(t, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
double slsDetectorUsers::getMeasuredPeriod(bool inseconds, int detPos) {
|
||||||
|
return myDetector->getMeasuredPeriod(inseconds, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
double slsDetectorUsers::getMeasuredSubFramePeriod(bool inseconds, int detPos) {
|
||||||
|
return myDetector->getMeasuredSubFramePeriod(inseconds, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setTimingMode(int pol, int detPos){
|
||||||
|
return myDetector->setExternalCommunicationMode(slsDetectorDefs::externalCommunicationMode(pol), detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setClockDivider(int value, int detPos) {
|
||||||
|
return myDetector->setSpeed(slsDetectorDefs::CLOCK_DIVIDER, value, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setParallelMode(int value, int detPos) {
|
||||||
|
if(value >= 0)
|
||||||
|
myDetector->setReadOutFlags(slsDetectorDefs::readOutFlags(value), detPos);
|
||||||
|
return myDetector->setReadOutFlags(-1, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setOverflowMode(int value, int detPos) {
|
||||||
|
if(value >= 0) {
|
||||||
|
if (value == 1)
|
||||||
|
myDetector->setReadOutFlags(slsDetectorDefs::SHOW_OVERFLOW, detPos);
|
||||||
|
else
|
||||||
|
myDetector->setReadOutFlags(slsDetectorDefs::NOOVERFLOW, detPos);
|
||||||
|
}
|
||||||
|
int ret = myDetector->setReadOutFlags(-1, detPos);
|
||||||
|
if (ret == -1)
|
||||||
|
return -1;
|
||||||
|
return ((ret & slsDetectorDefs::SHOW_OVERFLOW) ? 1 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setAllTrimbits(int val, int detPos) {
|
||||||
|
return myDetector->setAllTrimbits(val, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setDAC(int val, int index , int detPos) {
|
||||||
|
return myDetector->setDAC(val, dacsIndex(index), 0, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::getADC(int index, int detPos) {
|
||||||
|
return myDetector->getADC(dacsIndex(index),detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setTenGigabitEthernet(int i, int detPos) {
|
||||||
|
return myDetector->enableTenGigabitEthernet(i, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setStoragecellStart(int pos) {
|
||||||
|
return myDetector->setStoragecellStart(pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setHighVoltage(int i, int detPos) {
|
||||||
|
return myDetector->setDAC(i, slsDetectorDefs::HV_NEW, 0, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setFlowControl10G(int i, int detPos) {
|
||||||
|
return myDetector->setFlowControl10G(i, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************
|
||||||
|
|
||||||
|
RECEIVER FUNCTIONS
|
||||||
|
|
||||||
|
*********************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
int slsDetectorUsers::startReceiver(int detPos) {
|
||||||
|
return myDetector->startReceiver(detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::stopReceiver(int detPos) {
|
||||||
|
return myDetector->stopReceiver(detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setReceiverSilentMode(int i, int detPos) {
|
||||||
|
return myDetector->setReceiverSilentMode(i, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::resetFramesCaughtInReceiver(int detPos) {
|
||||||
|
return myDetector->resetFramesCaught(detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setReceiverFifoDepth(int i, int detPos) {
|
||||||
|
return myDetector->setReceiverFifoDepth(i, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
string slsDetectorUsers::getFilePath(int detPos){
|
||||||
|
return myDetector->getFilePath(detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
string slsDetectorUsers::setFilePath(string s, int detPos){
|
||||||
|
return myDetector->setFilePath(s, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
string slsDetectorUsers::getFileName(int detPos){
|
||||||
|
return myDetector->getFileName(detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
string slsDetectorUsers::setFileName(string s, int detPos){
|
||||||
|
return myDetector->setFileName(s, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::getFileIndex(int detPos){
|
||||||
|
return (int)myDetector->getFileIndex(detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setFileIndex(int i, int detPos){
|
||||||
|
return (int)myDetector->setFileIndex(i, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::enableWriteToFile(int enable, int detPos){
|
||||||
|
return myDetector->enableWriteToFile(enable, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::enableOverwriteFile(int enable, int detPos){
|
||||||
|
return myDetector->overwriteFile(enable, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setReceiverStreamingFrequency(int freq, int detPos){
|
||||||
|
return myDetector->setReceiverStreamingFrequency(freq, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
int slsDetectorUsers::setReceiverStreamingTimer(int time_in_ms, int detPos){
|
||||||
|
return myDetector->setReceiverStreamingTimer(time_in_ms, detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::enableDataStreamingToClient(int i){
|
int slsDetectorUsers::enableDataStreamingToClient(int i){
|
||||||
return myDetector->enableDataStreamingToClient(i);
|
return myDetector->enableDataStreamingToClient(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::setReceiverDataStreamingOutPort(int i){
|
int slsDetectorUsers::enableDataStreamingFromReceiver(int i, int detPos){
|
||||||
return myDetector->setReceiverDataStreamingOutPort(i);
|
return myDetector->enableDataStreamingFromReceiver(i, detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::setClientDataStreamingInPort(int i){
|
int slsDetectorUsers::setReceiverDataStreamingOutPort(int i, int detPos){
|
||||||
return myDetector->setClientDataStreamingInPort(i);
|
return myDetector->setReceiverDataStreamingOutPort(i, detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
string slsDetectorUsers::setReceiverDataStreamingOutIP(string ip){
|
int slsDetectorUsers::setClientDataStreamingInPort(int i, int detPos){
|
||||||
return myDetector->setReceiverDataStreamingOutIP(ip);
|
return myDetector->setClientDataStreamingInPort(i, detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
string slsDetectorUsers::setClientDataStreamingInIP(string ip){
|
string slsDetectorUsers::setReceiverDataStreamingOutIP(string ip, int detPos){
|
||||||
return myDetector->setClientDataStreamingInIP(ip);
|
return myDetector->setReceiverDataStreamingOutIP(ip, detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t slsDetectorUsers::getDetectorFirmwareVersion(){
|
string slsDetectorUsers::setClientDataStreamingInIP(string ip, int detPos){
|
||||||
return myDetector->getDetectorFirmwareVersion();
|
return myDetector->setClientDataStreamingInIP(ip, detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t slsDetectorUsers::getDetectorSerialNumber(){
|
int slsDetectorUsers::enableGapPixels(int enable, int detPos) {
|
||||||
return myDetector->getDetectorSerialNumber();
|
return myDetector->enableGapPixels(enable, detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t slsDetectorUsers::getDetectorSoftwareVersion(){
|
int slsDetectorUsers::setReceiverFramesDiscardPolicy(int f, int detPos) {
|
||||||
return myDetector->getDetectorSoftwareVersion();
|
return myDetector->setReceiverFramesDiscardPolicy(slsDetectorDefs::frameDiscardPolicy(f), detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t slsDetectorUsers::getThisSoftwareVersion(){
|
int slsDetectorUsers::setReceiverPartialFramesPadding(int f, int detPos) {
|
||||||
return myDetector->getThisSoftwareVersion();
|
return myDetector->setReceiverPartialFramesPadding(f, detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::enableGapPixels(int enable) {
|
int slsDetectorUsers::setReceiverFramesPerFile(int f, int detPos) {
|
||||||
return myDetector->enableGapPixels(enable);
|
return myDetector->setReceiverFramesPerFile(f, detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string slsDetectorUsers::setReceiverFramesDiscardPolicy(std::string f) {
|
|
||||||
return myDetector->getReceiverFrameDiscardPolicy(
|
|
||||||
myDetector->setReceiverFramesDiscardPolicy(
|
|
||||||
myDetector->getReceiverFrameDiscardPolicy(f)));
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::setReceiverPartialFramesPadding(int f) {
|
|
||||||
return myDetector->setReceiverPartialFramesPadding(f);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::setReceiverFramesPerFile(int f) {
|
/************************************************************************
|
||||||
return myDetector->setReceiverFramesPerFile(f);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::sendSoftwareTrigger() {
|
CALLBACKS & COMMAND LINE PARSING
|
||||||
return myDetector->sendSoftwareTrigger();
|
|
||||||
}
|
|
||||||
|
|
||||||
double slsDetectorUsers::getMeasuredPeriod(bool inseconds, int imod) {
|
*********************************************************************/
|
||||||
if(!inseconds)
|
|
||||||
return myDetector->getTimeLeft(slsReceiverDefs::MEASURED_PERIOD, imod);
|
|
||||||
|
|
||||||
int64_t tms = myDetector->getTimeLeft(slsReceiverDefs::MEASURED_PERIOD, imod);
|
|
||||||
if (tms < 0)
|
|
||||||
return -1;
|
|
||||||
return ((1E-9) * (double)tms);
|
|
||||||
}
|
|
||||||
|
|
||||||
double slsDetectorUsers::getMeasuredSubFramePeriod(bool inseconds, int imod) {
|
|
||||||
if(!inseconds)
|
|
||||||
return myDetector->getTimeLeft(slsReceiverDefs::MEASURED_SUBPERIOD, imod);
|
|
||||||
|
|
||||||
int64_t tms = myDetector->getTimeLeft(slsReceiverDefs::MEASURED_SUBPERIOD, imod);
|
|
||||||
if (tms < 0)
|
|
||||||
return -1;
|
|
||||||
return ((1E-9) * (double)tms);
|
|
||||||
}
|
|
||||||
|
|
||||||
void slsDetectorUsers::registerDataCallback(int( *userCallback)(detectorData*, int, int, void*), void *pArg) {
|
void slsDetectorUsers::registerDataCallback(int( *userCallback)(detectorData*, int, int, void*), void *pArg) {
|
||||||
myDetector->registerDataCallback(userCallback,pArg);
|
myDetector->registerDataCallback(userCallback,pArg);
|
||||||
@ -279,6 +379,14 @@ void slsDetectorUsers::registerAcquisitionFinishedCallback(int( *func)(double,in
|
|||||||
myDetector->registerAcquisitionFinishedCallback(func,pArg);
|
myDetector->registerAcquisitionFinishedCallback(func,pArg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void slsDetectorUsers::registerMeasurementFinishedCallback(int( *func)(int,int, void*), void *pArg) {
|
||||||
|
myDetector->registerMeasurementFinishedCallback(func,pArg);
|
||||||
|
}
|
||||||
|
|
||||||
|
void slsDetectorUsers::registerProgressCallback(int( *func)(double,void*), void *pArg) {
|
||||||
|
myDetector->registerProgressCallback(func,pArg);
|
||||||
|
}
|
||||||
|
|
||||||
string slsDetectorUsers::putCommand(int narg, char *args[], int pos){
|
string slsDetectorUsers::putCommand(int narg, char *args[], int pos){
|
||||||
if(narg < 2)
|
if(narg < 2)
|
||||||
return string("Error: Insufficient Parameters");
|
return string("Error: Insufficient Parameters");
|
||||||
@ -292,114 +400,12 @@ string slsDetectorUsers::getCommand(int narg, char *args[], int pos){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int slsDetectorUsers::setClockDivider(int value) {
|
|
||||||
return myDetector->setClockDivider(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::setParallelMode(int value) {
|
|
||||||
if(value >= 0)
|
|
||||||
myDetector->setParallelMode(value);
|
|
||||||
return myDetector->getParallelMode();
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::setOverflowMode(int value) {
|
|
||||||
if(value >= 0)
|
|
||||||
myDetector->setOverflowMode(value);
|
|
||||||
return myDetector->getOverflowMode();
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::setAllTrimbits(int val, int id) {
|
|
||||||
return myDetector->setAllTrimbits(val, id);
|
|
||||||
}
|
|
||||||
|
|
||||||
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(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();
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::stopAcquisition() {
|
|
||||||
return myDetector->stopAcquisition();
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::setReceiverSilentMode(int i) {
|
|
||||||
return myDetector->setReceiverSilentMode(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::setHighVoltage(int i) {
|
|
||||||
return myDetector->setHighVoltage(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::resetFramesCaughtInReceiver() {
|
|
||||||
return myDetector->resetFramesCaught();
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::setReceiverFifoDepth(int i) {
|
|
||||||
return myDetector->setReceiverFifoDepth(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::setFlowControl10G(int i) {
|
|
||||||
return myDetector->setFlowControl10G(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::setTenGigabitEthernet(int i) {
|
|
||||||
return myDetector->enableTenGigabitEthernet(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::getNumberOfDetectors() {
|
|
||||||
return myDetector->getNumberOfDetectors();
|
|
||||||
}
|
|
||||||
|
|
||||||
double slsDetectorUsers::setSubFrameExposureTime(double t, bool inseconds, int imod){
|
|
||||||
if(!inseconds)
|
|
||||||
return myDetector->setSubFrameExposureTime((int64_t)t,imod);
|
|
||||||
else {
|
|
||||||
// + 0.5 to round for precision lost from converting double to int64_t
|
|
||||||
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
|
|
||||||
if (t < 0) tms = -1;
|
|
||||||
tms = myDetector->setSubFrameExposureTime(tms,imod);
|
|
||||||
if (tms < 0)
|
|
||||||
return -1;
|
|
||||||
return ((1E-9) * (double)tms);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
double slsDetectorUsers::setSubFrameExposureDeadTime(double t, bool inseconds, int imod){
|
|
||||||
if(!inseconds)
|
|
||||||
return myDetector->setSubFrameDeadTime((int64_t)t,imod);
|
|
||||||
else {
|
|
||||||
// + 0.5 to round for precision lost from converting double to int64_t
|
|
||||||
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
|
|
||||||
if (t < 0) tms = -1;
|
|
||||||
tms = myDetector->setSubFrameDeadTime(tms,imod);
|
|
||||||
if (tms < 0)
|
|
||||||
return -1;
|
|
||||||
return ((1E-9) * (double)tms);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int64_t slsDetectorUsers::setNumberOfStorageCells(int64_t t, int imod) {
|
|
||||||
return myDetector->setTimer(slsReceiverDefs::STORAGE_CELL_NUMBER, t, imod);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::setStoragecellStart(int pos) {
|
|
||||||
return myDetector->setStoragecellStart(pos);
|
|
||||||
}
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -6,10 +6,7 @@ include_directories(
|
|||||||
../../commonfiles
|
../../commonfiles
|
||||||
../multiSlsDetector
|
../multiSlsDetector
|
||||||
../slsDetector
|
../slsDetector
|
||||||
../slsDetectorAnalysis
|
|
||||||
../slsReceiverInterface
|
../slsReceiverInterface
|
||||||
../usersFunctions
|
|
||||||
../MySocketTCP
|
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(sls_detector_get
|
add_executable(sls_detector_get
|
||||||
|
@ -4,7 +4,7 @@ CFLAGS= -DC_ONLY
|
|||||||
#FLAGS=-DVERBOSE
|
#FLAGS=-DVERBOSE
|
||||||
#ASM=$(shell echo "/lib/modules/`uname -r`/build/include")
|
#ASM=$(shell echo "/lib/modules/`uname -r`/build/include")
|
||||||
|
|
||||||
INCLUDES?= -I../../commonfiles -I../slsDetector -I ../MySocketTCP -I../usersFunctions -I../multiSlsDetector -I../slsDetectorAnalysis -I../slsReceiverInterface -I ../../slsReceiverSoftware/include -I$(shell echo "/lib/modules/`uname -r`/build/include")
|
INCLUDES?= -I../../commonfiles -I../slsDetector -I../multiSlsDetector -I../slsReceiverInterface -I$(shell echo "/lib/modules/`uname -r`/build/include")
|
||||||
DESTDIR ?= ../../bin
|
DESTDIR ?= ../../bin
|
||||||
BIN=$(DESTDIR)
|
BIN=$(DESTDIR)
|
||||||
LIBS?= -L$(DESTDIR) -lSlsDetector
|
LIBS?= -L$(DESTDIR) -lSlsDetector
|
||||||
|
Loading…
x
Reference in New Issue
Block a user