diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index 8593ba3dc..975c59420 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -964,11 +964,11 @@ std::string CmdProxy::CurrentSource(int action) { os << cmd << ' '; if (action == defs::HELP_ACTION) { os << "[0|1]\n\t[Gotthard2] Enable or disable current source. Default " - "is disabled.\n[0|1] [fix|nofix] [select source] " - "[normal|low]\n\t[Jungfrau] Disable or enable current source " - "with some parameters. The select source is 0-63 for chipv1.0 " - "and a 64 bit mask for chipv1.1. To disable, one needs only one " - "argument '0'." + "is disabled.\n[0|1] [fix|nofix] [select source] [(only for " + "chipv1.1)normal|low]\n\t[Jungfrau] Disable or enable current " + "source with some parameters. The select source is 0-63 for " + "chipv1.0 and a 64 bit mask for chipv1.1. To disable, one needs " + "only one argument '0'." << '\n'; } else if (action == defs::GET_ACTION) { if (args.size() != 0) { @@ -978,7 +978,7 @@ std::string CmdProxy::CurrentSource(int action) { os << OutString(t) << '\n'; } else if (action == defs::PUT_ACTION) { if (args.size() == 1) { - det->setCurrentsource( + det->setCurrentSource( defs::currentSrcParameters(StringTo(args[0]))); } else if (args.size() >= 3) { // scan fix @@ -992,8 +992,8 @@ std::string CmdProxy::CurrentSource(int action) { ". Did you mean fix or nofix?"); } if (args.size() == 3) { - det->setCurrentsource(defs::currentSrcParameters( - StringTo(args[0]), fix, StringTo(args[2]))); + det->setCurrentSource(defs::currentSrcParameters( + fix, StringTo(args[2]))); } else if (args.size() == 4) { bool normalCurrent = false; if (args[3] == "normal") { @@ -1004,9 +1004,8 @@ std::string CmdProxy::CurrentSource(int action) { throw sls::RuntimeError("Invalid argument: " + args[3] + ". Did you mean normal or low?"); } - det->setCurrentsource(defs::currentSrcParameters( - StringTo(args[0]), fix, StringTo(args[2]), - normalCurrent)); + det->setCurrentSource(defs::currentSrcParameters( + fix, StringTo(args[2]), normalCurrent)); } else { throw sls::RuntimeError( "Invalid number of parareters for this command."); diff --git a/slsDetectorSoftware/tests/test-CmdProxy.cpp b/slsDetectorSoftware/tests/test-CmdProxy.cpp index 6af032e82..814b23599 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy.cpp @@ -1428,7 +1428,7 @@ TEST_CASE("currentsource", "[.cmd]") { CmdProxy proxy(&det); auto det_type = det.getDetectorType().squash(); - if (det_type == defs::GOTTHARD2 || detType == defs::Jungfrau) { + if (det_type == defs::GOTTHARD2 || det_type == defs::JUNGFRAU) { auto prev_val = det.getCurrentSource(); if (det_type == defs::GOTTHARD2) { @@ -1461,11 +1461,11 @@ TEST_CASE("currentsource", "[.cmd]") { REQUIRE_THROWS( proxy.Call("currentsource", {"1", "fix"}, -1, PUT)); REQUIRE_THROWS( - proxy.Call("currentsource", {"1", "fix", 64}, -1, PUT)); + proxy.Call("currentsource", {"1", "fix", "64"}, -1, PUT)); REQUIRE_THROWS( - proxy.Call("currentsource", {"1", "dfg", 64}, -1, PUT)); - REQUIRE_THROWS(proxy.Call("currentsource", - {"1", "fix", 63, "normal"}, -1, PUT)); + proxy.Call("currentsource", {"1", "dfg", "64"}, -1, PUT)); + REQUIRE_THROWS(proxy.Call( + "currentsource", {"1", "fix", "63", "normal"}, -1, PUT)); { std::ostringstream oss; proxy.Call("currentsource", {"1", "fix", "63"}, -1, PUT, @@ -1501,9 +1501,9 @@ TEST_CASE("currentsource", "[.cmd]") { REQUIRE_THROWS( proxy.Call("currentsource", {"1", "fix"}, -1, PUT)); REQUIRE_THROWS(proxy.Call("currentsource", - {"1", "ffgdfgix", 65}, -1, PUT)); + {"1", "ffgdfgix", "65"}, -1, PUT)); REQUIRE_THROWS(proxy.Call( - "currentsource", {"1", "fix", 65, "normaldgf"}, -1, PUT)); + "currentsource", {"1", "fix", "65", "normaldgf"}, -1, PUT)); { std::ostringstream oss; diff --git a/slsSupportLib/include/sls/sls_detector_defs.h b/slsSupportLib/include/sls/sls_detector_defs.h index ca84a5b2f..59dfd0609 100644 --- a/slsSupportLib/include/sls/sls_detector_defs.h +++ b/slsSupportLib/include/sls/sls_detector_defs.h @@ -465,7 +465,7 @@ typedef struct { /** [Gotthard2][Jungfrau] disable */ currentSrcParameters() : enable(0), fix(-1), normal(-1), select(0) {} - /** [Gotthard2] enable */ + /** [Gotthard2] enable or disable */ currentSrcParameters(bool ena) : enable(static_cast(ena)), fix(-1), normal(-1), select(0) {}