mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
Defaultdacs (#214)
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
#include "slsDetectorServer_defs.h" // DAC_INDEX, ADC_INDEX, also include RegisterDefs.h
|
||||
#include "sls/sls_detector_defs.h"
|
||||
#include "slsDetectorServer_defs.h" // DAC_INDEX, ADC_INDEX, also include RegisterDefs.h
|
||||
#ifdef GOTTHARDD
|
||||
#include "AD9252.h" // old board compatibility
|
||||
#include "clogger.h" // runState(enum TLogLevel)
|
||||
@ -114,8 +114,7 @@ int updateDatabytesandAllocateRAM();
|
||||
void updateDataBytes();
|
||||
#endif
|
||||
|
||||
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(MYTHEN3D) || \
|
||||
defined(MOENCHD)
|
||||
#ifndef CHIPTESTBOARDD
|
||||
int setDefaultDacs();
|
||||
#endif
|
||||
#ifdef MYTHEN3D
|
||||
|
@ -240,4 +240,5 @@ int set_bad_channels(int);
|
||||
int reconfigure_udp(int);
|
||||
int validate_udp_configuration(int);
|
||||
int get_bursts_left(int);
|
||||
int start_readout(int);
|
||||
int start_readout(int);
|
||||
int set_default_dacs(int);
|
@ -2,8 +2,8 @@
|
||||
#include "clogger.h"
|
||||
#include "communication_funcs.h"
|
||||
#include "sharedMemory.h"
|
||||
#include "slsDetectorFunctionList.h"
|
||||
#include "sls/sls_detector_funcs.h"
|
||||
#include "slsDetectorFunctionList.h"
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <pthread.h>
|
||||
@ -359,6 +359,7 @@ void function_table() {
|
||||
flist[F_VALIDATE_UDP_CONFIG] = &validate_udp_configuration;
|
||||
flist[F_GET_BURSTS_LEFT] = &get_bursts_left;
|
||||
flist[F_START_READOUT] = &start_readout;
|
||||
flist[F_SET_DEFAULT_DACS] = &set_default_dacs;
|
||||
|
||||
// check
|
||||
if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) {
|
||||
@ -1634,8 +1635,7 @@ int set_settings(int file_des) {
|
||||
|
||||
if ((int)isett != GET_FLAG) {
|
||||
validate((int)isett, (int)retval, "set settings", DEC);
|
||||
#if defined(JUNGFRAUD) || defined(GOTTHARDD)
|
||||
// gotthard2 does not set default dacs
|
||||
#ifdef GOTTHARDD
|
||||
if (ret == OK) {
|
||||
ret = setDefaultDacs();
|
||||
if (ret == FAIL) {
|
||||
@ -8145,3 +8145,21 @@ int start_readout(int file_des) {
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||
}
|
||||
|
||||
int set_default_dacs(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
|
||||
#ifdef CHIPTESTBOARDD
|
||||
functionNotImplemented();
|
||||
#else
|
||||
if (Server_VerifyLock() == OK) {
|
||||
if (setDefaultDacs() == FAIL) {
|
||||
ret = FAIL;
|
||||
strcpy(mess, "Could not set default dacs");
|
||||
LOG(logERROR, (mess));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||
}
|
Reference in New Issue
Block a user