mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-08-11 10:30:30 +02:00
fixed disabled ports meta data as well
This commit is contained in:
@@ -222,7 +222,8 @@ int ClientInterface::functionTable(){
|
||||
flist[F_RECEIVER_GET_ROI_METADATA] = &ClientInterface::get_roi_metadata;
|
||||
flist[F_SET_RECEIVER_READOUT_SPEED] = &ClientInterface::set_readout_speed;
|
||||
flist[F_RECEIVER_GET_UDP_DATASTREAM] = &ClientInterface::get_port_udp_datastream;
|
||||
flist[F_RECEIVER_UDP_PORT_DISABLE_META] = &ClientInterface::update_udp_port_disable_meta;
|
||||
flist[F_RECEIVER_SET_UDP_PORT_DISABLE_META] = &ClientInterface::set_udp_port_disable_meta;
|
||||
flist[F_RECEIVER_GET_UDP_PORT_DISABLE_META] = &ClientInterface::get_udp_port_disable_meta;
|
||||
|
||||
|
||||
for (int i = NUM_DET_FUNCTIONS + 1; i < NUM_REC_FUNCTIONS ; i++) {
|
||||
@@ -1918,7 +1919,7 @@ int ClientInterface::set_readout_speed(Interface &socket) {
|
||||
return socket.Send(OK);
|
||||
}
|
||||
|
||||
int ClientInterface::update_udp_port_disable_meta(Interface &socket) {
|
||||
int ClientInterface::set_udp_port_disable_meta(Interface &socket) {
|
||||
auto nports = socket.Receive<int>();
|
||||
std::vector<int> portsDisabled;
|
||||
if (nports > 0) {
|
||||
@@ -1928,7 +1929,8 @@ int ClientInterface::update_udp_port_disable_meta(Interface &socket) {
|
||||
}
|
||||
verifyIdle(socket);
|
||||
try {
|
||||
impl()->updateUDPPortsDisabledMetadata(portsDisabled);
|
||||
|
||||
impl()->setUDPPortsDisabledMetadata(portsDisabled);
|
||||
} catch (const std::exception &e) {
|
||||
throw RuntimeError("Could not update UDP ports disabled metadata [" +
|
||||
std::string(e.what()) + ']');
|
||||
@@ -1936,4 +1938,16 @@ int ClientInterface::update_udp_port_disable_meta(Interface &socket) {
|
||||
return socket.Send(OK);
|
||||
}
|
||||
|
||||
int ClientInterface::get_udp_port_disable_meta(Interface &socket) {
|
||||
auto retvals = impl()->getUDPPortsDisabledMetadata();
|
||||
LOG(logDEBUG1) << "Receiver disabled udp ports retval:"
|
||||
<< ToString(retvals);
|
||||
socket.Send(OK);
|
||||
auto size = static_cast<int>(retvals.size());
|
||||
socket.Send(size);
|
||||
if (size > 0)
|
||||
socket.Send(retvals);
|
||||
return OK;
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
||||
@@ -170,7 +170,8 @@ class ClientInterface : private virtual slsDetectorDefs {
|
||||
int set_dbit_reorder(ServerInterface &socket);
|
||||
int get_roi_metadata(ServerInterface &socket);
|
||||
int set_readout_speed(ServerInterface &socket);
|
||||
int update_udp_port_disable_meta(ServerInterface &socket);
|
||||
int set_udp_port_disable_meta(ServerInterface &socket);
|
||||
int get_udp_port_disable_meta(ServerInterface &socket);
|
||||
|
||||
Implementation *impl() {
|
||||
if (receiver != nullptr) {
|
||||
|
||||
@@ -1715,11 +1715,15 @@ void Implementation::setUDPDataStream(const portPosition port,
|
||||
listener[i]->SetUDPDatastream(udpDataStream[i]);
|
||||
}
|
||||
|
||||
void Implementation::updateUDPPortsDisabledMetadata(
|
||||
void Implementation::setUDPPortsDisabledMetadata(
|
||||
const std::vector<int> &portsDisabled) {
|
||||
udpPortsDisabledMetadata = portsDisabled;
|
||||
}
|
||||
|
||||
std::vector<int> Implementation::getUDPPortsDisabledMetadata() const {
|
||||
return udpPortsDisabledMetadata;
|
||||
}
|
||||
|
||||
int Implementation::getReadNRows() const { return readNRows; }
|
||||
|
||||
void Implementation::setReadNRows(const int value) {
|
||||
|
||||
@@ -230,7 +230,8 @@ class Implementation : private virtual slsDetectorDefs {
|
||||
* [Eiger] deactivated at module level
|
||||
*/
|
||||
void setUDPDataStream(const portPosition port, const bool enable);
|
||||
void updateUDPPortsDisabledMetadata(const std::vector<int> &portsDisabled);
|
||||
void setUDPPortsDisabledMetadata(const std::vector<int> &portsDisabled);
|
||||
std::vector<int> getUDPPortsDisabledMetadata() const;
|
||||
int getReadNRows() const;
|
||||
/* [Eiger][Jungfrau][Moench] */
|
||||
void setReadNRows(const int value);
|
||||
|
||||
Reference in New Issue
Block a user