using GET_FLAG directly

This commit is contained in:
Erik Frojdh 2020-07-27 16:55:26 +02:00
parent 9204a56ff7
commit 02bda7c533

View File

@ -347,8 +347,7 @@ void Module::setDAC(int val, dacIndex index, bool mV) {
} }
bool Module::getPowerChip() const { bool Module::getPowerChip() const {
int arg = GET_FLAG; return sendToDetector<int>(F_POWER_CHIP, GET_FLAG);
return sendToDetector<int>(F_POWER_CHIP, arg);
} }
void Module::setPowerChip(bool on) { void Module::setPowerChip(bool on) {
@ -681,8 +680,7 @@ std::string Module::printReceiverConfiguration() {
} }
bool Module::getTenGiga() const { bool Module::getTenGiga() const {
int arg = GET_FLAG; return static_cast<bool>(sendToDetector<int>(F_ENABLE_TEN_GIGA, GET_FLAG));
return static_cast<bool>(sendToDetector<int>(F_ENABLE_TEN_GIGA, arg));
} }
void Module::setTenGiga(bool value) { void Module::setTenGiga(bool value) {
@ -819,8 +817,7 @@ int Module::setReceiverPort(int port_number) {
} }
int Module::getReceiverFifoDepth() const { int Module::getReceiverFifoDepth() const {
int arg = GET_FLAG; return sendToReceiver<int>(F_SET_RECEIVER_FIFO_DEPTH, GET_FLAG);
return sendToReceiver<int>(F_SET_RECEIVER_FIFO_DEPTH, arg);
} }
void Module::setReceiverFifoDepth(int n_frames) { void Module::setReceiverFifoDepth(int n_frames) {
@ -867,8 +864,7 @@ void Module::setReceiverUDPSocketBufferSize(int64_t udpsockbufsize) {
} }
bool Module::getReceiverLock() const { bool Module::getReceiverLock() const {
int arg = GET_FLAG; return static_cast<bool>(sendToReceiver<int>(F_LOCK_RECEIVER, GET_FLAG));
return static_cast<bool>(sendToReceiver<int>(F_LOCK_RECEIVER, arg));
} }
void Module::setReceiverLock(bool lock) { void Module::setReceiverLock(bool lock) {
@ -991,8 +987,7 @@ void Module::setReceiverStreamingFrequency(int freq) {
} }
int Module::getReceiverStreamingTimer() const { int Module::getReceiverStreamingTimer() const {
int arg = GET_FLAG; return sendToReceiver<int>(F_RECEIVER_STREAMING_TIMER, GET_FLAG);
return sendToReceiver<int>(F_RECEIVER_STREAMING_TIMER, arg);
} }
void Module::setReceiverStreamingTimer(int time_in_ms) { void Module::setReceiverStreamingTimer(int time_in_ms) {
@ -1208,9 +1203,8 @@ int64_t Module::getMeasuredSubFramePeriod() const {
} }
bool Module::getActivate() const { bool Module::getActivate() const {
int arg = GET_FLAG; auto retval = sendToDetector<int>(F_ACTIVATE, GET_FLAG);
auto retval = sendToDetector<int>(F_ACTIVATE, arg); auto retval2 = sendToDetectorStop<int>(F_ACTIVATE, GET_FLAG);
auto retval2 = sendToDetectorStop<int>(F_ACTIVATE, arg);
if (retval != retval2) { if (retval != retval2) {
std::ostringstream oss; std::ostringstream oss;
oss << "Inconsistent activate state. Control Server: " << retval oss << "Inconsistent activate state. Control Server: " << retval
@ -1239,8 +1233,7 @@ void Module::setDeactivatedRxrPaddingMode(bool padding) {
} }
bool Module::getCounterBit() const { bool Module::getCounterBit() const {
int arg = GET_FLAG; return (!static_cast<bool>(sendToDetector<int>(F_SET_COUNTER_BIT, GET_FLAG)));
return (!static_cast<bool>(sendToDetector<int>(F_SET_COUNTER_BIT, arg)));
} }
void Module::setCounterBit(bool cb) { void Module::setCounterBit(bool cb) {
@ -1288,8 +1281,7 @@ void Module::setThresholdTemperature(int val) {
} }
bool Module::getTemperatureControl() const { bool Module::getTemperatureControl() const {
int arg = GET_FLAG; return static_cast<bool>(sendToDetectorStop<int>(F_TEMP_CONTROL, GET_FLAG));
return static_cast<bool>(sendToDetectorStop<int>(F_TEMP_CONTROL, arg));
} }
void Module::setTemperatureControl(bool val) { void Module::setTemperatureControl(bool val) {
@ -1297,8 +1289,7 @@ void Module::setTemperatureControl(bool val) {
} }
int Module::getTemperatureEvent() const { int Module::getTemperatureEvent() const {
int arg = GET_FLAG; return sendToDetectorStop<int>(F_TEMP_EVENT, GET_FLAG);
return sendToDetectorStop<int>(F_TEMP_EVENT, arg);
} }
void Module::resetTemperatureEvent() { void Module::resetTemperatureEvent() {
@ -1307,8 +1298,7 @@ void Module::resetTemperatureEvent() {
} }
bool Module::getAutoComparatorDisableMode() const{ bool Module::getAutoComparatorDisableMode() const{
int arg = GET_FLAG; return static_cast<bool>(sendToDetector<int>(F_AUTO_COMP_DISABLE, GET_FLAG));
return static_cast<bool>(sendToDetector<int>(F_AUTO_COMP_DISABLE, arg));
} }
void Module::setAutoComparatorDisableMode(bool val) { void Module::setAutoComparatorDisableMode(bool val) {
@ -1324,8 +1314,7 @@ void Module::setNumberOfAdditionalStorageCells(int value) {
} }
int Module::getStorageCellStart() const { int Module::getStorageCellStart() const {
int arg = GET_FLAG; return sendToDetector<int>(F_STORAGE_CELL_START, GET_FLAG);
return sendToDetector<int>(F_STORAGE_CELL_START, arg);
} }
void Module::setStorageCellStart(int pos) { void Module::setStorageCellStart(int pos) {
@ -1900,8 +1889,7 @@ int Module::setExternalSamplingSource(int value) {
} }
bool Module::getExternalSampling() const{ bool Module::getExternalSampling() const{
int arg = GET_FLAG; return sendToDetector<int>(F_EXTERNAL_SAMPLING, GET_FLAG);
return sendToDetector<int>(F_EXTERNAL_SAMPLING, arg);
} }
void Module::setExternalSampling(bool value) { void Module::setExternalSampling(bool value) {
@ -1942,8 +1930,7 @@ void Module::setDigitalIODelay(uint64_t pinMask, int delay) {
} }
bool Module::getLEDEnable() const { bool Module::getLEDEnable() const {
int arg = GET_FLAG; return static_cast<bool>(sendToDetector<int>(F_LED, GET_FLAG));
return static_cast<bool>(sendToDetector<int>(F_LED, arg));
} }
void Module::setLEDEnable(bool enable) { void Module::setLEDEnable(bool enable) {
@ -2344,8 +2331,7 @@ int Module::setStopPort(int port_number) {
} }
bool Module::getLockDetector() const { bool Module::getLockDetector() const {
int arg = GET_FLAG; return static_cast<bool>(sendToDetector<int>(F_LOCK_SERVER, GET_FLAG));
return static_cast<bool>(sendToDetector<int>(F_LOCK_SERVER, arg));
} }
void Module::setLockDetector(bool lock) { void Module::setLockDetector(bool lock) {