mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-01 09:01:19 +01:00
Removeshm (#90)
* eiger: moved rate correction outside, fixed threshold energy bug in client (binaries not updated yet) * removed dr and deadtiem from shm * help for rx_status and status to point them to rx_Start, rx_stop, start and stop * moved progress to receiver * removed currentsettings from eiger shm * updated server binaries, and client api * moench and ctb virtual servers compile fix * gui: moved acquire to a concurrent qt thread so it doesnt block updateplot
This commit is contained in:
@@ -396,14 +396,6 @@ void Module::initializeDetectorStructure(detectorType type) {
|
||||
shm()->controlPort = DEFAULT_PORTNO;
|
||||
shm()->stopPort = DEFAULT_PORTNO + 1;
|
||||
sls::strcpy_safe(shm()->settingsDir, getenv("HOME"));
|
||||
shm()->currentSettings = UNINITIALIZED;
|
||||
shm()->nFrames = 1;
|
||||
shm()->nTriggers = 1;
|
||||
shm()->nBursts = 1;
|
||||
shm()->nAddStorageCells = 0;
|
||||
shm()->timingMode = AUTO_TIMING;
|
||||
shm()->burstMode = BURST_INTERNAL;
|
||||
shm()->deadTime = 0;
|
||||
sls::strcpy_safe(shm()->rxHostname, "none");
|
||||
shm()->rxTCPPort = DEFAULT_PORTNO + 2;
|
||||
shm()->useReceiverFlag = false;
|
||||
@@ -420,7 +412,6 @@ void Module::initializeDetectorStructure(detectorType type) {
|
||||
shm()->nChip.x = parameters.nChipX;
|
||||
shm()->nChip.y = parameters.nChipY;
|
||||
shm()->nDacs = parameters.nDacs;
|
||||
shm()->dynamicRange = parameters.dynamicRange;
|
||||
}
|
||||
|
||||
int Module::sendModule(sls_detector_module *myMod,
|
||||
@@ -719,54 +710,11 @@ void Module::updateCachedDetectorVariables() {
|
||||
if (client.sendCommandThenRead(fnum, nullptr, 0, nullptr, 0) ==
|
||||
FORCE_UPDATE) {
|
||||
int n = 0, i32 = 0;
|
||||
int64_t i64 = 0;
|
||||
sls::IpAddr lastClientIP;
|
||||
n += client.Receive(&lastClientIP, sizeof(lastClientIP));
|
||||
LOG(logDEBUG1)
|
||||
<< "Updating detector last modified by " << lastClientIP;
|
||||
|
||||
// dr
|
||||
n += client.Receive(&i32, sizeof(i32));
|
||||
shm()->dynamicRange = i32;
|
||||
|
||||
// settings
|
||||
if (shm()->myDetectorType == EIGER || shm()->myDetectorType == JUNGFRAU ||
|
||||
shm()->myDetectorType == GOTTHARD || shm()->myDetectorType == GOTTHARD2 ||
|
||||
shm()->myDetectorType == MOENCH) {
|
||||
n += client.Receive(&i32, sizeof(i32));
|
||||
shm()->currentSettings = static_cast<detectorSettings>(i32);
|
||||
}
|
||||
|
||||
// frame number
|
||||
n += client.Receive(&i64, sizeof(i64));
|
||||
shm()->nFrames = i64;
|
||||
|
||||
// storage cell
|
||||
if (shm()->myDetectorType == JUNGFRAU) {
|
||||
n += client.Receive(&i64, sizeof(i64));
|
||||
shm()->nAddStorageCells = i64;
|
||||
}
|
||||
|
||||
// triggers
|
||||
n += client.Receive(&i64, sizeof(i64));
|
||||
shm()->nTriggers = i64;
|
||||
|
||||
// bursts
|
||||
if (shm()->myDetectorType == GOTTHARD2) {
|
||||
n += client.Receive(&i64, sizeof(i64));
|
||||
shm()->nBursts = i64;
|
||||
}
|
||||
|
||||
// timing mode
|
||||
n += client.Receive(&i32, sizeof(i32));
|
||||
shm()->timingMode = static_cast<timingMode>(i32);
|
||||
|
||||
// burst mode
|
||||
if (shm()->myDetectorType == GOTTHARD2) {
|
||||
n += client.Receive(&i32, sizeof(i32));
|
||||
shm()->burstMode = static_cast<burstMode>(i32);
|
||||
}
|
||||
|
||||
// number of channels (depends on #samples, adcmask)
|
||||
if (shm()->myDetectorType == CHIPTESTBOARD ||
|
||||
shm()->myDetectorType == MOENCH) {
|
||||
@@ -863,49 +811,21 @@ std::vector<std::string> Module::getConfigFileCommands() {
|
||||
}
|
||||
|
||||
slsDetectorDefs::detectorSettings Module::getSettings() {
|
||||
return sendSettingsOnly(GET_SETTINGS);
|
||||
int arg = -1;
|
||||
int retval = -1;
|
||||
sendToDetector(F_SET_SETTINGS, arg, retval);
|
||||
LOG(logDEBUG1) << "Settings: " << retval;
|
||||
return static_cast<detectorSettings>(retval);
|
||||
}
|
||||
|
||||
slsDetectorDefs::detectorSettings
|
||||
Module::setSettings(detectorSettings isettings) {
|
||||
LOG(logDEBUG1) << "Module setSettings " << isettings;
|
||||
|
||||
if (isettings == -1) {
|
||||
return getSettings();
|
||||
}
|
||||
|
||||
// eiger: only set shm, setting threshold loads the module data
|
||||
void Module::setSettings(detectorSettings isettings) {
|
||||
if (shm()->myDetectorType == EIGER) {
|
||||
switch (isettings) {
|
||||
case STANDARD:
|
||||
case HIGHGAIN:
|
||||
case LOWGAIN:
|
||||
case VERYHIGHGAIN:
|
||||
case VERYLOWGAIN:
|
||||
shm()->currentSettings = isettings;
|
||||
return shm()->currentSettings;
|
||||
default:
|
||||
std::ostringstream ss;
|
||||
ss << "Unknown settings " << ToString(isettings)
|
||||
<< " for this detector!";
|
||||
throw RuntimeError(ss.str());
|
||||
}
|
||||
throw RuntimeError("Cannot set settings for Eiger. Use threshold energy.");
|
||||
}
|
||||
|
||||
// others: send only the settings, detector server will update dac values
|
||||
// already in server
|
||||
return sendSettingsOnly(isettings);
|
||||
}
|
||||
|
||||
slsDetectorDefs::detectorSettings
|
||||
Module::sendSettingsOnly(detectorSettings isettings) {
|
||||
int arg = static_cast<int>(isettings);
|
||||
int retval = -1;
|
||||
LOG(logDEBUG1) << "Setting settings to " << arg;
|
||||
sendToDetector(F_SET_SETTINGS, arg, retval);
|
||||
LOG(logDEBUG1) << "Settings: " << retval;
|
||||
shm()->currentSettings = static_cast<detectorSettings>(retval);
|
||||
return shm()->currentSettings;
|
||||
}
|
||||
|
||||
int Module::getThresholdEnergy() {
|
||||
@@ -944,8 +864,11 @@ void Module::setThresholdEnergy(int e_eV, detectorSettings isettings,
|
||||
else if (shm()->myDetectorType == MOENCH) {
|
||||
setAdditionalJsonParameter("threshold", std::to_string(e_eV));
|
||||
}
|
||||
throw RuntimeError(
|
||||
|
||||
else {
|
||||
throw RuntimeError(
|
||||
"Set threshold energy not implemented for this detector");
|
||||
}
|
||||
}
|
||||
|
||||
void Module::setThresholdEnergyAndSettings(int e_eV,
|
||||
@@ -954,7 +877,7 @@ void Module::setThresholdEnergyAndSettings(int e_eV,
|
||||
|
||||
// if settings provided, use that, else use the shared memory variable
|
||||
detectorSettings is =
|
||||
((isettings != GET_SETTINGS) ? isettings : shm()->currentSettings);
|
||||
((isettings != GET_SETTINGS) ? isettings : getSettings());
|
||||
|
||||
// verify e_eV exists in trimEneregies[]
|
||||
if (shm()->trimEnergies.empty() || (e_eV < shm()->trimEnergies.front()) ||
|
||||
@@ -999,8 +922,7 @@ void Module::setThresholdEnergyAndSettings(int e_eV,
|
||||
linearInterpolation(e_eV, trim1, trim2, myMod1.tau, myMod2.tau);
|
||||
}
|
||||
|
||||
shm()->currentSettings = is;
|
||||
myMod.reg = shm()->currentSettings;
|
||||
myMod.reg = is;
|
||||
myMod.eV = e_eV;
|
||||
setModule(myMod, tb);
|
||||
if (getSettings() != is) {
|
||||
@@ -1161,101 +1083,64 @@ uint64_t Module::getStartingFrameNumber() {
|
||||
return retval;
|
||||
}
|
||||
|
||||
int64_t Module::getTotalNumFramesToReceive() {
|
||||
int64_t repeats = shm()->nTriggers;
|
||||
// gotthard2 & auto & burst mode, use nBursts instead of nTriggers
|
||||
if (shm()->myDetectorType == GOTTHARD2) {
|
||||
// auto mode (either bursts or no repeats)
|
||||
if (shm()->timingMode == AUTO_TIMING) {
|
||||
if (shm()->burstMode != BURST_OFF) {
|
||||
repeats = shm()->nBursts;
|
||||
} else {
|
||||
repeats = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (shm()->nFrames * repeats * (int64_t)(shm()->nAddStorageCells + 1));
|
||||
}
|
||||
|
||||
void Module::sendTotalNumFramestoReceiver() {
|
||||
if (shm()->useReceiverFlag) {
|
||||
int64_t arg = getTotalNumFramesToReceive();
|
||||
LOG(logDEBUG1) << "Sending total number of frames (#f x #t x #s) to Receiver: " << arg;
|
||||
sendToReceiver(F_RECEIVER_SET_NUM_FRAMES, arg, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
int64_t Module::getNumberOfFrames() {
|
||||
int64_t retval = -1;
|
||||
sendToDetector(F_GET_NUM_FRAMES, nullptr, retval);
|
||||
LOG(logDEBUG1) << "number of frames :" << retval;
|
||||
if (shm()->nFrames != retval) {
|
||||
shm()->nFrames = retval;
|
||||
sendTotalNumFramestoReceiver();
|
||||
}
|
||||
return shm()->nFrames;
|
||||
return retval;
|
||||
}
|
||||
|
||||
void Module::setNumberOfFrames(int64_t value) {
|
||||
LOG(logDEBUG1) << "Setting number of frames to " << value;
|
||||
sendToDetector(F_SET_NUM_FRAMES, value, nullptr);
|
||||
shm()->nFrames = value;
|
||||
sendTotalNumFramestoReceiver();
|
||||
if (shm()->useReceiverFlag) {
|
||||
LOG(logDEBUG1) << "Sending number of frames to Receiver: " << value;
|
||||
sendToReceiver(F_RECEIVER_SET_NUM_FRAMES, value, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
int64_t Module::getNumberOfTriggers() {
|
||||
int64_t retval = -1;
|
||||
sendToDetector(F_GET_NUM_TRIGGERS, nullptr, retval);
|
||||
LOG(logDEBUG1) << "number of triggers :" << retval;
|
||||
if (shm()->nTriggers != retval) {
|
||||
shm()->nTriggers = retval;
|
||||
sendTotalNumFramestoReceiver();
|
||||
}
|
||||
return shm()->nTriggers;
|
||||
return retval;
|
||||
}
|
||||
|
||||
void Module::setNumberOfTriggers(int64_t value) {
|
||||
LOG(logDEBUG1) << "Setting number of triggers to " << value;
|
||||
sendToDetector(F_SET_NUM_TRIGGERS, value, nullptr);
|
||||
shm()->nTriggers = value;
|
||||
sendTotalNumFramestoReceiver();
|
||||
if (shm()->useReceiverFlag) {
|
||||
LOG(logDEBUG1) << "Sending number of triggers to Receiver: " << value;
|
||||
sendToReceiver(F_SET_RECEIVER_NUM_TRIGGERS, value, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
int64_t Module::getNumberOfBursts() {
|
||||
int64_t retval = -1;
|
||||
sendToDetector(F_GET_NUM_BURSTS, nullptr, retval);
|
||||
LOG(logDEBUG1) << "number of bursts :" << retval;
|
||||
if (shm()->nBursts != retval) {
|
||||
shm()->nBursts = retval;
|
||||
sendTotalNumFramestoReceiver();
|
||||
}
|
||||
return shm()->nBursts;
|
||||
return retval;
|
||||
}
|
||||
|
||||
void Module::setNumberOfBursts(int64_t value) {
|
||||
LOG(logDEBUG1) << "Setting number of bursts to " << value;
|
||||
sendToDetector(F_SET_NUM_BURSTS, value, nullptr);
|
||||
shm()->nBursts = value;
|
||||
sendTotalNumFramestoReceiver();
|
||||
if (shm()->useReceiverFlag) {
|
||||
LOG(logDEBUG1) << "Sending number of bursts to Receiver: " << value;
|
||||
sendToReceiver(F_SET_RECEIVER_NUM_BURSTS, value, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
int Module::getNumberOfAdditionalStorageCells() {
|
||||
int prevVal = shm()->nAddStorageCells;
|
||||
int retval = -1;
|
||||
sendToDetector(F_GET_NUM_ADDITIONAL_STORAGE_CELLS, nullptr, retval);
|
||||
LOG(logDEBUG1) << "number of storage cells :" << retval;
|
||||
shm()->nAddStorageCells = retval;
|
||||
if (prevVal != retval) {
|
||||
sendTotalNumFramestoReceiver();
|
||||
}
|
||||
return shm()->nAddStorageCells;
|
||||
return retval;
|
||||
}
|
||||
|
||||
void Module::setNumberOfAdditionalStorageCells(int value) {
|
||||
LOG(logDEBUG1) << "Setting number of storage cells to " << value;
|
||||
sendToDetector(F_SET_NUM_ADDITIONAL_STORAGE_CELLS, value, nullptr);
|
||||
shm()->nAddStorageCells = value;
|
||||
sendTotalNumFramestoReceiver();
|
||||
}
|
||||
|
||||
int Module::getNumberOfAnalogSamples() {
|
||||
@@ -1305,16 +1190,13 @@ void Module::setExptime(int64_t value) {
|
||||
}
|
||||
LOG(logDEBUG1) << "Setting exptime to " << value << "ns";
|
||||
sendToDetector(F_SET_EXPTIME, value, nullptr);
|
||||
if (shm()->myDetectorType == EIGER && prevVal != value && shm()->dynamicRange == 16) {
|
||||
int r = getRateCorrection();
|
||||
if (r != 0) {
|
||||
setRateCorrection(r);
|
||||
}
|
||||
}
|
||||
if (shm()->useReceiverFlag) {
|
||||
LOG(logDEBUG1) << "Sending exptime to Receiver: " << value;
|
||||
sendToReceiver(F_RECEIVER_SET_EXPTIME, value, nullptr);
|
||||
}
|
||||
if (prevVal != value) {
|
||||
updateRateCorrection();
|
||||
}
|
||||
}
|
||||
|
||||
int64_t Module::getPeriod() {
|
||||
@@ -1358,17 +1240,14 @@ void Module::setSubExptime(int64_t value) {
|
||||
prevVal = getSubExptime();
|
||||
}
|
||||
LOG(logDEBUG1) << "Setting sub exptime to " << value << "ns";
|
||||
sendToDetector(F_SET_SUB_EXPTIME, value, nullptr);
|
||||
if (shm()->myDetectorType == EIGER && prevVal != value && shm()->dynamicRange == 32) {
|
||||
int r = getRateCorrection();
|
||||
if (r != 0) {
|
||||
setRateCorrection(r);
|
||||
}
|
||||
}
|
||||
sendToDetector(F_SET_SUB_EXPTIME, value, nullptr);
|
||||
if (shm()->useReceiverFlag) {
|
||||
LOG(logDEBUG1) << "Sending sub exptime to Receiver: " << value;
|
||||
sendToReceiver(F_RECEIVER_SET_SUB_EXPTIME, value, nullptr);
|
||||
}
|
||||
if (prevVal != value) {
|
||||
updateRateCorrection();
|
||||
}
|
||||
}
|
||||
|
||||
int64_t Module::getSubDeadTime() {
|
||||
@@ -1466,48 +1345,68 @@ int64_t Module::getMeasurementTime() const {
|
||||
return retval;
|
||||
}
|
||||
|
||||
slsDetectorDefs::timingMode Module::setTimingMode(timingMode value) {
|
||||
int fnum = F_SET_TIMING_MODE;
|
||||
//auto arg = static_cast<int>(pol);
|
||||
slsDetectorDefs::timingMode Module::getTimingMode() {
|
||||
int arg = -1;
|
||||
timingMode retval = GET_TIMING_MODE;
|
||||
LOG(logDEBUG1) << "Setting communication to mode " << value;
|
||||
sendToDetector(fnum, static_cast<int>(value), retval);
|
||||
sendToDetector(F_SET_TIMING_MODE, arg, retval);
|
||||
LOG(logDEBUG1) << "Timing Mode: " << retval;
|
||||
shm()->timingMode = retval;
|
||||
return retval;
|
||||
}
|
||||
|
||||
int Module::setDynamicRange(int n) {
|
||||
// TODO! Properly handle fail
|
||||
int prevDr = shm()->dynamicRange;
|
||||
void Module::setTimingMode(timingMode value) {
|
||||
timingMode retval = GET_TIMING_MODE;
|
||||
LOG(logDEBUG1) << "Setting timing mode to " << value;
|
||||
sendToDetector(F_SET_TIMING_MODE, static_cast<int>(value), retval);
|
||||
if (shm()->useReceiverFlag) {
|
||||
LOG(logDEBUG1) << "Sending timing mode to Receiver: " << value;
|
||||
sendToReceiver(F_SET_RECEIVER_TIMING_MODE, value, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
int Module::getDynamicRange() {
|
||||
int arg = -1;
|
||||
int retval = -1;
|
||||
sendToDetector(F_SET_DYNAMIC_RANGE, arg, retval);
|
||||
LOG(logDEBUG1) << "Dynamic Range: " << retval;
|
||||
return retval;
|
||||
}
|
||||
|
||||
void Module::setDynamicRange(int n) {
|
||||
int prev_val = n;
|
||||
if (shm()->myDetectorType == EIGER) {
|
||||
prev_val = getDynamicRange();
|
||||
}
|
||||
|
||||
int retval = -1;
|
||||
LOG(logDEBUG1) << "Setting dynamic range to " << n;
|
||||
sendToDetector(F_SET_DYNAMIC_RANGE, n, retval);
|
||||
LOG(logDEBUG1) << "Dynamic Range: " << retval;
|
||||
shm()->dynamicRange = retval;
|
||||
|
||||
if (shm()->useReceiverFlag) {
|
||||
n = shm()->dynamicRange;
|
||||
int arg = retval;
|
||||
retval = -1;
|
||||
LOG(logDEBUG1) << "Sending dynamic range to receiver: " << n;
|
||||
sendToReceiver(F_SET_RECEIVER_DYNAMIC_RANGE, n, retval);
|
||||
LOG(logDEBUG1) << "Sending dynamic range to receiver: " << arg;
|
||||
sendToReceiver(F_SET_RECEIVER_DYNAMIC_RANGE, arg, retval);
|
||||
LOG(logDEBUG1) << "Receiver Dynamic range: " << retval;
|
||||
}
|
||||
|
||||
// changes in dr
|
||||
int dr = shm()->dynamicRange;
|
||||
if (prevDr != dr && shm()->myDetectorType == EIGER) {
|
||||
updateRateCorrection();
|
||||
if (n != prev_val) {
|
||||
// update speed for usability
|
||||
if (dr == 32) {
|
||||
LOG(logINFO) << "Setting Clock to Quarter Speed to cope with Dynamic Range of 32"; setClockDivider(RUN_CLOCK, 2);
|
||||
} else {
|
||||
LOG(logINFO) << "Setting Clock to Full Speed to cope with Dynamic Range of " << dr; setClockDivider(RUN_CLOCK, 0);
|
||||
switch (n) {
|
||||
case 32:
|
||||
LOG(logINFO) << "Setting Clock to Quarter Speed to cope with Dynamic Range of 32";
|
||||
setClockDivider(RUN_CLOCK, 2);
|
||||
break;
|
||||
case 16:
|
||||
LOG(logINFO) << "Setting Clock to Full Speed to cope with Dynamic Range of " << n;
|
||||
setClockDivider(RUN_CLOCK, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
updateRateCorrection();
|
||||
}
|
||||
|
||||
return shm()->dynamicRange;
|
||||
}
|
||||
|
||||
int Module::setDAC(int val, dacIndex index, int mV) {
|
||||
@@ -1701,7 +1600,9 @@ std::string Module::setReceiverHostname(const std::string &receiverIP) {
|
||||
LOG(logDEBUG1) << printReceiverConfiguration();
|
||||
|
||||
setReceiverUDPSocketBufferSize(0);
|
||||
sendTotalNumFramestoReceiver();
|
||||
setNumberOfFrames(getNumberOfFrames());
|
||||
setNumberOfTriggers(getNumberOfTriggers());
|
||||
setTimingMode(getTimingMode());
|
||||
setExptime(getExptime());
|
||||
setPeriod(getPeriod());
|
||||
|
||||
@@ -1711,7 +1612,7 @@ std::string Module::setReceiverHostname(const std::string &receiverIP) {
|
||||
case EIGER:
|
||||
setSubExptime(getSubExptime());
|
||||
setSubDeadTime(getSubDeadTime());
|
||||
setDynamicRange(shm()->dynamicRange);
|
||||
setDynamicRange(getDynamicRange());
|
||||
activate(-1);
|
||||
enableTenGigabitEthernet(-1);
|
||||
setQuad(getQuad());
|
||||
@@ -1739,7 +1640,12 @@ std::string Module::setReceiverHostname(const std::string &receiverIP) {
|
||||
|
||||
case MYTHEN3:
|
||||
sendNumberofCounterstoReceiver(getCounterMask());
|
||||
setDynamicRange(shm()->dynamicRange);
|
||||
setDynamicRange(getDynamicRange());
|
||||
break;
|
||||
|
||||
case GOTTHARD2:
|
||||
setNumberOfBursts(getNumberOfBursts());
|
||||
setBurstMode(getBurstMode());
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -2374,15 +2280,17 @@ slsDetectorDefs::burstMode Module::getBurstMode() {
|
||||
int retval = -1;
|
||||
sendToDetector(F_GET_BURST_MODE, nullptr, retval);
|
||||
LOG(logDEBUG1) << "Burst mode:" << retval;
|
||||
shm()->burstMode = static_cast<slsDetectorDefs::burstMode>(retval);
|
||||
return shm()->burstMode;
|
||||
return static_cast<slsDetectorDefs::burstMode>(retval);
|
||||
}
|
||||
|
||||
void Module::setBurstMode(slsDetectorDefs::burstMode value) {
|
||||
int arg = static_cast<int>(value);
|
||||
LOG(logDEBUG1) << "Setting burst mode to " << arg;
|
||||
sendToDetector(F_SET_BURST_MODE, arg, nullptr);
|
||||
shm()->burstMode = value;
|
||||
if (shm()->useReceiverFlag) {
|
||||
LOG(logDEBUG1) << "Sending burst mode to Receiver: " << value;
|
||||
sendToReceiver(F_SET_RECEIVER_BURST_MODE, value, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
bool Module::getCurrentSource() {
|
||||
@@ -2950,37 +2858,23 @@ void Module::setDefaultRateCorrection() {
|
||||
LOG(logDEBUG1) << "Setting Default Rate Correction";
|
||||
int64_t arg = -1;
|
||||
sendToDetector(F_SET_RATE_CORRECT, arg, nullptr);
|
||||
shm()->deadTime = -1;
|
||||
}
|
||||
|
||||
void Module::setRateCorrection(int64_t t) {
|
||||
LOG(logDEBUG1) << "Setting Rate Correction to " << t;
|
||||
sendToDetector(F_SET_RATE_CORRECT, t, nullptr);
|
||||
shm()->deadTime = t;
|
||||
}
|
||||
|
||||
int64_t Module::getRateCorrection() {
|
||||
int64_t retval = -1;
|
||||
LOG(logDEBUG1) << "Getting rate correction";
|
||||
sendToDetector(F_GET_RATE_CORRECT, nullptr, retval);
|
||||
shm()->deadTime = retval;
|
||||
LOG(logDEBUG1) << "Rate correction: " << retval;
|
||||
return retval;
|
||||
}
|
||||
|
||||
void Module::updateRateCorrection() {
|
||||
if (shm()->deadTime != 0) {
|
||||
switch (shm()->dynamicRange) {
|
||||
case 16:
|
||||
case 32:
|
||||
setRateCorrection(shm()->deadTime);
|
||||
break;
|
||||
default:
|
||||
setRateCorrection(0);
|
||||
throw sls::RuntimeError(
|
||||
"Rate correction Deactivated, must be in 32 or 16 bit mode");
|
||||
}
|
||||
}
|
||||
LOG(logDEBUG1) << "Updating rate correction";
|
||||
sendToDetector(F_UPDATE_RATE_CORRECTION);
|
||||
}
|
||||
|
||||
std::string Module::printReceiverConfiguration() {
|
||||
@@ -3281,6 +3175,15 @@ uint64_t Module::getReceiverCurrentFrameIndex() const {
|
||||
return retval;
|
||||
}
|
||||
|
||||
int Module::getReceiverProgress() const {
|
||||
int retval = -1;
|
||||
if (shm()->useReceiverFlag) {
|
||||
sendToReceiver(F_GET_RECEIVER_PROGRESS, nullptr, retval);
|
||||
LOG(logDEBUG1) << "Current Progress of Receiver: " << retval;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
void Module::setFileWrite(bool value) {
|
||||
if (!shm()->useReceiverFlag) {
|
||||
throw RuntimeError("Set rx_hostname first to use receiver parameters (file write enable)");
|
||||
|
||||
Reference in New Issue
Block a user