diff --git a/slsDetectorServers/ctbDetectorServer/CMakeLists.txt b/slsDetectorServers/ctbDetectorServer/CMakeLists.txt new file mode 100644 index 000000000..eb5133635 --- /dev/null +++ b/slsDetectorServers/ctbDetectorServer/CMakeLists.txt @@ -0,0 +1,31 @@ +add_executable(ctbDetectorServer + slsDetectorFunctionList.c + ../slsDetectorServer/slsDetectorServer.c + ../slsDetectorServer/slsDetectorServer_funcs.c + ../slsDetectorServer/communication_funcs.c +) + +include_directories( + ../slsDetectorServer/ + ../../slsSupportLib/include +) + +target_include_directories(ctbDetectorServer + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_compile_definitions(ctbDetectorServer + PUBLIC CHIPTESTBOARDD VIRTUAL STOP_SERVER +) + +target_link_libraries(ctbDetectorServer + PUBLIC pthread rt +) + +set_target_properties(ctbDetectorServer PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin +) + +install(TARGETS ctbDetectorServer + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/slsDetectorServers/gotthardDetectorServer/CMakeLists.txt b/slsDetectorServers/gotthardDetectorServer/CMakeLists.txt new file mode 100644 index 000000000..fa72c7d09 --- /dev/null +++ b/slsDetectorServers/gotthardDetectorServer/CMakeLists.txt @@ -0,0 +1,31 @@ +add_executable(gotthardDetectorServer + slsDetectorFunctionList.c + ../slsDetectorServer/slsDetectorServer.c + ../slsDetectorServer/slsDetectorServer_funcs.c + ../slsDetectorServer/communication_funcs.c +) + +include_directories( + ../slsDetectorServer/ + ../../slsSupportLib/include +) + +target_include_directories(gotthardDetectorServer + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_compile_definitions(gotthardDetectorServer + PUBLIC GOTTHARDD VIRTUAL STOP_SERVER +) + +target_link_libraries(gotthardDetectorServer + PUBLIC pthread rt +) + +set_target_properties(gotthardDetectorServer PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin +) + +install(TARGETS gotthardDetectorServer + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/slsDetectorServers/moenchDetectorServer/CMakeLists.txt b/slsDetectorServers/moenchDetectorServer/CMakeLists.txt new file mode 100644 index 000000000..f8b47a602 --- /dev/null +++ b/slsDetectorServers/moenchDetectorServer/CMakeLists.txt @@ -0,0 +1,31 @@ +add_executable(moenchDetectorServer + slsDetectorFunctionList.c + ../slsDetectorServer/slsDetectorServer.c + ../slsDetectorServer/slsDetectorServer_funcs.c + ../slsDetectorServer/communication_funcs.c +) + +include_directories( + ../slsDetectorServer/ + ../../slsSupportLib/include +) + +target_include_directories(moenchDetectorServer + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_compile_definitions(moenchDetectorServer + PUBLIC MOENCHD VIRTUAL STOP_SERVER +) + +target_link_libraries(moenchDetectorServer + PUBLIC pthread rt +) + +set_target_properties(moenchDetectorServer PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin +) + +install(TARGETS moenchDetectorServer + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index d34b586b4..b01e4ada5 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -130,14 +130,20 @@ class Detector { void setSpeed(int value, Positions pos = {}); /** [Gotthard][Jungfrau][CTB] */ - Result getADCPhase(bool inDeg, Positions pos = {}) const; + Result getADCPhase(Positions pos = {}) const; /** [Gotthard][Jungfrau][CTB] */ - void setADCPhase(int value, bool inDeg, Positions pos = {}); + void setADCPhase(int value, Positions pos = {}); /** [Jungfrau][CTB] */ Result getMaxADCPhaseShift(Positions pos = {}) const; + /** [Gotthard][Jungfrau][CTB] */ + Result getADCPhaseInDegrees(Positions pos = {}) const; + + /** [Gotthard][Jungfrau][CTB] */ + void setADCPhaseInDegrees(int value, Positions pos = {}); + Result getHighVoltage(Positions pos = {}) const; /** @@ -832,21 +838,27 @@ class Detector { void setNumberOfDigitalSamples(int64_t value, Positions pos = {}); /** [CTB] */ - Result getSignalType(Positions pos = {}) const; + Result getReadoutMode(Positions pos = {}) const; - /** [CTB] Options: NORMAL_READOUT = 0, DIGITAL_ONLY = 1, ANALOG_AND_DIGITAL + /** [CTB] Options: NORMAL_READOUT = 0, DIGITAL_ONLY = 1, ANALOG_AND_DIGITAL //TODO ANALOG_ONLY, make enum * = 2 */ - void setSignalType(int value, Positions pos = {}); + void setReadoutMode(int value, Positions pos = {}); /** [CTB] */ - Result getDBITPhase(bool inDeg, Positions pos = {}) const; + Result getDBITPhase(Positions pos = {}) const; /** [CTB] */ - void setDBITPhase(int value, bool inDeg, Positions pos = {}); + void setDBITPhase(int value, Positions pos = {}); /** [CTB] */ Result getMaxDBITPhaseShift(Positions pos = {}) const; + /** [CTB] */ + Result getDBITPhaseInDegrees(Positions pos = {}) const; + + /** [CTB] */ + void setDBITPhaseInDegrees(int value, Positions pos = {}); + /** [CTB] */ Result getADCClock(Positions pos = {}) const; @@ -1137,8 +1149,6 @@ class Detector { * * * ************************************************/ - - Result getControlPort(Positions pos = {}) const; /** Detector Control TCP port (for client communication with Detector @@ -1158,8 +1168,8 @@ class Detector { /** Get last client IP saved on detector server */ Result getLastClientIP(Positions pos = {}) const; - /** Execute a command on the detector server */ - void execCommand(const std::string &value, Positions pos = {}); + /** Execute a command on the detector server console */ + void executeCommand(const std::string &value, Positions pos = {}); /** [Gotthard][Jungfrau][CTB] */ Result getNumberOfFramesFromStart(Positions pos = {}) const; diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index fe355206e..ca146d8ae 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -154,13 +154,12 @@ void Detector::setSpeed(int value, Positions pos) { pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER, value, 0); } -Result Detector::getADCPhase(bool inDeg, Positions pos) const { - return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_PHASE, -1, - inDeg); +Result Detector::getADCPhase(Positions pos) const { + return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_PHASE, -1, 0); } -void Detector::setADCPhase(int value, bool inDeg, Positions pos) { - pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_PHASE, value, inDeg); +void Detector::setADCPhase(int value, Positions pos) { + pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_PHASE, value, 0); } Result Detector::getMaxADCPhaseShift(Positions pos) const { @@ -168,6 +167,14 @@ Result Detector::getMaxADCPhaseShift(Positions pos) const { defs::MAX_ADC_PHASE_SHIFT, -1, 0); } +Result Detector::getADCPhaseInDegrees(Positions pos) const { + return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_PHASE, -1, 1); +} + +void Detector::setADCPhaseInDegrees(int value, Positions pos) { + pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_PHASE, value, 1); +} + Result Detector::getHighVoltage(Positions pos) const { return pimpl->Parallel(&slsDetector::setDAC, pos, -1, defs::HIGH_VOLTAGE, 0); @@ -283,7 +290,7 @@ Result Detector::getNumberofUDPInterfaces(Positions pos) const { void Detector::setNumberofUDPInterfaces(int n, Positions pos) { int previouslyClientStreaming = pimpl->enableDataStreamingToClient(); - bool previouslyReceiverStreaming = true;//getRxZmqIP(pos).squash(false); //FIXME TODO + bool previouslyReceiverStreaming = getRxZmqDataStream(pos).squash(true); pimpl->Parallel(&slsDetector::setNumberofUDPInterfaces, pos, n); // redo the zmq sockets if enabled if (previouslyClientStreaming != 0) { @@ -815,7 +822,7 @@ Result Detector::getRateCorrection(Positions pos) const { } void Detector::setRateCorrection(ns dead_time, Positions pos) { - pimpl->Parallel(&slsDetector::setRateCorrection, pos, 0);//FIXME TODO dead_time); + pimpl->Parallel(&slsDetector::setRateCorrection, pos, dead_time.count()); } Result Detector::getPartialReadout(Positions pos) const { @@ -1076,7 +1083,7 @@ void Detector::setNumberOfDigitalSamples(int64_t value, Positions pos) { pimpl->Parallel(&slsDetector::setTimer, pos, defs::DIGITAL_SAMPLES, value); } -Result Detector::getSignalType(Positions pos) const { +Result Detector::getReadoutMode(Positions pos) const { auto res = pimpl->Parallel(&slsDetector::setReadOutFlags, pos, defs::GET_READOUT_FLAGS); for (auto &it : res) { @@ -1093,7 +1100,7 @@ Result Detector::getSignalType(Positions pos) const { return res; } -void Detector::setSignalType(int value, Positions pos) { +void Detector::setReadoutMode(int value, Positions pos) { defs::readOutFlags flag; switch (value) { case 0: @@ -1111,14 +1118,12 @@ void Detector::setSignalType(int value, Positions pos) { pimpl->Parallel(&slsDetector::setReadOutFlags, pos, flag); } -Result Detector::getDBITPhase(bool inDeg, Positions pos) const { - return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_PHASE, -1, - inDeg); +Result Detector::getDBITPhase(Positions pos) const { + return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_PHASE, -1, 0); } -void Detector::setDBITPhase(int value, bool inDeg, Positions pos) { - pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_PHASE, value, - inDeg); +void Detector::setDBITPhase(int value, Positions pos) { + pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_PHASE, value, 0); } Result Detector::getMaxDBITPhaseShift(Positions pos) const { @@ -1126,6 +1131,14 @@ Result Detector::getMaxDBITPhaseShift(Positions pos) const { defs::MAX_DBIT_PHASE_SHIFT, -1, 0); } +Result Detector::getDBITPhaseInDegrees(Positions pos) const { + return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_PHASE, -1, 1); +} + +void Detector::setDBITPhaseInDegrees(int value,Positions pos) { + pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_PHASE, value, 1); +} + Result Detector::getADCClock(Positions pos) const { return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_CLOCK, -1, 0); } @@ -1568,7 +1581,7 @@ Result Detector::getLastClientIP(Positions pos) const { return pimpl->Parallel(&slsDetector::getLastClientIP, pos); } -void Detector::execCommand(const std::string &value, Positions pos) { +void Detector::executeCommand(const std::string &value, Positions pos) { pimpl->Parallel(&slsDetector::execCommand, pos, value); }