mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 03:10:02 +02:00
Merge branch 'j13flippeddatax' into j7filter
This commit is contained in:
commit
fd6e82e161
@ -161,7 +161,7 @@ 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.DYNAMIC_GAIN_MODE,
|
gainMode.DYNAMIC,
|
||||||
gainMode.FORCE_SWITCH_G1,
|
gainMode.FORCE_SWITCH_G1,
|
||||||
gainMode.FORCE_SWITCH_G2,
|
gainMode.FORCE_SWITCH_G2,
|
||||||
gainMode.FIX_G1,
|
gainMode.FIX_G1,
|
||||||
@ -176,7 +176,7 @@ 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.DYNAMIC_GAIN_MODE,
|
gainMode.DYNAMIC,
|
||||||
gainMode.FORCE_SWITCH_G1,
|
gainMode.FORCE_SWITCH_G1,
|
||||||
gainMode.FORCE_SWITCH_G2,
|
gainMode.FORCE_SWITCH_G2,
|
||||||
gainMode.FIX_G1,
|
gainMode.FIX_G1,
|
||||||
|
@ -2201,7 +2201,7 @@ class Detector(CppDetectorApi):
|
|||||||
[Jungfrau] Detector gain mode. Enum: gainMode
|
[Jungfrau] Detector gain mode. Enum: gainMode
|
||||||
Note
|
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!!!
|
CAUTION: Do not use FIX_G0 without caution, you can damage the detector!!!
|
||||||
"""
|
"""
|
||||||
return element_if_equal(self.getGainMode())
|
return element_if_equal(self.getGainMode())
|
||||||
|
@ -308,7 +308,7 @@ void init_enums(py::module &m) {
|
|||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::gainMode>(Defs, "gainMode")
|
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_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_G1", slsDetectorDefs::gainMode::FIX_G1)
|
||||||
|
@ -65,7 +65,7 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject {
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
DYNAMIC_GAIN_MODE,
|
DYNAMIC,
|
||||||
FORCE_SWITCH_G1,
|
FORCE_SWITCH_G1,
|
||||||
FORCE_SWITCH_G2,
|
FORCE_SWITCH_G2,
|
||||||
FIX_G1,
|
FIX_G1,
|
||||||
|
@ -132,7 +132,7 @@ void qTabSettings::SetupDetectorSettings() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void qTabSettings::SetupGainMode() {
|
void qTabSettings::SetupGainMode() {
|
||||||
comboGainMode->setCurrentIndex(DYNAMIC_GAIN_MODE);
|
comboGainMode->setCurrentIndex(DYNAMIC);
|
||||||
ShowFixG0(false);
|
ShowFixG0(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1105,7 +1105,7 @@ enum gainMode getGainMode() {
|
|||||||
|
|
||||||
// dynamic gain, when nothing is set
|
// dynamic gain, when nothing is set
|
||||||
if (retval_force == 0 && retval_fix == 0 && retval_cmp_rst == 0) {
|
if (retval_force == 0 && retval_fix == 0 && retval_cmp_rst == 0) {
|
||||||
return DYNAMIC_GAIN_MODE;
|
return DYNAMIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (retval_force) {
|
switch (retval_force) {
|
||||||
@ -1139,7 +1139,7 @@ void setGainMode(enum gainMode mode) {
|
|||||||
uint32_t value = bus_r(addr);
|
uint32_t value = bus_r(addr);
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case DYNAMIC_GAIN_MODE:
|
case DYNAMIC:
|
||||||
value &= ~(DAQ_GAIN_MODE_MASK);
|
value &= ~(DAQ_GAIN_MODE_MASK);
|
||||||
bus_w(addr, value);
|
bus_w(addr, value);
|
||||||
LOG(logINFO,
|
LOG(logINFO,
|
||||||
|
@ -98,7 +98,7 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS };
|
|||||||
#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 (GAIN0)
|
#define DEFAULT_SETTINGS (GAIN0)
|
||||||
#define DEFAULT_GAINMODE (DYNAMIC_GAIN_MODE)
|
#define DEFAULT_GAINMODE (DYNAMIC)
|
||||||
#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)
|
||||||
|
Binary file not shown.
@ -8589,7 +8589,7 @@ int set_default_dac(int file_des) {
|
|||||||
int get_gain_mode(int file_des) {
|
int get_gain_mode(int file_des) {
|
||||||
ret = OK;
|
ret = OK;
|
||||||
memset(mess, 0, sizeof(mess));
|
memset(mess, 0, sizeof(mess));
|
||||||
enum gainMode retval = DYNAMIC_GAIN_MODE;
|
enum gainMode retval = DYNAMIC;
|
||||||
LOG(logDEBUG1, ("Getting gain mode\n"));
|
LOG(logDEBUG1, ("Getting gain mode\n"));
|
||||||
|
|
||||||
#ifndef JUNGFRAUD
|
#ifndef JUNGFRAUD
|
||||||
@ -8622,7 +8622,7 @@ int set_gain_mode(int file_des) {
|
|||||||
// only set
|
// only set
|
||||||
if (Server_VerifyLock() == OK) {
|
if (Server_VerifyLock() == OK) {
|
||||||
switch (gainmode) {
|
switch (gainmode) {
|
||||||
case DYNAMIC_GAIN_MODE:
|
case DYNAMIC:
|
||||||
case FORCE_SWITCH_G1:
|
case FORCE_SWITCH_G1:
|
||||||
case FORCE_SWITCH_G2:
|
case FORCE_SWITCH_G2:
|
||||||
case FIX_G1:
|
case FIX_G1:
|
||||||
|
@ -1193,7 +1193,7 @@ class Detector {
|
|||||||
/** [Jungfrau]*/
|
/** [Jungfrau]*/
|
||||||
Result<defs::gainMode> getGainMode(Positions pos = {}) const;
|
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
|
* FIX_G1, FIX_G2, FIX_G0 \n\CAUTION: Do not use FIX_G0 without caution, you
|
||||||
* can damage the detector!!!\n
|
* can damage the detector!!!\n
|
||||||
*/
|
*/
|
||||||
|
@ -1501,7 +1501,7 @@ void Detector::setStorageCellDelay(ns value, Positions pos) {
|
|||||||
std::vector<defs::gainMode> Detector::getGainModeList() const {
|
std::vector<defs::gainMode> Detector::getGainModeList() const {
|
||||||
switch (getDetectorType().squash()) {
|
switch (getDetectorType().squash()) {
|
||||||
case defs::JUNGFRAU:
|
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_G1,
|
||||||
defs::FORCE_SWITCH_G2,
|
defs::FORCE_SWITCH_G2,
|
||||||
defs::FIX_G1,
|
defs::FIX_G1,
|
||||||
|
@ -458,8 +458,8 @@ TEST_CASE("gainmode", "[.cmd]") {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
proxy.Call("gainmode", {"dynamicgain"}, -1, PUT, oss);
|
proxy.Call("gainmode", {"dynamic"}, -1, PUT, oss);
|
||||||
REQUIRE(oss.str() == "gainmode dynamicgain\n");
|
REQUIRE(oss.str() == "gainmode dynamic\n");
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
|
@ -36,13 +36,9 @@ std::string ToString(const defs::dacIndex s);
|
|||||||
std::string ToString(const std::vector<defs::dacIndex> &vec);
|
std::string ToString(const std::vector<defs::dacIndex> &vec);
|
||||||
std::string ToString(const defs::burstMode s);
|
std::string ToString(const defs::burstMode s);
|
||||||
std::string ToString(const defs::timingSourceType s);
|
std::string ToString(const defs::timingSourceType s);
|
||||||
<<<<<<< HEAD
|
|
||||||
std::string ToString(const defs::M3_GainCaps s);
|
std::string ToString(const defs::M3_GainCaps s);
|
||||||
std::string ToString(const defs::portPosition s);
|
std::string ToString(const defs::portPosition s);
|
||||||
std::string ToString(const defs::ethernetInterface s);
|
|
||||||
=======
|
|
||||||
std::string ToString(const defs::streamingInterface s);
|
std::string ToString(const defs::streamingInterface s);
|
||||||
>>>>>>> 5.2.0-rc
|
|
||||||
std::string ToString(const defs::vetoAlgorithm s);
|
std::string ToString(const defs::vetoAlgorithm s);
|
||||||
std::string ToString(const defs::gainMode s);
|
std::string ToString(const defs::gainMode s);
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ typedef struct {
|
|||||||
enum vetoAlgorithm { DEFAULT_ALGORITHM };
|
enum vetoAlgorithm { DEFAULT_ALGORITHM };
|
||||||
|
|
||||||
enum gainMode {
|
enum gainMode {
|
||||||
DYNAMIC_GAIN_MODE,
|
DYNAMIC,
|
||||||
FORCE_SWITCH_G1,
|
FORCE_SWITCH_G1,
|
||||||
FORCE_SWITCH_G2,
|
FORCE_SWITCH_G2,
|
||||||
FIX_G1,
|
FIX_G1,
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
#define APILIB 0x210225
|
#define APILIB 0x210225
|
||||||
#define APIRECEIVER 0x210225
|
#define APIRECEIVER 0x210225
|
||||||
#define APIGUI 0x210225
|
#define APIGUI 0x210225
|
||||||
|
|
||||||
#define APIEIGER 0x210806
|
#define APIEIGER 0x210806
|
||||||
#define APICTB 0x210806
|
#define APICTB 0x210806
|
||||||
#define APIGOTTHARD 0x210806
|
#define APIGOTTHARD 0x210806
|
||||||
|
@ -583,8 +583,8 @@ 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::DYNAMIC_GAIN_MODE:
|
case defs::DYNAMIC:
|
||||||
return std::string("dynamicgain");
|
return std::string("dynamic");
|
||||||
case defs::FORCE_SWITCH_G1:
|
case defs::FORCE_SWITCH_G1:
|
||||||
return std::string("forceswitchg1");
|
return std::string("forceswitchg1");
|
||||||
case defs::FORCE_SWITCH_G2:
|
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) {
|
template <> defs::gainMode StringTo(const std::string &s) {
|
||||||
if (s == "dynamicgain")
|
if (s == "dynamic")
|
||||||
return defs::DYNAMIC_GAIN_MODE;
|
return defs::DYNAMIC;
|
||||||
if (s == "forceswitchg1")
|
if (s == "forceswitchg1")
|
||||||
return defs::FORCE_SWITCH_G1;
|
return defs::FORCE_SWITCH_G1;
|
||||||
if (s == "forceswitchg2")
|
if (s == "forceswitchg2")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user