mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-26 16:20:03 +02:00
mythen3 gui: discard bits option for debugging
This commit is contained in:
parent
dfc886a65b
commit
1539326fda
@ -54,7 +54,7 @@
|
||||
<enum>QTabWidget::North</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="elideMode">
|
||||
<enum>Qt::ElideLeft</enum>
|
||||
@ -1066,6 +1066,22 @@
|
||||
<string>Acquisition</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="1" column="4">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<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="0" column="0">
|
||||
<widget class="QLabel" name="lblNumStoragecells">
|
||||
<property name="enabled">
|
||||
@ -1095,7 +1111,7 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<item row="4" column="2">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@ -1409,21 +1425,70 @@ Exposure Time of a sub frame. Only for Eiger in 32 bit mode
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lblDiscardBits">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
<property name="toolTip">
|
||||
<string><nobr>
|
||||
Dead time between sub frames. Only for Eiger in 32 bit mode.
|
||||
</nobr><br><nobr>
|
||||
Default value is 0. A value less than the required minimum is ignored.
|
||||
</nobr><br><nobr>
|
||||
#subdeadtime#
|
||||
</nobr></string>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<property name="text">
|
||||
<string>Number of bits to discard:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QSpinBox" name="spinDiscardBits">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html></string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="keyboardTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>31</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
@ -54,6 +54,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
||||
void SetAccumulate(bool enable);
|
||||
void ResetAccumulate();
|
||||
void DisplayStatistics(bool enable);
|
||||
void SetNumDiscardBits(int value);
|
||||
void EnableGainPlot(bool enable);
|
||||
void ClonePlot();
|
||||
void SavePlot();
|
||||
@ -148,6 +149,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
||||
bool hasGainData{false};
|
||||
bool isGainDataExtracted{false};
|
||||
bool disableZoom{false};
|
||||
int numDiscardBits{0};
|
||||
|
||||
int progress{0};
|
||||
int64_t currentFrame{0};
|
||||
|
@ -2,13 +2,15 @@
|
||||
|
||||
#include "ui_form_tab_advanced.h"
|
||||
|
||||
class qDrawPlot;
|
||||
|
||||
#include "Detector.h"
|
||||
|
||||
class qTabAdvanced:public QWidget, private Ui::TabAdvancedObject{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
qTabAdvanced(QWidget *parent, sls::Detector* detector);
|
||||
qTabAdvanced(QWidget *parent, sls::Detector* detector, qDrawPlot* p);
|
||||
~qTabAdvanced();
|
||||
|
||||
public slots:
|
||||
@ -61,6 +63,7 @@ private:
|
||||
void GetSubDeadTime();
|
||||
|
||||
sls::Detector *det;
|
||||
qDrawPlot *plot;
|
||||
};
|
||||
|
||||
|
||||
|
@ -135,7 +135,7 @@ void qDetectorMain::SetUpWidgetWindow() {
|
||||
tabDataOutput = sls::make_unique<qTabDataOutput>(this, det.get());
|
||||
tabPlot = sls::make_unique<qTabPlot>(this, det.get(), plot.get());
|
||||
tabSettings = sls::make_unique<qTabSettings>(this, det.get());
|
||||
tabAdvanced = sls::make_unique<qTabAdvanced>(this, det.get());
|
||||
tabAdvanced = sls::make_unique<qTabAdvanced>(this, det.get(), plot.get());
|
||||
tabDebugging = sls::make_unique<qTabDebugging>(this, det.get());
|
||||
tabDeveloper = sls::make_unique<qTabDeveloper>(this, det.get());
|
||||
|
||||
|
@ -412,6 +412,11 @@ void qDrawPlot::DisplayStatistics(bool enable) {
|
||||
displayStatistics = enable;
|
||||
}
|
||||
|
||||
void qDrawPlot::SetNumDiscardBits(int value) {
|
||||
FILE_LOG(logINFO) << "Setting number of bits to discard: " << value;
|
||||
numDiscardBits = value;
|
||||
}
|
||||
|
||||
void qDrawPlot::EnableGainPlot(bool enable) {
|
||||
FILE_LOG(logINFO) << (enable ? "Enabling" : "Disabling") << " Gain Plot";
|
||||
hasGainData = enable;
|
||||
@ -874,6 +879,9 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size, int data
|
||||
int halfbyte = 0;
|
||||
char cbyte = '\0';
|
||||
|
||||
// mythen 3 debugging
|
||||
int discardBits = numDiscardBits;
|
||||
|
||||
switch (dr) {
|
||||
|
||||
case 4:
|
||||
@ -926,7 +934,7 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size, int data
|
||||
|
||||
default:
|
||||
for (ichan = 0; ichan < size; ++ichan) {
|
||||
dest[ichan] = *((u_int32_t *)source);
|
||||
dest[ichan] = ((*((u_int32_t *)source)) >> discardBits);
|
||||
source += 4;
|
||||
}
|
||||
break;
|
||||
|
@ -1,11 +1,12 @@
|
||||
#include "qTabAdvanced.h"
|
||||
#include "qDefs.h"
|
||||
#include "qDrawPlot.h"
|
||||
#include "network_utils.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
qTabAdvanced::qTabAdvanced(QWidget *parent, sls::Detector *detector)
|
||||
: QWidget(parent), det(detector) {
|
||||
qTabAdvanced::qTabAdvanced(QWidget *parent, sls::Detector *detector, qDrawPlot *p)
|
||||
: QWidget(parent), det(detector), plot(p) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
FILE_LOG(logDEBUG) << "Advanced ready";
|
||||
@ -28,6 +29,9 @@ void qTabAdvanced::SetupWidgetWindow() {
|
||||
case slsDetectorDefs::GOTTHARD:
|
||||
tab_roi->setEnabled(true);
|
||||
break;
|
||||
case slsDetectorDefs::MYTHEN3:
|
||||
lblDiscardBits->setEnabled(true);
|
||||
spinDiscardBits->setEnabled(true);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -105,6 +109,12 @@ void qTabAdvanced::Initialization() {
|
||||
connect(comboSubDeadTimeUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetSubDeadTime()));
|
||||
}
|
||||
|
||||
// throw bits
|
||||
if (lblDiscardBits->isEnabled()) {
|
||||
connect(spinDiscardBits, SIGNAL(valueChanged(int)), plot,
|
||||
SLOT(SetNumDiscardBits(int)));
|
||||
}
|
||||
}
|
||||
|
||||
void qTabAdvanced::PopulateDetectors() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user