mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
format
This commit is contained in:
@ -9,8 +9,8 @@
|
||||
#include "sls_detector_defs.h"
|
||||
#include "versionAPI.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <chrono>
|
||||
#include <fstream>
|
||||
#include <thread>
|
||||
|
||||
namespace sls {
|
||||
|
@ -14,13 +14,13 @@
|
||||
#include <array>
|
||||
#include <bitset>
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
#include <iomanip>
|
||||
#include <iterator>
|
||||
#include <sstream>
|
||||
#include <thread>
|
||||
|
||||
namespace sls {
|
||||
|
||||
@ -933,9 +933,7 @@ void Module::setFileIndex(int64_t file_index) {
|
||||
sendToReceiver(F_SET_RECEIVER_FILE_INDEX, file_index, nullptr);
|
||||
}
|
||||
|
||||
void Module::incrementFileIndex() {
|
||||
sendToReceiver(F_INCREMENT_FILE_INDEX);
|
||||
}
|
||||
void Module::incrementFileIndex() { sendToReceiver(F_INCREMENT_FILE_INDEX); }
|
||||
|
||||
bool Module::getFileWrite() {
|
||||
return sendToReceiver<int>(F_GET_RECEIVER_FILE_WRITE);
|
||||
@ -1391,7 +1389,7 @@ void Module::setBurstPeriod(int64_t value) {
|
||||
}
|
||||
|
||||
std::array<int, 2> Module::getInjectChannel() {
|
||||
return sendToDetector<std::array<int, 2> >(F_GET_INJECT_CHANNEL);
|
||||
return sendToDetector<std::array<int, 2>>(F_GET_INJECT_CHANNEL);
|
||||
}
|
||||
|
||||
void Module::setInjectChannel(const int offsetChannel,
|
||||
|
@ -9,50 +9,50 @@ TEST_CASE("Construction with a defined detector type") {
|
||||
m.freeSharedMemory(); // clean up
|
||||
}
|
||||
|
||||
TEST_CASE("Read back detector type from shm"){
|
||||
TEST_CASE("Read back detector type from shm") {
|
||||
// Create specific detector in order to create shm
|
||||
sls::Module m(dt::JUNGFRAU);
|
||||
|
||||
// New detector that reads type from shm
|
||||
sls::Module m2;
|
||||
REQUIRE(m2.getDetectorType()== dt::JUNGFRAU);
|
||||
REQUIRE(m2.getDetectorType() == dt::JUNGFRAU);
|
||||
|
||||
// Now both objects point to the same shm so we can only
|
||||
// Now both objects point to the same shm so we can only
|
||||
// free one!
|
||||
m2.freeSharedMemory();
|
||||
}
|
||||
|
||||
TEST_CASE("Is shm fixed pattern shm compatible"){
|
||||
TEST_CASE("Is shm fixed pattern shm compatible") {
|
||||
sls::Module m(dt::JUNGFRAU);
|
||||
|
||||
// Should be true since we just created the shm
|
||||
REQUIRE(m.isFixedPatternSharedMemoryCompatible() == true);
|
||||
|
||||
// Set shm version to 0
|
||||
sls::SharedMemory<sls::sharedSlsDetector> shm(0,0);
|
||||
REQUIRE(shm.IsExisting()== true);
|
||||
// Set shm version to 0
|
||||
sls::SharedMemory<sls::sharedSlsDetector> shm(0, 0);
|
||||
REQUIRE(shm.IsExisting() == true);
|
||||
shm.OpenSharedMemory();
|
||||
shm()->shmversion = 0;
|
||||
|
||||
|
||||
// Should fail since version is set to 0
|
||||
REQUIRE(m.isFixedPatternSharedMemoryCompatible() == false);
|
||||
|
||||
m.freeSharedMemory();
|
||||
}
|
||||
|
||||
TEST_CASE("Get default control port"){
|
||||
TEST_CASE("Get default control port") {
|
||||
sls::Module m(dt::MYTHEN3);
|
||||
REQUIRE(m.getControlPort() == 1952);
|
||||
m.freeSharedMemory();
|
||||
}
|
||||
|
||||
TEST_CASE("Get default stop port"){
|
||||
TEST_CASE("Get default stop port") {
|
||||
sls::Module m(dt::GOTTHARD2);
|
||||
REQUIRE(m.getStopPort() == 1953);
|
||||
m.freeSharedMemory();
|
||||
}
|
||||
|
||||
TEST_CASE("Get default receiver TCP port"){
|
||||
TEST_CASE("Get default receiver TCP port") {
|
||||
sls::Module m(dt::MYTHEN3);
|
||||
REQUIRE(m.getReceiverPort() == 1954);
|
||||
m.freeSharedMemory();
|
||||
|
Reference in New Issue
Block a user