merge conflict

This commit is contained in:
maliakal_d 2019-03-14 12:41:37 +01:00
commit cb687d805e
5 changed files with 2911 additions and 1029 deletions

View File

@ -37,6 +37,8 @@ option (SLS_USE_GUI "GUI" OFF)
option (SLS_USE_TESTS "TESTS" ON)
option (SLS_USE_INTEGRATION_TESTS "Integration Tests" ON)
option(SLS_USE_SANITIZER OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#Testing for minimum version for compilers
@ -61,12 +63,10 @@ endif()
#set (CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 ")
# set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=thread")
# set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=thread")
#set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address,undefined")
#set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address,undefiend")
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG}")
if(SLS_USE_SANITIZER)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address,undefined")
set (CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address,undefiend")
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

File diff suppressed because it is too large Load Diff

View File

@ -460,12 +460,11 @@ void slsDetector::connectDataError() {
setErrorMask((getErrorMask()) | (CANNOT_CONNECT_TO_RECEIVER));
}
int slsDetector::sendModule(sls_detector_module *myMod) {
int slsDetector::sendModule(sls_detector_module *myMod, sls::ClientSocket& client) {
TLogLevel level = logDEBUG1;
FILE_LOG(level) << "Sending Module";
int ts = 0;
int n = 0;
auto client = sls::ClientSocket(false, detector_shm()->hostname, detector_shm()->controlPort);
n = client.sendData(&(myMod->serialnumber), sizeof(myMod->serialnumber));
ts += n;
FILE_LOG(level) << "Serial number sent. " << n << " bytes. serialno: " << myMod->serialnumber;
@ -510,8 +509,7 @@ int slsDetector::sendModule(sls_detector_module *myMod) {
return ts;
}
int slsDetector::receiveModule(sls_detector_module *myMod) {
auto client = sls::ClientSocket(false, detector_shm()->hostname, detector_shm()->controlPort);
int slsDetector::receiveModule(sls_detector_module *myMod, sls::ClientSocket& client) {
int ts = 0;
ts += client.receiveData(&(myMod->serialnumber), sizeof(myMod->serialnumber));
ts += client.receiveData(&(myMod->nchan), sizeof(myMod->nchan));
@ -3900,7 +3898,7 @@ int slsDetector::setModule(sls_detector_module module, int tb) {
if (detector_shm()->onlineFlag == ONLINE_FLAG) {
auto client = sls::ClientSocket(false, detector_shm()->hostname, detector_shm()->controlPort);
client.sendData(&fnum, sizeof(fnum));
sendModule(&module);
sendModule(&module, client);
client.receiveData(&ret, sizeof(ret));
// handle ret
@ -3950,7 +3948,7 @@ slsDetectorDefs::sls_detector_module *slsDetector::getModule() {
if (ret == FAIL) {
setErrorMask((getErrorMask()) | (OTHER_ERROR_CODE));
} else {
receiveModule(myMod);
receiveModule(myMod, client);
}
}
if (ret == FORCE_UPDATE) {

View File

@ -1672,14 +1672,14 @@ class slsDetector : public virtual slsDetectorDefs, public virtual errorDefs {
* @param myMod module structure to send
* @returns number of bytes sent to the detector
*/
int sendModule(sls_detector_module *myMod);
int sendModule(sls_detector_module *myMod, sls::ClientSocket& client);
/**
* Receive a sls_detector_module structure over socket
* @param myMod module structure to receive
* @returns number of bytes received from the detector
*/
int receiveModule(sls_detector_module *myMod);
int receiveModule(sls_detector_module *myMod, sls::ClientSocket& client);
/**
* Get MAC from the receiver using udpip and

View File

@ -12,7 +12,7 @@ class DataSocket {
virtual ~DataSocket();
DataSocket &operator=(DataSocket &&move) noexcept;
void swap(DataSocket &other) noexcept;
DataSocket(DataSocket const &) = delete;
DataSocket(const DataSocket &) = delete;
DataSocket &operator=(DataSocket const &) = delete;
int getSocketId() const {
return socketId_;