mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 22:40:02 +02:00
rewrote settings enums, gainmode enums
This commit is contained in:
parent
550810a3ca
commit
0e5e0f346b
@ -101,11 +101,11 @@ def test_module_size(virtual_jf_detectors):
|
|||||||
|
|
||||||
def test_settings(virtual_jf_detectors):
|
def test_settings(virtual_jf_detectors):
|
||||||
d = ExperimentalDetector()
|
d = ExperimentalDetector()
|
||||||
assert d.settings == detectorSettings.DYNAMICGAIN
|
assert d.settings == detectorSettings.GAIN0
|
||||||
|
|
||||||
gain_list = [
|
gain_list = [
|
||||||
detectorSettings.DYNAMICHG0,
|
detectorSettings.GAIN0,
|
||||||
detectorSettings.DYNAMICGAIN,
|
detectorSettings.HIGHGAIN0,
|
||||||
]
|
]
|
||||||
|
|
||||||
# Set all viable gain for Jungfrau to make sure nothing is crashing
|
# Set all viable gain for Jungfrau to make sure nothing is crashing
|
||||||
@ -113,14 +113,14 @@ def test_settings(virtual_jf_detectors):
|
|||||||
d.settings = gain
|
d.settings = gain
|
||||||
assert d.settings == gain
|
assert d.settings == gain
|
||||||
|
|
||||||
d.setSettings(detectorSettings.DYNAMICGAIN, [1])
|
d.setSettings(detectorSettings.GAIN0, [1])
|
||||||
assert d.settings == [
|
assert d.settings == [
|
||||||
detectorSettings.DYNAMICHG0,
|
detectorSettings.GAIN0,
|
||||||
detectorSettings.DYNAMICGAIN,
|
detectorSettings.HIGHGAIN0,
|
||||||
]
|
]
|
||||||
|
|
||||||
d.settings = detectorSettings.DYNAMICGAIN
|
d.settings = detectorSettings.GAIN0
|
||||||
assert d.settings == detectorSettings.DYNAMICGAIN
|
assert d.settings == detectorSettings.GAIN0
|
||||||
|
|
||||||
def test_frames(virtual_jf_detectors):
|
def test_frames(virtual_jf_detectors):
|
||||||
d = ExperimentalDetector()
|
d = ExperimentalDetector()
|
||||||
@ -161,9 +161,12 @@ def test_gainmode(virtual_jf_detectors):
|
|||||||
assert d.gainMode == gainMode.NORMAL_GAIN_MODE
|
assert d.gainMode == gainMode.NORMAL_GAIN_MODE
|
||||||
|
|
||||||
gain_list = [
|
gain_list = [
|
||||||
gainMode.NORMAL_GAIN_MODE,
|
gainMode.DYNAMIC_GAIN,
|
||||||
gainMode.FORCE_SWITCH_G1,
|
gainMode.FORCE_SWITCH_G1,
|
||||||
gainMode.FORCE_SWITCH_G2,
|
gainMode.FORCE_SWITCH_G2,
|
||||||
|
gainMode.FIX_G1,
|
||||||
|
gainMode.FIX_G2,
|
||||||
|
gainMode.FIX_G0
|
||||||
]
|
]
|
||||||
|
|
||||||
# Set all viable gain for Jungfrau to make sure nothing is crashing
|
# Set all viable gain for Jungfrau to make sure nothing is crashing
|
||||||
@ -173,9 +176,12 @@ def test_gainmode(virtual_jf_detectors):
|
|||||||
|
|
||||||
d.setGainMode(gainMode.FORCE_SWITCH_G1, [1])
|
d.setGainMode(gainMode.FORCE_SWITCH_G1, [1])
|
||||||
assert d.gainMode == [
|
assert d.gainMode == [
|
||||||
gainMode.NORMAL_GAIN_MODE,
|
gainMode.DYNAMIC_GAIN,
|
||||||
gainMode.FORCE_SWITCH_G1,
|
gainMode.FORCE_SWITCH_G1,
|
||||||
gainMode.FORCE_SWITCH_G2,
|
gainMode.FORCE_SWITCH_G2,
|
||||||
|
gainMode.FIX_G1,
|
||||||
|
gainMode.FIX_G2,
|
||||||
|
gainMode.FIX_G0
|
||||||
]
|
]
|
||||||
|
|
||||||
d.gainMode = gainMode.FORCE_SWITCH_G1
|
d.gainMode = gainMode.FORCE_SWITCH_G1
|
||||||
|
@ -311,7 +311,7 @@ class Detector(CppDetectorApi):
|
|||||||
-----
|
-----
|
||||||
|
|
||||||
[Eiger] Use threshold command to load settings
|
[Eiger] Use threshold command to load settings
|
||||||
[Jungfrau] DYNAMICGAIN, DYNAMICHG0 \n
|
[Jungfrau] GAIN0, HIGHGAIN0 \n
|
||||||
[Gotthard] DYNAMICGAIN, HIGHGAIN, LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN \n
|
[Gotthard] DYNAMICGAIN, HIGHGAIN, LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN \n
|
||||||
[Gotthard2] DYNAMICGAIN, FIXGAIN1, FIXGAIN2 \n
|
[Gotthard2] DYNAMICGAIN, FIXGAIN1, FIXGAIN2 \n
|
||||||
[Moench] G1_HIGHGAIN, G1_LOWGAIN, G2_HIGHCAP_HIGHGAIN, G2_HIGHCAP_LOWGAIN, G2_LOWCAP_HIGHGAIN, G2_LOWCAP_LOWGAIN, G4_HIGHGAIN, G4_LOWGAIN \n
|
[Moench] G1_HIGHGAIN, G1_LOWGAIN, G2_HIGHCAP_HIGHGAIN, G2_HIGHCAP_LOWGAIN, G2_LOWCAP_HIGHGAIN, G2_LOWCAP_LOWGAIN, G4_HIGHGAIN, G4_LOWGAIN \n
|
||||||
@ -2201,8 +2201,8 @@ class Detector(CppDetectorApi):
|
|||||||
[Jungfrau] Detector gain mode. Enum: gainMode
|
[Jungfrau] Detector gain mode. Enum: gainMode
|
||||||
Note
|
Note
|
||||||
-----
|
-----
|
||||||
[Jungfrau] NORMAL_GAIN_MODE, FORCE_SWITCH_G1, FORCE_SWITCH_G2, FIX_G1, FIX_G2, FIX_G0, FIX_HG0 \n
|
[Jungfrau] DYNAMIC_GAIN, FORCE_SWITCH_G1, FORCE_SWITCH_G2, FIX_G1, FIX_G2, FIX_G0 \n
|
||||||
CAUTION: Do not use FIX_G0 and FIX_HG0 blindly, you can damage the detector!!!
|
CAUTION: Do not use FIX_G0 blindly, you can damage the detector!!!
|
||||||
"""
|
"""
|
||||||
return element_if_equal(self.getGainMode())
|
return element_if_equal(self.getGainMode())
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ void init_enums(py::module &m) {
|
|||||||
.value("LOWGAIN", slsDetectorDefs::detectorSettings::LOWGAIN)
|
.value("LOWGAIN", slsDetectorDefs::detectorSettings::LOWGAIN)
|
||||||
.value("MEDIUMGAIN", slsDetectorDefs::detectorSettings::MEDIUMGAIN)
|
.value("MEDIUMGAIN", slsDetectorDefs::detectorSettings::MEDIUMGAIN)
|
||||||
.value("VERYHIGHGAIN", slsDetectorDefs::detectorSettings::VERYHIGHGAIN)
|
.value("VERYHIGHGAIN", slsDetectorDefs::detectorSettings::VERYHIGHGAIN)
|
||||||
.value("DYNAMICHG0", slsDetectorDefs::detectorSettings::DYNAMICHG0)
|
.value("HIGHGAIN0", slsDetectorDefs::detectorSettings::HIGHGAIN0)
|
||||||
.value("FIXGAIN1", slsDetectorDefs::detectorSettings::FIXGAIN1)
|
.value("FIXGAIN1", slsDetectorDefs::detectorSettings::FIXGAIN1)
|
||||||
.value("FIXGAIN2", slsDetectorDefs::detectorSettings::FIXGAIN2)
|
.value("FIXGAIN2", slsDetectorDefs::detectorSettings::FIXGAIN2)
|
||||||
.value("VERYLOWGAIN", slsDetectorDefs::detectorSettings::VERYLOWGAIN)
|
.value("VERYLOWGAIN", slsDetectorDefs::detectorSettings::VERYLOWGAIN)
|
||||||
@ -226,6 +226,7 @@ void init_enums(py::module &m) {
|
|||||||
slsDetectorDefs::detectorSettings::G2_LOWCAP_LOWGAIN)
|
slsDetectorDefs::detectorSettings::G2_LOWCAP_LOWGAIN)
|
||||||
.value("G4_HIGHGAIN", slsDetectorDefs::detectorSettings::G4_HIGHGAIN)
|
.value("G4_HIGHGAIN", slsDetectorDefs::detectorSettings::G4_HIGHGAIN)
|
||||||
.value("G4_LOWGAIN", slsDetectorDefs::detectorSettings::G4_LOWGAIN)
|
.value("G4_LOWGAIN", slsDetectorDefs::detectorSettings::G4_LOWGAIN)
|
||||||
|
.value("GAIN0", slsDetectorDefs::detectorSettings::GAIN0)
|
||||||
.value("UNDEFINED", slsDetectorDefs::detectorSettings::UNDEFINED)
|
.value("UNDEFINED", slsDetectorDefs::detectorSettings::UNDEFINED)
|
||||||
.value("UNINITIALIZED",
|
.value("UNINITIALIZED",
|
||||||
slsDetectorDefs::detectorSettings::UNINITIALIZED)
|
slsDetectorDefs::detectorSettings::UNINITIALIZED)
|
||||||
@ -307,8 +308,11 @@ void init_enums(py::module &m) {
|
|||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::gainMode>(Defs, "gainMode")
|
py::enum_<slsDetectorDefs::gainMode>(Defs, "gainMode")
|
||||||
.value("NORMAL_GAIN_MODE", slsDetectorDefs::gainMode::NORMAL_GAIN_MODE)
|
.value("DYNAMIC_GAIN", slsDetectorDefs::gainMode::DYNAMIC_GAIN)
|
||||||
.value("FORCE_SWITCH_G1", slsDetectorDefs::gainMode::FORCE_SWITCH_G1)
|
.value("FORCE_SWITCH_G1", slsDetectorDefs::gainMode::FORCE_SWITCH_G1)
|
||||||
.value("FORCE_SWITCH_G2", slsDetectorDefs::gainMode::FORCE_SWITCH_G2)
|
.value("FORCE_SWITCH_G2", slsDetectorDefs::gainMode::FORCE_SWITCH_G2)
|
||||||
|
.value("FIX_G1", slsDetectorDefs::gainMode::FIX_G1)
|
||||||
|
.value("FIX_G2", slsDetectorDefs::gainMode::FIX_G2)
|
||||||
|
.value("FIX_G0", slsDetectorDefs::gainMode::FIX_G0)
|
||||||
.export_values();
|
.export_values();
|
||||||
}
|
}
|
||||||
|
@ -32,29 +32,5 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject {
|
|||||||
sls::Detector *det;
|
sls::Detector *det;
|
||||||
std::vector<QCheckBox *> counters;
|
std::vector<QCheckBox *> counters;
|
||||||
|
|
||||||
enum {
|
|
||||||
STANDARD,
|
|
||||||
FAST,
|
|
||||||
HIGHGAIN,
|
|
||||||
DYNAMICGAIN,
|
|
||||||
LOWGAIN,
|
|
||||||
MEDIUMGAIN,
|
|
||||||
VERYHIGHGAIN,
|
|
||||||
DYNAMICHG0,
|
|
||||||
FIXGAIN1,
|
|
||||||
FIXGAIN2,
|
|
||||||
VERLOWGAIN,
|
|
||||||
G1_HIGHGAIN,
|
|
||||||
G1_LOWGAIN,
|
|
||||||
G2_HIGHCAP_HIGHGAIN,
|
|
||||||
G2_HIGHCAP_LOWGAIN,
|
|
||||||
G2_LOWCAP_HIGHGAIN,
|
|
||||||
G2_LOWCAP_LOWGAIN,
|
|
||||||
G4_HIGHGAIN,
|
|
||||||
G4_LOWGAIN,
|
|
||||||
UNDEFINED,
|
|
||||||
UNINITIALIZED,
|
|
||||||
NUMSETTINGS
|
|
||||||
};
|
|
||||||
enum { DYNAMICRANGE_32, DYNAMICRANGE_16, DYNAMICRANGE_8, DYNAMICRANGE_4 };
|
enum { DYNAMICRANGE_32, DYNAMICRANGE_16, DYNAMICRANGE_8, DYNAMICRANGE_4 };
|
||||||
};
|
};
|
||||||
|
@ -92,10 +92,11 @@ void qTabSettings::SetupWidgetWindow() {
|
|||||||
void qTabSettings::SetupDetectorSettings() {
|
void qTabSettings::SetupDetectorSettings() {
|
||||||
QStandardItemModel *model =
|
QStandardItemModel *model =
|
||||||
qobject_cast<QStandardItemModel *>(comboSettings->model());
|
qobject_cast<QStandardItemModel *>(comboSettings->model());
|
||||||
|
const int numSettings = comboSettings->count();
|
||||||
if (model) {
|
if (model) {
|
||||||
QModelIndex index[NUMSETTINGS];
|
QModelIndex index[numSettings];
|
||||||
QStandardItem *item[NUMSETTINGS];
|
QStandardItem *item[numSettings];
|
||||||
for (int i = 0; i < NUMSETTINGS; ++i) {
|
for (int i = 0; i < numSettings; ++i) {
|
||||||
index[i] = model->index(i, comboSettings->modelColumn(),
|
index[i] = model->index(i, comboSettings->modelColumn(),
|
||||||
comboSettings->rootModelIndex());
|
comboSettings->rootModelIndex());
|
||||||
item[i] = model->itemFromIndex(index[i]);
|
item[i] = model->itemFromIndex(index[i]);
|
||||||
@ -160,7 +161,7 @@ void qTabSettings::GetSettings() {
|
|||||||
comboSettings->setCurrentIndex(UNINITIALIZED);
|
comboSettings->setCurrentIndex(UNINITIALIZED);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if ((int)retval < -1 || (int)retval >= NUMSETTINGS) {
|
if ((int)retval < -1 || (int)retval >= comboSettings->count()) {
|
||||||
throw sls::RuntimeError(std::string("Unknown settings: ") +
|
throw sls::RuntimeError(std::string("Unknown settings: ") +
|
||||||
std::to_string(retval));
|
std::to_string(retval));
|
||||||
}
|
}
|
||||||
|
@ -351,6 +351,7 @@
|
|||||||
#define DAQ_CRRNT_SRC_CLMN_FIX_MSK (0x00000001 << DAQ_CRRNT_SRC_CLMN_FIX_OFST)
|
#define DAQ_CRRNT_SRC_CLMN_FIX_MSK (0x00000001 << DAQ_CRRNT_SRC_CLMN_FIX_OFST)
|
||||||
#define DAQ_CRRNT_SRC_CLMN_SLCT_OFST (20)
|
#define DAQ_CRRNT_SRC_CLMN_SLCT_OFST (20)
|
||||||
#define DAQ_CRRNT_SRC_CLMN_SLCT_MSK (0x0000003F << DAQ_CRRNT_SRC_CLMN_SLCT_OFST)
|
#define DAQ_CRRNT_SRC_CLMN_SLCT_MSK (0x0000003F << DAQ_CRRNT_SRC_CLMN_SLCT_OFST)
|
||||||
|
#define DAQ_GAIN_MODE_MASK (DAQ_FRCE_SWTCH_GAIN_MSK | DAQ_FIX_GAIN_MSK | DAQ_CMP_RST_MSK)
|
||||||
|
|
||||||
/** Chip Power Register */
|
/** Chip Power Register */
|
||||||
#define CHIP_POWER_REG (0x5E << MEM_MAP_SHIFT)
|
#define CHIP_POWER_REG (0x5E << MEM_MAP_SHIFT)
|
||||||
|
@ -451,6 +451,7 @@ void setupDetector() {
|
|||||||
|
|
||||||
// Initialization of acquistion parameters
|
// Initialization of acquistion parameters
|
||||||
setSettings(DEFAULT_SETTINGS);
|
setSettings(DEFAULT_SETTINGS);
|
||||||
|
setGainMode(DEFAULT_GAINMODE);
|
||||||
|
|
||||||
setNumFrames(DEFAULT_NUM_FRAMES);
|
setNumFrames(DEFAULT_NUM_FRAMES);
|
||||||
setNumTriggers(DEFAULT_NUM_CYCLES);
|
setNumTriggers(DEFAULT_NUM_CYCLES);
|
||||||
@ -507,10 +508,10 @@ int resetToDefaultDacs(int hardReset) {
|
|||||||
// special dac: replace default value
|
// special dac: replace default value
|
||||||
if (specialDacs[j] == i) {
|
if (specialDacs[j] == i) {
|
||||||
switch (oldSettings) {
|
switch (oldSettings) {
|
||||||
case DYNAMICGAIN:
|
case GAIN0:
|
||||||
value = defaultDacValue_G0[j];
|
value = defaultDacValue_G0[j];
|
||||||
break;
|
break;
|
||||||
case DYNAMICHG0:
|
case HIGHGAIN0:
|
||||||
value = defaultDacValue_HG0[j];
|
value = defaultDacValue_HG0[j];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -541,10 +542,10 @@ int getDefaultDac(enum DACINDEX index, enum detectorSettings sett,
|
|||||||
for (int i = 0; i < NSPECIALDACS; ++i) {
|
for (int i = 0; i < NSPECIALDACS; ++i) {
|
||||||
if ((int)index == specialDacs[i]) {
|
if ((int)index == specialDacs[i]) {
|
||||||
switch (sett) {
|
switch (sett) {
|
||||||
case DYNAMICGAIN:
|
case GAIN0:
|
||||||
*retval = defaultDacValue_G0[i];
|
*retval = defaultDacValue_G0[i];
|
||||||
return OK;
|
return OK;
|
||||||
case DYNAMICHG0:
|
case HIGHGAIN0:
|
||||||
*retval = defaultDacValue_HG0[i];
|
*retval = defaultDacValue_HG0[i];
|
||||||
return OK;
|
return OK;
|
||||||
// unknown settings
|
// unknown settings
|
||||||
@ -573,15 +574,14 @@ int setDefaultDac(enum DACINDEX index, enum detectorSettings sett, int value) {
|
|||||||
for (int i = 0; i < NSPECIALDACS; ++i) {
|
for (int i = 0; i < NSPECIALDACS; ++i) {
|
||||||
if ((int)index == specialDacs[i]) {
|
if ((int)index == specialDacs[i]) {
|
||||||
switch (sett) {
|
switch (sett) {
|
||||||
case DYNAMICGAIN:
|
case GAIN0:
|
||||||
LOG(logINFO,
|
LOG(logINFO, ("Setting Default Dac [%d - %s, gain0]: %d\n",
|
||||||
("Setting Default Dac [%d - %s, dynamicgain]: %d\n",
|
|
||||||
(int)index, dac_names[index], value));
|
(int)index, dac_names[index], value));
|
||||||
defaultDacValue_G0[i] = value;
|
defaultDacValue_G0[i] = value;
|
||||||
return OK;
|
return OK;
|
||||||
case DYNAMICHG0:
|
case HIGHGAIN0:
|
||||||
LOG(logINFO,
|
LOG(logINFO,
|
||||||
("Setting Default Dac [%d - %s, dynamichg0]: %d\n",
|
("Setting Default Dac [%d - %s, highgain0]: %d\n",
|
||||||
(int)index, dac_names[index], value));
|
(int)index, dac_names[index], value));
|
||||||
defaultDacValue_HG0[i] = value;
|
defaultDacValue_HG0[i] = value;
|
||||||
return OK;
|
return OK;
|
||||||
@ -1045,16 +1045,16 @@ enum detectorSettings setSettings(enum detectorSettings sett) {
|
|||||||
int *dacVals = NULL;
|
int *dacVals = NULL;
|
||||||
// set settings
|
// set settings
|
||||||
switch (sett) {
|
switch (sett) {
|
||||||
case DYNAMICGAIN:
|
case GAIN0:
|
||||||
bus_w(DAQ_REG, bus_r(DAQ_REG) & ~DAQ_HIGH_GAIN_MSK);
|
bus_w(DAQ_REG, bus_r(DAQ_REG) & ~DAQ_HIGH_GAIN_MSK);
|
||||||
LOG(logINFO,
|
LOG(logINFO,
|
||||||
("Set settings - Dyanmic Gain [DAQ Reg:0x%x]\n", bus_r(DAQ_REG)));
|
("Set settings - Gain 0 [DAQ Reg:0x%x]\n", bus_r(DAQ_REG)));
|
||||||
dacVals = defaultDacValue_G0;
|
dacVals = defaultDacValue_G0;
|
||||||
break;
|
break;
|
||||||
case DYNAMICHG0:
|
case HIGHGAIN0:
|
||||||
bus_w(DAQ_REG, bus_r(DAQ_REG) | DAQ_HIGH_GAIN_MSK);
|
bus_w(DAQ_REG, bus_r(DAQ_REG) | DAQ_HIGH_GAIN_MSK);
|
||||||
LOG(logINFO, ("Set settings - Dyanmic High Gain 0 [DAQ Reg:0x%x]\n",
|
LOG(logINFO,
|
||||||
bus_r(DAQ_REG)));
|
("Set settings - High Gain 0 [DAQ Reg:0x%x]\n", bus_r(DAQ_REG)));
|
||||||
dacVals = defaultDacValue_HG0;
|
dacVals = defaultDacValue_HG0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -1080,8 +1080,8 @@ enum detectorSettings setSettings(enum detectorSettings sett) {
|
|||||||
|
|
||||||
enum detectorSettings getSettings() {
|
enum detectorSettings getSettings() {
|
||||||
if (bus_r(DAQ_REG) & DAQ_HIGH_GAIN_MSK)
|
if (bus_r(DAQ_REG) & DAQ_HIGH_GAIN_MSK)
|
||||||
return DYNAMICHG0;
|
return HIGHGAIN0;
|
||||||
return DYNAMICGAIN;
|
return GAIN0;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum gainMode getGainMode() {
|
enum gainMode getGainMode() {
|
||||||
@ -1098,7 +1098,7 @@ enum gainMode getGainMode() {
|
|||||||
|
|
||||||
switch (retval_force) {
|
switch (retval_force) {
|
||||||
case DAQ_FRCE_GAIN_STG_0_VAL:
|
case DAQ_FRCE_GAIN_STG_0_VAL:
|
||||||
return DYNAMICGAIN;
|
return DYNAMIC_GAIN;
|
||||||
case DAQ_FRCE_GAIN_STG_1_VAL:
|
case DAQ_FRCE_GAIN_STG_1_VAL:
|
||||||
return FORCE_SWITCH_G1;
|
return FORCE_SWITCH_G1;
|
||||||
case DAQ_FRCE_GAIN_STG_2_VAL:
|
case DAQ_FRCE_GAIN_STG_2_VAL:
|
||||||
@ -1117,11 +1117,8 @@ enum gainMode getGainMode() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (retval_cmp_rst) {
|
if (retval_cmp_rst) {
|
||||||
if (getSettings() == DYNAMICGAIN) {
|
|
||||||
return FIX_G0;
|
return FIX_G0;
|
||||||
}
|
}
|
||||||
return FIX_HG0;
|
|
||||||
}
|
|
||||||
LOG(logERROR, ("This gain mode is undefined [DAQ reg: %d]\n", regval));
|
LOG(logERROR, ("This gain mode is undefined [DAQ reg: %d]\n", regval));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1131,46 +1128,46 @@ void setGainMode(enum gainMode mode) {
|
|||||||
uint32_t value = bus_r(addr);
|
uint32_t value = bus_r(addr);
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case DYNAMICGAIN:
|
case DYNAMIC_GAIN:
|
||||||
value &= ~(DAQ_FRCE_SWTCH_GAIN_MSK);
|
value &= ~(DAQ_GAIN_MODE_MASK);
|
||||||
bus_w(addr, value);
|
bus_w(addr, value);
|
||||||
LOG(logINFO, ("Set gain mode - Normal Gain Mode [DAQ Reg:0x%x]\n",
|
LOG(logINFO,
|
||||||
bus_r(DAQ_REG)));
|
("Set gain mode - Dynamic Gain [DAQ Reg:0x%x]\n", bus_r(DAQ_REG)));
|
||||||
break;
|
break;
|
||||||
case FORCE_SWITCH_G1:
|
case FORCE_SWITCH_G1:
|
||||||
value &= ~(DAQ_FRCE_SWTCH_GAIN_MSK);
|
value &= ~(DAQ_GAIN_MODE_MASK);
|
||||||
value |= DAQ_FRCE_GAIN_STG_1_VAL;
|
value |= DAQ_FRCE_GAIN_STG_1_VAL;
|
||||||
bus_w(addr, value);
|
bus_w(addr, value);
|
||||||
LOG(logINFO, ("Set gain mode - Force Switch G1 [DAQ Reg:0x%x]\n",
|
LOG(logINFO, ("Set gain mode - Force Switch G1 [DAQ Reg:0x%x]\n",
|
||||||
bus_r(DAQ_REG)));
|
bus_r(DAQ_REG)));
|
||||||
break;
|
break;
|
||||||
case FORCE_SWITCH_G2:
|
case FORCE_SWITCH_G2:
|
||||||
value &= ~(DAQ_FRCE_SWTCH_GAIN_MSK);
|
value &= ~(DAQ_GAIN_MODE_MASK);
|
||||||
value |= DAQ_FRCE_GAIN_STG_2_VAL;
|
value |= DAQ_FRCE_GAIN_STG_2_VAL;
|
||||||
bus_w(addr, value);
|
bus_w(addr, value);
|
||||||
LOG(logINFO, ("Set gain mode - Force Switch G2 [DAQ Reg:0x%x]\n",
|
LOG(logINFO, ("Set gain mode - Force Switch G2 [DAQ Reg:0x%x]\n",
|
||||||
bus_r(DAQ_REG)));
|
bus_r(DAQ_REG)));
|
||||||
break;
|
break;
|
||||||
case FIX_G1:
|
case FIX_G1:
|
||||||
value &= ~(DAQ_FIX_GAIN_MSK);
|
value &= ~(DAQ_GAIN_MODE_MASK);
|
||||||
value |= DAQ_FIX_GAIN_STG_1_VAL;
|
value |= DAQ_FIX_GAIN_STG_1_VAL;
|
||||||
bus_w(addr, value);
|
bus_w(addr, value);
|
||||||
LOG(logINFO,
|
LOG(logINFO,
|
||||||
("Set gain mode - Fix G1 [DAQ Reg:0x%x]\n", bus_r(DAQ_REG)));
|
("Set gain mode - Fix G1 [DAQ Reg:0x%x]\n", bus_r(DAQ_REG)));
|
||||||
break;
|
break;
|
||||||
case FIX_G2:
|
case FIX_G2:
|
||||||
value &= ~(DAQ_FIX_GAIN_MSK);
|
value &= ~(DAQ_GAIN_MODE_MASK);
|
||||||
value |= DAQ_FIX_GAIN_STG_2_VAL;
|
value |= DAQ_FIX_GAIN_STG_2_VAL;
|
||||||
bus_w(addr, value);
|
bus_w(addr, value);
|
||||||
LOG(logINFO,
|
LOG(logINFO,
|
||||||
("Set gain mode - Fix G2 [DAQ Reg:0x%x]\n", bus_r(DAQ_REG)));
|
("Set gain mode - Fix G2 [DAQ Reg:0x%x]\n", bus_r(DAQ_REG)));
|
||||||
break;
|
break;
|
||||||
case FIX_G0: //????
|
case FIX_G0:
|
||||||
value &= ~(DAQ_FIX_GAIN_MSK);
|
value &= ~(DAQ_GAIN_MODE_MASK);
|
||||||
value |= DAQ_FIX_GAIN_STG_2_VAL;
|
value |= DAQ_CMP_RST_MSK;
|
||||||
bus_w(addr, value);
|
bus_w(addr, value);
|
||||||
LOG(logINFO,
|
LOG(logINFO,
|
||||||
("Set gain mode - Fix G2 [DAQ Reg:0x%x]\n", bus_r(DAQ_REG)));
|
("Set gain mode - Fix G0 [DAQ Reg:0x%x]\n", bus_r(DAQ_REG)));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG(logERROR, ("This gain mode %d is not defined\n", (int)mode));
|
LOG(logERROR, ("This gain mode %d is not defined\n", (int)mode));
|
||||||
|
@ -97,7 +97,8 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS };
|
|||||||
#define DEFAULT_DELAY (0)
|
#define DEFAULT_DELAY (0)
|
||||||
#define DEFAULT_HIGH_VOLTAGE (0)
|
#define DEFAULT_HIGH_VOLTAGE (0)
|
||||||
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
|
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
|
||||||
#define DEFAULT_SETTINGS (DYNAMICGAIN)
|
#define DEFAULT_SETTINGS (GAIN0)
|
||||||
|
#define DEFAULT_GAINMODE (DYNAMIC_GAIN)
|
||||||
#define DEFAULT_TX_UDP_PORT (0x7e9a)
|
#define DEFAULT_TX_UDP_PORT (0x7e9a)
|
||||||
#define DEFAULT_TMP_THRSHLD (65 * 1000) // milli degree Celsius
|
#define DEFAULT_TMP_THRSHLD (65 * 1000) // milli degree Celsius
|
||||||
#define DEFAULT_NUM_STRG_CLLS (0)
|
#define DEFAULT_NUM_STRG_CLLS (0)
|
||||||
|
@ -1561,8 +1561,8 @@ void validate_settings(enum detectorSettings sett) {
|
|||||||
#ifdef EIGERD
|
#ifdef EIGERD
|
||||||
case STANDARD:
|
case STANDARD:
|
||||||
#elif JUNGFRAUD
|
#elif JUNGFRAUD
|
||||||
case DYNAMICGAIN:
|
case GAIN0:
|
||||||
case DYNAMICHG0:
|
case HIGHGAIN0:
|
||||||
#elif GOTTHARDD
|
#elif GOTTHARDD
|
||||||
case DYNAMICGAIN:
|
case DYNAMICGAIN:
|
||||||
case HIGHGAIN:
|
case HIGHGAIN:
|
||||||
@ -8593,9 +8593,12 @@ int set_gain_mode(int file_des) {
|
|||||||
// only set
|
// only set
|
||||||
if (Server_VerifyLock() == OK) {
|
if (Server_VerifyLock() == OK) {
|
||||||
switch (gainmode) {
|
switch (gainmode) {
|
||||||
case NORMAL_GAIN_MODE:
|
case DYNAMIC_GAIN:
|
||||||
case FORCE_SWITCH_G1:
|
case FORCE_SWITCH_G1:
|
||||||
case FORCE_SWITCH_G2:
|
case FORCE_SWITCH_G2:
|
||||||
|
case FIX_G1:
|
||||||
|
case FIX_G2:
|
||||||
|
case FIX_G0:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
modeNotImplemented("Gain Mode Index", (int)gainmode);
|
modeNotImplemented("Gain Mode Index", (int)gainmode);
|
||||||
|
@ -113,7 +113,7 @@ class Detector {
|
|||||||
/** [Jungfrau][Gotthard][Gotthard2][Mythen3] */
|
/** [Jungfrau][Gotthard][Gotthard2][Mythen3] */
|
||||||
Result<defs::detectorSettings> getSettings(Positions pos = {}) const;
|
Result<defs::detectorSettings> getSettings(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Jungfrau] DYNAMICGAIN, DYNAMICHG0 \n [Gotthard] DYNAMICGAIN, HIGHGAIN,
|
/** [Jungfrau] GAIN0, HIGHGAIN0 \n [Gotthard] DYNAMICGAIN, HIGHGAIN,
|
||||||
* LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN \n [Gotthard2] DYNAMICGAIN,
|
* LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN \n [Gotthard2] DYNAMICGAIN,
|
||||||
* FIXGAIN1, FIXGAIN2 \n [Moench] G1_HIGHGAIN, G1_LOWGAIN,
|
* FIXGAIN1, FIXGAIN2 \n [Moench] G1_HIGHGAIN, G1_LOWGAIN,
|
||||||
* G2_HIGHCAP_HIGHGAIN, G2_HIGHCAP_LOWGAIN, G2_LOWCAP_HIGHGAIN,
|
* G2_HIGHCAP_HIGHGAIN, G2_HIGHCAP_LOWGAIN, G2_LOWCAP_HIGHGAIN,
|
||||||
@ -1179,9 +1179,9 @@ class Detector {
|
|||||||
/** [Jungfrau]*/
|
/** [Jungfrau]*/
|
||||||
Result<defs::gainMode> getGainMode(Positions pos = {}) const;
|
Result<defs::gainMode> getGainMode(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Jungfrau] Options: DYNAMICGAIN, FORCE_SWITCH_G1, FORCE_SWITCH_G2,
|
/** [Jungfrau] Options: DYNAMIC_GAIN, FORCE_SWITCH_G1, FORCE_SWITCH_G2,
|
||||||
* FIX_G1, FIX_G2, FIX_G0, FIX_HG0 \n\CAUTION: Do not use FIX_G0 and FIX_HG0
|
* FIX_G1, FIX_G2, FIX_G0 \n\CAUTION: Do not use FIX_G0 blindly, you can
|
||||||
* blindly, you can damage the detector!!!\n
|
* damage the detector!!!\n
|
||||||
*/
|
*/
|
||||||
void setGainMode(const defs::gainMode mode, Positions pos = {});
|
void setGainMode(const defs::gainMode mode, Positions pos = {});
|
||||||
|
|
||||||
|
@ -1203,12 +1203,12 @@ class CmdProxy {
|
|||||||
settings, getSettings, setSettings,
|
settings, getSettings, setSettings,
|
||||||
sls::StringTo<slsDetectorDefs::detectorSettings>,
|
sls::StringTo<slsDetectorDefs::detectorSettings>,
|
||||||
"[standard, fast, highgain, dynamicgain, lowgain, "
|
"[standard, fast, highgain, dynamicgain, lowgain, "
|
||||||
"mediumgain, veryhighgain, dynamichg0, "
|
"mediumgain, veryhighgain, highgain0, "
|
||||||
"fixgain1, fixgain2, forceswitchg1, forceswitchg2, "
|
"fixgain1, fixgain2, forceswitchg1, forceswitchg2, "
|
||||||
"verylowgain, g1_hg, g1_lg, g2_hc_hg, g2_hc_lg, "
|
"verylowgain, g1_hg, g1_lg, g2_hc_hg, g2_hc_lg, "
|
||||||
"g2_lc_hg, g2_lc_lg, g4_hg, g4_lg]"
|
"g2_lc_hg, g2_lc_lg, g4_hg, g4_lg, gain0]"
|
||||||
"\n\t Detector Settings"
|
"\n\t Detector Settings"
|
||||||
"\n\t[Jungfrau] - [dynamicgain | dynamichg0]"
|
"\n\t[Jungfrau] - [ gain0 | highgain0]"
|
||||||
"\n\t[Gotthard] - [dynamicgain | highgain | lowgain | "
|
"\n\t[Gotthard] - [dynamicgain | highgain | lowgain | "
|
||||||
"mediumgain | veryhighgain]"
|
"mediumgain | veryhighgain]"
|
||||||
"\n\t[Gotthard2] - [dynamicgain | fixgain1 | fixgain2]"
|
"\n\t[Gotthard2] - [dynamicgain | fixgain1 | fixgain2]"
|
||||||
@ -1877,9 +1877,9 @@ class CmdProxy {
|
|||||||
INTEGER_COMMAND_VEC_ID(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
gainmode, getGainMode, setGainMode,
|
gainmode, getGainMode, setGainMode,
|
||||||
sls::StringTo<slsDetectorDefs::gainMode>,
|
sls::StringTo<slsDetectorDefs::gainMode>,
|
||||||
"[forceswitchg1|forceswitchg2|fixgain1|fixgain2|fixgain0|"
|
"[dynamicgain|forceswitchg1|forceswitchg2|fixg1|fixg2|fixg0]\n\t["
|
||||||
"fixhighgain0]\n\t[Jungfrau] Gain mode.\n\tCAUTION: Do not use "
|
"Jungfrau] Gain mode.\n\tCAUTION: Do not use fixg0 blindly, you can "
|
||||||
"fixgain0 and fixhighgain0 blindly, you can damage the detector!!!");
|
"damage the detector!!!");
|
||||||
|
|
||||||
/* Gotthard Specific */
|
/* Gotthard Specific */
|
||||||
TIME_GET_COMMAND(exptimel, getExptimeLeft,
|
TIME_GET_COMMAND(exptimel, getExptimeLeft,
|
||||||
|
@ -158,8 +158,8 @@ std::vector<defs::detectorSettings> Detector::getSettingsList() const {
|
|||||||
defs::HIGHGAIN, defs::DYNAMICGAIN, defs::LOWGAIN, defs::MEDIUMGAIN,
|
defs::HIGHGAIN, defs::DYNAMICGAIN, defs::LOWGAIN, defs::MEDIUMGAIN,
|
||||||
defs::VERYHIGHGAIN};
|
defs::VERYHIGHGAIN};
|
||||||
case defs::JUNGFRAU:
|
case defs::JUNGFRAU:
|
||||||
return std::vector<defs::detectorSettings>{defs::DYNAMICGAIN,
|
return std::vector<defs::detectorSettings>{defs::GAIN0,
|
||||||
defs::DYNAMICHG0};
|
defs::HIGHGAIN0};
|
||||||
case defs::GOTTHARD2:
|
case defs::GOTTHARD2:
|
||||||
return std::vector<defs::detectorSettings>{
|
return std::vector<defs::detectorSettings>{
|
||||||
defs::DYNAMICGAIN, defs::DYNAMICHG0, defs::FIXGAIN1,
|
defs::DYNAMICGAIN, defs::DYNAMICHG0, defs::FIXGAIN1,
|
||||||
@ -1495,9 +1495,8 @@ std::vector<defs::gainMode> Detector::getGainModeList() const {
|
|||||||
switch (getDetectorType().squash()) {
|
switch (getDetectorType().squash()) {
|
||||||
case defs::JUNGFRAU:
|
case defs::JUNGFRAU:
|
||||||
return std::vector<defs::gainMode>{
|
return std::vector<defs::gainMode>{
|
||||||
defs::DYNAMICGAIN, defs::FORCE_SWITCH_G1, defs::FORCE_SWITCH_G2,
|
defs::DYNAMIC_GAIN, defs::FORCE_SWITCH_G1, defs::FORCE_SWITCH_G2,
|
||||||
defs::FIX_G1, defs::FIX_G2, defs::FIX_G0,
|
defs::FIX_G1, defs::FIX_G2, defs::FIX_G0};
|
||||||
defs::FIX_HG0};
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw RuntimeError("Gain mode is not implemented for this detector.");
|
throw RuntimeError("Gain mode is not implemented for this detector.");
|
||||||
|
@ -456,6 +456,11 @@ TEST_CASE("gainmode", "[.cmd]") {
|
|||||||
proxy.Call("gainmode", {}, -1, GET, oss);
|
proxy.Call("gainmode", {}, -1, GET, oss);
|
||||||
REQUIRE(oss.str() == "gainmode forceswitchg1\n");
|
REQUIRE(oss.str() == "gainmode forceswitchg1\n");
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
std::ostringstream oss;
|
||||||
|
proxy.Call("gainmode", {"dynamicgain"}, -1, PUT, oss);
|
||||||
|
REQUIRE(oss.str() == "gainmode dynamicgain\n");
|
||||||
|
}
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
proxy.Call("gainmode", {"forceswitchg2"}, -1, PUT, oss);
|
proxy.Call("gainmode", {"forceswitchg2"}, -1, PUT, oss);
|
||||||
@ -473,8 +478,8 @@ TEST_CASE("gainmode", "[.cmd]") {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
proxy.Call("gainmode", {"dynamic"}, -1, PUT, oss);
|
proxy.Call("gainmode", {"fixg0"}, -1, PUT, oss);
|
||||||
REQUIRE(oss.str() == "gainmode dynamic\n");
|
REQUIRE(oss.str() == "gainmode fixg0\n");
|
||||||
}
|
}
|
||||||
for (int i = 0; i != det.size(); ++i) {
|
for (int i = 0; i != det.size(); ++i) {
|
||||||
det.setGainMode(prev_val[i], {i});
|
det.setGainMode(prev_val[i], {i});
|
||||||
|
@ -150,7 +150,7 @@ TEST_CASE("settings", "[.cmd]") {
|
|||||||
allSett.push_back("lowgain");
|
allSett.push_back("lowgain");
|
||||||
allSett.push_back("mediumgain");
|
allSett.push_back("mediumgain");
|
||||||
allSett.push_back("veryhighgain");
|
allSett.push_back("veryhighgain");
|
||||||
allSett.push_back("dynamichg0");
|
allSett.push_back("highgain0");
|
||||||
allSett.push_back("fixgain1");
|
allSett.push_back("fixgain1");
|
||||||
allSett.push_back("fixgain2");
|
allSett.push_back("fixgain2");
|
||||||
allSett.push_back("verylowgain");
|
allSett.push_back("verylowgain");
|
||||||
@ -164,12 +164,13 @@ TEST_CASE("settings", "[.cmd]") {
|
|||||||
allSett.push_back("g4_lg");
|
allSett.push_back("g4_lg");
|
||||||
allSett.push_back("forceswitchg1");
|
allSett.push_back("forceswitchg1");
|
||||||
allSett.push_back("forceswitchg2");
|
allSett.push_back("forceswitchg2");
|
||||||
|
allSett.push_back("gain0");
|
||||||
|
|
||||||
std::vector<std::string> sett;
|
std::vector<std::string> sett;
|
||||||
switch (det_type) {
|
switch (det_type) {
|
||||||
case defs::JUNGFRAU:
|
case defs::JUNGFRAU:
|
||||||
sett.push_back("dynamicgain");
|
sett.push_back("gain0");
|
||||||
sett.push_back("dynamichg0");
|
sett.push_back("highgain0");
|
||||||
break;
|
break;
|
||||||
case defs::GOTTHARD:
|
case defs::GOTTHARD:
|
||||||
sett.push_back("highgain");
|
sett.push_back("highgain");
|
||||||
|
@ -345,7 +345,7 @@ typedef struct {
|
|||||||
LOWGAIN,
|
LOWGAIN,
|
||||||
MEDIUMGAIN,
|
MEDIUMGAIN,
|
||||||
VERYHIGHGAIN,
|
VERYHIGHGAIN,
|
||||||
DYNAMICHG0,
|
HIGHGAIN0,
|
||||||
FIXGAIN1,
|
FIXGAIN1,
|
||||||
FIXGAIN2,
|
FIXGAIN2,
|
||||||
VERYLOWGAIN,
|
VERYLOWGAIN,
|
||||||
@ -357,6 +357,7 @@ typedef struct {
|
|||||||
G2_LOWCAP_LOWGAIN,
|
G2_LOWCAP_LOWGAIN,
|
||||||
G4_HIGHGAIN,
|
G4_HIGHGAIN,
|
||||||
G4_LOWGAIN,
|
G4_LOWGAIN,
|
||||||
|
GAIN0,
|
||||||
UNDEFINED = 200,
|
UNDEFINED = 200,
|
||||||
UNINITIALIZED
|
UNINITIALIZED
|
||||||
};
|
};
|
||||||
@ -415,13 +416,13 @@ typedef struct {
|
|||||||
enum vetoAlgorithm { DEFAULT_ALGORITHM };
|
enum vetoAlgorithm { DEFAULT_ALGORITHM };
|
||||||
|
|
||||||
enum gainMode {
|
enum gainMode {
|
||||||
DYNAMICGAIN,
|
DYNAMIC_GAIN,
|
||||||
FORCE_SWITCH_G1,
|
FORCE_SWITCH_G1,
|
||||||
FORCE_SWITCH_G2,
|
FORCE_SWITCH_G2,
|
||||||
FIX_G1,
|
FIX_G1,
|
||||||
FIX_G2,
|
FIX_G2,
|
||||||
FIX_G0,
|
FIX_G0,
|
||||||
FIX_HG0
|
FIX_G0
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -170,8 +170,8 @@ std::string ToString(const defs::detectorSettings s) {
|
|||||||
return std::string("mediumgain");
|
return std::string("mediumgain");
|
||||||
case defs::VERYHIGHGAIN:
|
case defs::VERYHIGHGAIN:
|
||||||
return std::string("veryhighgain");
|
return std::string("veryhighgain");
|
||||||
case defs::DYNAMICHG0:
|
case defs::HIGHGAIN0:
|
||||||
return std::string("dynamichg0");
|
return std::string("highgain0");
|
||||||
case defs::FIXGAIN1:
|
case defs::FIXGAIN1:
|
||||||
return std::string("fixgain1");
|
return std::string("fixgain1");
|
||||||
case defs::FIXGAIN2:
|
case defs::FIXGAIN2:
|
||||||
@ -194,6 +194,8 @@ std::string ToString(const defs::detectorSettings s) {
|
|||||||
return std::string("g4_hg");
|
return std::string("g4_hg");
|
||||||
case defs::G4_LOWGAIN:
|
case defs::G4_LOWGAIN:
|
||||||
return std::string("g4_lg");
|
return std::string("g4_lg");
|
||||||
|
case defs::GAIN0:
|
||||||
|
return std::string("gain0");
|
||||||
case defs::UNDEFINED:
|
case defs::UNDEFINED:
|
||||||
return std::string("undefined");
|
return std::string("undefined");
|
||||||
case defs::UNINITIALIZED:
|
case defs::UNINITIALIZED:
|
||||||
@ -581,7 +583,7 @@ std::string ToString(const defs::vetoAlgorithm s) {
|
|||||||
|
|
||||||
std::string ToString(const defs::gainMode s) {
|
std::string ToString(const defs::gainMode s) {
|
||||||
switch (s) {
|
switch (s) {
|
||||||
case defs::DYNAMICGAIN:
|
case defs::DYNAMIC_GAIN:
|
||||||
return std::string("dynamicgain");
|
return std::string("dynamicgain");
|
||||||
case defs::FORCE_SWITCH_G1:
|
case defs::FORCE_SWITCH_G1:
|
||||||
return std::string("forceswitchg1");
|
return std::string("forceswitchg1");
|
||||||
@ -593,8 +595,6 @@ std::string ToString(const defs::gainMode s) {
|
|||||||
return std::string("fixg2");
|
return std::string("fixg2");
|
||||||
case defs::FIX_G0:
|
case defs::FIX_G0:
|
||||||
return std::string("fixg0");
|
return std::string("fixg0");
|
||||||
case defs::FIX_HG0:
|
|
||||||
return std::string("fixhg0");
|
|
||||||
default:
|
default:
|
||||||
return std::string("Unknown");
|
return std::string("Unknown");
|
||||||
}
|
}
|
||||||
@ -635,8 +635,8 @@ template <> defs::detectorSettings StringTo(const std::string &s) {
|
|||||||
return defs::MEDIUMGAIN;
|
return defs::MEDIUMGAIN;
|
||||||
if (s == "veryhighgain")
|
if (s == "veryhighgain")
|
||||||
return defs::VERYHIGHGAIN;
|
return defs::VERYHIGHGAIN;
|
||||||
if (s == "dynamichg0")
|
if (s == "highgain0")
|
||||||
return defs::DYNAMICHG0;
|
return defs::HIGHGAIN0;
|
||||||
if (s == "fixgain1")
|
if (s == "fixgain1")
|
||||||
return defs::FIXGAIN1;
|
return defs::FIXGAIN1;
|
||||||
if (s == "fixgain2")
|
if (s == "fixgain2")
|
||||||
@ -657,6 +657,8 @@ template <> defs::detectorSettings StringTo(const std::string &s) {
|
|||||||
return defs::G2_LOWCAP_LOWGAIN;
|
return defs::G2_LOWCAP_LOWGAIN;
|
||||||
if (s == "g4_hg")
|
if (s == "g4_hg")
|
||||||
return defs::G4_HIGHGAIN;
|
return defs::G4_HIGHGAIN;
|
||||||
|
if (s == "gain0")
|
||||||
|
return defs::GAIN0;
|
||||||
if (s == "g4_lg")
|
if (s == "g4_lg")
|
||||||
return defs::G4_LOWGAIN;
|
return defs::G4_LOWGAIN;
|
||||||
throw sls::RuntimeError("Unknown setting " + s);
|
throw sls::RuntimeError("Unknown setting " + s);
|
||||||
@ -985,7 +987,7 @@ template <> defs::vetoAlgorithm StringTo(const std::string &s) {
|
|||||||
|
|
||||||
template <> defs::gainMode StringTo(const std::string &s) {
|
template <> defs::gainMode StringTo(const std::string &s) {
|
||||||
if (s == "dynamicgain")
|
if (s == "dynamicgain")
|
||||||
return defs::DYNAMICGAIN;
|
return defs::DYNAMIC_GAIN;
|
||||||
if (s == "forceswitchg1")
|
if (s == "forceswitchg1")
|
||||||
return defs::FORCE_SWITCH_G1;
|
return defs::FORCE_SWITCH_G1;
|
||||||
if (s == "forceswitchg2")
|
if (s == "forceswitchg2")
|
||||||
@ -996,8 +998,6 @@ template <> defs::gainMode StringTo(const std::string &s) {
|
|||||||
return defs::FIX_G2;
|
return defs::FIX_G2;
|
||||||
if (s == "fixg0")
|
if (s == "fixg0")
|
||||||
return defs::FIX_G0;
|
return defs::FIX_G0;
|
||||||
if (s == "fixhg0")
|
|
||||||
return defs::FIX_HG0;
|
|
||||||
throw sls::RuntimeError("Unknown gain mode " + s);
|
throw sls::RuntimeError("Unknown gain mode " + s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user