merge from 7.0.0

This commit is contained in:
2023-02-24 10:39:51 +01:00
101 changed files with 4009 additions and 2128 deletions

View File

@ -31,6 +31,11 @@ namespace sls {
// #define ZMQ_DETAIL
#define ROIVERBOSITY
// high water mark for gui
#define DEFFAULT_LOW_ZMQ_HWM (25)
#define DEFAULT_LOW_ZMQ_HWM_BUFFERSIZE (1024 * 1024) // 1MB
#define DEFAULT_ZMQ_BUFFERSIZE (-1) // os default
/** zmq header structure */
struct zmqHeader {
/** true if incoming data, false if end of acquisition */
@ -108,15 +113,29 @@ class ZmqSocket {
/** Returns high water mark for outbound messages */
int GetSendHighWaterMark();
/** Sets high water mark for outbound messages. Default 1000 (zmqlib) */
/** Sets high water mark for outbound messages. Default 1000 (zmqlib). Also
* changes send buffer size depending on hwm. Must rebind. */
void SetSendHighWaterMark(int limit);
/** Returns high water mark for inbound messages */
int GetReceiveHighWaterMark();
/** Sets high water mark for inbound messages. Default 1000 (zmqlib) */
/** Sets high water mark for inbound messages. Default 1000 (zmqlib). Also
* changes receiver buffer size depending on hwm. Must reconnect */
void SetReceiveHighWaterMark(int limit);
/** Gets kernel buffer for outbound messages. Default 0 (os) */
int GetSendBuffer();
/** Sets kernel buffer for outbound messages. Default 0 (os) */
void SetSendBuffer(int limit);
/** Gets kernel buffer for inbound messages. Default 0 (os) */
int GetReceiveBuffer();
/** Sets kernel buffer for inbound messages. Default 0 (os) */
void SetReceiveBuffer(int limit);
/**
* Returns Port Number
* @returns Port Number
@ -129,6 +148,9 @@ class ZmqSocket {
*/
std::string GetZmqServerAddress() { return sockfd.serverAddress; }
/** unbinds and rebind, to apply changes of HWM */
void Rebind();
/**
* Connect client socket to server socket
* @returns 1 for fail, 0 for success

View File

@ -148,6 +148,18 @@ Squash(const Container &c, typename Container::value_type default_value = {}) {
return default_value;
}
template <typename T>
typename std::enable_if<is_container<T>::value, bool>::type
removeDuplicates(T &c) {
auto containerSize = c.size();
std::sort(c.begin(), c.end());
c.erase(std::unique(c.begin(), c.end()), c.end());
if (c.size() != containerSize) {
return true;
}
return false;
}
} // namespace sls
#endif // CONTAINER_UTILS_H

View File

@ -50,6 +50,8 @@ ssize_t getFileSize(FILE *fd, const std::string &prependErrorString);
std::string getFileNameFromFilePath(const std::string &fpath);
std::vector<int> getChannelsFromStringList(const std::vector<std::string> list);
/** File can have # for comments.
* Channels can be separated by spaces, commas
* and ranges provided using ':', eg. 23:29

View File

@ -10,6 +10,8 @@
*@short functions indices to call on server (detector/receiver)
*/
#define UNRECOGNIZED_FNUM_ENUM "Unrecognized Function enum"
enum detFuncs {
F_EXEC_COMMAND = 0,
F_GET_DETECTOR_TYPE,

View File

@ -1,6 +1,7 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
/** API versions */
<<<<<<< HEAD
#define RELEASE "developer"
#define APILIB "developer 0x221213"
#define APIRECEIVER "developer 0x221213"
@ -11,3 +12,15 @@
#define APIMOENCH "developer 0x221215"
#define APIGOTTHARD "developer 0x230117"
#define APIMYTHEN3 "developer 0x230117"
=======
#define RELEASE "7.0.0"
#define APICTB "7.0.0 0x230222"
#define APIGOTTHARD "7.0.0 0x230222"
#define APIGOTTHARD2 "7.0.0 0x230222"
#define APIJUNGFRAU "7.0.0 0x230222"
#define APIMYTHEN3 "7.0.0 0x230222"
#define APIMOENCH "7.0.0 0x230222"
#define APIEIGER "7.0.0 0x230222"
#define APILIB "7.0.0 0x230223"
#define APIRECEIVER "7.0.0 0x230222"
>>>>>>> 7.0.0.rc