mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-28 09:10:01 +02:00
Defaultdacs (#214)
This commit is contained in:
parent
b6b9a5d598
commit
4c4e2ccb6b
Binary file not shown.
Binary file not shown.
@ -681,18 +681,7 @@ void allocateDetectorStructureMemory() {
|
|||||||
void setupDetector() {
|
void setupDetector() {
|
||||||
|
|
||||||
allocateDetectorStructureMemory();
|
allocateDetectorStructureMemory();
|
||||||
// set dacs
|
setDefaultDacs();
|
||||||
LOG(logINFOBLUE, ("Setting Default Dac values\n"));
|
|
||||||
{
|
|
||||||
const int defaultvals[NDAC] = DEFAULT_DAC_VALS;
|
|
||||||
for (int i = 0; i < NDAC; ++i) {
|
|
||||||
setDAC((enum DACINDEX)i, defaultvals[i], 0);
|
|
||||||
if ((detectorModules)->dacs[i] != defaultvals[i]) {
|
|
||||||
LOG(logERROR, ("Setting dac %d failed, wrote %d, read %d\n", i,
|
|
||||||
defaultvals[i], (detectorModules)->dacs[i]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#ifdef VIRTUAL
|
#ifdef VIRTUAL
|
||||||
sharedMemory_setStatus(IDLE);
|
sharedMemory_setStatus(IDLE);
|
||||||
#endif
|
#endif
|
||||||
@ -754,6 +743,21 @@ void setupDetector() {
|
|||||||
LOG(logDEBUG1, ("Setup detector done\n\n"));
|
LOG(logDEBUG1, ("Setup detector done\n\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int setDefaultDacs() {
|
||||||
|
int ret = OK;
|
||||||
|
LOG(logINFOBLUE, ("Setting Default Dac values\n"));
|
||||||
|
const int defaultvals[NDAC] = DEFAULT_DAC_VALS;
|
||||||
|
for (int i = 0; i < NDAC; ++i) {
|
||||||
|
setDAC((enum DACINDEX)i, defaultvals[i], 0);
|
||||||
|
if ((detectorModules)->dacs[i] != defaultvals[i]) {
|
||||||
|
ret = FAIL;
|
||||||
|
LOG(logERROR, ("Setting dac %d failed, wrote %d, read %d\n", i,
|
||||||
|
defaultvals[i], (detectorModules)->dacs[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* advanced read/write reg */
|
/* advanced read/write reg */
|
||||||
int writeRegister(uint32_t offset, uint32_t data) {
|
int writeRegister(uint32_t offset, uint32_t data) {
|
||||||
#ifdef VIRTUAL
|
#ifdef VIRTUAL
|
||||||
|
Binary file not shown.
@ -48,6 +48,8 @@ double systemFrequency = 0;
|
|||||||
int highvoltage = 0;
|
int highvoltage = 0;
|
||||||
int dacValues[NDAC] = {};
|
int dacValues[NDAC] = {};
|
||||||
int onChipdacValues[ONCHIP_NDAC][NCHIP] = {};
|
int onChipdacValues[ONCHIP_NDAC][NCHIP] = {};
|
||||||
|
int defaultDacValues[NDAC] = {};
|
||||||
|
int defaultOnChipdacValues[ONCHIP_NDAC][NCHIP] = {};
|
||||||
int injectedChannelsOffset = 0;
|
int injectedChannelsOffset = 0;
|
||||||
int injectedChannelsIncrement = 0;
|
int injectedChannelsIncrement = 0;
|
||||||
int vetoReference[NCHIP][NCHAN];
|
int vetoReference[NCHIP][NCHAN];
|
||||||
@ -389,9 +391,13 @@ void setupDetector() {
|
|||||||
cdsGain = 0;
|
cdsGain = 0;
|
||||||
memset(clkPhase, 0, sizeof(clkPhase));
|
memset(clkPhase, 0, sizeof(clkPhase));
|
||||||
memset(dacValues, 0, sizeof(dacValues));
|
memset(dacValues, 0, sizeof(dacValues));
|
||||||
|
for (int i = 0; i < NDAC; ++i) {
|
||||||
|
defaultDacValues[i] = -1;
|
||||||
|
}
|
||||||
for (int i = 0; i < ONCHIP_NDAC; ++i) {
|
for (int i = 0; i < ONCHIP_NDAC; ++i) {
|
||||||
for (int j = 0; j < NCHIP; ++j) {
|
for (int j = 0; j < NCHIP; ++j) {
|
||||||
onChipdacValues[i][j] = -1;
|
onChipdacValues[i][j] = -1;
|
||||||
|
defaultOnChipdacValues[i][j] = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
memset(vetoReference, 0, sizeof(vetoReference));
|
memset(vetoReference, 0, sizeof(vetoReference));
|
||||||
@ -475,6 +481,40 @@ void setupDetector() {
|
|||||||
setCurrentSource(DEFAULT_CURRENT_SOURCE);
|
setCurrentSource(DEFAULT_CURRENT_SOURCE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int setDefaultDacs() {
|
||||||
|
int ret = OK;
|
||||||
|
LOG(logINFOBLUE, ("Setting Default Dac values\n"));
|
||||||
|
for (int i = 0; i < NDAC; ++i) {
|
||||||
|
if (defaultDacValues[i] != -1) {
|
||||||
|
setDAC((enum DACINDEX)i, defaultDacValues[i], 0);
|
||||||
|
if (dacValues[i] != defaultDacValues[i]) {
|
||||||
|
ret = FAIL;
|
||||||
|
LOG(logERROR, ("Setting dac %d failed, wrote %d, read %d\n", i,
|
||||||
|
defaultDacValues[i], dacValues[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LOG(logINFOBLUE, ("Setting Default On-chip Dac values\n"));
|
||||||
|
for (int ichip = 0; ichip < NCHIP; ++ichip) {
|
||||||
|
for (int idac = 0; idac < ONCHIP_NDAC; ++idac) {
|
||||||
|
if (defaultOnChipdacValues[idac][ichip] != -1) {
|
||||||
|
setOnChipDAC((enum ONCHIP_DACINDEX)idac, ichip,
|
||||||
|
defaultOnChipdacValues[idac][ichip]);
|
||||||
|
if (onChipdacValues[idac][ichip] !=
|
||||||
|
defaultOnChipdacValues[idac][ichip]) {
|
||||||
|
ret = FAIL;
|
||||||
|
LOG(logERROR,
|
||||||
|
("Setting on-chip dac %d (ichip:%d) failed, "
|
||||||
|
"wrote %d, read %d\n",
|
||||||
|
idac, ichip, defaultOnChipdacValues[idac][ichip],
|
||||||
|
onChipdacValues[idac][ichip]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int readConfigFile() {
|
int readConfigFile() {
|
||||||
|
|
||||||
if (initError == FAIL) {
|
if (initError == FAIL) {
|
||||||
@ -691,6 +731,18 @@ int readConfigFile() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set default on chip dac variable
|
||||||
|
// specific chip
|
||||||
|
if (ichip != -1) {
|
||||||
|
defaultOnChipdacValues[idac][ichip] = value;
|
||||||
|
}
|
||||||
|
// all chips
|
||||||
|
else {
|
||||||
|
for (int i = 0; i < NCHIP; ++i) {
|
||||||
|
defaultOnChipdacValues[idac][i] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// set on chip dac
|
// set on chip dac
|
||||||
if (setOnChipDAC(idac, ichip, value) == FAIL) {
|
if (setOnChipDAC(idac, ichip, value) == FAIL) {
|
||||||
sprintf(initErrorMessage,
|
sprintf(initErrorMessage,
|
||||||
@ -703,7 +755,6 @@ int readConfigFile() {
|
|||||||
|
|
||||||
// dac command
|
// dac command
|
||||||
else {
|
else {
|
||||||
|
|
||||||
enum DACINDEX idac = 0;
|
enum DACINDEX idac = 0;
|
||||||
int value = 0;
|
int value = 0;
|
||||||
|
|
||||||
@ -752,6 +803,9 @@ int readConfigFile() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set default dac variables
|
||||||
|
defaultDacValues[idac] = value;
|
||||||
|
|
||||||
// set dac
|
// set dac
|
||||||
setDAC(idac, value, 0);
|
setDAC(idac, value, 0);
|
||||||
int retval = getDAC(idac, 0);
|
int retval = getDAC(idac, 0);
|
||||||
|
Binary file not shown.
@ -436,9 +436,11 @@ int setDefaultDacs() {
|
|||||||
LOG(logINFOBLUE, ("Setting Default Dac values\n"));
|
LOG(logINFOBLUE, ("Setting Default Dac values\n"));
|
||||||
const int defaultvals[NDAC] = DEFAULT_DAC_VALS;
|
const int defaultvals[NDAC] = DEFAULT_DAC_VALS;
|
||||||
for (int i = 0; i < NDAC; ++i) {
|
for (int i = 0; i < NDAC; ++i) {
|
||||||
// if not already default, set it to default
|
setDAC((enum DACINDEX)i, defaultvals[i], 0);
|
||||||
if (dacValues[i] != defaultvals[i]) {
|
if (dacValues[i] != defaultvals[i]) {
|
||||||
setDAC((enum DACINDEX)i, defaultvals[i], 0);
|
ret = FAIL;
|
||||||
|
LOG(logERROR, ("Setting dac %d failed, wrote %d, read %d\n", i,
|
||||||
|
defaultvals[i], dacValues[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
Binary file not shown.
@ -458,9 +458,11 @@ int setDefaultDacs() {
|
|||||||
LOG(logINFOBLUE, ("Setting Default Dac values\n"));
|
LOG(logINFOBLUE, ("Setting Default Dac values\n"));
|
||||||
const int defaultvals[NDAC] = DEFAULT_DAC_VALS;
|
const int defaultvals[NDAC] = DEFAULT_DAC_VALS;
|
||||||
for (int i = 0; i < NDAC; ++i) {
|
for (int i = 0; i < NDAC; ++i) {
|
||||||
// if not already default, set it to default
|
setDAC((enum DACINDEX)i, defaultvals[i], 0);
|
||||||
if (dacValues[i] != defaultvals[i]) {
|
if (dacValues[i] != defaultvals[i]) {
|
||||||
setDAC((enum DACINDEX)i, defaultvals[i], 0);
|
ret = FAIL;
|
||||||
|
LOG(logERROR, ("Setting dac %d failed, wrote %d, read %d\n", i,
|
||||||
|
defaultvals[i], dacValues[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
Binary file not shown.
@ -616,9 +616,11 @@ int setDefaultDacs() {
|
|||||||
LOG(logINFOBLUE, ("Setting Default Dac values\n"));
|
LOG(logINFOBLUE, ("Setting Default Dac values\n"));
|
||||||
const int defaultvals[NDAC] = DEFAULT_DAC_VALS;
|
const int defaultvals[NDAC] = DEFAULT_DAC_VALS;
|
||||||
for (int i = 0; i < NDAC; ++i) {
|
for (int i = 0; i < NDAC; ++i) {
|
||||||
// if not already default, set it to default
|
setDAC((enum DACINDEX)i, defaultvals[i], 0);
|
||||||
if (dacValues[i] != defaultvals[i]) {
|
if (dacValues[i] != defaultvals[i]) {
|
||||||
setDAC((enum DACINDEX)i, defaultvals[i], 0);
|
ret = FAIL;
|
||||||
|
LOG(logERROR, ("Setting dac %d failed, wrote %d, read %d\n", i,
|
||||||
|
defaultvals[i], dacValues[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
Binary file not shown.
@ -493,6 +493,7 @@ int setDefaultDacs() {
|
|||||||
for (int i = 0; i < NDAC; ++i) {
|
for (int i = 0; i < NDAC; ++i) {
|
||||||
setDAC((enum DACINDEX)i, defaultvals[i], 0);
|
setDAC((enum DACINDEX)i, defaultvals[i], 0);
|
||||||
if (detectorDacs[i] != defaultvals[i]) {
|
if (detectorDacs[i] != defaultvals[i]) {
|
||||||
|
ret = FAIL;
|
||||||
LOG(logERROR, ("Setting dac %d failed, wrote %d, read %d\n", i,
|
LOG(logERROR, ("Setting dac %d failed, wrote %d, read %d\n", i,
|
||||||
defaultvals[i], detectorDacs[i]));
|
defaultvals[i], detectorDacs[i]));
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "slsDetectorServer_defs.h" // DAC_INDEX, ADC_INDEX, also include RegisterDefs.h
|
|
||||||
#include "sls/sls_detector_defs.h"
|
#include "sls/sls_detector_defs.h"
|
||||||
|
#include "slsDetectorServer_defs.h" // DAC_INDEX, ADC_INDEX, also include RegisterDefs.h
|
||||||
#ifdef GOTTHARDD
|
#ifdef GOTTHARDD
|
||||||
#include "AD9252.h" // old board compatibility
|
#include "AD9252.h" // old board compatibility
|
||||||
#include "clogger.h" // runState(enum TLogLevel)
|
#include "clogger.h" // runState(enum TLogLevel)
|
||||||
@ -114,8 +114,7 @@ int updateDatabytesandAllocateRAM();
|
|||||||
void updateDataBytes();
|
void updateDataBytes();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(MYTHEN3D) || \
|
#ifndef CHIPTESTBOARDD
|
||||||
defined(MOENCHD)
|
|
||||||
int setDefaultDacs();
|
int setDefaultDacs();
|
||||||
#endif
|
#endif
|
||||||
#ifdef MYTHEN3D
|
#ifdef MYTHEN3D
|
||||||
|
@ -241,3 +241,4 @@ int reconfigure_udp(int);
|
|||||||
int validate_udp_configuration(int);
|
int validate_udp_configuration(int);
|
||||||
int get_bursts_left(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 "clogger.h"
|
||||||
#include "communication_funcs.h"
|
#include "communication_funcs.h"
|
||||||
#include "sharedMemory.h"
|
#include "sharedMemory.h"
|
||||||
#include "slsDetectorFunctionList.h"
|
|
||||||
#include "sls/sls_detector_funcs.h"
|
#include "sls/sls_detector_funcs.h"
|
||||||
|
#include "slsDetectorFunctionList.h"
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
@ -359,6 +359,7 @@ void function_table() {
|
|||||||
flist[F_VALIDATE_UDP_CONFIG] = &validate_udp_configuration;
|
flist[F_VALIDATE_UDP_CONFIG] = &validate_udp_configuration;
|
||||||
flist[F_GET_BURSTS_LEFT] = &get_bursts_left;
|
flist[F_GET_BURSTS_LEFT] = &get_bursts_left;
|
||||||
flist[F_START_READOUT] = &start_readout;
|
flist[F_START_READOUT] = &start_readout;
|
||||||
|
flist[F_SET_DEFAULT_DACS] = &set_default_dacs;
|
||||||
|
|
||||||
// check
|
// check
|
||||||
if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) {
|
if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) {
|
||||||
@ -1634,8 +1635,7 @@ int set_settings(int file_des) {
|
|||||||
|
|
||||||
if ((int)isett != GET_FLAG) {
|
if ((int)isett != GET_FLAG) {
|
||||||
validate((int)isett, (int)retval, "set settings", DEC);
|
validate((int)isett, (int)retval, "set settings", DEC);
|
||||||
#if defined(JUNGFRAUD) || defined(GOTTHARDD)
|
#ifdef GOTTHARDD
|
||||||
// gotthard2 does not set default dacs
|
|
||||||
if (ret == OK) {
|
if (ret == OK) {
|
||||||
ret = setDefaultDacs();
|
ret = setDefaultDacs();
|
||||||
if (ret == FAIL) {
|
if (ret == FAIL) {
|
||||||
@ -8145,3 +8145,21 @@ int start_readout(int file_des) {
|
|||||||
#endif
|
#endif
|
||||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
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);
|
||||||
|
}
|
@ -381,6 +381,9 @@ class Detector {
|
|||||||
/** gets list of dac enums for this detector */
|
/** gets list of dac enums for this detector */
|
||||||
std::vector<defs::dacIndex> getDacList() const;
|
std::vector<defs::dacIndex> getDacList() const;
|
||||||
|
|
||||||
|
/** [Eiger][Jungfrau][Moench][Gotthard][Gotthard2][Mythen3] */
|
||||||
|
void setDefaultDacs(Positions pos = {});
|
||||||
|
|
||||||
Result<int> getDAC(defs::dacIndex index, bool mV = false,
|
Result<int> getDAC(defs::dacIndex index, bool mV = false,
|
||||||
Positions pos = {}) const;
|
Positions pos = {}) const;
|
||||||
|
|
||||||
|
@ -826,6 +826,7 @@ class CmdProxy {
|
|||||||
{"dac", &CmdProxy::Dac},
|
{"dac", &CmdProxy::Dac},
|
||||||
{"daclist", &CmdProxy::daclist},
|
{"daclist", &CmdProxy::daclist},
|
||||||
{"dacvalues", &CmdProxy::DacValues},
|
{"dacvalues", &CmdProxy::DacValues},
|
||||||
|
{"defaultdacs", &CmdProxy::defaultdacs},
|
||||||
|
|
||||||
/* on chip dacs */
|
/* on chip dacs */
|
||||||
{"vchip_comp_fe", &CmdProxy::vchip_comp_fe},
|
{"vchip_comp_fe", &CmdProxy::vchip_comp_fe},
|
||||||
@ -1211,7 +1212,8 @@ class CmdProxy {
|
|||||||
"\n\t[Moench] - [g1_hg | g1_lg | g2_hc_hg | g2_hc_lg | "
|
"\n\t[Moench] - [g1_hg | g1_lg | g2_hc_hg | g2_hc_lg | "
|
||||||
"g2_lc_hg | g2_lc_lg | g4_hg | g4_lg]"
|
"g2_lc_hg | g2_lc_lg | g4_hg | g4_lg]"
|
||||||
"\n\t[Eiger] Use threshold or thresholdnotb. \n\t[Eiger] "
|
"\n\t[Eiger] Use threshold or thresholdnotb. \n\t[Eiger] "
|
||||||
"settings loaded from file found in settingspath.");
|
"settings loaded from file found in settingspath. \n\t[Gotthard] Also "
|
||||||
|
"loads default dacs on to the detector.");
|
||||||
|
|
||||||
EXECUTE_SET_COMMAND_1ARG(
|
EXECUTE_SET_COMMAND_1ARG(
|
||||||
trimbits, loadTrimbits,
|
trimbits, loadTrimbits,
|
||||||
@ -1378,6 +1380,10 @@ class CmdProxy {
|
|||||||
daclist, getDacList,
|
daclist, getDacList,
|
||||||
"\n\tGets the list of commands for every dac for this detector.");
|
"\n\tGets the list of commands for every dac for this detector.");
|
||||||
|
|
||||||
|
EXECUTE_SET_COMMAND(defaultdacs, setDefaultDacs,
|
||||||
|
"\n\t[Eiger][Jungfrau][Gotthard][Moench][Gotthard2]["
|
||||||
|
"Mythen3]Sets default dacs on to the detector.");
|
||||||
|
|
||||||
/* on chip dacs */
|
/* on chip dacs */
|
||||||
INTEGER_USER_IND_COMMAND(
|
INTEGER_USER_IND_COMMAND(
|
||||||
vchip_comp_fe, getOnChipDAC, setOnChipDAC, StringTo<int>,
|
vchip_comp_fe, getOnChipDAC, setOnChipDAC, StringTo<int>,
|
||||||
|
@ -542,6 +542,10 @@ std::vector<defs::dacIndex> Detector::getDacList() const {
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Detector::setDefaultDacs(Positions pos) {
|
||||||
|
pimpl->Parallel(&Module::setDefaultDacs, pos);
|
||||||
|
}
|
||||||
|
|
||||||
Result<int> Detector::getDAC(defs::dacIndex index, bool mV,
|
Result<int> Detector::getDAC(defs::dacIndex index, bool mV,
|
||||||
Positions pos) const {
|
Positions pos) const {
|
||||||
return pimpl->Parallel(&Module::getDAC, pos, index, mV);
|
return pimpl->Parallel(&Module::getDAC, pos, index, mV);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "Module.h"
|
#include "Module.h"
|
||||||
#include "sls/ClientSocket.h"
|
|
||||||
#include "SharedMemory.h"
|
#include "SharedMemory.h"
|
||||||
|
#include "sls/ClientSocket.h"
|
||||||
#include "sls/ToString.h"
|
#include "sls/ToString.h"
|
||||||
#include "sls/container_utils.h"
|
#include "sls/container_utils.h"
|
||||||
#include "sls/file_utils.h"
|
#include "sls/file_utils.h"
|
||||||
@ -335,6 +335,8 @@ int Module::getDAC(dacIndex index, bool mV) const {
|
|||||||
return sendToDetector<int>(F_SET_DAC, args);
|
return sendToDetector<int>(F_SET_DAC, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Module::setDefaultDacs() { sendToDetector(F_SET_DEFAULT_DACS); }
|
||||||
|
|
||||||
void Module::setDAC(int val, dacIndex index, bool mV) {
|
void Module::setDAC(int val, dacIndex index, bool mV) {
|
||||||
int args[]{static_cast<int>(index), static_cast<int>(mV), val};
|
int args[]{static_cast<int>(index), static_cast<int>(mV), val};
|
||||||
sendToDetector<int>(F_SET_DAC, args);
|
sendToDetector<int>(F_SET_DAC, args);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "sls/ClientSocket.h"
|
|
||||||
#include "SharedMemory.h"
|
#include "SharedMemory.h"
|
||||||
|
#include "sls/ClientSocket.h"
|
||||||
#include "sls/StaticVector.h"
|
#include "sls/StaticVector.h"
|
||||||
#include "sls/logger.h"
|
#include "sls/logger.h"
|
||||||
#include "sls/network_utils.h"
|
#include "sls/network_utils.h"
|
||||||
@ -136,6 +136,8 @@ class Module : public virtual slsDetectorDefs {
|
|||||||
int getMaxClockPhaseShift(int clkIndex) const;
|
int getMaxClockPhaseShift(int clkIndex) const;
|
||||||
int getClockFrequency(int clkIndex) const;
|
int getClockFrequency(int clkIndex) const;
|
||||||
void setClockFrequency(int clkIndex, int value);
|
void setClockFrequency(int clkIndex, int value);
|
||||||
|
/** [Eiger][Jungfrau][Moench][Gotthard][Gotthard2][Mythen3] */
|
||||||
|
void setDefaultDacs();
|
||||||
int getDAC(dacIndex index, bool mV) const;
|
int getDAC(dacIndex index, bool mV) const;
|
||||||
void setDAC(int val, dacIndex index, bool mV);
|
void setDAC(int val, dacIndex index, bool mV);
|
||||||
bool getPowerChip() const;
|
bool getPowerChip() const;
|
||||||
|
@ -1146,6 +1146,19 @@ TEST_CASE("dacvalues", "[.cmd][.new]") {
|
|||||||
REQUIRE_THROWS(proxy.Call("dacvalues", {}, -1, PUT));
|
REQUIRE_THROWS(proxy.Call("dacvalues", {}, -1, PUT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("defaultdacs", "[.cmd][.new]") {
|
||||||
|
Detector det;
|
||||||
|
CmdProxy proxy(&det);
|
||||||
|
auto det_type = det.getDetectorType().squash();
|
||||||
|
if (det_type != defs::CHIPTESTBOARD) {
|
||||||
|
REQUIRE_THROWS(proxy.Call("defaultdacs", {}, -1, GET));
|
||||||
|
REQUIRE_NOTHROW(proxy.Call("defaultdacs", {}, -1, PUT));
|
||||||
|
} else {
|
||||||
|
REQUIRE_THROWS(proxy.Call("defaultdacs", {}, -1, GET));
|
||||||
|
REQUIRE_THROWS(proxy.Call("defaultdacs", {}, -1, PUT));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* acquisition */
|
/* acquisition */
|
||||||
|
|
||||||
TEST_CASE("trigger", "[.cmd][.new]") {
|
TEST_CASE("trigger", "[.cmd][.new]") {
|
||||||
|
@ -215,6 +215,7 @@ enum detFuncs {
|
|||||||
F_VALIDATE_UDP_CONFIG,
|
F_VALIDATE_UDP_CONFIG,
|
||||||
F_GET_BURSTS_LEFT,
|
F_GET_BURSTS_LEFT,
|
||||||
F_START_READOUT,
|
F_START_READOUT,
|
||||||
|
F_SET_DEFAULT_DACS,
|
||||||
|
|
||||||
NUM_DET_FUNCTIONS,
|
NUM_DET_FUNCTIONS,
|
||||||
RECEIVER_ENUM_START = 256, /**< detector function should not exceed this
|
RECEIVER_ENUM_START = 256, /**< detector function should not exceed this
|
||||||
@ -535,6 +536,7 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
|
|||||||
case F_VALIDATE_UDP_CONFIG: return "F_VALIDATE_UDP_CONFIG";
|
case F_VALIDATE_UDP_CONFIG: return "F_VALIDATE_UDP_CONFIG";
|
||||||
case F_GET_BURSTS_LEFT: return "F_GET_BURSTS_LEFT";
|
case F_GET_BURSTS_LEFT: return "F_GET_BURSTS_LEFT";
|
||||||
case F_START_READOUT: return "F_START_READOUT";
|
case F_START_READOUT: return "F_START_READOUT";
|
||||||
|
case F_SET_DEFAULT_DACS: return "F_SET_DEFAULT_DACS";
|
||||||
|
|
||||||
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
|
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
|
||||||
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
|
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/** API versions */
|
/** API versions */
|
||||||
#define GITBRANCH "developer"
|
#define GITBRANCH "developer"
|
||||||
#define APICTB 0x201102
|
|
||||||
#define APIGOTTHARD 0x201102
|
|
||||||
#define APIGOTTHARD2 0x201102
|
|
||||||
#define APIJUNGFRAU 0x201102
|
|
||||||
#define APIMYTHEN3 0x201102
|
|
||||||
#define APIMOENCH 0x201102
|
|
||||||
#define APIEIGER 0x201102
|
|
||||||
#define APILIB 0x201102
|
#define APILIB 0x201102
|
||||||
#define APIRECEIVER 0x201102
|
#define APIRECEIVER 0x201102
|
||||||
#define APIGUI 0x201102
|
#define APIGUI 0x201102
|
||||||
|
#define APICTB 0x201110
|
||||||
|
#define APIGOTTHARD 0x201110
|
||||||
|
#define APIGOTTHARD2 0x201110
|
||||||
|
#define APIJUNGFRAU 0x201110
|
||||||
|
#define APIMYTHEN3 0x201110
|
||||||
|
#define APIMOENCH 0x201110
|
||||||
|
#define APIEIGER 0x201110
|
||||||
|
Loading…
x
Reference in New Issue
Block a user