mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 13:27:14 +02:00
adding config for tests
This commit is contained in:
@ -1826,16 +1826,13 @@ int slsDetector::getDataBytesInclGapPixels() {
|
||||
int slsDetector::setDAC(int val, dacIndex index, int mV) {
|
||||
int fnum = F_SET_DAC;
|
||||
int ret = FAIL;
|
||||
int args[3]{static_cast<int>(index), mV, val};
|
||||
int args[]{static_cast<int>(index), mV, val};
|
||||
int retval = -1;
|
||||
FILE_LOG(logDEBUG1) << "Setting DAC " << index << " to " << val
|
||||
<< (mV != 0 ? "mV" : "dac units");
|
||||
|
||||
if (detector_shm()->onlineFlag == ONLINE_FLAG) {
|
||||
auto client = DetectorSocket(detector_shm()->hostname,
|
||||
detector_shm()->controlPort);
|
||||
ret = client.sendCommandThenRead(fnum, args, sizeof(args), &retval,
|
||||
sizeof(retval));
|
||||
ret = sendToDetector(fnum, args, sizeof(args), &retval, sizeof(retval));
|
||||
FILE_LOG(logDEBUG1) << "Dac index " << index << ": " << retval
|
||||
<< (mV != 0 ? "mV" : "dac units");
|
||||
}
|
||||
@ -1845,6 +1842,15 @@ int slsDetector::setDAC(int val, dacIndex index, int mV) {
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
int slsDetector::sendToDetector(int fnum, void* args, size_t args_size, void* retval, size_t retval_size)
|
||||
{
|
||||
auto client = DetectorSocket(detector_shm()->hostname,
|
||||
detector_shm()->controlPort);
|
||||
|
||||
return client.sendCommandThenRead(fnum, args, args_size, retval, retval_size);
|
||||
}
|
||||
|
||||
int slsDetector::getADC(dacIndex index) {
|
||||
int fnum = F_GET_ADC;
|
||||
int arg = static_cast<int>(index);
|
||||
@ -1870,10 +1876,10 @@ slsDetector::setExternalCommunicationMode(externalCommunicationMode pol) {
|
||||
FILE_LOG(logDEBUG1) << "Setting communication to mode " << pol;
|
||||
|
||||
if (detector_shm()->onlineFlag == ONLINE_FLAG) {
|
||||
auto client = DetectorSocket(detector_shm()->hostname,
|
||||
detector_shm()->controlPort);
|
||||
ret = client.sendCommandThenRead(fnum, &arg, sizeof(arg), &retval,
|
||||
sizeof(retval));
|
||||
ret = sendToDetector(fnum, &arg, sizeof(arg), &retval,sizeof(retval));
|
||||
// auto client = DetectorSocket(detector_shm()->hostname,
|
||||
// detector_shm()->controlPort);
|
||||
// ret = client.sendCommandThenRead(fnum, &arg, sizeof(arg), &retval,sizeof(retval));
|
||||
FILE_LOG(logDEBUG1) << "Timing Mode: " << retval;
|
||||
}
|
||||
if (ret == FORCE_UPDATE) {
|
||||
|
Reference in New Issue
Block a user