diff --git a/python/scripts/compile_servers.py b/python/scripts/compile_servers.py index 992dae1c9..e3395a06f 100644 --- a/python/scripts/compile_servers.py +++ b/python/scripts/compile_servers.py @@ -49,13 +49,13 @@ args = parser.parse_args() servers = [ - "eigerDetectorServer", - "jungfrauDetectorServer", +# "eigerDetectorServer", +# "jungfrauDetectorServer", "mythen3DetectorServer", - "gotthard2DetectorServer", - "gotthardDetectorServer", - "ctbDetectorServer", - "moenchDetectorServer", +# "gotthard2DetectorServer", +# "gotthardDetectorServer", +# "ctbDetectorServer", +# "moenchDetectorServer", ] diff --git a/python/src/detector.cpp b/python/src/detector.cpp index 444248d8b..2ac8a2ce2 100644 --- a/python/src/detector.cpp +++ b/python/src/detector.cpp @@ -1136,6 +1136,10 @@ void init_det(py::module &m) { (Result(Detector::*)(sls::Positions) const) & Detector::getMaster, py::arg() = Positions{}) + .def("getChipStatusRegister", + (Result(Detector::*)(sls::Positions) const) & + Detector::getChipStatusRegister, + py::arg() = Positions{}) .def("getNumberOfAnalogSamples", (Result(Detector::*)(sls::Positions) const) & Detector::getNumberOfAnalogSamples, diff --git a/slsDetectorServers/mythen3DetectorServer/mythen3.c b/slsDetectorServers/mythen3DetectorServer/mythen3.c index bb38bcbac..3da3cd92d 100644 --- a/slsDetectorServers/mythen3DetectorServer/mythen3.c +++ b/slsDetectorServers/mythen3DetectorServer/mythen3.c @@ -31,6 +31,10 @@ int clearBit(int ibit, int patword) { return patword &= ~(1 << ibit); } extern enum TLogLevel trimmingPrint ; +int getChipStatusRegister(){ + return chipStatusRegister; +} + patternParameters *setChipStatusRegister(int csr) { int iaddr=0; int nbits=18; diff --git a/slsDetectorServers/mythen3DetectorServer/mythen3.h b/slsDetectorServers/mythen3DetectorServer/mythen3.h index c47b6cd8e..890fdd2c8 100644 --- a/slsDetectorServers/mythen3DetectorServer/mythen3.h +++ b/slsDetectorServers/mythen3DetectorServer/mythen3.h @@ -57,6 +57,7 @@ enum {Cac225, Cac_450}; #define default_gain int setBit(int ibit, int patword); int clearBit(int ibit, int patword); +int getChipStatusRegister(); patternParameters *setChipStatusRegister(int csr); patternParameters *setChannelRegisterChip(int ichip, int *mask, int *trimbits); patternParameters *setInterpolation(int mask); diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h index 84103f61f..120738f8a 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h @@ -25,6 +25,10 @@ #include "blackfin.h" #endif +#if defined(MYTHEN3D) +#include "mythen3.h" +#endif + #include // FILE #include #include diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h index 62a947254..4b57dec10 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h @@ -246,4 +246,5 @@ int is_virtual(int); int get_pattern(int); int load_default_pattern(int); int get_all_threshold_energy(int); -int get_master(int); \ No newline at end of file +int get_master(int); +int get_csr(); \ No newline at end of file diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 7c3b50f79..93ca82604 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -369,6 +369,7 @@ void function_table() { flist[F_LOAD_DEFAULT_PATTERN] = &load_default_pattern; flist[F_GET_ALL_THRESHOLD_ENERGY] = &get_all_threshold_energy; flist[F_GET_MASTER] = &get_master; + flist[F_GET_CSR] = &get_csr; // check if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) { @@ -8388,3 +8389,19 @@ int get_master(int file_des){ #endif return Server_SendResult(file_des, INT32, &retval, sizeof(retval)); } + +int get_csr(int file_des){ + ret = OK; + memset(mess, 0, sizeof(mess)); + int retval = -1; + + LOG(logDEBUG1, ("Getting csr\n")); + +#ifndef MYTHEN3D + functionNotImplemented(); +#else + retval = getChipStatusRegister(); +#endif + return Server_SendResult(file_des, INT32, &retval, sizeof(retval)); +} + diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index 105d95dee..7c24ff055 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -1308,6 +1308,10 @@ class Detector { Result getMaster(Positions pos = {}) const; + + //TODO! check if we really want to expose this !!!!! + Result getChipStatusRegister(Positions pos = {}) const; + ///@{ /** @name CTB / Moench Specific */ diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index b0892c2a2..f09056444 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -1615,6 +1615,10 @@ Result Detector::getMaster(Positions pos) const{ return pimpl->Parallel(&Module::isMaster, pos); } +Result Detector::getChipStatusRegister(Positions pos) const{ + return pimpl->Parallel(&Module::getChipStatusRegister, pos); +} + // CTB/ Moench Specific diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index c5a570ea7..69ac21e59 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -1998,6 +1998,10 @@ bool Module::isMaster() const{ return sendToDetector(F_GET_MASTER); } +int Module::getChipStatusRegister() const{ + return sendToDetector(F_GET_CSR); +} + // CTB / Moench Specific int Module::getNumberOfAnalogSamples() const { return sendToDetector(F_GET_NUM_ANALOG_SAMPLES); diff --git a/slsDetectorSoftware/src/Module.h b/slsDetectorSoftware/src/Module.h index a1c52d0f7..8b3c6e842 100644 --- a/slsDetectorSoftware/src/Module.h +++ b/slsDetectorSoftware/src/Module.h @@ -426,6 +426,7 @@ class Module : public virtual slsDetectorDefs { void setGateDelay(int gateIndex, int64_t value); std::array getGateDelayForAllGates() const; bool isMaster() const; + int getChipStatusRegister() const; /************************************************** * * diff --git a/slsSupportLib/include/sls/sls_detector_funcs.h b/slsSupportLib/include/sls/sls_detector_funcs.h index 9abb18d7f..a99ac0e02 100755 --- a/slsSupportLib/include/sls/sls_detector_funcs.h +++ b/slsSupportLib/include/sls/sls_detector_funcs.h @@ -221,6 +221,7 @@ enum detFuncs { F_LOAD_DEFAULT_PATTERN, F_GET_ALL_THRESHOLD_ENERGY, F_GET_MASTER, + F_GET_CSR, NUM_DET_FUNCTIONS, RECEIVER_ENUM_START = 256, /**< detector function should not exceed this