removed forceswitch enum, removed fixgain1 and 2 from jungfrau settings (kept enum for g2

This commit is contained in:
maliakal_d 2021-07-23 17:12:48 +02:00
parent 61a99c70df
commit cce2511f7a
12 changed files with 10 additions and 51 deletions

View File

@ -104,10 +104,6 @@ def test_settings(virtual_jf_detectors):
assert d.settings == detectorSettings.DYNAMICGAIN
gain_list = [
detectorSettings.FIXGAIN1,
detectorSettings.FIXGAIN2,
detectorSettings.FORCESWITCHG1,
detectorSettings.FORCESWITCHG2,
detectorSettings.DYNAMICHG0,
detectorSettings.DYNAMICGAIN,
]
@ -117,10 +113,9 @@ def test_settings(virtual_jf_detectors):
d.settings = gain
assert d.settings == gain
d.setSettings(detectorSettings.FORCESWITCHG1, [1])
d.setSettings(detectorSettings.DYNAMICGAIN, [1])
assert d.settings == [
detectorSettings.DYNAMICGAIN,
detectorSettings.FORCESWITCHG1,
detectorSettings.DYNAMICHG0,
detectorSettings.DYNAMICGAIN,
]

View File

@ -311,7 +311,7 @@ class Detector(CppDetectorApi):
-----
[Eiger] Use threshold command to load settings
[Jungfrau] DYNAMICGAIN, DYNAMICHG0, FIXGAIN1, FIXGAIN2, FORCESWITCHG1, FORCESWITCHG2 \n
[Jungfrau] DYNAMICGAIN, DYNAMICHG0 \n
[Gotthard] DYNAMICGAIN, HIGHGAIN, LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN \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

View File

@ -213,10 +213,6 @@ void init_enums(py::module &m) {
.value("DYNAMICHG0", slsDetectorDefs::detectorSettings::DYNAMICHG0)
.value("FIXGAIN1", slsDetectorDefs::detectorSettings::FIXGAIN1)
.value("FIXGAIN2", slsDetectorDefs::detectorSettings::FIXGAIN2)
.value("FORCESWITCHG1",
slsDetectorDefs::detectorSettings::FORCESWITCHG1)
.value("FORCESWITCHG2",
slsDetectorDefs::detectorSettings::FORCESWITCHG2)
.value("VERYLOWGAIN", slsDetectorDefs::detectorSettings::VERYLOWGAIN)
.value("G1_HIGHGAIN", slsDetectorDefs::detectorSettings::G1_HIGHGAIN)
.value("G1_LOWGAIN", slsDetectorDefs::detectorSettings::G1_LOWGAIN)

View File

@ -527,16 +527,6 @@
<string>Fix Gain 2</string>
</property>
</item>
<item>
<property name="text">
<string>Force Switch G1</string>
</property>
</item>
<item>
<property name="text">
<string>Force Switch G2</string>
</property>
</item>
<item>
<property name="text">
<string>Very Low Gain</string>

View File

@ -43,8 +43,6 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject {
DYNAMICHG0,
FIXGAIN1,
FIXGAIN2,
FORCESWITCHG1,
FORCESWITCHG2,
VERLOWGAIN,
G1_HIGHGAIN,
G1_LOWGAIN,

View File

@ -119,10 +119,6 @@ void qTabSettings::SetupDetectorSettings() {
case slsDetectorDefs::JUNGFRAU:
item[(int)DYNAMICGAIN]->setEnabled(true);
item[(int)DYNAMICHG0]->setEnabled(true);
item[(int)FIXGAIN1]->setEnabled(true);
item[(int)FIXGAIN2]->setEnabled(true);
item[(int)FORCESWITCHG1]->setEnabled(true);
item[(int)FORCESWITCHG2]->setEnabled(true);
break;
case slsDetectorDefs::GOTTHARD2:
item[(int)DYNAMICGAIN]->setEnabled(true);

View File

@ -885,6 +885,7 @@ enum detectorSettings setSettings(enum detectorSettings sett) {
LOG(logINFO, ("Set settings - Dyanmic High Gain 0, DAQ Reg: 0x%x\n",
bus_r(DAQ_REG)));
break;
/*
case FIXGAIN1:
bus_w(DAQ_REG, bus_r(DAQ_REG) & ~DAQ_SETTINGS_MSK);
bus_w(DAQ_REG, bus_r(DAQ_REG) | DAQ_FIX_GAIN_STG_1_VAL);
@ -909,6 +910,7 @@ enum detectorSettings setSettings(enum detectorSettings sett) {
LOG(logINFO, ("Set settings - Force Switch Gain 2, DAQ Reg: 0x%x\n",
bus_r(DAQ_REG)));
break;
*/
default:
LOG(logERROR,
("This settings is not defined for this detector %d\n", (int)sett));
@ -937,6 +939,7 @@ enum detectorSettings getSettings() {
LOG(logDEBUG1,
("Settings read: Dynamig High Gain. DAQ Reg: 0x%x\n", regval));
break;
/*
case DAQ_FIX_GAIN_STG_1_VAL:
thisSettings = FIXGAIN1;
LOG(logDEBUG1, ("Settings read: Fix Gain 1. DAQ Reg: 0x%x\n", regval));
@ -955,6 +958,7 @@ enum detectorSettings getSettings() {
LOG(logDEBUG1,
("Settings read: Force Switch Gain 2. DAQ Reg: 0x%x\n", regval));
break;
*/
default:
thisSettings = UNDEFINED;
LOG(logERROR, ("Settings read: Undefined. DAQ Reg: 0x%x\n", regval));

View File

@ -1537,10 +1537,6 @@ int set_module(int file_des) {
#ifdef JUNGFRAUD
case DYNAMICGAIN:
case DYNAMICHG0:
case FIXGAIN1:
case FIXGAIN2:
case FORCESWITCHG1:
case FORCESWITCHG2:
#elif GOTTHARDD
case DYNAMICGAIN:
case HIGHGAIN:
@ -1592,10 +1588,6 @@ int set_settings(int file_des) {
#ifdef JUNGFRAUD
case DYNAMICGAIN:
case DYNAMICHG0:
case FIXGAIN1:
case FIXGAIN2:
case FORCESWITCHG1:
case FORCESWITCHG2:
#elif GOTTHARDD
case DYNAMICGAIN:
case HIGHGAIN:

View File

@ -113,8 +113,7 @@ class Detector {
/** [Jungfrau][Gotthard][Gotthard2][Mythen3] */
Result<defs::detectorSettings> getSettings(Positions pos = {}) const;
/** [Jungfrau] DYNAMICGAIN, DYNAMICHG0, FIXGAIN1, FIXGAIN2,
* FORCESWITCHG1, FORCESWITCHG2 \n [Gotthard] DYNAMICGAIN, HIGHGAIN,
/** [Jungfrau] DYNAMICGAIN, DYNAMICHG0 \n [Gotthard] DYNAMICGAIN, HIGHGAIN,
* LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN \n [Gotthard2] DYNAMICGAIN,
* FIXGAIN1, FIXGAIN2 \n [Moench] G1_HIGHGAIN, G1_LOWGAIN,
* G2_HIGHCAP_HIGHGAIN, G2_HIGHCAP_LOWGAIN, G2_LOWCAP_HIGHGAIN,

View File

@ -158,9 +158,8 @@ std::vector<defs::detectorSettings> Detector::getSettingsList() const {
defs::HIGHGAIN, defs::DYNAMICGAIN, defs::LOWGAIN, defs::MEDIUMGAIN,
defs::VERYHIGHGAIN};
case defs::JUNGFRAU:
return std::vector<defs::detectorSettings>{
defs::DYNAMICGAIN, defs::DYNAMICHG0, defs::FIXGAIN1,
defs::FIXGAIN2, defs::FORCESWITCHG1, defs::FORCESWITCHG2};
return std::vector<defs::detectorSettings>{defs::DYNAMICGAIN,
defs::DYNAMICHG0};
case defs::GOTTHARD2:
return std::vector<defs::detectorSettings>{
defs::DYNAMICGAIN, defs::DYNAMICHG0, defs::FIXGAIN1,

View File

@ -348,8 +348,6 @@ typedef struct {
DYNAMICHG0,
FIXGAIN1,
FIXGAIN2,
FORCESWITCHG1,
FORCESWITCHG2,
VERYLOWGAIN,
G1_HIGHGAIN,
G1_LOWGAIN,

View File

@ -176,10 +176,6 @@ std::string ToString(const defs::detectorSettings s) {
return std::string("fixgain1");
case defs::FIXGAIN2:
return std::string("fixgain2");
case defs::FORCESWITCHG1:
return std::string("forceswitchg1");
case defs::FORCESWITCHG2:
return std::string("forceswitchg2");
case defs::VERYLOWGAIN:
return std::string("verylowgain");
case defs::G1_HIGHGAIN:
@ -624,10 +620,6 @@ template <> defs::detectorSettings StringTo(const std::string &s) {
return defs::FIXGAIN1;
if (s == "fixgain2")
return defs::FIXGAIN2;
if (s == "forceswitchg1")
return defs::FORCESWITCHG1;
if (s == "forceswitchg2")
return defs::FORCESWITCHG2;
if (s == "verylowgain")
return defs::VERYLOWGAIN;
if (s == "g1_hg")