in the process of splitting network parameter function

This commit is contained in:
maliakal_d 2019-01-14 10:03:40 +01:00
parent 5ae31bc438
commit 3c41ec4a7a
2 changed files with 357 additions and 5 deletions

View File

@ -1634,6 +1634,204 @@ std::string multiSlsDetector::setClientDataStreamingInIP(const std::string& ip,
return getNetworkParameter(CLIENT_STREAMING_SRC_IP, detPos); return getNetworkParameter(CLIENT_STREAMING_SRC_IP, detPos);
} }
std::string multiSlsDetector::setDetectorMAC(const std::string& detectorMAC, int detPos) {
// single
if (detPos >= 0)
return detectors[detPos]->setDetectorMAC(detectorMAC);
// multi
auto r = parallelCall(&slsDetector::setDetectorMAC, detectorMAC);
return sls::concatenateIfDifferent(r);
}
std::string multiSlsDetector::getDetectorMAC(int detPos) {
// single
if (detPos >= 0) {
return detectors[detPos]->getDetectorMAC();
}
// multi
auto r = serialCall(&slsDetector::getDetectorMAC);
return sls::concatenateIfDifferent(r);
}
std::string multiSlsDetector::setDetectorIP(const std::string& detectorIP, int detPos) {
// single
if (detPos >= 0)
return detectors[detPos]->setDetectorIP(detectorIP);
// multi
auto r = parallelCall(&slsDetector::setDetectorIP, detectorIP);
return sls::concatenateIfDifferent(r);
}
std::string multiSlsDetector::getDetectorIP(int detPos) {
// single
if (detPos >= 0) {
return detectors[detPos]->getDetectorIP();
}
// multi
auto r = serialCall(&slsDetector::getDetectorIP);
return sls::concatenateIfDifferent(r);
}
std::string multiSlsDetector::setReceiverHostname(const std::string& receiver, int detPos) {
// single
if (detPos >= 0)
return detectors[detPos]->setReceiverHostname(receiver);
// multi
auto r = parallelCall(&slsDetector::setReceiverHostname, receiver);
return sls::concatenateIfDifferent(r);
}
std::string multiSlsDetector::getReceiverHostname(int detPos) {
// single
if (detPos >= 0) {
return detectors[detPos]->getReceiverHostname();
}
// multi
auto r = serialCall(&slsDetector::getReceiverHostname);
return sls::concatenateIfDifferent(r);
}
std::string multiSlsDetector::setReceiverUDPIP(const std::string& udpip, int detPos) {
// single
if (detPos >= 0)
return detectors[detPos]->setReceiverUDPIP(udpip);
// multi
auto r = parallelCall(&slsDetector::setReceiverUDPIP, udpip);
return sls::concatenateIfDifferent(r);
}
std::string multiSlsDetector::getReceiverUDPIP(int detPos) {
// single
if (detPos >= 0) {
return detectors[detPos]->getReceiverUDPIP();
}
// multi
auto r = serialCall(&slsDetector::getReceiverUDPIP);
return sls::concatenateIfDifferent(r);
}
std::string multiSlsDetector::setReceiverUDPMAC(const std::string& udpmac, int detPos) {
// single
if (detPos >= 0)
return detectors[detPos]->setReceiverUDPMAC(udpmac);
// multi
auto r = parallelCall(&slsDetector::setReceiverUDPMAC, udpmac);
return sls::concatenateIfDifferent(r);
}
std::string multiSlsDetector::getReceiverUDPMAC(int detPos) {
// single
if (detPos >= 0) {
return detectors[detPos]->getReceiverUDPMAC();
}
// multi
auto r = serialCall(&slsDetector::getReceiverUDPMAC);
return sls::concatenateIfDifferent(r);
}
int multiSlsDetector::setReceiverUDPPort(int udpport, int detPos) {
}
std::string multiSlsDetector::getReceiverUDPPort(int detPos) {
// single
if (detPos >= 0) {
return detectors[detPos]->getReceiverUDPPort();
}
// multi
auto r = serialCall(&slsDetector::getReceiverUDPPort);
return sls::concatenateIfDifferent(r);
}
int multiSlsDetector::setReceiverUDPPort2(int udpport, int detPos) {
}
std::string multiSlsDetector::getReceiverUDPPort2(int detPos) {
// single
if (detPos >= 0) {
return detectors[detPos]->getReceiverUDPPort2();
}
// multi
auto r = serialCall(&slsDetector::getReceiverUDPPort2);
return sls::concatenateIfDifferent(r);
}
std::string multiSlsDetector::setDetectorNetworkParameter(networkParameter index, int delay, int detPos) {
// single
if (detPos >= 0)
return detectors[detPos]->setDetectorNetworkParameter(index, delay);
// multi
auto r = parallelCall(&slsDetector::setDetectorNetworkParameter, index, delay);
return sls::concatenateIfDifferent(r);
}
std::string multiSlsDetector::setAdditionalJsonHeader(const std::string& jsonheader, int detPos) {
// single
if (detPos >= 0)
return detectors[detPos]->setAdditionalJsonHeader(jsonheader);
// multi
auto r = parallelCall(&slsDetector::setAdditionalJsonHeader, jsonheader);
return sls::concatenateIfDifferent(r);
}
std::string multiSlsDetector::getAdditionalJsonHeader(int detPos) {
// single
if (detPos >= 0) {
return detectors[detPos]->getAdditionalJsonHeader();
}
// multi
auto r = serialCall(&slsDetector::getAdditionalJsonHeader);
return sls::concatenateIfDifferent(r);
}
std::string multiSlsDetector::setReceiverUDPSocketBufferSize(int udpsockbufsize=-1, int detPos) {
// single
if (detPos >= 0)
return detectors[detPos]->setReceiverUDPSocketBufferSize(udpsockbufsize);
// multi
auto r = parallelCall(&slsDetector::setReceiverUDPSocketBufferSize, udpsockbufsize);
return sls::concatenateIfDifferent(r);
}
std::string multiSlsDetector::getReceiverUDPSocketBufferSize(int detPos) {
// single
if (detPos >= 0) {
return detectors[detPos]->getReceiverUDPSocketBufferSize();
}
// multi
auto r = serialCall(&slsDetector::getReceiverUDPSocketBufferSize);
return sls::concatenateIfDifferent(r);
}
std::string multiSlsDetector::getReceiverRealUDPSocketBufferSize(int detPos) {
// single
if (detPos >= 0) {
return detectors[detPos]->getReceiverRealUDPSocketBufferSize();
}
// multi
auto r = serialCall(&slsDetector::getReceiverRealUDPSocketBufferSize);
return sls::concatenateIfDifferent(r);
}
int multiSlsDetector::setFlowControl10G(int enable, int detPos) { int multiSlsDetector::setFlowControl10G(int enable, int detPos) {
std::string s; std::string s;
if (enable != -1) { if (enable != -1) {

View File

@ -514,14 +514,14 @@ class multiSlsDetector : public virtual slsDetectorDefs,
int tb = 1, int detPos = -1); int tb = 1, int detPos = -1);
/** /**
* Returns the detector trimbit/settings directory \sa sharedSlsDetector * Returns the detector trimbit/settings directory
* @param detPos -1 for all detectors in list or specific detector position * @param detPos -1 for all detectors in list or specific detector position
* @returns the trimbit/settings directory * @returns the trimbit/settings directory
*/ */
std::string getSettingsDir(int detPos = -1); std::string getSettingsDir(int detPos = -1);
/** /**
* Sets the detector trimbit/settings directory \sa sharedSlsDetector * Sets the detector trimbit/settings directory
* @param s trimbits/settings directory * @param s trimbits/settings directory
* @param detPos -1 for all detectors in list or specific detector position * @param detPos -1 for all detectors in list or specific detector position
* @returns the trimbit/settings directory * @returns the trimbit/settings directory
@ -752,7 +752,6 @@ class multiSlsDetector : public virtual slsDetectorDefs,
* @param i dynamic range (-1 get) * @param i dynamic range (-1 get)
* @param detPos -1 for all detectors in list or specific detector position * @param detPos -1 for all detectors in list or specific detector position
* @returns current dynamic range * @returns current dynamic range
* \sa sharedSlsDetector
*/ */
int setDynamicRange(int i = -1, int detPos = -1); int setDynamicRange(int i = -1, int detPos = -1);
@ -928,6 +927,161 @@ class multiSlsDetector : public virtual slsDetectorDefs,
int detPos = -1); int detPos = -1);
/** /**
* Validates the format of the detector MAC address and sets it
* @param detectorMAC detector MAC address
* @param detPos -1 for all detectors in list or specific detector position
* @returns the detector MAC address
*/
std::string setDetectorMAC(const std::string& detectorMAC, int detPos = -1);
/**
* Returns the detector MAC address
* @param detPos -1 for all detectors in list or specific detector position
* @returns the detector MAC address
*/
std::string getDetectorMAC(int detPos = -1);
/**
* Validates the format of the detector IP address and sets it
* @param detectorIP detector IP address
* @param detPos -1 for all detectors in list or specific detector position
* @returns the detector IP address
*/
std::string setDetectorIP(const std::string& detectorIP, int detPos = -1);
/**
* Returns the detector IP address
* @param detPos -1 for all detectors in list or specific detector position
* @returns the detector IP address
*/
std::string getDetectorIP(int detPos = -1);
/**
* Validates and sets the receiver.
* Also updates the receiver with all the shared memory parameters significant for the receiver
* Also configures the detector to the receiver as UDP destination
* @param receiver receiver hostname or IP address
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver IP address from shared memory
*/
std::string setReceiverHostname(const std::string& receiver, int detPos = -1);
/**
* Returns the receiver IP address
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver IP address
*/
std::string getReceiverHostname(int detPos = -1);
/**
* Validates the format of the receiver UDP IP address and sets it
* @param udpip receiver UDP IP address
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver UDP IP address
*/
std::string setReceiverUDPIP(const std::string& udpip, int detPos = -1);
/**
* Returns the receiver UDP IP address
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver UDP IP address
*/
std::string getReceiverUDPIP(int detPos = -1);
/**
* Validates the format of the receiver UDP MAC address and sets it
* @param udpmac receiver UDP MAC address
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver UDP MAC address
*/
std::string setReceiverUDPMAC(const std::string& udpmac, int detPos = -1);
/**
* Returns the receiver UDP MAC address
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver UDP MAC address
*/
std::string getReceiverUDPMAC(int detPos = -1);
/**
* Sets the receiver UDP port
* @param udpport receiver UDP port
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver UDP port
*/
int setReceiverUDPPort(int udpport, int detPos = -1);
/**
* Returns the receiver UDP port
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver UDP port
*/
std::string getReceiverUDPPort(int detPos = -1);
/**
* Sets the receiver UDP port 2
* @param udpport receiver UDP port 2
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver UDP port 2
*/
int setReceiverUDPPort2(int udpport, int detPos = -1);
/**
* Returns the receiver UDP port 2 of same interface
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver UDP port 2 of same interface
*/
std::string getReceiverUDPPort2(int detPos = -1);
/**
* Sets the transmission delay for left, right or entire frame
* (Eiger, Jungfrau(only entire frame))
* @param index type of delay
* @param delay delay
* @param detPos -1 for all detectors in list or specific detector position
* @returns transmission delay
*/
std::string setDetectorNetworkParameter(networkParameter index, int delay, int detPos = -1);
/**
* Sets the additional json header
* @param jsonheader additional json header
* @param detPos -1 for all detectors in list or specific detector position
* @returns additional json header, returns "none" if default setting and no custom ip set
*/
std::string setAdditionalJsonHeader(const std::string& jsonheader, int detPos = -1);
/**
* Returns the additional json header
* @param detPos -1 for all detectors in list or specific detector position
* @returns the additional json header, returns "none" if default setting and no custom ip set
*/
std::string getAdditionalJsonHeader(int detPos = -1);
/**
* Sets the receiver UDP socket buffer size
* @param udpsockbufsize additional json header
* @param detPos -1 for all detectors in list or specific detector position
* @returns receiver udp socket buffer size
*/
std::string setReceiverUDPSocketBufferSize(int udpsockbufsize=-1, int detPos = -1);
/**
* Returns the receiver UDP socket buffer size
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver UDP socket buffer size
*/
std::string getReceiverUDPSocketBufferSize(int detPos = -1) ;
/**
* Returns the receiver real UDP socket buffer size
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver real UDP socket buffer size
*/
std::string getReceiverRealUDPSocketBufferSize(int detPos = -1);
/** (users only)
* Set 10GbE Flow Control (Eiger) * Set 10GbE Flow Control (Eiger)
* @param enable 1 to set, 0 to unset, -1 gets * @param enable 1 to set, 0 to unset, -1 gets
* @param detPos -1 for all detectors in list or specific detector position * @param detPos -1 for all detectors in list or specific detector position
@ -1071,7 +1225,7 @@ class multiSlsDetector : public virtual slsDetectorDefs,
/** /**
* Sets the number of trim energies and their value (Eiger) * Sets the number of trim energies and their value (Eiger)
* \sa sharedSlsDetector *
* @param nen number of energies * @param nen number of energies
* @param en array of energies * @param en array of energies
* @param detPos -1 for all detectors in list or specific detector position * @param detPos -1 for all detectors in list or specific detector position
@ -1081,7 +1235,7 @@ class multiSlsDetector : public virtual slsDetectorDefs,
/** /**
* Returns the number of trim energies and their value (Eiger) * Returns the number of trim energies and their value (Eiger)
* \sa sharedSlsDetector *
* @param en array of energies * @param en array of energies
* @param detPos -1 for all detectors in list or specific detector position * @param detPos -1 for all detectors in list or specific detector position
* @returns number of trim energies * @returns number of trim energies