mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
rewrote settings enums, gainmode enums
This commit is contained in:
@ -32,29 +32,5 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject {
|
||||
sls::Detector *det;
|
||||
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 };
|
||||
};
|
||||
|
@ -92,10 +92,11 @@ void qTabSettings::SetupWidgetWindow() {
|
||||
void qTabSettings::SetupDetectorSettings() {
|
||||
QStandardItemModel *model =
|
||||
qobject_cast<QStandardItemModel *>(comboSettings->model());
|
||||
const int numSettings = comboSettings->count();
|
||||
if (model) {
|
||||
QModelIndex index[NUMSETTINGS];
|
||||
QStandardItem *item[NUMSETTINGS];
|
||||
for (int i = 0; i < NUMSETTINGS; ++i) {
|
||||
QModelIndex index[numSettings];
|
||||
QStandardItem *item[numSettings];
|
||||
for (int i = 0; i < numSettings; ++i) {
|
||||
index[i] = model->index(i, comboSettings->modelColumn(),
|
||||
comboSettings->rootModelIndex());
|
||||
item[i] = model->itemFromIndex(index[i]);
|
||||
@ -160,7 +161,7 @@ void qTabSettings::GetSettings() {
|
||||
comboSettings->setCurrentIndex(UNINITIALIZED);
|
||||
break;
|
||||
default:
|
||||
if ((int)retval < -1 || (int)retval >= NUMSETTINGS) {
|
||||
if ((int)retval < -1 || (int)retval >= comboSettings->count()) {
|
||||
throw sls::RuntimeError(std::string("Unknown settings: ") +
|
||||
std::to_string(retval));
|
||||
}
|
||||
|
Reference in New Issue
Block a user