jungfrau server: added deg and maxadcphaseshift, ctb & moench server: set adc phase like jungfrau that positive shift is positive, moved conversion between shift to degrees to the common function. receiver: removed unused variables

This commit is contained in:
2019-03-28 09:35:53 +01:00
parent 5a4122ae7c
commit c38bebd615
14 changed files with 152 additions and 132 deletions

View File

@ -1957,6 +1957,7 @@ int set_speed(int file_des) {
#ifdef JUNGFRAUD
case ADC_PHASE:
case CLOCK_DIVIDER:
case MAX_ADC_PHASE_SHIFT:
#elif CHIPTESTBOARDD
case ADC_PHASE:
case DBIT_PHASE:
@ -1987,7 +1988,7 @@ int set_speed(int file_des) {
modeNotImplemented(speedName, (int)ind);
break;
}
#if (!defined(CHIPTESTBOARDD)) && (!defined(MOENCHD))
#if (!defined(CHIPTESTBOARDD)) && (!defined(MOENCHD)) && (!defined(JUNGFRAUD))
if (ret == OK && mode == 1) {
ret = FAIL;
strcpy(mess, "deg is not defined for this detector.\n");
@ -1998,14 +1999,14 @@ int set_speed(int file_des) {
if (ret == OK) {
// set
if ((val != -1) && (Server_VerifyLock() == OK)) {
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(JUNGFRAUD)
setSpeed(ind, val, mode);
#else
setSpeed(ind, val);
#endif
}
// get
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(JUNGFRAUD)
retval = getSpeed(ind, mode);
#else
retval = getSpeed(ind);
@ -2015,9 +2016,13 @@ int set_speed(int file_des) {
char validateName[20] = {0};
sprintf(validateName, "set %s", speedName);
#ifndef GOTTHARDD
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(JUNGFRAUD)
if (ind == ADC_PHASE || ind == DBIT_PHASE && mode == 1) {
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
ret = validatePhaseinDegrees(ind, val, retval);
#else
ret = validatePhaseinDegrees(val, retval);
#endif
if (ret == FAIL) {
sprintf(mess, "Could not set %s. Set %s, got %s\n", validateName);
FILE_LOG(logERROR,(mess));