gotthard2 with veto data on second interface

This commit is contained in:
2020-05-13 17:50:18 +02:00
parent e730c124e3
commit eea67014b7
17 changed files with 455 additions and 379 deletions

View File

@@ -379,10 +379,13 @@ class Detector {
* *
* ************************************************/
/** [Jungfrau] */
/** [Jungfrau][Gotthard2] */
Result<int> getNumberofUDPInterfaces(Positions pos = {}) const;
/** [Jungfrau] Also restarts client and receiver sockets */
/** [Jungfrau][Gotthard2] Also restarts client and receiver zmq sockets
* [Gotthard2] second interface enabled to send veto information for
* debugging
* n can be 1 or 2 */
void setNumberofUDPInterfaces(int n, Positions pos = {});
/** [Jungfrau] */

View File

@@ -1517,10 +1517,13 @@ class CmdProxy {
/* Network Configuration (Detector<->Receiver) */
INTEGER_COMMAND(numinterfaces, getNumberofUDPInterfaces,
setNumberofUDPInterfaces, StringTo<int>,
"[1, 2]\n\t[Jungfrau] Number of udp interfaces to stream "
"data from detector. Default: 1.");
INTEGER_COMMAND(
numinterfaces, getNumberofUDPInterfaces, setNumberofUDPInterfaces,
StringTo<int>,
"[1, 2]\n\t[Jungfrau][Gotthard2] Number of udp interfaces to stream "
"data from detector. Default: 1.\n\t"
"[Gotthard2] Second interface enabled to send veto information for "
"debugging.");
INTEGER_COMMAND(
selinterface, getSelectedUDPInterface, selectUDPInterface,

View File

@@ -383,8 +383,12 @@ int DetectorImpl::createReceivingDataSockets(const bool destroy) {
if (multi_shm()->multiDetectorType == EIGER) {
numSocketsPerDetector = 2;
}
if (Parallel(&Module::getNumberofUDPInterfacesFromShm, {}).squash() == 2) {
numSocketsPerDetector = 2;
// gotthard2 second interface is only for veto debugging
else if (multi_shm()->multiDetectorType != GOTTHARD2) {
if (Parallel(&Module::getNumberofUDPInterfacesFromShm, {}).squash() ==
2) {
numSocketsPerDetector = 2;
}
}
numSockets *= numSocketsPerDetector;
@@ -424,9 +428,12 @@ void DetectorImpl::readFrameFromReceiver() {
int nDetPixelsY = 0;
bool quadEnable = false;
bool eiger = false;
bool numInterfaces = Parallel(&Module::getNumberofUDPInterfacesFromShm, {})
.squash(); // cannot pick up from zmq
bool numInterfaces = 1;
// gotthard2 second interface is veto debugging
if (multi_shm()->multiDetectorType != GOTTHARD2) {
numInterfaces = Parallel(&Module::getNumberofUDPInterfacesFromShm, {})
.squash(); // cannot pick up from zmq
}
bool runningList[zmqSocket.size()], connectList[zmqSocket.size()];
int numRunning = 0;
for (size_t i = 0; i < zmqSocket.size(); ++i) {

View File

@@ -780,12 +780,7 @@ class Module : public virtual slsDetectorDefs {
*/
int getDestinationUDPPort2();
/**
* Sets the number of UDP interfaces to stream data from detector (Jungfrau
* only)
* @param n number of interfaces. Options 1 or 2.
* @returns the number of interface
*/
/** [Jungfrau][Gotthard2] */
void setNumberofUDPInterfaces(int n);
/** Returns the number of udp interfaces from shared memory */