Merge branch 'j13flippeddatax' into j7filter

This commit is contained in:
maliakal_d 2021-08-06 16:41:51 +02:00
commit fd6e82e161
20 changed files with 20 additions and 25 deletions

View File

@ -161,7 +161,7 @@ def test_gainmode(virtual_jf_detectors):
assert d.gainMode == gainMode.NORMAL_GAIN_MODE
gain_list = [
gainMode.DYNAMIC_GAIN_MODE,
gainMode.DYNAMIC,
gainMode.FORCE_SWITCH_G1,
gainMode.FORCE_SWITCH_G2,
gainMode.FIX_G1,
@ -176,7 +176,7 @@ def test_gainmode(virtual_jf_detectors):
d.setGainMode(gainMode.FORCE_SWITCH_G1, [1])
assert d.gainMode == [
gainMode.DYNAMIC_GAIN_MODE,
gainMode.DYNAMIC,
gainMode.FORCE_SWITCH_G1,
gainMode.FORCE_SWITCH_G2,
gainMode.FIX_G1,

View File

@ -2201,7 +2201,7 @@ class Detector(CppDetectorApi):
[Jungfrau] Detector gain mode. Enum: gainMode
Note
-----
[Jungfrau] DYNAMIC_GAIN_MODE, FORCE_SWITCH_G1, FORCE_SWITCH_G2, FIX_G1, FIX_G2, FIX_G0 \n
[Jungfrau] DYNAMIC, FORCE_SWITCH_G1, FORCE_SWITCH_G2, FIX_G1, FIX_G2, FIX_G0 \n
CAUTION: Do not use FIX_G0 without caution, you can damage the detector!!!
"""
return element_if_equal(self.getGainMode())

View File

@ -308,7 +308,7 @@ void init_enums(py::module &m) {
.export_values();
py::enum_<slsDetectorDefs::gainMode>(Defs, "gainMode")
.value("DYNAMIC_GAIN_MODE", slsDetectorDefs::gainMode::DYNAMIC_GAIN_MODE)
.value("DYNAMIC", slsDetectorDefs::gainMode::DYNAMIC)
.value("FORCE_SWITCH_G1", slsDetectorDefs::gainMode::FORCE_SWITCH_G1)
.value("FORCE_SWITCH_G2", slsDetectorDefs::gainMode::FORCE_SWITCH_G2)
.value("FIX_G1", slsDetectorDefs::gainMode::FIX_G1)

View File

@ -65,7 +65,7 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject {
};
enum {
DYNAMIC_GAIN_MODE,
DYNAMIC,
FORCE_SWITCH_G1,
FORCE_SWITCH_G2,
FIX_G1,

View File

@ -132,7 +132,7 @@ void qTabSettings::SetupDetectorSettings() {
}
void qTabSettings::SetupGainMode() {
comboGainMode->setCurrentIndex(DYNAMIC_GAIN_MODE);
comboGainMode->setCurrentIndex(DYNAMIC);
ShowFixG0(false);
}

View File

@ -1105,7 +1105,7 @@ enum gainMode getGainMode() {
// dynamic gain, when nothing is set
if (retval_force == 0 && retval_fix == 0 && retval_cmp_rst == 0) {
return DYNAMIC_GAIN_MODE;
return DYNAMIC;
}
switch (retval_force) {
@ -1139,7 +1139,7 @@ void setGainMode(enum gainMode mode) {
uint32_t value = bus_r(addr);
switch (mode) {
case DYNAMIC_GAIN_MODE:
case DYNAMIC:
value &= ~(DAQ_GAIN_MODE_MASK);
bus_w(addr, value);
LOG(logINFO,

View File

@ -98,7 +98,7 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS };
#define DEFAULT_HIGH_VOLTAGE (0)
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
#define DEFAULT_SETTINGS (GAIN0)
#define DEFAULT_GAINMODE (DYNAMIC_GAIN_MODE)
#define DEFAULT_GAINMODE (DYNAMIC)
#define DEFAULT_TX_UDP_PORT (0x7e9a)
#define DEFAULT_TMP_THRSHLD (65 * 1000) // milli degree Celsius
#define DEFAULT_NUM_STRG_CLLS (0)

View File

@ -8589,7 +8589,7 @@ int set_default_dac(int file_des) {
int get_gain_mode(int file_des) {
ret = OK;
memset(mess, 0, sizeof(mess));
enum gainMode retval = DYNAMIC_GAIN_MODE;
enum gainMode retval = DYNAMIC;
LOG(logDEBUG1, ("Getting gain mode\n"));
#ifndef JUNGFRAUD
@ -8622,7 +8622,7 @@ int set_gain_mode(int file_des) {
// only set
if (Server_VerifyLock() == OK) {
switch (gainmode) {
case DYNAMIC_GAIN_MODE:
case DYNAMIC:
case FORCE_SWITCH_G1:
case FORCE_SWITCH_G2:
case FIX_G1:

View File

@ -1193,7 +1193,7 @@ class Detector {
/** [Jungfrau]*/
Result<defs::gainMode> getGainMode(Positions pos = {}) const;
/** [Jungfrau] Options: DYNAMIC_GAIN_MODE, FORCE_SWITCH_G1, FORCE_SWITCH_G2,
/** [Jungfrau] Options: DYNAMIC, FORCE_SWITCH_G1, FORCE_SWITCH_G2,
* FIX_G1, FIX_G2, FIX_G0 \n\CAUTION: Do not use FIX_G0 without caution, you
* can damage the detector!!!\n
*/

View File

@ -1501,7 +1501,7 @@ void Detector::setStorageCellDelay(ns value, Positions pos) {
std::vector<defs::gainMode> Detector::getGainModeList() const {
switch (getDetectorType().squash()) {
case defs::JUNGFRAU:
return std::vector<defs::gainMode>{defs::DYNAMIC_GAIN_MODE,
return std::vector<defs::gainMode>{defs::DYNAMIC,
defs::FORCE_SWITCH_G1,
defs::FORCE_SWITCH_G2,
defs::FIX_G1,

View File

@ -458,8 +458,8 @@ TEST_CASE("gainmode", "[.cmd]") {
}
{
std::ostringstream oss;
proxy.Call("gainmode", {"dynamicgain"}, -1, PUT, oss);
REQUIRE(oss.str() == "gainmode dynamicgain\n");
proxy.Call("gainmode", {"dynamic"}, -1, PUT, oss);
REQUIRE(oss.str() == "gainmode dynamic\n");
}
{
std::ostringstream oss;

View File

@ -36,13 +36,9 @@ std::string ToString(const defs::dacIndex s);
std::string ToString(const std::vector<defs::dacIndex> &vec);
std::string ToString(const defs::burstMode s);
std::string ToString(const defs::timingSourceType s);
<<<<<<< HEAD
std::string ToString(const defs::M3_GainCaps s);
std::string ToString(const defs::portPosition s);
std::string ToString(const defs::ethernetInterface s);
=======
std::string ToString(const defs::streamingInterface s);
>>>>>>> 5.2.0-rc
std::string ToString(const defs::vetoAlgorithm s);
std::string ToString(const defs::gainMode s);

View File

@ -416,7 +416,7 @@ typedef struct {
enum vetoAlgorithm { DEFAULT_ALGORITHM };
enum gainMode {
DYNAMIC_GAIN_MODE,
DYNAMIC,
FORCE_SWITCH_G1,
FORCE_SWITCH_G2,
FIX_G1,

View File

@ -3,7 +3,6 @@
#define APILIB 0x210225
#define APIRECEIVER 0x210225
#define APIGUI 0x210225
#define APIEIGER 0x210806
#define APICTB 0x210806
#define APIGOTTHARD 0x210806

View File

@ -583,8 +583,8 @@ std::string ToString(const defs::vetoAlgorithm s) {
std::string ToString(const defs::gainMode s) {
switch (s) {
case defs::DYNAMIC_GAIN_MODE:
return std::string("dynamicgain");
case defs::DYNAMIC:
return std::string("dynamic");
case defs::FORCE_SWITCH_G1:
return std::string("forceswitchg1");
case defs::FORCE_SWITCH_G2:
@ -986,8 +986,8 @@ template <> defs::vetoAlgorithm StringTo(const std::string &s) {
}
template <> defs::gainMode StringTo(const std::string &s) {
if (s == "dynamicgain")
return defs::DYNAMIC_GAIN_MODE;
if (s == "dynamic")
return defs::DYNAMIC;
if (s == "forceswitchg1")
return defs::FORCE_SWITCH_G1;
if (s == "forceswitchg2")