mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 12:57:13 +02:00
wip
This commit is contained in:
@ -514,7 +514,7 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Dynamic HG0</string>
|
<string>High Gain 0</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@ -572,6 +572,11 @@
|
|||||||
<string>G4_LG</string>
|
<string>G4_LG</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Gain 0</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Undefined</string>
|
<string>Undefined</string>
|
||||||
|
@ -32,5 +32,30 @@ 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,
|
||||||
|
HIGHGAIN0,
|
||||||
|
FIXGAIN1,
|
||||||
|
FIXGAIN2,
|
||||||
|
VERLOWGAIN,
|
||||||
|
G1_HIGHGAIN,
|
||||||
|
G1_LOWGAIN,
|
||||||
|
G2_HIGHCAP_HIGHGAIN,
|
||||||
|
G2_HIGHCAP_LOWGAIN,
|
||||||
|
G2_LOWCAP_HIGHGAIN,
|
||||||
|
G2_LOWCAP_LOWGAIN,
|
||||||
|
G4_HIGHGAIN,
|
||||||
|
G4_LOWGAIN,
|
||||||
|
GAIN0,
|
||||||
|
UNDEFINED,
|
||||||
|
UNINITIALIZED,
|
||||||
|
NUMSETTINGS
|
||||||
|
};
|
||||||
enum { DYNAMICRANGE_32, DYNAMICRANGE_16, DYNAMICRANGE_8, DYNAMICRANGE_4 };
|
enum { DYNAMICRANGE_32, DYNAMICRANGE_16, DYNAMICRANGE_8, DYNAMICRANGE_4 };
|
||||||
};
|
};
|
||||||
|
@ -94,9 +94,9 @@ void qTabSettings::SetupDetectorSettings() {
|
|||||||
qobject_cast<QStandardItemModel *>(comboSettings->model());
|
qobject_cast<QStandardItemModel *>(comboSettings->model());
|
||||||
const int numSettings = comboSettings->count();
|
const int numSettings = comboSettings->count();
|
||||||
if (model) {
|
if (model) {
|
||||||
QModelIndex index[numSettings];
|
std::vector<QModelIndex> index(numSettings);
|
||||||
QStandardItem *item[numSettings];
|
std::vector<QStandardItem *> item(numSettings);
|
||||||
for (int i = 0; i < numSettings; ++i) {
|
for (size_t i = 0; i < index.size(); ++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]);
|
||||||
|
@ -1101,9 +1101,12 @@ enum gainMode getGainMode() {
|
|||||||
LOG(logERROR, ("undefined gain mode. DAQ reg: 0x%x\n", regval));
|
LOG(logERROR, ("undefined gain mode. DAQ reg: 0x%x\n", regval));
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (retval_force) {
|
// dynamic gain, when nothing is set
|
||||||
case DAQ_FRCE_GAIN_STG_0_VAL:
|
if (retval_force == 0 && retval_fix == 0 && retval_cmp_rst == 0) {
|
||||||
return DYNAMIC_GAIN_MODE;
|
return DYNAMIC_GAIN_MODE;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (retval_force) {
|
||||||
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:
|
||||||
@ -1124,6 +1127,7 @@ enum gainMode getGainMode() {
|
|||||||
if (retval_cmp_rst) {
|
if (retval_cmp_rst) {
|
||||||
return FIX_G0;
|
return FIX_G0;
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
@ -162,8 +162,7 @@ std::vector<defs::detectorSettings> Detector::getSettingsList() const {
|
|||||||
defs::HIGHGAIN0};
|
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::FIXGAIN1, defs::FIXGAIN2};
|
||||||
defs::FIXGAIN2};
|
|
||||||
case defs::MOENCH:
|
case defs::MOENCH:
|
||||||
return std::vector<defs::detectorSettings>{
|
return std::vector<defs::detectorSettings>{
|
||||||
defs::G1_HIGHGAIN, defs::G1_LOWGAIN,
|
defs::G1_HIGHGAIN, defs::G1_LOWGAIN,
|
||||||
|
Reference in New Issue
Block a user