This commit is contained in:
maliakal_d 2019-08-20 10:55:55 +02:00
parent 08ac9b4ce8
commit 38b7e23ac4
5 changed files with 143 additions and 27 deletions

View File

@ -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}
)

View File

@ -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}
)

View File

@ -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}
)

View File

@ -130,14 +130,20 @@ class Detector {
void setSpeed(int value, Positions pos = {}); void setSpeed(int value, Positions pos = {});
/** [Gotthard][Jungfrau][CTB] */ /** [Gotthard][Jungfrau][CTB] */
Result<int> getADCPhase(bool inDeg, Positions pos = {}) const; Result<int> getADCPhase(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB] */ /** [Gotthard][Jungfrau][CTB] */
void setADCPhase(int value, bool inDeg, Positions pos = {}); void setADCPhase(int value, Positions pos = {});
/** [Jungfrau][CTB] */ /** [Jungfrau][CTB] */
Result<int> getMaxADCPhaseShift(Positions pos = {}) const; Result<int> getMaxADCPhaseShift(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB] */
Result<int> getADCPhaseInDegrees(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB] */
void setADCPhaseInDegrees(int value, Positions pos = {});
Result<int> getHighVoltage(Positions pos = {}) const; Result<int> getHighVoltage(Positions pos = {}) const;
/** /**
@ -832,21 +838,27 @@ class Detector {
void setNumberOfDigitalSamples(int64_t value, Positions pos = {}); void setNumberOfDigitalSamples(int64_t value, Positions pos = {});
/** [CTB] */ /** [CTB] */
Result<int> getSignalType(Positions pos = {}) const; Result<int> 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 */ * = 2 */
void setSignalType(int value, Positions pos = {}); void setReadoutMode(int value, Positions pos = {});
/** [CTB] */ /** [CTB] */
Result<int> getDBITPhase(bool inDeg, Positions pos = {}) const; Result<int> getDBITPhase(Positions pos = {}) const;
/** [CTB] */ /** [CTB] */
void setDBITPhase(int value, bool inDeg, Positions pos = {}); void setDBITPhase(int value, Positions pos = {});
/** [CTB] */ /** [CTB] */
Result<int> getMaxDBITPhaseShift(Positions pos = {}) const; Result<int> getMaxDBITPhaseShift(Positions pos = {}) const;
/** [CTB] */
Result<int> getDBITPhaseInDegrees(Positions pos = {}) const;
/** [CTB] */
void setDBITPhaseInDegrees(int value, Positions pos = {});
/** [CTB] */ /** [CTB] */
Result<int> getADCClock(Positions pos = {}) const; Result<int> getADCClock(Positions pos = {}) const;
@ -1137,8 +1149,6 @@ class Detector {
* * * *
* ************************************************/ * ************************************************/
Result<int> getControlPort(Positions pos = {}) const; Result<int> getControlPort(Positions pos = {}) const;
/** Detector Control TCP port (for client communication with Detector /** Detector Control TCP port (for client communication with Detector
@ -1158,8 +1168,8 @@ class Detector {
/** Get last client IP saved on detector server */ /** Get last client IP saved on detector server */
Result<std::string> getLastClientIP(Positions pos = {}) const; Result<std::string> getLastClientIP(Positions pos = {}) const;
/** Execute a command on the detector server */ /** Execute a command on the detector server console */
void execCommand(const std::string &value, Positions pos = {}); void executeCommand(const std::string &value, Positions pos = {});
/** [Gotthard][Jungfrau][CTB] */ /** [Gotthard][Jungfrau][CTB] */
Result<int64_t> getNumberOfFramesFromStart(Positions pos = {}) const; Result<int64_t> getNumberOfFramesFromStart(Positions pos = {}) const;

View File

@ -154,13 +154,12 @@ void Detector::setSpeed(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER, value, 0); pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER, value, 0);
} }
Result<int> Detector::getADCPhase(bool inDeg, Positions pos) const { Result<int> Detector::getADCPhase(Positions pos) const {
return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_PHASE, -1, return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_PHASE, -1, 0);
inDeg);
} }
void Detector::setADCPhase(int value, bool inDeg, Positions pos) { void Detector::setADCPhase(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_PHASE, value, inDeg); pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_PHASE, value, 0);
} }
Result<int> Detector::getMaxADCPhaseShift(Positions pos) const { Result<int> Detector::getMaxADCPhaseShift(Positions pos) const {
@ -168,6 +167,14 @@ Result<int> Detector::getMaxADCPhaseShift(Positions pos) const {
defs::MAX_ADC_PHASE_SHIFT, -1, 0); defs::MAX_ADC_PHASE_SHIFT, -1, 0);
} }
Result<int> 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<int> Detector::getHighVoltage(Positions pos) const { Result<int> Detector::getHighVoltage(Positions pos) const {
return pimpl->Parallel(&slsDetector::setDAC, pos, -1, defs::HIGH_VOLTAGE, return pimpl->Parallel(&slsDetector::setDAC, pos, -1, defs::HIGH_VOLTAGE,
0); 0);
@ -283,7 +290,7 @@ Result<int> Detector::getNumberofUDPInterfaces(Positions pos) const {
void Detector::setNumberofUDPInterfaces(int n, Positions pos) { void Detector::setNumberofUDPInterfaces(int n, Positions pos) {
int previouslyClientStreaming = pimpl->enableDataStreamingToClient(); 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); pimpl->Parallel(&slsDetector::setNumberofUDPInterfaces, pos, n);
// redo the zmq sockets if enabled // redo the zmq sockets if enabled
if (previouslyClientStreaming != 0) { if (previouslyClientStreaming != 0) {
@ -815,7 +822,7 @@ Result<ns> Detector::getRateCorrection(Positions pos) const {
} }
void Detector::setRateCorrection(ns dead_time, Positions pos) { 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<int> Detector::getPartialReadout(Positions pos) const { Result<int> 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); pimpl->Parallel(&slsDetector::setTimer, pos, defs::DIGITAL_SAMPLES, value);
} }
Result<int> Detector::getSignalType(Positions pos) const { Result<int> Detector::getReadoutMode(Positions pos) const {
auto res = pimpl->Parallel(&slsDetector::setReadOutFlags, pos, auto res = pimpl->Parallel(&slsDetector::setReadOutFlags, pos,
defs::GET_READOUT_FLAGS); defs::GET_READOUT_FLAGS);
for (auto &it : res) { for (auto &it : res) {
@ -1093,7 +1100,7 @@ Result<int> Detector::getSignalType(Positions pos) const {
return res; return res;
} }
void Detector::setSignalType(int value, Positions pos) { void Detector::setReadoutMode(int value, Positions pos) {
defs::readOutFlags flag; defs::readOutFlags flag;
switch (value) { switch (value) {
case 0: case 0:
@ -1111,14 +1118,12 @@ void Detector::setSignalType(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setReadOutFlags, pos, flag); pimpl->Parallel(&slsDetector::setReadOutFlags, pos, flag);
} }
Result<int> Detector::getDBITPhase(bool inDeg, Positions pos) const { Result<int> Detector::getDBITPhase(Positions pos) const {
return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_PHASE, -1, return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_PHASE, -1, 0);
inDeg);
} }
void Detector::setDBITPhase(int value, bool inDeg, Positions pos) { void Detector::setDBITPhase(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_PHASE, value, pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_PHASE, value, 0);
inDeg);
} }
Result<int> Detector::getMaxDBITPhaseShift(Positions pos) const { Result<int> Detector::getMaxDBITPhaseShift(Positions pos) const {
@ -1126,6 +1131,14 @@ Result<int> Detector::getMaxDBITPhaseShift(Positions pos) const {
defs::MAX_DBIT_PHASE_SHIFT, -1, 0); defs::MAX_DBIT_PHASE_SHIFT, -1, 0);
} }
Result<int> 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<int> Detector::getADCClock(Positions pos) const { Result<int> Detector::getADCClock(Positions pos) const {
return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_CLOCK, -1, 0); return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_CLOCK, -1, 0);
} }
@ -1568,7 +1581,7 @@ Result<std::string> Detector::getLastClientIP(Positions pos) const {
return pimpl->Parallel(&slsDetector::getLastClientIP, pos); 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); pimpl->Parallel(&slsDetector::execCommand, pos, value);
} }