mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-16 05:56:50 +01:00
Counters (#71)
* mythen3: adding counters mask, firmware still takes only number of counters for now * mythen3: checking if module attached before powering on chip * bug fix: loop inital declaration not allowed in c * fix scope eiger test * mythen3: renamed setCounters to setCounterMask and getCounterMask in API * mythen3 replacing counting bits with popcount Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
This commit is contained in:
committed by
Erik Fröjdh
parent
70c54f4315
commit
de53747ddd
27
slsDetectorSoftware/tests/test-CmdProxy-global.cpp
Normal file
27
slsDetectorSoftware/tests/test-CmdProxy-global.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include "test-CmdProxy-global.h"
|
||||
#include "CmdProxy.h"
|
||||
#include "Detector.h"
|
||||
#include "catch.hpp"
|
||||
#include "tests/globals.h"
|
||||
|
||||
using sls::CmdProxy;
|
||||
using sls::Detector;
|
||||
using test::GET;
|
||||
using test::PUT;
|
||||
|
||||
|
||||
void test_dac(defs::dacIndex index, const std::string &dacname, int dacvalue) {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
std::ostringstream oss_set, oss_get;
|
||||
auto dacstr = std::to_string(dacvalue);
|
||||
auto previous = det.getDAC(index, false);
|
||||
proxy.Call(dacname, {dacstr}, -1, PUT, oss_set);
|
||||
REQUIRE(oss_set.str() == dacname + " " + dacstr + "\n");
|
||||
proxy.Call(dacname, {}, -1, GET, oss_get);
|
||||
REQUIRE(oss_get.str() == dacname + " " + dacstr + "\n");
|
||||
// Reset all dacs to previous value
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setDAC(index, previous[i], false, {i});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user