diff --git a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer index 28608b061..e90b1eb18 100755 Binary files a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer and b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer differ diff --git a/slsDetectorServers/mythen3DetectorServer/mythen3.c b/slsDetectorServers/mythen3DetectorServer/mythen3.c index a03fd736d..9ece1637d 100644 --- a/slsDetectorServers/mythen3DetectorServer/mythen3.c +++ b/slsDetectorServers/mythen3DetectorServer/mythen3.c @@ -304,8 +304,6 @@ patternParameters *setChannelRegisterChip(int ichip, char *mask, chanReg |= (0x1 << (3 + icounter)); } } - chanReg /= 2; - // deserialize if (chanReg & CHAN_REG_BAD_CHANNEL_MSK) { LOG(logINFOBLUE, ("badchannel [chanReg:0x%x modCounter:%d, modChan:%d, " @@ -313,6 +311,8 @@ patternParameters *setChannelRegisterChip(int ichip, char *mask, chanReg, ichip * NCHAN + ich * NCOUNTERS, ichip * NCHAN_1_COUNTER + ich, ichip, ich)); } + chanReg /= 2; + // deserialize for (int i = 0; i < 23; i++) { patword = clearBit(SIGNAL_clk, patword); pat->word[iaddr++] = patword; diff --git a/slsDetectorServers/slsDetectorServer/src/loadPattern.c b/slsDetectorServers/slsDetectorServer/src/loadPattern.c index 154094b87..63ac6496a 100644 --- a/slsDetectorServers/slsDetectorServer/src/loadPattern.c +++ b/slsDetectorServers/slsDetectorServer/src/loadPattern.c @@ -149,10 +149,12 @@ int validate_writePatternWord(char *message, int addr, uint64_t word) { uint64_t retval = readPatternWord(addr); LOG(logDEBUG1, ("Pattern word (addr:0x%x) retval: 0x%llx\n", addr, (long long int)retval)); - char mode[128]; - memset(mode, 0, sizeof(mode)); - sprintf(mode, "set pattern word for addr 0x%x", addr); - validate64(&ret, message, word, retval, "set pattern word", HEX); + // runs for every pattern word: only build the message on a mismatch + if (retval != word) { + char mode[64]; + sprintf(mode, "set pattern word for addr 0x%x", addr); + validate64(&ret, message, word, retval, mode, HEX); + } #endif return ret; } @@ -700,7 +702,7 @@ int loadPattern(char *message, enum TLogLevel printLevel, int ret = OK; memset(clientPatternfile, 0, MAX_STR_LENGTH); memcpy(clientPatternfile, patfname, MAX_STR_LENGTH); - printf("Client Pattern File:%s\n", clientPatternfile); + LOG(logDEBUG1, ("Client Pattern File:%s\n", clientPatternfile)); #ifdef MYTHEN3D trimmingPrint = printLevel; #endif diff --git a/slsReceiverSoftware/src/FrameSynchronizerApp.cpp b/slsReceiverSoftware/src/FrameSynchronizerApp.cpp index d513c522a..d3b8c932f 100644 --- a/slsReceiverSoftware/src/FrameSynchronizerApp.cpp +++ b/slsReceiverSoftware/src/FrameSynchronizerApp.cpp @@ -542,30 +542,30 @@ int main(int argc, char *argv[]) { for (int i = 0; i != f.numReceivers; ++i) { uint16_t port = f.port + i; sem_t *semaphore = &semaphores[i]; - threads.emplace_back( - [i, semaphore, port, user_data, &threadException]() { - LOG(sls::logINFOBLUE) << "Thread " << i << " [ Tid: " - << sls::getThreadId() << ']'; - try { - sls::Receiver receiver(port); - receiver.registerCallBackStartAcquisition( - StartAcquisitionCallback, user_data); - receiver.registerCallBackAcquisitionFinished( - AcquisitionFinishedCallback, user_data); - receiver.registerCallBackRawDataReady(GetDataCallback, - user_data); + threads.emplace_back([i, semaphore, port, user_data, + &threadException]() { + LOG(sls::logINFOBLUE) + << "Thread " << i << " [ Tid: " << sls::getThreadId() << ']'; + try { + sls::Receiver receiver(port); + receiver.registerCallBackStartAcquisition( + StartAcquisitionCallback, user_data); + receiver.registerCallBackAcquisitionFinished( + AcquisitionFinishedCallback, user_data); + receiver.registerCallBackRawDataReady(GetDataCallback, + user_data); - /** - as long as no Ctrl+C */ - // each child shares the common semaphore - sem_wait(semaphore); - } catch (...) { - // capture exception and raise SIGINT to exit gracefully - threadException = std::current_exception(); - raise(SIGINT); - } - LOG(sls::logINFOBLUE) << "Exiting Thread " << i << " [ Tid: " - << sls::getThreadId() << " ]"; - }); + /** - as long as no Ctrl+C */ + // each child shares the common semaphore + sem_wait(semaphore); + } catch (...) { + // capture exception and raise SIGINT to exit gracefully + threadException = std::current_exception(); + raise(SIGINT); + } + LOG(sls::logINFOBLUE) << "Exiting Thread " << i + << " [ Tid: " << sls::getThreadId() << " ]"; + }); } for (auto &t : threads) { diff --git a/slsReceiverSoftware/src/MultiReceiverApp.cpp b/slsReceiverSoftware/src/MultiReceiverApp.cpp index 003b66c4f..180b8a084 100644 --- a/slsReceiverSoftware/src/MultiReceiverApp.cpp +++ b/slsReceiverSoftware/src/MultiReceiverApp.cpp @@ -177,9 +177,8 @@ int main(int argc, char *argv[]) { /** - if child process */ else if (pid == 0) { - LOG(sls::logINFOBLUE) - << "Child process " << i << " [ Tid: " << sls::getThreadId() - << ']'; + LOG(sls::logINFOBLUE) << "Child process " << i + << " [ Tid: " << sls::getThreadId() << ']'; try { uint16_t port = m.port + i; @@ -210,13 +209,15 @@ int main(int argc, char *argv[]) { // each child process gets a copy of the semaphore sem_wait(&semaphore); sem_destroy(&semaphore); - LOG(sls::logINFOBLUE) << "Exiting Child Process [ Tid: " - << sls::getThreadId() << ']'; + LOG(sls::logINFOBLUE) + << "Exiting Child Process [ Tid: " << sls::getThreadId() + << ']'; exit(EXIT_SUCCESS); } catch (...) { sem_destroy(&semaphore); - LOG(sls::logINFOBLUE) << "Exiting Child Process [ Tid: " - << sls::getThreadId() << " ]"; + LOG(sls::logINFOBLUE) + << "Exiting Child Process [ Tid: " << sls::getThreadId() + << " ]"; exit(EXIT_FAILURE); } } diff --git a/slsSupportLib/include/sls/ToString.h b/slsSupportLib/include/sls/ToString.h index 7c692badd..0b996cda2 100644 --- a/slsSupportLib/include/sls/ToString.h +++ b/slsSupportLib/include/sls/ToString.h @@ -352,8 +352,7 @@ T StringTo(const std::string &f, const std::string &unit) { } } -template ::value, int> = 0> +template ::value, int> = 0> T StringTo(const std::string &t) { std::string tmp{t}; auto unit = RemoveUnit(tmp); diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index 7828cff07..fb05bbf0d 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -9,5 +9,5 @@ #define APIEIGER "0.0.0 0x260807" #define APIXILINXCTB "0.0.0 0x260813" #define APIJUNGFRAU "0.0.0 0x261002" -#define APIMYTHEN3 "0.0.0 0x260506" +#define APIMYTHEN3 "0.0.0 0x261022" #define APIMATTERHORN "0.0.0 0x260529" diff --git a/slsSupportLib/tests/test-ToString.cpp b/slsSupportLib/tests/test-ToString.cpp index 194f04442..5c8cc6dce 100644 --- a/slsSupportLib/tests/test-ToString.cpp +++ b/slsSupportLib/tests/test-ToString.cpp @@ -415,10 +415,10 @@ TEST_CASE("string to timingInfoDecoder") { defs::timingInfoDecoder::SHINE); } - TEST_CASE("Convert string to vector of ints") { REQUIRE(StringTo>("1, 2, 3") == std::vector{1, 2, 3}); - REQUIRE(StringTo>(" 4 ,5,6 ") == std::vector{4, 5, 6}); + REQUIRE(StringTo>(" 4 ,5,6 ") == + std::vector{4, 5, 6}); REQUIRE(StringTo>("[8]") == std::vector{8}); REQUIRE(StringTo>("9, ") == std::vector{9}); REQUIRE(StringTo>("") == std::vector{});