diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index 857a9e838..6a92d6648 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -1008,7 +1008,7 @@ std::string CmdProxy::Scan(int action) { WrongNumberOfParameters(0); } auto t = det->getScan(); - os << ToString(t) << '\n'; + os << OutString(t) << '\n'; } else if (action == defs::PUT_ACTION) { // disable if (args.size() == 1) { diff --git a/slsSupportLib/include/sls_detector_defs.h b/slsSupportLib/include/sls_detector_defs.h index 8a12f37a3..733d4afb2 100644 --- a/slsSupportLib/include/sls_detector_defs.h +++ b/slsSupportLib/include/sls_detector_defs.h @@ -474,6 +474,13 @@ typedef struct { stepSize(step) { dacSettleTime_ns = t.count(); } + bool operator==(const scanParameters &other) const { + return ((enable == other.enable) && (dacInd == other.dacInd) && + (startOffset == other.startOffset) && + (stopOffset == other.stopOffset) && + (stepSize == other.stepSize) && + (dacSettleTime_ns == other.dacSettleTime_ns)); + } } __attribute__((packed)); #endif diff --git a/slsSupportLib/tests/test-sls_detector_defs.cpp b/slsSupportLib/tests/test-sls_detector_defs.cpp index 0162d92b7..d0c28e43c 100644 --- a/slsSupportLib/tests/test-sls_detector_defs.cpp +++ b/slsSupportLib/tests/test-sls_detector_defs.cpp @@ -49,4 +49,26 @@ TEST_CASE("assign module", "[support]") { CHECK(m3.reg == 500); CHECK(m3.iodelay == 750); CHECK(m3.nchan == 256 * 256 * 4); +} + +TEST_CASE("default construct scanParameters"){ + slsDetectorDefs::scanParameters p; + CHECK(p.dacSettleTime_ns == 0); + CHECK(p.dacInd == slsDetectorDefs::DAC_0); + CHECK(p.enable == 0); + CHECK(p.startOffset == 0); + CHECK(p.stopOffset == 0); + CHECK(p.stepSize == 0); + +} + +TEST_CASE("compare two scanParameters"){ + slsDetectorDefs::scanParameters p0; + slsDetectorDefs::scanParameters p1; + + CHECK(p0 == p1); + + p0.enable = 1; + CHECK_FALSE(p0 == p1); + } \ No newline at end of file