mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-19 18:40:01 +02:00
WIP
This commit is contained in:
parent
4053594c4d
commit
223e24f924
@ -1622,9 +1622,6 @@ int setDetectorPosition(int pos[]) {
|
||||
int *getDetectorPosition() { return detPos; }
|
||||
|
||||
int enableTenGigabitEthernet(int val) {
|
||||
#ifdef VIRTUAL
|
||||
return 0;
|
||||
#endif
|
||||
uint32_t addr = CONFIG_REG;
|
||||
|
||||
// set
|
||||
|
@ -1255,9 +1255,6 @@ int setDetectorPosition(int pos[]) {
|
||||
int *getDetectorPosition() { return detPos; }
|
||||
|
||||
int enableTenGigabitEthernet(int val) {
|
||||
#ifdef VIRTUAL
|
||||
return 0;
|
||||
#endif
|
||||
uint32_t addr = CONFIG_REG;
|
||||
|
||||
// set
|
||||
|
@ -357,7 +357,7 @@ void DetectorImpl::setGapPixelsinCallback(const bool enable) {
|
||||
break;
|
||||
default:
|
||||
throw RuntimeError("Gap Pixels is not implemented for " +
|
||||
multi_shm()->multiDetectorType);
|
||||
ToString(multi_shm()->multiDetectorType));
|
||||
}
|
||||
}
|
||||
multi_shm()->gapPixels = enable;
|
||||
|
@ -320,8 +320,6 @@ TEST_CASE("dr", "[.cmd][.new]") {
|
||||
CmdProxy proxy(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::EIGER) {
|
||||
// The only detector currently supporting setting dr
|
||||
// is EIGER?
|
||||
auto dr = det.getDynamicRange().squash();
|
||||
std::array<int, 4> vals{4, 8, 16, 32};
|
||||
for (const auto val : vals) {
|
||||
@ -332,6 +330,17 @@ TEST_CASE("dr", "[.cmd][.new]") {
|
||||
REQUIRE(oss2.str() == "dr " + std::to_string(val) + '\n');
|
||||
}
|
||||
det.setDynamicRange(dr);
|
||||
} else if (det_type == defs::MYTHEN3) {
|
||||
// not updated in firmware to support anything other than 32 at the
|
||||
// moment
|
||||
std::ostringstream oss1, oss2;
|
||||
proxy.Call("dr", {"32"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "dr 32\n");
|
||||
proxy.Call("dr", {"32"}, -1, PUT, oss2);
|
||||
REQUIRE(oss2.str() == "dr 32\n");
|
||||
REQUIRE_THROWS(proxy.Call("dr", {"4"}, -1, PUT));
|
||||
REQUIRE_THROWS(proxy.Call("dr", {"8"}, -1, PUT));
|
||||
REQUIRE_THROWS(proxy.Call("dr", {"16"}, -1, PUT));
|
||||
} else {
|
||||
// For the other detectors we should get an error message
|
||||
// except for dr 16
|
||||
|
@ -1173,7 +1173,17 @@ TEST_CASE("gappixels", "[.cmd][.new]") {
|
||||
}
|
||||
det.setGapPixelsinCallback(prev_val);
|
||||
} else {
|
||||
REQUIRE_THROWS(proxy.Call("gappixels", {}, -1, GET));
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("gappixels", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "gappixels 0\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("gappixels", {"0"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "gappixels 0\n");
|
||||
}
|
||||
REQUIRE_THROWS(proxy.Call("gappixels", {"1"}, -1, PUT));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1355,7 +1365,8 @@ TEST_CASE("tengiga", "[.cmd][.new]") {
|
||||
CmdProxy proxy(&det);
|
||||
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::EIGER || det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::EIGER || det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::MOENCH) {
|
||||
auto tengiga = det.getTenGiga();
|
||||
det.setTenGiga(false);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user