This commit is contained in:
Erik Frojdh 2019-08-09 15:20:53 +02:00
parent 1bd1d0d64d
commit 56703c4886
3 changed files with 122 additions and 26 deletions

View File

@ -854,7 +854,7 @@ class Detector {
// TODO! // TODO!
// int enableDataStreamingToClient(int enable = -1); // int enableDataStreamingToClient(int enable = -1);
// int enableDataStreamingFromReceiver(int enable = -1, int detPos = -1) void enableDataStreamingFromReceiver(bool enable, Positions pos = {});
/** [TODO! All?] */ /** [TODO! All?] */
void setTenGigaEnabled(bool value, Positions pos = {}); void setTenGigaEnabled(bool value, Positions pos = {});
@ -1257,7 +1257,38 @@ class Detector {
Result<int> getReceiverStreamingPort(Positions pos = {}) const; Result<int> getReceiverStreamingPort(Positions pos = {}) const;
// void setReceiverDataStreamingOutPort(int i = -1, int detPos = -1); /** Single detector or all since ports are calculated*/
void setReceiverDataStreamingOutPort(int port, int module_id = -1);
Result<int> getClientStreamingPort(Positions pos = {}) const;
/** Single detector or all since ports are calculated*/
void setClientDataStreamingInPort(int port, int module_id = -1);
/** [Jungfrau] */
Result<int> getSelectedUDPInterface(Positions pos = {}) const;
/**
* [Jungfrau]
* @param interface interface to select, either 1 or 2
* */
void selectUDPInterface(int interface, Positions pos = {});
Result<int> getNumberofUDPInterfaces(Positions pos = {}) const;
void setNumberofUDPInterfaces(int n, Positions pos = {});
/** [Eiger][Jungfrau] */
Result<int> getReceiverUDPPort2(Positions pos = {}) const;
/** [Eiger][Jungfrau] */
void setReceiverUDPPort2(int udpport, Positions pos = {});
/** [Eiger][Jungfrau] */
Result<int> getReceiverUDPPort(Positions pos = {}) const;
/** [Eiger][Jungfrau] */
void setReceiverUDPPort(int udpport, Positions pos = {});
}; };
} // namespace sls } // namespace sls

View File

@ -1120,14 +1120,14 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @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 receiver UDP port * @returns the receiver UDP port
*/ */
int setReceiverUDPPort(int udpport, int detPos = -1); int setReceiverUDPPort(int udpport, int detPos = -1); //
/** /**
* Returns the receiver UDP port * Returns the receiver UDP port
* @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 receiver UDP port * @returns the receiver UDP port
*/ */
int getReceiverUDPPort(int detPos = -1) const; int getReceiverUDPPort(int detPos = -1) const; //
/** /**
* Sets the receiver UDP port 2 (Eiger and Jungfrau only) * Sets the receiver UDP port 2 (Eiger and Jungfrau only)
@ -1135,7 +1135,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @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 receiver UDP port 2 * @returns the receiver UDP port 2
*/ */
int setReceiverUDPPort2(int udpport, int detPos = -1); int setReceiverUDPPort2(int udpport, int detPos = -1); //
/** /**
* Returns the receiver UDP port 2 of same interface (Eiger and Jungfrau * Returns the receiver UDP port 2 of same interface (Eiger and Jungfrau
@ -1143,7 +1143,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @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 receiver UDP port 2 of same interface * @returns the receiver UDP port 2 of same interface
*/ */
int getReceiverUDPPort2(int detPos = -1) const; int getReceiverUDPPort2(int detPos = -1) const; //
/** /**
* Sets the number of UDP interfaces to stream data from detector (Jungfrau * Sets the number of UDP interfaces to stream data from detector (Jungfrau
@ -1152,7 +1152,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @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 number of interfaces * @returns the number of interfaces
*/ */
int setNumberofUDPInterfaces(int n, int detPos = -1); int setNumberofUDPInterfaces(int n, int detPos = -1); //
/** /**
* Returns the number of UDP interfaces to stream data from detector * Returns the number of UDP interfaces to stream data from detector
@ -1160,7 +1160,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @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 number of interfaces * @returns the number of interfaces
*/ */
int getNumberofUDPInterfaces(int detPos = -1) const; int getNumberofUDPInterfaces(int detPos = -1) const; //
/** /**
* Selects the UDP interfaces to stream data from detector. Effective only * Selects the UDP interfaces to stream data from detector. Effective only
@ -1177,7 +1177,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @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 interface selected * @returns the interface selected
*/ */
int getSelectedUDPInterface(int detPos = -1) const; int getSelectedUDPInterface(int detPos = -1) const; //
/** /**
* (advanced users) * (advanced users)
@ -1196,7 +1196,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @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 client zmq port * @returns the client zmq port
*/ */
int getClientStreamingPort(int detPos = -1); int getClientStreamingPort(int detPos = -1); //
/** /**
* (advanced users) * (advanced users)
@ -1206,7 +1206,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* individual detectors using i * individual detectors using i
* @param detPos -1 for all detectors in list or specific detector position * @param detPos -1 for all detectors in list or specific detector position
*/ */
void setReceiverDataStreamingOutPort(int i = -1, int detPos = -1); void setReceiverDataStreamingOutPort(int i = -1, int detPos = -1); //
/** /**
* Returns the receiver zmq port * Returns the receiver zmq port
@ -1215,7 +1215,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @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 receiver zmq port * @returns the receiver zmq port
*/ */
int getReceiverStreamingPort(int detPos = -1); int getReceiverStreamingPort(int detPos = -1); //
/** /**
* (advanced users) * (advanced users)

View File

@ -468,7 +468,8 @@ Result<ns> Detector::getMeasuredSubFramePeriod(Positions pos) const {
} }
Result<int> Detector::getSpeed(Positions pos) const { Result<int> Detector::getSpeed(Positions pos) const {
return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER, -1, 0); return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER, -1,
0);
} }
void Detector::setSpeed(int value, Positions pos) { void Detector::setSpeed(int value, Positions pos) {
@ -476,7 +477,8 @@ void Detector::setSpeed(int value, Positions pos) {
} }
Result<int> Detector::getADCPhase(bool inDeg, Positions pos) const { Result<int> Detector::getADCPhase(bool inDeg, Positions pos) const {
return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_PHASE, -1, inDeg); return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_PHASE, -1,
inDeg);
} }
void Detector::setADCPhase(int value, bool inDeg, Positions pos) { void Detector::setADCPhase(int value, bool inDeg, Positions pos) {
@ -484,19 +486,23 @@ void Detector::setADCPhase(int value, bool inDeg, Positions pos) {
} }
Result<int> Detector::getMaxADCPhaseShift(Positions pos) const { Result<int> Detector::getMaxADCPhaseShift(Positions pos) const {
return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::MAX_ADC_PHASE_SHIFT, -1, 0); return pimpl->Parallel(&slsDetector::setSpeed, pos,
defs::MAX_ADC_PHASE_SHIFT, -1, 0);
} }
Result<int> Detector::getDBITPhase(bool inDeg, Positions pos) const { Result<int> Detector::getDBITPhase(bool inDeg, Positions pos) const {
return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_PHASE, -1, inDeg); return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_PHASE, -1,
inDeg);
} }
void Detector::setDBITPhase(int value, bool inDeg, Positions pos) { void Detector::setDBITPhase(int value, bool inDeg, Positions pos) {
pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_PHASE, value, inDeg); pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_PHASE, value,
inDeg);
} }
Result<int> Detector::getMaxDBITPhaseShift(Positions pos) const { Result<int> Detector::getMaxDBITPhaseShift(Positions pos) const {
return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::MAX_DBIT_PHASE_SHIFT, -1, 0); return pimpl->Parallel(&slsDetector::setSpeed, pos,
defs::MAX_DBIT_PHASE_SHIFT, -1, 0);
} }
Result<int> Detector::getADCClock(Positions pos) const { Result<int> Detector::getADCClock(Positions pos) const {
@ -508,7 +514,8 @@ void Detector::setADCClock(int value, Positions pos) {
} }
Result<int> Detector::getDBITClock(Positions pos) const { Result<int> Detector::getDBITClock(Positions pos) const {
return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_CLOCK, -1, 0); return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_CLOCK, -1,
0);
} }
void Detector::setDBITClock(int value, Positions pos) { void Detector::setDBITClock(int value, Positions pos) {
@ -516,7 +523,8 @@ void Detector::setDBITClock(int value, Positions pos) {
} }
Result<int> Detector::getRUNClock(Positions pos) const { Result<int> Detector::getRUNClock(Positions pos) const {
return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER, -1, 0); return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER, -1,
0);
} }
void Detector::setRUNClock(int value, Positions pos) { void Detector::setRUNClock(int value, Positions pos) {
@ -524,11 +532,13 @@ void Detector::setRUNClock(int value, Positions pos) {
} }
Result<int> Detector::getSYNCClock(Positions pos) const { Result<int> Detector::getSYNCClock(Positions pos) const {
return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::SYNC_CLOCK, -1, 0); return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::SYNC_CLOCK, -1,
0);
} }
Result<int> Detector::getADCPipeline(Positions pos) const { Result<int> Detector::getADCPipeline(Positions pos) const {
return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_PIPELINE, -1, 0); return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::ADC_PIPELINE, -1,
0);
} }
void Detector::setADCPipeline(int value, Positions pos) { void Detector::setADCPipeline(int value, Positions pos) {
@ -536,7 +546,8 @@ void Detector::setADCPipeline(int value, Positions pos) {
} }
Result<int> Detector::getDBITPipeline(Positions pos) const { Result<int> Detector::getDBITPipeline(Positions pos) const {
return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_PIPELINE, -1, 0); return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::DBIT_PIPELINE, -1,
0);
} }
void Detector::setDBITPipeline(int value, Positions pos) { void Detector::setDBITPipeline(int value, Positions pos) {
@ -572,6 +583,11 @@ Result<int> Detector::getReceiverStreamingTimer(Positions pos) const {
return pimpl->Parallel(&slsDetector::setReceiverStreamingTimer, pos, -1); return pimpl->Parallel(&slsDetector::setReceiverStreamingTimer, pos, -1);
} }
void Detector::enableDataStreamingFromReceiver(bool enable, Positions pos) {
pimpl->Parallel(&slsDetector::enableDataStreamingFromReceiver, pos,
static_cast<int>(enable));
}
void Detector::setTenGigaEnabled(bool value, Positions pos) { void Detector::setTenGigaEnabled(bool value, Positions pos) {
pimpl->Parallel(&slsDetector::enableTenGigabitEthernet, pos, pimpl->Parallel(&slsDetector::enableTenGigabitEthernet, pos,
static_cast<int>(value)); static_cast<int>(value));
@ -1028,8 +1044,8 @@ void Detector::setReceiverDataStreamingOutIP(const std::string &ip,
Positions pos) { Positions pos) {
// TODO! probably in one call // TODO! probably in one call
pimpl->Parallel(&slsDetector::setReceiverStreamingIP, pos, ip); pimpl->Parallel(&slsDetector::setReceiverStreamingIP, pos, ip);
pimpl->Parallel(&slsDetector::enableDataStreamingFromReceiver, pos, 0); enableDataStreamingFromReceiver(false, pos);
pimpl->Parallel(&slsDetector::enableDataStreamingFromReceiver, pos, 1); enableDataStreamingFromReceiver(true, pos);
} }
Result<std::string> Detector::getClientStreamingIP(Positions pos) const { Result<std::string> Detector::getClientStreamingIP(Positions pos) const {
@ -1044,8 +1060,57 @@ void Detector::setClientDataStreamingInIP(const std::string &ip,
pimpl->enableDataStreamingToClient(1); pimpl->enableDataStreamingToClient(1);
} }
Result<int> Detector::getReceiverStreamingPort(Positions pos) const{ Result<int> Detector::getReceiverStreamingPort(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverStreamingPort, pos); return pimpl->Parallel(&slsDetector::getReceiverStreamingPort, pos);
} }
void Detector::setReceiverDataStreamingOutPort(int port, int module_id) {
pimpl->setReceiverDataStreamingOutPort(port, module_id);
}
Result<int> Detector::getClientStreamingPort(Positions pos) const {
return pimpl->Parallel(&slsDetector::getClientStreamingPort, pos);
}
void Detector::setClientDataStreamingInPort(int port, int module_id) {
pimpl->setClientDataStreamingInPort(port, module_id);
}
Result<int> Detector::getSelectedUDPInterface(Positions pos) const {
return pimpl->Parallel(&slsDetector::getSelectedUDPInterface, pos);
}
void Detector::selectUDPInterface(int interface, Positions pos) {
pimpl->Parallel(&slsDetector::selectUDPInterface, pos, interface);
}
Result<int> Detector::getNumberofUDPInterfaces(Positions pos) const {
return pimpl->Parallel(&slsDetector::getNumberofUDPInterfaces, pos);
}
void Detector::setNumberofUDPInterfaces(int n, Positions pos) {
pimpl->Parallel(&slsDetector::setNumberofUDPInterfaces, pos, n);
pimpl->enableDataStreamingToClient(0);
pimpl->enableDataStreamingToClient(1);
enableDataStreamingFromReceiver(false, pos);
enableDataStreamingFromReceiver(true, pos);
}
Result<int> Detector::getReceiverUDPPort2(Positions pos) const{
pimpl->Parallel(&slsDetector::getReceiverUDPPort2, pos);
}
void Detector::setReceiverUDPPort2(int udpport, Positions pos){
pimpl->Parallel(&slsDetector::setReceiverUDPPort2, pos, udpport);
}
Result<int> Detector::getReceiverUDPPort(Positions pos) const{
pimpl->Parallel(&slsDetector::getReceiverUDPPort2, pos);
}
void Detector::setReceiverUDPPort(int udpport, Positions pos){
pimpl->Parallel(&slsDetector::setReceiverUDPPort2, pos, udpport);
}
} // namespace sls } // namespace sls