mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 23:30:03 +02:00
removed GET_ flags, replaced -1 with GET_FLAG
This commit is contained in:
parent
7c23f1e42c
commit
489fccb25c
@ -1186,9 +1186,9 @@ std::string CmdProxy::Threshold(int action) {
|
|||||||
os << OutString(t) << '\n';
|
os << OutString(t) << '\n';
|
||||||
} else if (action == defs::PUT_ACTION) {
|
} else if (action == defs::PUT_ACTION) {
|
||||||
if (args.size() == 1) {
|
if (args.size() == 1) {
|
||||||
det->setThresholdEnergy(StringTo<int>(args[0]),
|
auto t = det->getSettings({det_id}).tsquash(
|
||||||
slsDetectorDefs::GET_SETTINGS, true,
|
"Inconsistent settings between detectors");
|
||||||
{det_id});
|
det->setThresholdEnergy(StringTo<int>(args[0]), t, true, {det_id});
|
||||||
} else if (args.size() == 2) {
|
} else if (args.size() == 2) {
|
||||||
det->setThresholdEnergy(
|
det->setThresholdEnergy(
|
||||||
StringTo<int>(args[0]),
|
StringTo<int>(args[0]),
|
||||||
@ -1216,9 +1216,9 @@ std::string CmdProxy::ThresholdNoTb(int action) {
|
|||||||
throw sls::RuntimeError("cannot get");
|
throw sls::RuntimeError("cannot get");
|
||||||
} else if (action == defs::PUT_ACTION) {
|
} else if (action == defs::PUT_ACTION) {
|
||||||
if (args.size() == 1) {
|
if (args.size() == 1) {
|
||||||
det->setThresholdEnergy(StringTo<int>(args[0]),
|
auto t = det->getSettings({det_id}).tsquash(
|
||||||
slsDetectorDefs::GET_SETTINGS, false,
|
"Inconsistent settings between detectors");
|
||||||
{det_id});
|
det->setThresholdEnergy(StringTo<int>(args[0]), t, false, {det_id});
|
||||||
} else if (args.size() == 2) {
|
} else if (args.size() == 2) {
|
||||||
det->setThresholdEnergy(
|
det->setThresholdEnergy(
|
||||||
StringTo<int>(args[0]),
|
StringTo<int>(args[0]),
|
||||||
|
@ -142,7 +142,7 @@ void Module::updateNumberOfDetector(slsDetectorDefs::xy det) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
slsDetectorDefs::detectorSettings Module::getSettings() {
|
slsDetectorDefs::detectorSettings Module::getSettings() {
|
||||||
auto r = sendToDetector<int>(F_SET_SETTINGS, -1);
|
auto r = sendToDetector<int>(F_SET_SETTINGS, GET_FLAG);
|
||||||
return static_cast<detectorSettings>(r);
|
return static_cast<detectorSettings>(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ void Module::loadSettingsFile(const std::string &fname) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Module::getAllTrimbits() {
|
int Module::getAllTrimbits() {
|
||||||
return sendToDetector<int>(F_SET_ALL_TRIMBITS, -1);
|
return sendToDetector<int>(F_SET_ALL_TRIMBITS, GET_FLAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::setAllTrimbits(int val) {
|
void Module::setAllTrimbits(int val) {
|
||||||
@ -242,36 +242,27 @@ void Module::setDelayAfterTrigger(int64_t value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int64_t Module::getNumberOfFramesLeft() const {
|
int64_t Module::getNumberOfFramesLeft() const {
|
||||||
int64_t retval = -1;
|
return sendToDetectorStop<int64_t>(F_GET_FRAMES_LEFT);
|
||||||
sendToDetectorStop(F_GET_FRAMES_LEFT, nullptr, retval);
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t Module::getNumberOfTriggersLeft() const {
|
int64_t Module::getNumberOfTriggersLeft() const {
|
||||||
int64_t retval = -1;
|
return sendToDetectorStop<int64_t>(F_GET_TRIGGERS_LEFT);
|
||||||
sendToDetectorStop(F_GET_TRIGGERS_LEFT, nullptr, retval);
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t Module::getDelayAfterTriggerLeft() const {
|
int64_t Module::getDelayAfterTriggerLeft() const {
|
||||||
int64_t retval = -1;
|
return sendToDetectorStop<int64_t>(F_GET_DELAY_AFTER_TRIGGER_LEFT);
|
||||||
sendToDetectorStop(F_GET_DELAY_AFTER_TRIGGER_LEFT, nullptr, retval);
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t Module::getPeriodLeft() const {
|
int64_t Module::getPeriodLeft() const {
|
||||||
int64_t retval = -1;
|
return sendToDetectorStop<int64_t>(F_GET_PERIOD_LEFT);
|
||||||
sendToDetectorStop(F_GET_PERIOD_LEFT, nullptr, retval);
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
slsDetectorDefs::timingMode Module::getTimingMode() {
|
slsDetectorDefs::timingMode Module::getTimingMode() {
|
||||||
return sendToDetector<timingMode>(F_SET_TIMING_MODE, -1);
|
return sendToDetector<timingMode>(F_SET_TIMING_MODE, GET_FLAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::setTimingMode(timingMode value) {
|
void Module::setTimingMode(timingMode value) {
|
||||||
timingMode retval = GET_TIMING_MODE;
|
sendToDetector<int>(F_SET_TIMING_MODE, static_cast<int>(value));
|
||||||
sendToDetector(F_SET_TIMING_MODE, static_cast<int>(value), retval);
|
|
||||||
if (shm()->useReceiverFlag) {
|
if (shm()->useReceiverFlag) {
|
||||||
sendToReceiver(F_SET_RECEIVER_TIMING_MODE, value, nullptr);
|
sendToReceiver(F_SET_RECEIVER_TIMING_MODE, value, nullptr);
|
||||||
}
|
}
|
||||||
@ -310,7 +301,7 @@ void Module::setClockFrequency(int clkIndex, int value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Module::getDAC(dacIndex index, bool mV) {
|
int Module::getDAC(dacIndex index, bool mV) {
|
||||||
int args[]{static_cast<int>(index), static_cast<int>(mV), -1};
|
int args[]{static_cast<int>(index), static_cast<int>(mV), GET_FLAG};
|
||||||
return sendToDetector<int>(F_SET_DAC, args);
|
return sendToDetector<int>(F_SET_DAC, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,7 +311,7 @@ void Module::setDAC(int val, dacIndex index, bool mV) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Module::getPowerChip() {
|
bool Module::getPowerChip() {
|
||||||
int arg = -1;
|
int arg = GET_FLAG;
|
||||||
return sendToDetector<int>(F_POWER_CHIP, arg);
|
return sendToDetector<int>(F_POWER_CHIP, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -640,17 +631,16 @@ std::string Module::printReceiverConfiguration() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Module::getTenGiga() {
|
bool Module::getTenGiga() {
|
||||||
int arg = -1;
|
int arg = GET_FLAG;
|
||||||
return static_cast<bool>(sendToDetector<int>(F_ENABLE_TEN_GIGA, arg));
|
return static_cast<bool>(sendToDetector<int>(F_ENABLE_TEN_GIGA, arg));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::setTenGiga(bool value) {
|
void Module::setTenGiga(bool value) {
|
||||||
int arg = static_cast<int>(value);
|
int arg = static_cast<int>(value);
|
||||||
int retval = -1;
|
auto retval = sendToDetector<int>(F_ENABLE_TEN_GIGA, arg);
|
||||||
sendToDetector(F_ENABLE_TEN_GIGA, arg, retval);
|
|
||||||
sendToDetectorStop<int>(F_ENABLE_TEN_GIGA, arg);
|
sendToDetectorStop<int>(F_ENABLE_TEN_GIGA, arg);
|
||||||
arg = retval;
|
arg = retval;
|
||||||
if (shm()->useReceiverFlag && arg != -1) {
|
if (shm()->useReceiverFlag && arg != GET_FLAG) {
|
||||||
sendToReceiver<int>(F_ENABLE_RECEIVER_TEN_GIGA, arg);
|
sendToReceiver<int>(F_ENABLE_RECEIVER_TEN_GIGA, arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -769,9 +759,8 @@ int Module::getReceiverPort() const { return shm()->rxTCPPort; }
|
|||||||
int Module::setReceiverPort(int port_number) {
|
int Module::setReceiverPort(int port_number) {
|
||||||
if (port_number >= 0 && port_number != shm()->rxTCPPort) {
|
if (port_number >= 0 && port_number != shm()->rxTCPPort) {
|
||||||
if (shm()->useReceiverFlag) {
|
if (shm()->useReceiverFlag) {
|
||||||
int retval = -1;
|
shm()->rxTCPPort =
|
||||||
sendToReceiver(F_SET_RECEIVER_PORT, port_number, retval);
|
sendToReceiver<int>(F_SET_RECEIVER_PORT, port_number);
|
||||||
shm()->rxTCPPort = retval;
|
|
||||||
} else {
|
} else {
|
||||||
shm()->rxTCPPort = port_number;
|
shm()->rxTCPPort = port_number;
|
||||||
}
|
}
|
||||||
@ -780,7 +769,7 @@ int Module::setReceiverPort(int port_number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Module::getReceiverFifoDepth() {
|
int Module::getReceiverFifoDepth() {
|
||||||
int arg = -1;
|
int arg = GET_FLAG;
|
||||||
return sendToReceiver<int>(F_SET_RECEIVER_FIFO_DEPTH, arg);
|
return sendToReceiver<int>(F_SET_RECEIVER_FIFO_DEPTH, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -815,7 +804,7 @@ void Module::setPartialFramesPadding(bool padding) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int64_t Module::getReceiverUDPSocketBufferSize() const {
|
int64_t Module::getReceiverUDPSocketBufferSize() const {
|
||||||
int64_t arg = -1;
|
int64_t arg = GET_FLAG;
|
||||||
return sendToReceiver<int64_t>(F_RECEIVER_UDP_SOCK_BUF_SIZE, arg);
|
return sendToReceiver<int64_t>(F_RECEIVER_UDP_SOCK_BUF_SIZE, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -828,7 +817,7 @@ void Module::setReceiverUDPSocketBufferSize(int64_t udpsockbufsize) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Module::getReceiverLock() {
|
bool Module::getReceiverLock() {
|
||||||
int arg = -1;
|
int arg = GET_FLAG;
|
||||||
return static_cast<bool>(sendToReceiver<int>(F_LOCK_RECEIVER, arg));
|
return static_cast<bool>(sendToReceiver<int>(F_LOCK_RECEIVER, arg));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -954,7 +943,7 @@ void Module::setReceiverStreamingFrequency(int freq) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Module::getReceiverStreamingTimer() {
|
int Module::getReceiverStreamingTimer() {
|
||||||
int arg = -1;
|
int arg = GET_FLAG;
|
||||||
return sendToReceiver<int>(F_RECEIVER_STREAMING_TIMER, arg);
|
return sendToReceiver<int>(F_RECEIVER_STREAMING_TIMER, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1001,7 +990,7 @@ void Module::setClientStreamingIP(const sls::IpAddr ip) {
|
|||||||
// Eiger Specific
|
// Eiger Specific
|
||||||
|
|
||||||
int Module::getDynamicRange() {
|
int Module::getDynamicRange() {
|
||||||
return sendToDetector<int>(F_SET_DYNAMIC_RANGE, -1);
|
return sendToDetector<int>(F_SET_DYNAMIC_RANGE, GET_FLAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::setDynamicRange(int n) {
|
void Module::setDynamicRange(int n) {
|
||||||
@ -1120,7 +1109,7 @@ void Module::setOverFlowMode(const bool enable) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Module::getFlippedDataX() {
|
bool Module::getFlippedDataX() {
|
||||||
return sendToReceiver<int>(F_SET_FLIPPED_DATA_RECEIVER, -1);
|
return sendToReceiver<int>(F_SET_FLIPPED_DATA_RECEIVER, GET_FLAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::setFlippedDataX(bool value) {
|
void Module::setFlippedDataX(bool value) {
|
||||||
@ -1191,7 +1180,7 @@ int64_t Module::getMeasuredSubFramePeriod() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Module::getActivate() {
|
bool Module::getActivate() {
|
||||||
int arg = -1;
|
int arg = GET_FLAG;
|
||||||
auto retval = sendToDetector<int>(F_ACTIVATE, arg);
|
auto retval = sendToDetector<int>(F_ACTIVATE, arg);
|
||||||
auto retval2 = sendToDetectorStop<int>(F_ACTIVATE, arg);
|
auto retval2 = sendToDetectorStop<int>(F_ACTIVATE, arg);
|
||||||
if (retval != retval2) {
|
if (retval != retval2) {
|
||||||
@ -1222,7 +1211,7 @@ void Module::setDeactivatedRxrPaddingMode(bool padding) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Module::getCounterBit() {
|
bool Module::getCounterBit() {
|
||||||
int arg = -1;
|
int arg = GET_FLAG;
|
||||||
return (!static_cast<bool>(sendToDetector<int>(F_SET_COUNTER_BIT, arg)));
|
return (!static_cast<bool>(sendToDetector<int>(F_SET_COUNTER_BIT, arg)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1257,7 +1246,7 @@ void Module::setQuad(const bool enable) {
|
|||||||
// Jungfrau Specific
|
// Jungfrau Specific
|
||||||
|
|
||||||
int Module::getThresholdTemperature() {
|
int Module::getThresholdTemperature() {
|
||||||
int arg = -1;
|
int arg = GET_FLAG;
|
||||||
auto retval = sendToDetectorStop<int>(F_THRESHOLD_TEMP, arg);
|
auto retval = sendToDetectorStop<int>(F_THRESHOLD_TEMP, arg);
|
||||||
if (retval != 0) {
|
if (retval != 0) {
|
||||||
retval /= 1000;
|
retval /= 1000;
|
||||||
@ -1275,7 +1264,7 @@ void Module::setThresholdTemperature(int val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Module::getTemperatureControl() {
|
bool Module::getTemperatureControl() {
|
||||||
int arg = -1;
|
int arg = GET_FLAG;
|
||||||
return static_cast<bool>(sendToDetectorStop<int>(F_TEMP_CONTROL, arg));
|
return static_cast<bool>(sendToDetectorStop<int>(F_TEMP_CONTROL, arg));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1284,7 +1273,7 @@ void Module::setTemperatureControl(bool val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Module::getTemperatureEvent() {
|
int Module::getTemperatureEvent() {
|
||||||
int arg = -1;
|
int arg = GET_FLAG;
|
||||||
return sendToDetectorStop<int>(F_TEMP_EVENT, arg);
|
return sendToDetectorStop<int>(F_TEMP_EVENT, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1294,7 +1283,7 @@ void Module::resetTemperatureEvent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Module::getAutoComparatorDisableMode() {
|
bool Module::getAutoComparatorDisableMode() {
|
||||||
int arg = -1;
|
int arg = GET_FLAG;
|
||||||
return static_cast<bool>(sendToDetector<int>(F_AUTO_COMP_DISABLE, arg));
|
return static_cast<bool>(sendToDetector<int>(F_AUTO_COMP_DISABLE, arg));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1311,7 +1300,7 @@ void Module::setNumberOfAdditionalStorageCells(int value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Module::getStorageCellStart() {
|
int Module::getStorageCellStart() {
|
||||||
int arg = -1;
|
int arg = GET_FLAG;
|
||||||
return sendToDetector<int>(F_STORAGE_CELL_START, arg);
|
return sendToDetector<int>(F_STORAGE_CELL_START, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1696,7 +1685,7 @@ void Module::setReadoutMode(const slsDetectorDefs::readoutMode mode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Module::getExternalSamplingSource() {
|
int Module::getExternalSamplingSource() {
|
||||||
return setExternalSamplingSource(-1);
|
return setExternalSamplingSource(GET_FLAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Module::setExternalSamplingSource(int value) {
|
int Module::setExternalSamplingSource(int value) {
|
||||||
@ -1704,7 +1693,7 @@ int Module::setExternalSamplingSource(int value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Module::getExternalSampling() {
|
bool Module::getExternalSampling() {
|
||||||
int arg = -1;
|
int arg = GET_FLAG;
|
||||||
return sendToDetector<int>(F_EXTERNAL_SAMPLING, arg);
|
return sendToDetector<int>(F_EXTERNAL_SAMPLING, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1746,7 +1735,7 @@ void Module::setDigitalIODelay(uint64_t pinMask, int delay) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Module::getLEDEnable() {
|
bool Module::getLEDEnable() {
|
||||||
int arg = -1;
|
int arg = GET_FLAG;
|
||||||
return static_cast<bool>(sendToDetector<int>(F_LED, arg));
|
return static_cast<bool>(sendToDetector<int>(F_LED, arg));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1773,7 +1762,7 @@ void Module::setPattern(const std::string &fname) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint64_t Module::getPatternIOControl() {
|
uint64_t Module::getPatternIOControl() {
|
||||||
int64_t arg = -1;
|
int64_t arg = GET_FLAG;
|
||||||
return sendToDetector<uint64_t>(F_SET_PATTERN_IO_CONTROL, arg);
|
return sendToDetector<uint64_t>(F_SET_PATTERN_IO_CONTROL, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1782,7 +1771,7 @@ void Module::setPatternIOControl(uint64_t word) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint64_t Module::getPatternClockControl() {
|
uint64_t Module::getPatternClockControl() {
|
||||||
int64_t arg = -1;
|
int64_t arg = GET_FLAG;
|
||||||
return sendToDetector<uint64_t>(F_SET_PATTERN_CLOCK_CONTROL, arg);
|
return sendToDetector<uint64_t>(F_SET_PATTERN_CLOCK_CONTROL, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1791,7 +1780,8 @@ void Module::setPatternClockControl(uint64_t word) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint64_t Module::getPatternWord(int addr) {
|
uint64_t Module::getPatternWord(int addr) {
|
||||||
uint64_t args[]{static_cast<uint64_t>(addr), static_cast<uint64_t>(-1)};
|
uint64_t args[]{static_cast<uint64_t>(addr),
|
||||||
|
static_cast<uint64_t>(GET_FLAG)};
|
||||||
return sendToDetector<uint64_t>(F_SET_PATTERN_WORD, args);
|
return sendToDetector<uint64_t>(F_SET_PATTERN_WORD, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1801,7 +1791,7 @@ void Module::setPatternWord(int addr, uint64_t word) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::array<int, 2> Module::getPatternLoopAddresses(int level) {
|
std::array<int, 2> Module::getPatternLoopAddresses(int level) {
|
||||||
int args[]{level, -1, -1};
|
int args[]{level, GET_FLAG, GET_FLAG};
|
||||||
std::array<int, 2> retvals{};
|
std::array<int, 2> retvals{};
|
||||||
sendToDetector(F_SET_PATTERN_LOOP_ADDRESSES, args, retvals);
|
sendToDetector(F_SET_PATTERN_LOOP_ADDRESSES, args, retvals);
|
||||||
return retvals;
|
return retvals;
|
||||||
@ -1814,7 +1804,7 @@ void Module::setPatternLoopAddresses(int level, int start, int stop) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Module::getPatternLoopCycles(int level) {
|
int Module::getPatternLoopCycles(int level) {
|
||||||
int args[]{level, -1};
|
int args[]{level, GET_FLAG};
|
||||||
return sendToDetector<int>(F_SET_PATTERN_LOOP_CYCLES, args);
|
return sendToDetector<int>(F_SET_PATTERN_LOOP_CYCLES, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1824,7 +1814,7 @@ void Module::setPatternLoopCycles(int level, int n) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Module::getPatternWaitAddr(int level) {
|
int Module::getPatternWaitAddr(int level) {
|
||||||
int args[]{level, -1};
|
int args[]{level, GET_FLAG};
|
||||||
return sendToDetector<int>(F_SET_PATTERN_WAIT_ADDR, args);
|
return sendToDetector<int>(F_SET_PATTERN_WAIT_ADDR, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1834,7 +1824,8 @@ void Module::setPatternWaitAddr(int level, int addr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint64_t Module::getPatternWaitTime(int level) {
|
uint64_t Module::getPatternWaitTime(int level) {
|
||||||
uint64_t args[]{static_cast<uint64_t>(level), static_cast<uint64_t>(-1)};
|
uint64_t args[]{static_cast<uint64_t>(level),
|
||||||
|
static_cast<uint64_t>(GET_FLAG)};
|
||||||
return sendToDetector<uint64_t>(F_SET_PATTERN_WAIT_TIME, args);
|
return sendToDetector<uint64_t>(F_SET_PATTERN_WAIT_TIME, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2069,7 +2060,7 @@ int Module::setStopPort(int port_number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Module::getLockDetector() {
|
bool Module::getLockDetector() {
|
||||||
int arg = -1;
|
int arg = GET_FLAG;
|
||||||
return static_cast<bool>(sendToDetector<int>(F_LOCK_SERVER, arg));
|
return static_cast<bool>(sendToDetector<int>(F_LOCK_SERVER, arg));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2618,10 +2609,6 @@ void Module::updateRateCorrection() {
|
|||||||
void Module::setThresholdEnergyAndSettings(int e_eV, detectorSettings isettings,
|
void Module::setThresholdEnergyAndSettings(int e_eV, detectorSettings isettings,
|
||||||
bool trimbits) {
|
bool trimbits) {
|
||||||
|
|
||||||
// if settings provided, use that, else use the shared memory variable
|
|
||||||
detectorSettings is =
|
|
||||||
((isettings != GET_SETTINGS) ? isettings : getSettings());
|
|
||||||
|
|
||||||
// verify e_eV exists in trimEneregies[]
|
// verify e_eV exists in trimEneregies[]
|
||||||
if (shm()->trimEnergies.empty() || (e_eV < shm()->trimEnergies.front()) ||
|
if (shm()->trimEnergies.empty() || (e_eV < shm()->trimEnergies.front()) ||
|
||||||
(e_eV > shm()->trimEnergies.back())) {
|
(e_eV > shm()->trimEnergies.back())) {
|
||||||
@ -2636,7 +2623,7 @@ void Module::setThresholdEnergyAndSettings(int e_eV, detectorSettings isettings,
|
|||||||
sls_detector_module myMod{shm()->myDetectorType};
|
sls_detector_module myMod{shm()->myDetectorType};
|
||||||
|
|
||||||
if (!interpolate) {
|
if (!interpolate) {
|
||||||
std::string settingsfname = getTrimbitFilename(is, e_eV);
|
std::string settingsfname = getTrimbitFilename(isettings, e_eV);
|
||||||
LOG(logDEBUG1) << "Settings File is " << settingsfname;
|
LOG(logDEBUG1) << "Settings File is " << settingsfname;
|
||||||
myMod = readSettingsFile(settingsfname, trimbits);
|
myMod = readSettingsFile(settingsfname, trimbits);
|
||||||
} else {
|
} else {
|
||||||
@ -2649,8 +2636,8 @@ void Module::setThresholdEnergyAndSettings(int e_eV, detectorSettings isettings,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::string settingsfname1 = getTrimbitFilename(is, trim1);
|
std::string settingsfname1 = getTrimbitFilename(isettings, trim1);
|
||||||
std::string settingsfname2 = getTrimbitFilename(is, trim2);
|
std::string settingsfname2 = getTrimbitFilename(isettings, trim2);
|
||||||
LOG(logDEBUG1) << "Settings Files are " << settingsfname1 << " and "
|
LOG(logDEBUG1) << "Settings Files are " << settingsfname1 << " and "
|
||||||
<< settingsfname2;
|
<< settingsfname2;
|
||||||
auto myMod1 = readSettingsFile(settingsfname1, trimbits);
|
auto myMod1 = readSettingsFile(settingsfname1, trimbits);
|
||||||
@ -2665,10 +2652,10 @@ void Module::setThresholdEnergyAndSettings(int e_eV, detectorSettings isettings,
|
|||||||
linearInterpolation(e_eV, trim1, trim2, myMod1.tau, myMod2.tau);
|
linearInterpolation(e_eV, trim1, trim2, myMod1.tau, myMod2.tau);
|
||||||
}
|
}
|
||||||
|
|
||||||
myMod.reg = is;
|
myMod.reg = isettings;
|
||||||
myMod.eV = e_eV;
|
myMod.eV = e_eV;
|
||||||
setModule(myMod, trimbits);
|
setModule(myMod, trimbits);
|
||||||
if (getSettings() != is) {
|
if (getSettings() != isettings) {
|
||||||
throw RuntimeError("setThresholdEnergyAndSettings: Could not set "
|
throw RuntimeError("setThresholdEnergyAndSettings: Could not set "
|
||||||
"settings in detector");
|
"settings in detector");
|
||||||
}
|
}
|
||||||
|
@ -293,8 +293,8 @@ class Module : public virtual slsDetectorDefs {
|
|||||||
int64_t getSubDeadTime();
|
int64_t getSubDeadTime();
|
||||||
void setSubDeadTime(int64_t value);
|
void setSubDeadTime(int64_t value);
|
||||||
int getThresholdEnergy();
|
int getThresholdEnergy();
|
||||||
void setThresholdEnergy(int e_eV, detectorSettings isettings = GET_SETTINGS,
|
void setThresholdEnergy(int e_eV, detectorSettings isettings,
|
||||||
bool trimbits = true);
|
bool trimbits);
|
||||||
std::string getSettingsDir();
|
std::string getSettingsDir();
|
||||||
std::string setSettingsDir(const std::string &dir);
|
std::string setSettingsDir(const std::string &dir);
|
||||||
bool getParallelMode();
|
bool getParallelMode();
|
||||||
|
@ -1088,8 +1088,7 @@ int ClientInterface::set_flipped_data(Interface &socket) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int ClientInterface::set_file_format(Interface &socket) {
|
int ClientInterface::set_file_format(Interface &socket) {
|
||||||
fileFormat f = GET_FILE_FORMAT;
|
auto f = socket.Receive<fileFormat>();
|
||||||
socket.Receive(f);
|
|
||||||
if (f < 0 || f > NUM_FILE_FORMATS) {
|
if (f < 0 || f > NUM_FILE_FORMATS) {
|
||||||
throw RuntimeError("Invalid file format: " + std::to_string(f));
|
throw RuntimeError("Invalid file format: " + std::to_string(f));
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,6 @@
|
|||||||
/** maximum unit size of program sent to detector */
|
/** maximum unit size of program sent to detector */
|
||||||
#define MAX_FPGAPROGRAMSIZE (2 * 1024 * 1024)
|
#define MAX_FPGAPROGRAMSIZE (2 * 1024 * 1024)
|
||||||
|
|
||||||
/** get flag form most functions */
|
|
||||||
#define GET_FLAG -1
|
#define GET_FLAG -1
|
||||||
|
|
||||||
#define DEFAULT_DET_MAC "00:aa:bb:cc:dd:ee"
|
#define DEFAULT_DET_MAC "00:aa:bb:cc:dd:ee"
|
||||||
@ -73,7 +72,6 @@ class slsDetectorDefs {
|
|||||||
|
|
||||||
/** Type of the detector */
|
/** Type of the detector */
|
||||||
enum detectorType {
|
enum detectorType {
|
||||||
GET_DETECTOR_TYPE = -1,
|
|
||||||
GENERIC,
|
GENERIC,
|
||||||
EIGER,
|
EIGER,
|
||||||
GOTTHARD,
|
GOTTHARD,
|
||||||
@ -85,20 +83,17 @@ class slsDetectorDefs {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** return values */
|
/** return values */
|
||||||
enum {
|
enum { OK, FAIL };
|
||||||
OK, /**< function succeeded */
|
|
||||||
FAIL /**< function failed */
|
|
||||||
};
|
|
||||||
|
|
||||||
/** staus mask */
|
/** staus mask */
|
||||||
enum runStatus {
|
enum runStatus {
|
||||||
IDLE, /**< detector ready to start acquisition - no data in memory */
|
IDLE,
|
||||||
ERROR, /**< error i.e. normally fifo full */
|
ERROR,
|
||||||
WAITING, /**< waiting for trigger or gate signal */
|
WAITING,
|
||||||
RUN_FINISHED, /**< acquisition not running but data in memory */
|
RUN_FINISHED,
|
||||||
TRANSMITTING, /**< acquisition running and data in memory */
|
TRANSMITTING,
|
||||||
RUNNING, /**< acquisition running, no data in memory */
|
RUNNING,
|
||||||
STOPPED /**< acquisition stopped externally */
|
STOPPED
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -121,22 +116,19 @@ class slsDetectorDefs {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint64_t frameNumber; /**< is the frame number */
|
uint64_t frameNumber;
|
||||||
uint32_t expLength; /**< is the subframe number (32 bit eiger) or real
|
uint32_t expLength;
|
||||||
time exposure time in 100ns (others) */
|
uint32_t packetNumber;
|
||||||
uint32_t packetNumber; /**< is the packet number */
|
uint64_t bunchId;
|
||||||
uint64_t bunchId; /**< is the bunch id from beamline */
|
uint64_t timestamp;
|
||||||
uint64_t timestamp; /**< is the time stamp with 10 MHz clock */
|
uint16_t modId;
|
||||||
uint16_t modId; /**< is the unique module id (unique even for left,
|
uint16_t row;
|
||||||
right, top, bottom) */
|
uint16_t column;
|
||||||
uint16_t row; /**< is the row index in the complete detector system */
|
uint16_t reserved;
|
||||||
uint16_t
|
uint32_t debug;
|
||||||
column; /**< is the column index in the complete detector system */
|
uint16_t roundRNumber;
|
||||||
uint16_t reserved; /**< is reserved */
|
uint8_t detType;
|
||||||
uint32_t debug; /**< is for debugging purposes */
|
uint8_t version;
|
||||||
uint16_t roundRNumber; /**< is the round robin set number */
|
|
||||||
uint8_t detType; /**< is the detector type see :: detectorType */
|
|
||||||
uint8_t version; /**< is the version number of this structure format */
|
|
||||||
} sls_detector_header;
|
} sls_detector_header;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@ -149,37 +141,27 @@ class slsDetectorDefs {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
enum frameDiscardPolicy {
|
enum frameDiscardPolicy {
|
||||||
GET_FRAME_DISCARD_POLICY = -1, /**< to get the missing packet mode */
|
NO_DISCARD,
|
||||||
NO_DISCARD, /**< pad incomplete packets with -1, default mode */
|
DISCARD_EMPTY_FRAMES,
|
||||||
DISCARD_EMPTY_FRAMES, /**< discard incomplete frames, fastest mode, save
|
DISCARD_PARTIAL_FRAMES,
|
||||||
space, not suitable for multiple modules */
|
|
||||||
DISCARD_PARTIAL_FRAMES, /**< ignore missing packets, must check with
|
|
||||||
packetsMask for data integrity, fast mode and
|
|
||||||
suitable for multiple modules */
|
|
||||||
NUM_DISCARD_POLICIES
|
NUM_DISCARD_POLICIES
|
||||||
};
|
};
|
||||||
|
|
||||||
enum fileFormat {
|
enum fileFormat { BINARY, HDF5, NUM_FILE_FORMATS };
|
||||||
GET_FILE_FORMAT = -1, /**< the receiver will return its file format */
|
|
||||||
BINARY, /**< binary format */
|
|
||||||
HDF5, /**< hdf5 format */
|
|
||||||
NUM_FILE_FORMATS
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@short structure for a region of interest
|
@short structure for a region of interest
|
||||||
xmin,xmax,ymin,ymax define the limits of the region
|
xmin,xmax,ymin,ymax define the limits of the region
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
struct ROI {
|
struct ROI {
|
||||||
int xmin{-1}; /**< is the roi xmin (in channel number) */
|
int xmin{-1};
|
||||||
int xmax{-1}; /**< is the roi xmax (in channel number)*/
|
int xmax{-1};
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
#else
|
#else
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int xmin; /**< is the roi xmin (in channel number) */
|
int xmin;
|
||||||
int xmax; /**< is the roi xmax (in channel number)*/
|
int xmax;
|
||||||
} ROI;
|
} ROI;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -191,10 +173,7 @@ typedef struct {
|
|||||||
/**
|
/**
|
||||||
dimension indexes
|
dimension indexes
|
||||||
*/
|
*/
|
||||||
enum dimension {
|
enum dimension { X, Y };
|
||||||
X = 0, /**< X dimension */
|
|
||||||
Y = 1 /**< Y dimension */
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
struct xy {
|
struct xy {
|
||||||
@ -219,12 +198,11 @@ typedef struct {
|
|||||||
communication mode using external signals
|
communication mode using external signals
|
||||||
*/
|
*/
|
||||||
enum timingMode {
|
enum timingMode {
|
||||||
GET_TIMING_MODE = -1, /**<return flag for communication mode */
|
AUTO_TIMING,
|
||||||
AUTO_TIMING, /**< internal timing */
|
TRIGGER_EXPOSURE,
|
||||||
TRIGGER_EXPOSURE, /**< trigger mode i.e. exposure is triggered */
|
GATED,
|
||||||
GATED, /**< gated */
|
BURST_TRIGGER,
|
||||||
BURST_TRIGGER, /**< trigger a burst of frames */
|
TRIGGER_GATED,
|
||||||
TRIGGER_GATED, /**< trigger and gating */
|
|
||||||
NUM_TIMING_MODES
|
NUM_TIMING_MODES
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -350,7 +328,6 @@ typedef struct {
|
|||||||
detector settings indexes
|
detector settings indexes
|
||||||
*/
|
*/
|
||||||
enum detectorSettings {
|
enum detectorSettings {
|
||||||
GET_SETTINGS = -1,
|
|
||||||
STANDARD,
|
STANDARD,
|
||||||
FAST,
|
FAST,
|
||||||
HIGHGAIN,
|
HIGHGAIN,
|
||||||
@ -372,8 +349,8 @@ typedef struct {
|
|||||||
G2_LOWCAP_LOWGAIN,
|
G2_LOWCAP_LOWGAIN,
|
||||||
G4_HIGHGAIN,
|
G4_HIGHGAIN,
|
||||||
G4_LOWGAIN,
|
G4_LOWGAIN,
|
||||||
UNDEFINED = 200, /**< undefined or custom settings */
|
UNDEFINED = 200,
|
||||||
UNINITIALIZED /**< uninitialiazed (status at startup) */
|
UNINITIALIZED
|
||||||
};
|
};
|
||||||
|
|
||||||
#define TRIMBITMASK 0x3f
|
#define TRIMBITMASK 0x3f
|
||||||
@ -388,41 +365,18 @@ typedef struct {
|
|||||||
/** chip speed */
|
/** chip speed */
|
||||||
enum speedLevel { FULL_SPEED, HALF_SPEED, QUARTER_SPEED };
|
enum speedLevel { FULL_SPEED, HALF_SPEED, QUARTER_SPEED };
|
||||||
|
|
||||||
/** port type */
|
|
||||||
enum portType {
|
|
||||||
CONTROL_PORT, /**< control port */
|
|
||||||
STOP_PORT, /**<stop port */
|
|
||||||
DATA_PORT /**< receiver tcp port with client*/
|
|
||||||
};
|
|
||||||
|
|
||||||
/** hierarchy in multi-detector structure, if any */
|
/** hierarchy in multi-detector structure, if any */
|
||||||
enum masterFlags {
|
enum masterFlags { NO_MASTER, IS_MASTER, IS_SLAVE };
|
||||||
GET_MASTER = -1, /**< return master flag */
|
|
||||||
NO_MASTER, /**< no master/slave hierarchy defined */
|
|
||||||
IS_MASTER, /**<is master */
|
|
||||||
IS_SLAVE /**< is slave */
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* frame mode for processor
|
* frame mode for processor
|
||||||
*/
|
*/
|
||||||
enum frameModeType {
|
enum frameModeType { PEDESTAL, NEW_PEDESTAL, FLATFIELD, NEW_FLATFIELD };
|
||||||
GET_FRAME_MODE = -1,
|
|
||||||
PEDESTAL, /** < pedestal */
|
|
||||||
NEW_PEDESTAL, /** < new pedestal */
|
|
||||||
FLATFIELD, /** < flatfield */
|
|
||||||
NEW_FLATFIELD /** < new flatfield */
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* detector mode for processor
|
* detector mode for processor
|
||||||
*/
|
*/
|
||||||
enum detectorModeType {
|
enum detectorModeType { COUNTING, INTERPOLATING, ANALOG };
|
||||||
GET_DETECTOR_MODE = -1,
|
|
||||||
COUNTING, /** < counting */
|
|
||||||
INTERPOLATING, /** < interpolating */
|
|
||||||
ANALOG /** < analog */
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* burst mode for gotthard2
|
* burst mode for gotthard2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user