mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 23:30: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
|
||||
#define COULDNOT_SET_NETWORK_PARAMETER 0x0000000000000001ULL
|
||||
#define COULDNOT_SET_ROI 0x0000000000000002ULL
|
||||
#define RECEIVER_READ_FREQUENCY 0x0000000000000004ULL
|
||||
#define RECEIVER_STREAMING_FREQUENCY 0x0000000000000004ULL
|
||||
#define SETTINGS_NOT_SET 0x0000000000000008ULL
|
||||
#define SETTINGS_FILE_NOT_OPEN 0x0000000000000010ULL
|
||||
#define DETECTOR_TIMER_VALUE_NOT_SET 0x0000000000000020ULL
|
||||
@ -81,7 +81,7 @@
|
||||
#define DATA_STREAMING 0x0000000000400000ULL
|
||||
#define RESET_ERROR 0x0000000000800000ULL
|
||||
#define POWER_CHIP 0x0000000001000000ULL
|
||||
#define RECEIVER_READ_TIMER 0x0000000002000000ULL
|
||||
#define RECEIVER_STREAMING_TIMER 0x0000000002000000ULL
|
||||
#define RECEIVER_ACQ_TIME_NOT_SET 0x0000000004000000ULL
|
||||
#define RECEIVER_FLIPPED_DATA_NOT_SET 0x0000000008000000ULL
|
||||
#define THRESHOLD_NOT_SET 0x0000000010000000ULL
|
||||
@ -179,7 +179,7 @@ public:
|
||||
if(slsErrorMask&COULDNOT_SET_ROI)
|
||||
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");
|
||||
|
||||
if(slsErrorMask&SETTINGS_NOT_SET)
|
||||
@ -254,7 +254,7 @@ public:
|
||||
if(slsErrorMask&POWER_CHIP)
|
||||
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");
|
||||
|
||||
if(slsErrorMask&RECEIVER_FLIPPED_DATA_NOT_SET)
|
||||
|
@ -22,8 +22,6 @@
|
||||
|
||||
typedef char mystring[MAX_STR_LENGTH];
|
||||
|
||||
typedef int dacs_t;
|
||||
|
||||
|
||||
#define DEFAULT_DET_MAC "00:aa:bb:cc:dd:ee"
|
||||
#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 reg; /**< is the module register (e.g. dynamic range?)
|
||||
\see moduleRegisterBit */
|
||||
dacs_t *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 *dacs; /**< is the pointer to the array of the dac values (in V) */
|
||||
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
|
||||
\see ::chipRegisterBit */
|
||||
int *chanregs; /**< is the pointer to the array of the channel registers
|
||||
|
@ -28,7 +28,7 @@ enum recFuncs{
|
||||
//Acquisition setup functions
|
||||
F_SET_RECEIVER_TIMER, /**< set/get timer value */
|
||||
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
|
||||
F_GET_RECEIVER_STATUS, /**< gets the status of receiver listening mode */
|
||||
@ -51,7 +51,7 @@ enum recFuncs{
|
||||
|
||||
F_RECEIVER_ACTIVATE, /** < activate/deactivate readout */
|
||||
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_RECEIVER_FILE_FORMAT, /** < sets the receiver file format */
|
||||
|
||||
|
@ -5,9 +5,6 @@ set(SOURCES
|
||||
slsDetector/slsDetectorCommand.cpp
|
||||
slsDetector/slsDetector.cpp
|
||||
slsReceiverInterface/receiverInterface.cpp
|
||||
threadFiles/CondVar.cpp
|
||||
threadFiles/Mutex.cpp
|
||||
threadFiles/ThreadPool.cpp
|
||||
../commonFiles/utilities.cpp
|
||||
)
|
||||
|
||||
@ -20,11 +17,6 @@ multiSlsDetector
|
||||
sharedMemory
|
||||
slsDetector
|
||||
slsReceiverInterface
|
||||
threadFiles
|
||||
)
|
||||
|
||||
add_definitions(
|
||||
-DDACS_INT
|
||||
)
|
||||
|
||||
add_library(slsDetectorStatic STATIC
|
||||
|
@ -9,15 +9,15 @@ CFLAGS= -g -DC_ONLY -fPIC
|
||||
|
||||
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
|
||||
|
||||
LIBZMQDIR = ../commonFiles
|
||||
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
|
||||
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
|
||||
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 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)
|
||||
|
||||
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
|
||||
$(CXX) -o $@ -c $< $(INCLUDES) $(DFLAGS) -fPIC $(EPICSFLAGS) -pthread -lrt $(LIBZMQ) $(FLAGS)
|
||||
|
@ -101,13 +101,6 @@ INPUT = ../commonfiles/communication_funcs.h \
|
||||
slsDetector/slsDetectorUsers.h \
|
||||
slsDetector/detectorData.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/BinaryFileStatic.h \
|
||||
../slsReceiverSoftware/include/circularFifo.h \
|
||||
|
@ -486,7 +486,7 @@ void multiSlsDetector::initializeMembers(bool verify) {
|
||||
// get objects from single det shared memory (open)
|
||||
for (int i = 0; i < thisMultiDetector->numberOfDetectors; i++) {
|
||||
try {
|
||||
slsDetector* sdet = new slsDetector(detId, i, verify, this);
|
||||
slsDetector* sdet = new slsDetector(detId, i, verify);
|
||||
detectors.push_back(sdet);
|
||||
} catch (...) {
|
||||
// clear detectors list
|
||||
@ -620,7 +620,7 @@ void multiSlsDetector::addSlsDetector (std::string s) {
|
||||
|
||||
|
||||
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);
|
||||
thisMultiDetector->numberOfDetectors = detectors.size();
|
||||
|
||||
@ -724,13 +724,13 @@ int multiSlsDetector::setMaxNumberOfChannelsPerDetector(dimension d,int i) {
|
||||
}
|
||||
|
||||
|
||||
int multiSlsDetector::getDetectorOffset(dimension d, int pos) {
|
||||
return detectors[pos]->getDetectorOffset(d);
|
||||
int multiSlsDetector::getDetectorOffset(dimension d, int detPos) {
|
||||
return detectors[detPos]->getDetectorOffset(d);
|
||||
}
|
||||
|
||||
|
||||
void multiSlsDetector::setDetectorOffset(dimension d, int off, int pos) {
|
||||
detectors[pos]->setDetectorOffset(d, off);
|
||||
void multiSlsDetector::setDetectorOffset(dimension d, int off, int detPos) {
|
||||
detectors[detPos]->setDetectorOffset(d, off);
|
||||
}
|
||||
|
||||
|
||||
@ -871,6 +871,10 @@ void multiSlsDetector::updateOffsets() {
|
||||
thisMultiDetector->numberOfChannelInclGapPixels[Y] << std::endl
|
||||
<< std::endl;
|
||||
#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) {
|
||||
// single
|
||||
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) {
|
||||
// single
|
||||
if (detPos >= 0) {
|
||||
@ -1442,11 +1385,11 @@ int multiSlsDetector::readAll(int detPos) {
|
||||
int multiSlsDetector::configureMAC(int detPos) {
|
||||
// single
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->configureMAC();
|
||||
return detectors[detPos]->configureMAC(getNumberOfDetectors(Y));
|
||||
}
|
||||
|
||||
// multi
|
||||
auto r = parallelCall(&slsDetector::configureMAC);
|
||||
auto r = parallelCall(&slsDetector::configureMAC, getNumberOfDetectors(Y));
|
||||
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) {
|
||||
// single
|
||||
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
|
||||
if (detPos >= 0) {
|
||||
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);
|
||||
|
||||
// ignore slave values for hv (-999)
|
||||
dacs_t firstValue = r.front();
|
||||
int firstValue = r.front();
|
||||
for (const auto& value : r) {
|
||||
if ((value != -999) && (value != firstValue))
|
||||
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
|
||||
if (detPos >= 0) {
|
||||
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) {
|
||||
// single
|
||||
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) {
|
||||
// single
|
||||
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
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->setReadReceiverFrequency(freq);
|
||||
return detectors[detPos]->setReceiverStreamingFrequency(freq);
|
||||
}
|
||||
|
||||
// multi
|
||||
auto r = parallelCall(&slsDetector::setReadReceiverFrequency, freq);
|
||||
auto r = parallelCall(&slsDetector::setReceiverStreamingFrequency, freq);
|
||||
return sls::minusOneIfDifferent(r);
|
||||
}
|
||||
|
||||
|
||||
int multiSlsDetector::setReceiverReadTimer(int time_in_ms, int detPos) {
|
||||
int multiSlsDetector::setReceiverStreamingTimer(int time_in_ms, int detPos) {
|
||||
// single
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->setReceiverReadTimer(time_in_ms);
|
||||
return detectors[detPos]->setReceiverStreamingTimer(time_in_ms);
|
||||
}
|
||||
|
||||
// multi
|
||||
auto r = parallelCall(&slsDetector::setReceiverReadTimer, time_in_ms);
|
||||
auto r = parallelCall(&slsDetector::setReceiverStreamingTimer, time_in_ms);
|
||||
return sls::minusOneIfDifferent(r);
|
||||
}
|
||||
|
||||
|
||||
int multiSlsDetector::enableDataStreamingToClient(int enable, int detPos) {
|
||||
int multiSlsDetector::enableDataStreamingToClient(int enable) {
|
||||
if (enable >= 0) {
|
||||
//destroy data threads
|
||||
if (!enable)
|
||||
|
@ -308,9 +308,7 @@ public:
|
||||
std::string sgetDetectorsType(int detPos = -1);
|
||||
|
||||
/**
|
||||
* Just to overload getDetectorType from users
|
||||
* Concatenates string types of all sls detectors or
|
||||
* returns the detector type of the first sls detector
|
||||
* Gets Detector type (concatenates if different)
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns detector type of sls detector in position pos, if -1, concatenates
|
||||
*/
|
||||
@ -336,7 +334,6 @@ public:
|
||||
*/
|
||||
void getNumberOfDetectors(int& nx, int& ny);
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
@ -385,16 +382,18 @@ public:
|
||||
/**
|
||||
* Get Detector offset from shared memory in 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
|
||||
*/
|
||||
int getDetectorOffset(dimension d);
|
||||
int getDetectorOffset(dimension d, int detPos = -1);
|
||||
|
||||
/**
|
||||
* Set Detector offset in shared memory in dimension d
|
||||
* @param d dimension d
|
||||
* @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
|
||||
@ -522,21 +521,6 @@ public:
|
||||
*/
|
||||
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
|
||||
* file name extension is automatically generated.
|
||||
@ -555,24 +539,6 @@ public:
|
||||
*/
|
||||
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
|
||||
* @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);
|
||||
|
||||
/**
|
||||
* 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)
|
||||
* @param index timer index
|
||||
@ -688,7 +751,7 @@ public:
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @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
|
||||
@ -696,7 +759,7 @@ public:
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @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
|
||||
@ -758,6 +821,21 @@ public:
|
||||
*/
|
||||
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
|
||||
* @param p network parameter type
|
||||
@ -775,6 +853,54 @@ public:
|
||||
*/
|
||||
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)
|
||||
* @param mode testmode type
|
||||
@ -1257,33 +1383,31 @@ public:
|
||||
int overwriteFile(int enable=-1, int detPos = -1);
|
||||
|
||||
/**
|
||||
* Sets the read receiver frequency
|
||||
* if data required from receiver randomly readRxrFrequency=0,
|
||||
* else every nth frame to be sent to gui/callback
|
||||
* @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.
|
||||
* (previously setReadReceiverFrequency)
|
||||
* Sets the receiver streaming frequency
|
||||
* @param freq nth frame streamed out, if 0, streamed out at a timer of 200 ms
|
||||
* @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
|
||||
* if data required from receiver randomly readRxrFrequency=0,
|
||||
* then the timer between each data stream is set with time_in_ms
|
||||
* (previously setReceiverReadTimer)
|
||||
* Sets the receiver streaming timer
|
||||
* 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 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
|
||||
* @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
|
||||
*/
|
||||
int enableDataStreamingToClient(int enable=-1, int detPos = -1);
|
||||
int enableDataStreamingToClient(int enable=-1);
|
||||
|
||||
/**
|
||||
* Enable or disable streaming data from receiver to client
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -16,7 +16,7 @@ class multiSlsDetector;
|
||||
class SharedMemory;
|
||||
class receiverInterface;
|
||||
|
||||
#define SLS_SHMVERSION 0x181002
|
||||
#define SLS_SHMVERSION 0x181005
|
||||
#define NCHIPSMAX 10
|
||||
#define NCHANSMAX 65536
|
||||
#define NDACSMAX 16
|
||||
@ -63,6 +63,9 @@ private:
|
||||
* before starting the communication */
|
||||
char hostname[MAX_STR_LENGTH];
|
||||
|
||||
/** detector type \ see :: detectorType*/
|
||||
detectorType myDetectorType;
|
||||
|
||||
/** END OF FIXED PATTERN -----------------------------------------------*/
|
||||
|
||||
|
||||
@ -71,21 +74,18 @@ private:
|
||||
/** Detector offset in the X & Y direction in the multi detector structure */
|
||||
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 */
|
||||
int controlPort;
|
||||
|
||||
/** is the port used to stop the acquisition */
|
||||
int stopPort;
|
||||
|
||||
/** detector type \ see :: detectorType*/
|
||||
detectorType myDetectorType;
|
||||
|
||||
/** path of the trimbits/settings files */
|
||||
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 */
|
||||
int nTrimEn;
|
||||
|
||||
@ -126,9 +126,6 @@ private:
|
||||
* (i.e. if data are processed in a separate thread) */
|
||||
int threadedProcessing;
|
||||
|
||||
/** dead time (in ns) for rate corrections */
|
||||
double tDead;
|
||||
|
||||
/** number of rois defined */
|
||||
int nROI;
|
||||
|
||||
@ -289,51 +286,28 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//FIXME: all pos or id arguments needed only for same multi signature
|
||||
|
||||
/**
|
||||
* Constructor called when creating new shared memory
|
||||
* @param type detector type
|
||||
* @param multiId multi detector shared memory id
|
||||
* @param id sls detector id (position in detectors list)
|
||||
* @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
|
||||
* @param multiId multi detector shared memory id
|
||||
* @param id sls detector id (position in detectors list)
|
||||
* @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
|
||||
*/
|
||||
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
|
||||
* (if hostname/rx_hostname has been set/ sockets created)
|
||||
@ -345,10 +319,9 @@ public:
|
||||
/**
|
||||
* Get ID or version numbers
|
||||
* @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
|
||||
*/
|
||||
int64_t getId(idMode mode, int imod=0);
|
||||
int64_t getId(idMode mode);
|
||||
|
||||
/**
|
||||
* Free shared memory without creating objects
|
||||
@ -368,13 +341,6 @@ public:
|
||||
*/
|
||||
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
|
||||
* Connects to them to set up online flag
|
||||
@ -389,14 +355,6 @@ public:
|
||||
*/
|
||||
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
|
||||
* @returns OK, FAIL or undefined
|
||||
@ -456,17 +414,15 @@ public:
|
||||
|
||||
/**
|
||||
* Get Detector type from shared memory variable
|
||||
* @param pos insignificant
|
||||
* @returns detector type from shared memory variable
|
||||
*/
|
||||
detectorType getDetectorsType(int pos = -1);
|
||||
detectorType getDetectorsType();
|
||||
|
||||
/**
|
||||
* Gets string version of detector type from shared memory variable
|
||||
* @param pos insignificant
|
||||
* @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
|
||||
@ -537,6 +493,13 @@ public:
|
||||
*/
|
||||
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
|
||||
* @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);
|
||||
|
||||
|
||||
/**
|
||||
* Set/Gets TCP Port of detector or receiver
|
||||
* @param t port type
|
||||
@ -670,23 +632,21 @@ public:
|
||||
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
|
||||
* @param fname name of the file to be written
|
||||
* @param imod module number
|
||||
* @param iodelay io delay (detector specific)
|
||||
* @param tau tau (detector specific)
|
||||
* @returns OK or FAIL if the file could not be written
|
||||
* \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
|
||||
* @param imod module number (-1 all)
|
||||
* @returns current settings
|
||||
*/
|
||||
detectorSettings getSettings(int imod=-1);
|
||||
detectorSettings getSettings();
|
||||
|
||||
/**
|
||||
* Load detector settings from the settings file picked from the trimdir/settingsdir
|
||||
@ -694,39 +654,35 @@ public:
|
||||
* For Eiger, one must use threshold
|
||||
* Gotthard, Propix, Jungfrau and Moench only sends the settings enum to the detector
|
||||
* @param isettings settings
|
||||
* @param imod module number (-1 all)
|
||||
* @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)
|
||||
* Only the settings enum is sent to the detector, where it will
|
||||
* initialize al the dacs already hard coded in the detector server
|
||||
* @param isettings settings
|
||||
* @param imod module number (-1 all)
|
||||
* @returns current settings
|
||||
*/
|
||||
detectorSettings sendSettingsOnly(detectorSettings isettings, int imod=-1);
|
||||
detectorSettings sendSettingsOnly(detectorSettings isettings);
|
||||
|
||||
/**
|
||||
* Get threshold energy (Mythen and Eiger)
|
||||
* @param imod module number (-1 all)
|
||||
* @returns current threshold value for imod in ev (-1 failed)
|
||||
* @returns current threshold value in ev (-1 failed)
|
||||
*/
|
||||
int getThresholdEnergy(int imod=-1);
|
||||
int getThresholdEnergy();
|
||||
|
||||
|
||||
/**
|
||||
* Set threshold energy (Mythen and Eiger)
|
||||
* For Eiger, calls setThresholdEneryAndSettings
|
||||
* @param e_eV threshold in eV
|
||||
* @param imod module number (-1 all)
|
||||
* @param isettings ev. change settings
|
||||
* @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)
|
||||
@ -750,55 +706,21 @@ public:
|
||||
*/
|
||||
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
|
||||
* file name extension is automatically generated.
|
||||
* @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
|
||||
*/
|
||||
int loadSettingsFile(std::string fname, int imod=-1);
|
||||
int loadSettingsFile(std::string fname);
|
||||
|
||||
/**
|
||||
* Saves the modules settings/trimbits to a specific file
|
||||
* file name extension is automatically generated.
|
||||
* @param fname specific settings/trimbits file
|
||||
* @param imod module number (-1 for all)
|
||||
* returns OK or FAIL
|
||||
*/
|
||||
int saveSettingsFile(std::string fname, int imod=-1);
|
||||
|
||||
/**
|
||||
* 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);
|
||||
int saveSettingsFile(std::string fname);
|
||||
|
||||
/**
|
||||
* Get run status of the detector
|
||||
@ -849,28 +771,27 @@ public:
|
||||
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
|
||||
*/
|
||||
int configureMAC();
|
||||
int configureMAC(int ndety);
|
||||
|
||||
/**
|
||||
* Set/get timer value (not all implemented for all detectors)
|
||||
* @param index timer index
|
||||
* @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)
|
||||
*/
|
||||
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)
|
||||
* @param index timer index
|
||||
* @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)
|
||||
*/
|
||||
int64_t getTimeLeft(timerIndex index, int imod = -1);
|
||||
int64_t getTimeLeft(timerIndex index);
|
||||
|
||||
/**
|
||||
* Set speed
|
||||
@ -906,18 +827,16 @@ public:
|
||||
* @param val value (in V)
|
||||
* @param index DAC index
|
||||
* @param mV 0 in dac units or 1 in mV
|
||||
* @param imod module number (if -1 all modules)
|
||||
* @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
|
||||
* @param index adc(DAC) index
|
||||
* @param imod module number (if -1 all modules)
|
||||
* @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
|
||||
@ -1137,10 +1056,9 @@ public:
|
||||
/**
|
||||
* Execute a digital test (Gotthard, Mythen)
|
||||
* @param mode testmode type
|
||||
* @param imod module index (-1 for all)
|
||||
* @returns result of test
|
||||
*/
|
||||
int digitalTest(digitalTestMode mode, int imod=0);
|
||||
int digitalTest(digitalTestMode mode);
|
||||
|
||||
/**
|
||||
* Load dark or gain image to detector (Gotthard)
|
||||
@ -1260,10 +1178,9 @@ public:
|
||||
/**
|
||||
* Sets all the trimbits to a particular value (Eiger)
|
||||
* @param val trimbit value
|
||||
* @param imod module number, -1 means all modules
|
||||
* @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)
|
||||
@ -1318,26 +1235,23 @@ public:
|
||||
/**
|
||||
* Set/gets threshold temperature (Jungfrau)
|
||||
* @param val value in millidegrees, -1 gets
|
||||
* @param imod module number, -1 is all
|
||||
* @returns threshold temperature in millidegrees
|
||||
*/
|
||||
int setThresholdTemperature(int val=-1, int imod=-1);
|
||||
int setThresholdTemperature(int val=-1);
|
||||
|
||||
/**
|
||||
* Enables/disables temperature control (Jungfrau)
|
||||
* @param val value, -1 gets
|
||||
* @param imod module number, -1 is all
|
||||
* @returns temperature control enable
|
||||
*/
|
||||
int setTemperatureControl(int val=-1, int imod=-1);
|
||||
int setTemperatureControl(int val=-1);
|
||||
|
||||
/**
|
||||
* Resets/ gets over-temperature event (Jungfrau)
|
||||
* @param val value, -1 gets
|
||||
* @param imod module number, -1 is all
|
||||
* @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)
|
||||
@ -1403,10 +1317,9 @@ public:
|
||||
|
||||
/**
|
||||
* 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)
|
||||
*/
|
||||
sls_detector_module *getModule(int imod);
|
||||
sls_detector_module *getModule();
|
||||
|
||||
/**
|
||||
* Calibrate Pedestal (ChipTestBoard)
|
||||
@ -1506,6 +1419,8 @@ public:
|
||||
|
||||
/**
|
||||
* 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();
|
||||
|
||||
@ -1658,23 +1573,23 @@ public:
|
||||
int overwriteFile(int enable=-1);
|
||||
|
||||
/**
|
||||
* Sets the read receiver frequency
|
||||
* if data required from receiver randomly readRxrFrequency=0,
|
||||
* else every nth frame to be sent to gui/callback
|
||||
* @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.
|
||||
* @returns read receiver frequency
|
||||
* (previously setReadReceiverFrequency)
|
||||
* Sets the receiver streaming frequency
|
||||
* @param freq nth frame streamed out, if 0, streamed out at a timer of 200 ms
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns receiver streaming frequency
|
||||
*/
|
||||
int setReadReceiverFrequency(int freq=-1);
|
||||
int setReceiverStreamingFrequency(int freq=-1);
|
||||
|
||||
/**
|
||||
* Sets the read receiver timer
|
||||
* if data required from receiver randomly readRxrFrequency=0,
|
||||
* then the timer between each data stream is set with time_in_ms
|
||||
* (previously setReceiverReadTimer)
|
||||
* Sets the receiver streaming timer
|
||||
* 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
|
||||
* @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
|
||||
@ -1996,9 +1911,7 @@ private:
|
||||
/** Shared memory structure */
|
||||
sharedSlsDetector *thisDetector;
|
||||
|
||||
/** multiSlsDetector referece */
|
||||
multiSlsDetector *multiDet;
|
||||
|
||||
/** receiver interface */
|
||||
receiverInterface *thisReceiver;
|
||||
|
||||
/** socket for control commands */
|
||||
@ -2014,10 +1927,10 @@ private:
|
||||
sls_detector_module *detectorModules;
|
||||
|
||||
/** pointer to dac valuse in shared memory */
|
||||
dacs_t *dacs;
|
||||
int *dacs;
|
||||
|
||||
/** pointer to adc valuse in shared memory */
|
||||
dacs_t *adcs;
|
||||
int *adcs;
|
||||
|
||||
/** pointer to chip registers in shared memory */
|
||||
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;
|
||||
++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
|
||||
- <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){
|
||||
int ival;
|
||||
int ip;
|
||||
@ -3890,7 +3857,7 @@ string slsDetectorCommand::cmdDAC(int narg, char *args[], int action, int detPos
|
||||
return helpDAC(action);
|
||||
|
||||
dacIndex dac;
|
||||
dacs_t val=-1;
|
||||
int val=-1;
|
||||
char answer[1000];
|
||||
int mode=0;
|
||||
|
||||
@ -5047,9 +5014,9 @@ string slsDetectorCommand::cmdReceiver(int narg, char *args[], int action, int d
|
||||
if (!sscanf(args[1],"%d",&ival))
|
||||
return string("Could not scan read frequency mode ")+string(args[1]);
|
||||
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);
|
||||
|
||||
}
|
||||
|
@ -46,7 +46,6 @@ class slsDetectorCommand : public virtual slsDetectorDefs {
|
||||
static std::string helpUser(int action);
|
||||
static std::string helpExitServer(int action);
|
||||
static std::string helpSettingsDir(int action);
|
||||
static std::string helpCalDir(int action);
|
||||
static std::string helpTrimEn(int action);
|
||||
static std::string helpOutDir(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 cmdExitServer(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 cmdOutDir(int narg, char *args[], int action, int detPos = -1);
|
||||
std::string cmdFileName(int narg, char *args[], int action, int detPos = -1);
|
||||
|
@ -18,265 +18,373 @@ slsDetectorUsers::slsDetectorUsers(int& ret, int id) : myDetector(0), myCmd(0){
|
||||
|
||||
}
|
||||
|
||||
|
||||
slsDetectorUsers::~slsDetectorUsers() {
|
||||
if (myDetector)
|
||||
delete myDetector;
|
||||
if (myDetector)
|
||||
delete myDetector;
|
||||
}
|
||||
|
||||
string slsDetectorUsers::getDetectorDeveloper(){
|
||||
return myDetector->getDetectorDeveloper();
|
||||
}
|
||||
|
||||
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::getNumberOfDetectors() {
|
||||
return myDetector->getNumberOfDetectors();
|
||||
}
|
||||
|
||||
int slsDetectorUsers::getMaximumDetectorSize(int &nx, int &ny){
|
||||
nx=myDetector->getMaxNumberOfChannelsPerDetector(slsDetectorDefs::X);
|
||||
ny=myDetector->getMaxNumberOfChannelsPerDetector(slsDetectorDefs::Y);
|
||||
return nx*ny;
|
||||
nx=myDetector->getMaxNumberOfChannelsPerDetector(slsDetectorDefs::X);
|
||||
ny=myDetector->getMaxNumberOfChannelsPerDetector(slsDetectorDefs::Y);
|
||||
return nx*ny;
|
||||
}
|
||||
|
||||
int slsDetectorUsers::setBitDepth(int i){
|
||||
return myDetector->setDynamicRange(i);
|
||||
int slsDetectorUsers::getDetectorSize(int &x, int &y, int &nx, int &ny, int detPos){
|
||||
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){
|
||||
return myDetector->slsDetectorBase::setSettings(isettings);
|
||||
string slsDetectorUsers::getDetectorType(int detPos){
|
||||
return myDetector->sgetDetectorsType(detPos);
|
||||
}
|
||||
int slsDetectorUsers::setOnline(int const online, int detPos){
|
||||
return myDetector->setOnline(online, detPos);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::getThresholdEnergy(){
|
||||
return myDetector->getThresholdEnergy(-1);
|
||||
}
|
||||
|
||||
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::setReceiverOnline(int const online, int detPos){
|
||||
return myDetector->setReceiverOnline(online, detPos);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::readConfigurationFile(string const fname){
|
||||
return myDetector->readConfigurationFile(fname);
|
||||
}
|
||||
return myDetector->readConfigurationFile(fname);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::dumpDetectorSetup(string const fname){
|
||||
return myDetector->dumpDetectorSetup(fname);
|
||||
}
|
||||
int slsDetectorUsers::writeConfigurationFile(string const fname){
|
||||
return myDetector->writeConfigurationFile(fname);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::retrieveDetectorSetup(string const fname){
|
||||
return myDetector->retrieveDetectorSetup(fname);
|
||||
return myDetector->retrieveDetectorSetup(fname);
|
||||
}
|
||||
|
||||
string slsDetectorUsers::getDetectorType(){
|
||||
return myDetector->sgetDetectorsType();
|
||||
int slsDetectorUsers::dumpDetectorSetup(string const fname){
|
||||
return myDetector->dumpDetectorSetup(fname);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::setReceiverMode(int n){
|
||||
return myDetector->setReadReceiverFrequency(n);
|
||||
int64_t slsDetectorUsers::getDetectorFirmwareVersion(int detPos){
|
||||
return myDetector->getId(slsDetectorDefs::DETECTOR_FIRMWARE_VERSION);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::enableDataStreamingFromReceiver(int i){
|
||||
return myDetector->enableDataStreamingFromReceiver(i);
|
||||
int64_t slsDetectorUsers::getDetectorSerialNumber(int detPos){
|
||||
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){
|
||||
return myDetector->enableDataStreamingToClient(i);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::setReceiverDataStreamingOutPort(int i){
|
||||
return myDetector->setReceiverDataStreamingOutPort(i);
|
||||
int slsDetectorUsers::enableDataStreamingFromReceiver(int i, int detPos){
|
||||
return myDetector->enableDataStreamingFromReceiver(i, detPos);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::setClientDataStreamingInPort(int i){
|
||||
return myDetector->setClientDataStreamingInPort(i);
|
||||
int slsDetectorUsers::setReceiverDataStreamingOutPort(int i, int detPos){
|
||||
return myDetector->setReceiverDataStreamingOutPort(i, detPos);
|
||||
}
|
||||
|
||||
string slsDetectorUsers::setReceiverDataStreamingOutIP(string ip){
|
||||
return myDetector->setReceiverDataStreamingOutIP(ip);
|
||||
int slsDetectorUsers::setClientDataStreamingInPort(int i, int detPos){
|
||||
return myDetector->setClientDataStreamingInPort(i, detPos);
|
||||
}
|
||||
|
||||
string slsDetectorUsers::setClientDataStreamingInIP(string ip){
|
||||
return myDetector->setClientDataStreamingInIP(ip);
|
||||
string slsDetectorUsers::setReceiverDataStreamingOutIP(string ip, int detPos){
|
||||
return myDetector->setReceiverDataStreamingOutIP(ip, detPos);
|
||||
}
|
||||
|
||||
int64_t slsDetectorUsers::getDetectorFirmwareVersion(){
|
||||
return myDetector->getDetectorFirmwareVersion();
|
||||
string slsDetectorUsers::setClientDataStreamingInIP(string ip, int detPos){
|
||||
return myDetector->setClientDataStreamingInIP(ip, detPos);
|
||||
}
|
||||
|
||||
int64_t slsDetectorUsers::getDetectorSerialNumber(){
|
||||
return myDetector->getDetectorSerialNumber();
|
||||
int slsDetectorUsers::enableGapPixels(int enable, int detPos) {
|
||||
return myDetector->enableGapPixels(enable, detPos);
|
||||
}
|
||||
|
||||
int64_t slsDetectorUsers::getDetectorSoftwareVersion(){
|
||||
return myDetector->getDetectorSoftwareVersion();
|
||||
int slsDetectorUsers::setReceiverFramesDiscardPolicy(int f, int detPos) {
|
||||
return myDetector->setReceiverFramesDiscardPolicy(slsDetectorDefs::frameDiscardPolicy(f), detPos);
|
||||
}
|
||||
|
||||
int64_t slsDetectorUsers::getThisSoftwareVersion(){
|
||||
return myDetector->getThisSoftwareVersion();
|
||||
int slsDetectorUsers::setReceiverPartialFramesPadding(int f, int detPos) {
|
||||
return myDetector->setReceiverPartialFramesPadding(f, detPos);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::enableGapPixels(int enable) {
|
||||
return myDetector->enableGapPixels(enable);
|
||||
int slsDetectorUsers::setReceiverFramesPerFile(int f, int detPos) {
|
||||
return myDetector->setReceiverFramesPerFile(f, detPos);
|
||||
}
|
||||
|
||||
std::string slsDetectorUsers::setReceiverFramesDiscardPolicy(std::string f) {
|
||||
return myDetector->getReceiverFrameDiscardPolicy(
|
||||
myDetector->setReceiverFramesDiscardPolicy(
|
||||
myDetector->getReceiverFrameDiscardPolicy(f)));
|
||||
|
||||
|
||||
/************************************************************************
|
||||
|
||||
CALLBACKS & COMMAND LINE PARSING
|
||||
|
||||
*********************************************************************/
|
||||
|
||||
void slsDetectorUsers::registerDataCallback(int( *userCallback)(detectorData*, int, int, void*), void *pArg) {
|
||||
myDetector->registerDataCallback(userCallback,pArg);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::setReceiverPartialFramesPadding(int f) {
|
||||
return myDetector->setReceiverPartialFramesPadding(f);
|
||||
void slsDetectorUsers::registerAcquisitionFinishedCallback(int( *func)(double,int, void*), void *pArg) {
|
||||
myDetector->registerAcquisitionFinishedCallback(func,pArg);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::setReceiverFramesPerFile(int f) {
|
||||
return myDetector->setReceiverFramesPerFile(f);
|
||||
void slsDetectorUsers::registerMeasurementFinishedCallback(int( *func)(int,int, void*), void *pArg) {
|
||||
myDetector->registerMeasurementFinishedCallback(func,pArg);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::sendSoftwareTrigger() {
|
||||
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){
|
||||
myDetector->registerDataCallback(userCallback,pArg);
|
||||
}
|
||||
|
||||
void slsDetectorUsers::registerAcquisitionFinishedCallback(int( *func)(double,int, void*), void *pArg){
|
||||
myDetector->registerAcquisitionFinishedCallback(func,pArg);
|
||||
void slsDetectorUsers::registerProgressCallback(int( *func)(double,void*), void *pArg) {
|
||||
myDetector->registerProgressCallback(func,pArg);
|
||||
}
|
||||
|
||||
string slsDetectorUsers::putCommand(int narg, char *args[], int pos){
|
||||
@ -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
|
||||
../multiSlsDetector
|
||||
../slsDetector
|
||||
../slsDetectorAnalysis
|
||||
../slsReceiverInterface
|
||||
../usersFunctions
|
||||
../MySocketTCP
|
||||
)
|
||||
|
||||
add_executable(sls_detector_get
|
||||
|
@ -4,7 +4,7 @@ CFLAGS= -DC_ONLY
|
||||
#FLAGS=-DVERBOSE
|
||||
#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
|
||||
BIN=$(DESTDIR)
|
||||
LIBS?= -L$(DESTDIR) -lSlsDetector
|
||||
|
Loading…
x
Reference in New Issue
Block a user