mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
slsdetector and users updated to reflect new signatures, not yet compiled
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user