mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 01:58:00 +02:00
j: 1. chipversion
This commit is contained in:
@ -1081,6 +1081,9 @@ class Detector {
|
||||
* *
|
||||
* ************************************************/
|
||||
|
||||
/** [Jungfrau] */
|
||||
Result<double> getChipVersion(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau] */
|
||||
Result<int> getThresholdTemperature(Positions pos = {}) const;
|
||||
|
||||
|
@ -918,6 +918,7 @@ class CmdProxy {
|
||||
{"datastream", &CmdProxy::DataStream},
|
||||
|
||||
/* Jungfrau Specific */
|
||||
{"chipversion", &CmdProxy::chipversion},
|
||||
{"temp_threshold", &CmdProxy::temp_threshold},
|
||||
{"temp_control", &CmdProxy::temp_control},
|
||||
{"temp_event", &CmdProxy::TemperatureEvent},
|
||||
@ -1812,6 +1813,9 @@ class CmdProxy {
|
||||
|
||||
/* Jungfrau Specific */
|
||||
|
||||
GET_COMMAND(chipversion, getChipVersion,
|
||||
"\n\t[Jungfrau] Returns chip version. Can be 1.0 or 1.1");
|
||||
|
||||
INTEGER_COMMAND_VEC_ID(
|
||||
temp_threshold, getThresholdTemperature, setThresholdTemperature,
|
||||
StringTo<int>,
|
||||
|
@ -1398,6 +1398,9 @@ void Detector::setDataStream(const defs::portPosition port, const bool enable,
|
||||
}
|
||||
|
||||
// Jungfrau Specific
|
||||
Result<double> Detector::getChipVersion(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getChipVersion, pos);
|
||||
}
|
||||
|
||||
Result<int> Detector::getThresholdTemperature(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getThresholdTemperature, pos);
|
||||
|
@ -1522,6 +1522,9 @@ void Module::setDataStream(const portPosition port, const bool enable) {
|
||||
}
|
||||
|
||||
// Jungfrau Specific
|
||||
double Module::getChipVersion() const {
|
||||
return (sendToDetector<int>(F_GET_CHIP_VERSION)) / 10.00;
|
||||
}
|
||||
|
||||
int Module::getThresholdTemperature() const {
|
||||
auto retval = sendToDetectorStop<int>(F_THRESHOLD_TEMP, GET_FLAG);
|
||||
|
@ -351,6 +351,7 @@ class Module : public virtual slsDetectorDefs {
|
||||
* Jungfrau Specific *
|
||||
* *
|
||||
* ************************************************/
|
||||
double getChipVersion() const;
|
||||
int getThresholdTemperature() const;
|
||||
void setThresholdTemperature(int val);
|
||||
bool getTemperatureControl() const;
|
||||
|
@ -190,6 +190,18 @@ TEST_CASE("temp_threshold", "[.cmd]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("chipversion", "[.cmd]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::JUNGFRAU) {
|
||||
REQUIRE_NOTHROW(proxy.Call("chipversion", {}, -1, GET));
|
||||
} else {
|
||||
REQUIRE_THROWS(proxy.Call("chipversion", {}, -1, GET));
|
||||
}
|
||||
REQUIRE_THROWS(proxy.Call("chipversion", {"0"}, -1, PUT));
|
||||
}
|
||||
|
||||
TEST_CASE("temp_control", "[.cmd]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
|
Reference in New Issue
Block a user