slsDetector implicit conversion

This commit is contained in:
Erik Frojdh 2019-04-16 09:15:17 +02:00
parent d31446ce07
commit 0527880747
4 changed files with 7 additions and 7 deletions

View File

@ -1299,7 +1299,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @param detPos -1 for all detectors in list or specific detector position
* @returns return value (mostly -1 as it can't read adc register)
*/
int writeAdcRegister(int addr, int val, int detPos = -1);
int writeAdcRegister(uint32_t addr, uint32_t val, int detPos = -1);
/**
* Activates/Deactivates the detector (Eiger only)

View File

@ -1160,7 +1160,7 @@ class slsDetector : public virtual slsDetectorDefs{
* @param val value
* @returns return value (mostly -1 as it can't read adc register)
*/
int writeAdcRegister(int addr, int val);
int writeAdcRegister(uint32_t addr, uint32_t val);
/**
* Activates/Deactivates the detector (Eiger only)

View File

@ -2448,7 +2448,7 @@ const slsDetectorDefs::ROI *multiSlsDetector::getROI(int &n, int detPos) {
return retval;
}
int multiSlsDetector::writeAdcRegister(int addr, int val, int detPos) {
int multiSlsDetector::writeAdcRegister(uint32_t addr, uint32_t val, int detPos) {
// single
if (detPos >= 0) {
return detectors[detPos]->writeAdcRegister(addr, val);

View File

@ -3204,10 +3204,10 @@ int slsDetector::sendROI(int n, ROI roiLimits[]) {
return ret;
}
int slsDetector::writeAdcRegister(int addr, int val) {
int slsDetector::writeAdcRegister(uint32_t addr, uint32_t val) {
int fnum = F_WRITE_ADC_REG;
int ret = FAIL;
uint32_t args[2] = {(uint32_t)addr, (uint32_t)val};
uint32_t args[]{addr, val};
FILE_LOG(logDEBUG1) << "Writing to ADC register 0x" << std::hex << addr
<< "data: 0x" << std::hex << val << std::dec;
@ -3236,7 +3236,7 @@ int slsDetector::activate(int enable) {
ret = client.sendCommandThenRead(fnum, &arg, sizeof(arg), &retval,
sizeof(retval));
FILE_LOG(logDEBUG1) << "Activate: " << retval;
detector_shm()->activated = retval;
detector_shm()->activated = static_cast<bool>(retval);
}
if (ret == FORCE_UPDATE) {
ret = updateDetector();
@ -3260,7 +3260,7 @@ int slsDetector::activate(int enable) {
updateCachedReceiverVariables();
}
}
return detector_shm()->activated;
return static_cast<int>(detector_shm()->activated);
}
int slsDetector::setDeactivatedRxrPaddingMode(int padding) {