mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 06:50:02 +02:00
moved counters in gui from data output tab to settings tab
This commit is contained in:
parent
1bcf10a211
commit
f01e5fd5ec
@ -533,61 +533,6 @@ Directory where one saves the data.
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_11">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Expanding</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>10</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="chkCounter1">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Counter 1</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="chkCounter2">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Counter 2</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="chkCounter3">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Counter 3</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
|
@ -32,8 +32,85 @@
|
|||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="1" column="4">
|
<item row="3" column="3">
|
||||||
<widget class="QSpinBox" name="spinThreshold3">
|
<widget class="QCheckBox" name="chkCounter2">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>50</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>2</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="4">
|
||||||
|
<widget class="QCheckBox" name="chkCounter3">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>50</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>3</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2" colspan="3">
|
||||||
|
<widget class="QComboBox" name="comboDynamicRange">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>140</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>140</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>1.67772e+07</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>65535</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>255</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>7</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2" colspan="3">
|
||||||
|
<widget class="QSpinBox" name="spinThreshold">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -69,8 +146,8 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="2">
|
<item row="1" column="6">
|
||||||
<widget class="QSpinBox" name="spinThreshold">
|
<widget class="QSpinBox" name="spinThreshold3">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -128,7 +205,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="2">
|
<item row="4" column="2">
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@ -144,46 +221,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="2">
|
<item row="1" column="8">
|
||||||
<widget class="QComboBox" name="comboDynamicRange">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>140</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>140</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>1.67772e+07</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>65535</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>255</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>7</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="6">
|
|
||||||
<widget class="QPushButton" name="btnSetThreshold">
|
<widget class="QPushButton" name="btnSetThreshold">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@ -280,7 +318,139 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
<item row="0" column="1">
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="lblThreshold">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>110</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>110</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Threshold:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="5">
|
||||||
|
<widget class="QSpinBox" name="spinThreshold2">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>140</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>140</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string> eV</string>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>-100000</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>100000</number>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<number>100</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>-1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="9">
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Expanding</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="lblCounter">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>110</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>110</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Counters:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="2">
|
||||||
|
<widget class="QCheckBox" name="chkCounter1">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>50</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>1</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2" colspan="3">
|
||||||
<widget class="QComboBox" name="comboSettings">
|
<widget class="QComboBox" name="comboSettings">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@ -424,97 +594,6 @@
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="lblThreshold">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>110</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>110</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Threshold:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="3">
|
|
||||||
<widget class="QSpinBox" name="spinThreshold2">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>140</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>140</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="keyboardTracking">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="suffix">
|
|
||||||
<string> eV</string>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>-100000</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>100000</number>
|
|
||||||
</property>
|
|
||||||
<property name="singleStep">
|
|
||||||
<number>100</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>-1</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="7">
|
|
||||||
<spacer name="horizontalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Expanding</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
@ -523,7 +602,6 @@
|
|||||||
<tabstop>spinThreshold2</tabstop>
|
<tabstop>spinThreshold2</tabstop>
|
||||||
<tabstop>spinThreshold3</tabstop>
|
<tabstop>spinThreshold3</tabstop>
|
||||||
<tabstop>btnSetThreshold</tabstop>
|
<tabstop>btnSetThreshold</tabstop>
|
||||||
<tabstop>comboDynamicRange</tabstop>
|
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../include/icons.qrc"/>
|
<include location="../include/icons.qrc"/>
|
||||||
|
@ -22,7 +22,6 @@ class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject {
|
|||||||
void SetRateCorrection();
|
void SetRateCorrection();
|
||||||
void SetSpeed(int speed);
|
void SetSpeed(int speed);
|
||||||
void SetParallel(bool enable);
|
void SetParallel(bool enable);
|
||||||
void SetCounterMask();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetupWidgetWindow();
|
void SetupWidgetWindow();
|
||||||
@ -37,7 +36,6 @@ class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject {
|
|||||||
void GetRateCorrection();
|
void GetRateCorrection();
|
||||||
void GetSpeed();
|
void GetSpeed();
|
||||||
void GetParallel();
|
void GetParallel();
|
||||||
void GetCounterMask();
|
|
||||||
|
|
||||||
sls::Detector *det;
|
sls::Detector *det;
|
||||||
// Button group for radiobuttons for rate
|
// Button group for radiobuttons for rate
|
||||||
|
@ -15,6 +15,7 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject {
|
|||||||
void SetDynamicRange(int index);
|
void SetDynamicRange(int index);
|
||||||
void SetThresholdEnergy(int index);
|
void SetThresholdEnergy(int index);
|
||||||
void SetThresholdEnergies();
|
void SetThresholdEnergies();
|
||||||
|
void SetCounterMask();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetupWidgetWindow();
|
void SetupWidgetWindow();
|
||||||
@ -25,6 +26,7 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject {
|
|||||||
void GetDynamicRange();
|
void GetDynamicRange();
|
||||||
void GetThresholdEnergy();
|
void GetThresholdEnergy();
|
||||||
void GetThresholdEnergies();
|
void GetThresholdEnergies();
|
||||||
|
void GetCounterMask();
|
||||||
|
|
||||||
sls::Detector *det;
|
sls::Detector *det;
|
||||||
enum {
|
enum {
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
#include "qTabDataOutput.h"
|
#include "qTabDataOutput.h"
|
||||||
#include "qDefs.h"
|
#include "qDefs.h"
|
||||||
#include "sls/bit_utils.h"
|
|
||||||
|
|
||||||
#include <QButtonGroup>
|
#include <QButtonGroup>
|
||||||
#include <QCheckBox>
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
@ -25,12 +23,6 @@ void qTabDataOutput::SetupWidgetWindow() {
|
|||||||
btnGroupRate = new QButtonGroup(this);
|
btnGroupRate = new QButtonGroup(this);
|
||||||
btnGroupRate->addButton(radioDefaultDeadtime, 0);
|
btnGroupRate->addButton(radioDefaultDeadtime, 0);
|
||||||
btnGroupRate->addButton(radioCustomDeadtime, 1);
|
btnGroupRate->addButton(radioCustomDeadtime, 1);
|
||||||
chkCounter1->setEnabled(false);
|
|
||||||
chkCounter2->setEnabled(false);
|
|
||||||
chkCounter3->setEnabled(false);
|
|
||||||
chkCounter1->hide();
|
|
||||||
chkCounter2->hide();
|
|
||||||
chkCounter3->hide();
|
|
||||||
|
|
||||||
// enabling according to det type
|
// enabling according to det type
|
||||||
switch (det->getDetectorType().squash()) {
|
switch (det->getDetectorType().squash()) {
|
||||||
@ -49,12 +41,6 @@ void qTabDataOutput::SetupWidgetWindow() {
|
|||||||
break;
|
break;
|
||||||
case slsDetectorDefs::MYTHEN3:
|
case slsDetectorDefs::MYTHEN3:
|
||||||
chkParallel->setEnabled(true);
|
chkParallel->setEnabled(true);
|
||||||
chkCounter1->setEnabled(true);
|
|
||||||
chkCounter2->setEnabled(true);
|
|
||||||
chkCounter3->setEnabled(true);
|
|
||||||
chkCounter1->show();
|
|
||||||
chkCounter2->show();
|
|
||||||
chkCounter3->show();
|
|
||||||
break;
|
break;
|
||||||
case slsDetectorDefs::JUNGFRAU:
|
case slsDetectorDefs::JUNGFRAU:
|
||||||
lblClkDivider->setEnabled(true);
|
lblClkDivider->setEnabled(true);
|
||||||
@ -101,14 +87,6 @@ void qTabDataOutput::Initialization() {
|
|||||||
connect(chkParallel, SIGNAL(toggled(bool)), this,
|
connect(chkParallel, SIGNAL(toggled(bool)), this,
|
||||||
SLOT(SetParallel(bool)));
|
SLOT(SetParallel(bool)));
|
||||||
}
|
}
|
||||||
if (chkCounter1->isEnabled()) {
|
|
||||||
connect(chkCounter1, SIGNAL(toggled(bool)), this,
|
|
||||||
SLOT(SetCounterMask()));
|
|
||||||
connect(chkCounter2, SIGNAL(toggled(bool)), this,
|
|
||||||
SLOT(SetCounterMask()));
|
|
||||||
connect(chkCounter3, SIGNAL(toggled(bool)), this,
|
|
||||||
SLOT(SetCounterMask()));
|
|
||||||
}
|
|
||||||
// speed
|
// speed
|
||||||
if (comboClkDivider->isEnabled()) {
|
if (comboClkDivider->isEnabled()) {
|
||||||
connect(comboClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
connect(comboClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
||||||
@ -438,57 +416,6 @@ void qTabDataOutput::SetParallel(bool enable) {
|
|||||||
&qTabDataOutput::GetParallel)
|
&qTabDataOutput::GetParallel)
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabDataOutput::GetCounterMask() {
|
|
||||||
LOG(logDEBUG) << "Getting counter mask";
|
|
||||||
disconnect(chkCounter1, SIGNAL(toggled(bool)), this,
|
|
||||||
SLOT(SetCounterMask()));
|
|
||||||
disconnect(chkCounter2, SIGNAL(toggled(bool)), this,
|
|
||||||
SLOT(SetCounterMask()));
|
|
||||||
disconnect(chkCounter3, SIGNAL(toggled(bool)), this,
|
|
||||||
SLOT(SetCounterMask()));
|
|
||||||
try {
|
|
||||||
auto retval = sls::getSetBits(det->getCounterMask().tsquash(
|
|
||||||
"Counter mask is inconsistent for all detectors."));
|
|
||||||
std::vector<QCheckBox *> counters = {chkCounter1, chkCounter2,
|
|
||||||
chkCounter3};
|
|
||||||
// default to unchecked
|
|
||||||
for (unsigned int i = 0; i < counters.size(); ++i) {
|
|
||||||
counters[i]->setChecked(false);
|
|
||||||
}
|
|
||||||
// if retva[i] = 2, chkCounter2 is checked
|
|
||||||
for (unsigned int i = 0; i < retval.size(); ++i) {
|
|
||||||
if (retval[i] > 3) {
|
|
||||||
throw sls::RuntimeError(
|
|
||||||
std::string("Unknown counter index : ") +
|
|
||||||
std::to_string(static_cast<int>(retval[i])));
|
|
||||||
}
|
|
||||||
counters[retval[i]]->setChecked(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CATCH_DISPLAY("Could not get parallel readout.",
|
|
||||||
"qTabDataOutput::GetParallel")
|
|
||||||
connect(chkCounter1, SIGNAL(toggled(bool)), this, SLOT(SetCounterMask()));
|
|
||||||
connect(chkCounter2, SIGNAL(toggled(bool)), this, SLOT(SetCounterMask()));
|
|
||||||
connect(chkCounter3, SIGNAL(toggled(bool)), this, SLOT(SetCounterMask()));
|
|
||||||
}
|
|
||||||
|
|
||||||
void qTabDataOutput::SetCounterMask() {
|
|
||||||
std::vector<QCheckBox *> counters = {chkCounter1, chkCounter2, chkCounter3};
|
|
||||||
uint32_t mask = 0;
|
|
||||||
for (unsigned int i = 0; i < counters.size(); ++i) {
|
|
||||||
if (counters[i]->isChecked()) {
|
|
||||||
mask |= (1 << i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LOG(logINFO) << "Setting counter mask to " << mask;
|
|
||||||
try {
|
|
||||||
det->setCounterMask(mask);
|
|
||||||
}
|
|
||||||
CATCH_HANDLE("Could not set counter mask.",
|
|
||||||
"qTabDataOutput::SetCounterMask", this,
|
|
||||||
&qTabDataOutput::GetCounterMask)
|
|
||||||
}
|
|
||||||
|
|
||||||
void qTabDataOutput::Refresh() {
|
void qTabDataOutput::Refresh() {
|
||||||
LOG(logDEBUG) << "**Updating DataOutput Tab";
|
LOG(logDEBUG) << "**Updating DataOutput Tab";
|
||||||
|
|
||||||
@ -507,9 +434,6 @@ void qTabDataOutput::Refresh() {
|
|||||||
if (chkParallel->isEnabled()) {
|
if (chkParallel->isEnabled()) {
|
||||||
GetParallel();
|
GetParallel();
|
||||||
}
|
}
|
||||||
if (chkCounter1->isEnabled()) {
|
|
||||||
GetCounterMask();
|
|
||||||
}
|
|
||||||
if (comboClkDivider->isEnabled()) {
|
if (comboClkDivider->isEnabled()) {
|
||||||
GetSpeed();
|
GetSpeed();
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#include "qTabSettings.h"
|
#include "qTabSettings.h"
|
||||||
#include "qDefs.h"
|
#include "qDefs.h"
|
||||||
#include "sls/ToString.h"
|
#include "sls/ToString.h"
|
||||||
|
#include "sls/bit_utils.h"
|
||||||
|
#include <QCheckBox>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
|
||||||
qTabSettings::qTabSettings(QWidget *parent, sls::Detector *detector)
|
qTabSettings::qTabSettings(QWidget *parent, sls::Detector *detector)
|
||||||
@ -18,6 +20,15 @@ void qTabSettings::SetupWidgetWindow() {
|
|||||||
spinThreshold3->hide();
|
spinThreshold3->hide();
|
||||||
btnSetThreshold->hide();
|
btnSetThreshold->hide();
|
||||||
btnSetThreshold->setEnabled(false);
|
btnSetThreshold->setEnabled(false);
|
||||||
|
lblCounter->hide();
|
||||||
|
lblCounter->setEnabled(false);
|
||||||
|
chkCounter1->setEnabled(false);
|
||||||
|
chkCounter2->setEnabled(false);
|
||||||
|
chkCounter3->setEnabled(false);
|
||||||
|
chkCounter1->hide();
|
||||||
|
chkCounter2->hide();
|
||||||
|
chkCounter3->hide();
|
||||||
|
|
||||||
// enabling according to det type
|
// enabling according to det type
|
||||||
slsDetectorDefs::detectorType detType = det->getDetectorType().squash();
|
slsDetectorDefs::detectorType detType = det->getDetectorType().squash();
|
||||||
if (detType == slsDetectorDefs::MYTHEN3) {
|
if (detType == slsDetectorDefs::MYTHEN3) {
|
||||||
@ -32,6 +43,16 @@ void qTabSettings::SetupWidgetWindow() {
|
|||||||
spinThreshold3->setEnabled(true);
|
spinThreshold3->setEnabled(true);
|
||||||
btnSetThreshold->setEnabled(true);
|
btnSetThreshold->setEnabled(true);
|
||||||
btnSetThreshold->show();
|
btnSetThreshold->show();
|
||||||
|
|
||||||
|
lblCounter->show();
|
||||||
|
lblCounter->setEnabled(true);
|
||||||
|
chkCounter1->setEnabled(true);
|
||||||
|
chkCounter2->setEnabled(true);
|
||||||
|
chkCounter3->setEnabled(true);
|
||||||
|
chkCounter1->show();
|
||||||
|
chkCounter2->show();
|
||||||
|
chkCounter3->show();
|
||||||
|
|
||||||
// disable dr
|
// disable dr
|
||||||
QStandardItemModel *model =
|
QStandardItemModel *model =
|
||||||
qobject_cast<QStandardItemModel *>(comboDynamicRange->model());
|
qobject_cast<QStandardItemModel *>(comboDynamicRange->model());
|
||||||
@ -153,6 +174,16 @@ void qTabSettings::Initialization() {
|
|||||||
else if (spinThreshold->isEnabled())
|
else if (spinThreshold->isEnabled())
|
||||||
connect(spinThreshold, SIGNAL(valueChanged(int)), this,
|
connect(spinThreshold, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(SetThresholdEnergy(int)));
|
SLOT(SetThresholdEnergy(int)));
|
||||||
|
|
||||||
|
// counters
|
||||||
|
if (lblCounter->isEnabled()) {
|
||||||
|
connect(chkCounter1, SIGNAL(toggled(bool)), this,
|
||||||
|
SLOT(SetCounterMask()));
|
||||||
|
connect(chkCounter2, SIGNAL(toggled(bool)), this,
|
||||||
|
SLOT(SetCounterMask()));
|
||||||
|
connect(chkCounter3, SIGNAL(toggled(bool)), this,
|
||||||
|
SLOT(SetCounterMask()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabSettings::GetSettings() {
|
void qTabSettings::GetSettings() {
|
||||||
@ -269,7 +300,7 @@ void qTabSettings::GetThresholdEnergies() {
|
|||||||
spinThreshold3->setValue(retval[2]);
|
spinThreshold3->setValue(retval[2]);
|
||||||
}
|
}
|
||||||
CATCH_DISPLAY("Could not get threshold energy.",
|
CATCH_DISPLAY("Could not get threshold energy.",
|
||||||
"qTabDataOutput::GetThresholdEnergies")
|
"qTabSettings::GetThresholdEnergies")
|
||||||
connect(btnSetThreshold, SIGNAL(clicked()), this,
|
connect(btnSetThreshold, SIGNAL(clicked()), this,
|
||||||
SLOT(SetThresholdEnergies()));
|
SLOT(SetThresholdEnergies()));
|
||||||
}
|
}
|
||||||
@ -284,7 +315,7 @@ void qTabSettings::GetThresholdEnergy() {
|
|||||||
spinThreshold->setValue(retval);
|
spinThreshold->setValue(retval);
|
||||||
}
|
}
|
||||||
CATCH_DISPLAY("Could not get threshold energy.",
|
CATCH_DISPLAY("Could not get threshold energy.",
|
||||||
"qTabDataOutput::GetThresholdEnergy")
|
"qTabSettings::GetThresholdEnergy")
|
||||||
connect(spinThreshold, SIGNAL(valueChanged(int)), this,
|
connect(spinThreshold, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(SetThresholdEnergy(int)));
|
SLOT(SetThresholdEnergy(int)));
|
||||||
}
|
}
|
||||||
@ -317,6 +348,55 @@ void qTabSettings::SetThresholdEnergy(int index) {
|
|||||||
GetThresholdEnergy();
|
GetThresholdEnergy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabSettings::GetCounterMask() {
|
||||||
|
LOG(logDEBUG) << "Getting counter mask";
|
||||||
|
disconnect(chkCounter1, SIGNAL(toggled(bool)), this,
|
||||||
|
SLOT(SetCounterMask()));
|
||||||
|
disconnect(chkCounter2, SIGNAL(toggled(bool)), this,
|
||||||
|
SLOT(SetCounterMask()));
|
||||||
|
disconnect(chkCounter3, SIGNAL(toggled(bool)), this,
|
||||||
|
SLOT(SetCounterMask()));
|
||||||
|
try {
|
||||||
|
auto retval = sls::getSetBits(det->getCounterMask().tsquash(
|
||||||
|
"Counter mask is inconsistent for all detectors."));
|
||||||
|
std::vector<QCheckBox *> counters = {chkCounter1, chkCounter2,
|
||||||
|
chkCounter3};
|
||||||
|
// default to unchecked
|
||||||
|
for (unsigned int i = 0; i < counters.size(); ++i) {
|
||||||
|
counters[i]->setChecked(false);
|
||||||
|
}
|
||||||
|
// if retva[i] = 2, chkCounter2 is checked
|
||||||
|
for (unsigned int i = 0; i < retval.size(); ++i) {
|
||||||
|
if (retval[i] > 3) {
|
||||||
|
throw sls::RuntimeError(
|
||||||
|
std::string("Unknown counter index : ") +
|
||||||
|
std::to_string(static_cast<int>(retval[i])));
|
||||||
|
}
|
||||||
|
counters[retval[i]]->setChecked(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CATCH_DISPLAY("Could not get counter mask.", "qTabSettings::GetCounterMask")
|
||||||
|
connect(chkCounter1, SIGNAL(toggled(bool)), this, SLOT(SetCounterMask()));
|
||||||
|
connect(chkCounter2, SIGNAL(toggled(bool)), this, SLOT(SetCounterMask()));
|
||||||
|
connect(chkCounter3, SIGNAL(toggled(bool)), this, SLOT(SetCounterMask()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabSettings::SetCounterMask() {
|
||||||
|
std::vector<QCheckBox *> counters = {chkCounter1, chkCounter2, chkCounter3};
|
||||||
|
uint32_t mask = 0;
|
||||||
|
for (unsigned int i = 0; i < counters.size(); ++i) {
|
||||||
|
if (counters[i]->isChecked()) {
|
||||||
|
mask |= (1 << i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LOG(logINFO) << "Setting counter mask to " << mask;
|
||||||
|
try {
|
||||||
|
det->setCounterMask(mask);
|
||||||
|
}
|
||||||
|
CATCH_HANDLE("Could not set counter mask.", "qTabSettings::SetCounterMask",
|
||||||
|
this, &qTabSettings::GetCounterMask)
|
||||||
|
}
|
||||||
|
|
||||||
void qTabSettings::Refresh() {
|
void qTabSettings::Refresh() {
|
||||||
LOG(logDEBUG) << "**Updating Settings Tab";
|
LOG(logDEBUG) << "**Updating Settings Tab";
|
||||||
|
|
||||||
@ -337,5 +417,9 @@ void qTabSettings::Refresh() {
|
|||||||
GetThresholdEnergy();
|
GetThresholdEnergy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lblCounter->isEnabled()) {
|
||||||
|
GetCounterMask();
|
||||||
|
}
|
||||||
|
|
||||||
LOG(logDEBUG) << "**Updated Settings Tab";
|
LOG(logDEBUG) << "**Updated Settings Tab";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user