format GUI

This commit is contained in:
Erik Frojdh 2020-05-05 10:12:05 +02:00
parent ea4044e4b1
commit 8ff9b0cdac
29 changed files with 151 additions and 170 deletions

View File

@ -53,7 +53,6 @@ set(ClangFormat_EXCLUDE_PATTERNS "build/"
"slsDetectorServers/" "slsDetectorServers/"
"ctbGui/" "ctbGui/"
"manual/" "manual/"
"slsDetectorGui/"
"python/" "python/"
"sample/" "sample/"
${CMAKE_BINARY_DIR}) ${CMAKE_BINARY_DIR})

View File

@ -14,7 +14,8 @@ class qCloneWidget : public QMainWindow, private Ui::ClonePlotObject {
qCloneWidget(QWidget *parent, SlsQt1DPlot *p1, SlsQt2DPlot *p2, qCloneWidget(QWidget *parent, SlsQt1DPlot *p1, SlsQt2DPlot *p2,
SlsQt1DPlot *gp1, SlsQt2DPlot *gp, QString title, SlsQt1DPlot *gp1, SlsQt2DPlot *gp, QString title,
QString filePath, QString fileName, int64_t aIndex, QString filePath, QString fileName, int64_t aIndex,
bool displayStats, QString min, QString max, QString sum, bool completeImage); bool displayStats, QString min, QString max, QString sum,
bool completeImage);
~qCloneWidget(); ~qCloneWidget();

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include "ui_form_dac.h"
#include "Detector.h" #include "Detector.h"
#include "sls_detector_defs.h" #include "sls_detector_defs.h"
#include "ui_form_dac.h"
#include <string> #include <string>
class qDacWidget : public QWidget, private Ui::WidgetDacObject { class qDacWidget : public QWidget, private Ui::WidgetDacObject {

View File

@ -6,9 +6,9 @@
#include <QMessageBox> #include <QMessageBox>
#include <chrono> #include <chrono>
#include <cstdint>
#include <iostream> #include <iostream>
#include <ostream> #include <ostream>
#include <cstdint>
#include <string> #include <string>
using std::chrono::duration; using std::chrono::duration;

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include "ui_form_detectormain.h"
#include "qDefs.h"
#include "Detector.h" #include "Detector.h"
#include "qDefs.h"
#include "ui_form_detectormain.h"
#include <QTabWidget> #include <QTabWidget>
class qDrawPlot; class qDrawPlot;
@ -29,7 +29,7 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
Q_OBJECT Q_OBJECT
public: public:
qDetectorMain(int multiId, const std::string& fname, bool isDevel); qDetectorMain(int multiId, const std::string &fname, bool isDevel);
~qDetectorMain(); ~qDetectorMain();
private slots: private slots:
@ -51,9 +51,9 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
private: private:
void SetUpWidgetWindow(); void SetUpWidgetWindow();
void SetUpDetector(const std::string& config_file, int multiID); void SetUpDetector(const std::string &config_file, int multiID);
void Initialization(); void Initialization();
void LoadConfigFile(const std::string& config_file); void LoadConfigFile(const std::string &config_file);
/** enumeration of the tabs */ /** enumeration of the tabs */
enum { enum {
@ -70,7 +70,7 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
slsDetectorDefs::detectorType detType; slsDetectorDefs::detectorType detType;
std::unique_ptr<sls::Detector> det; std::unique_ptr<sls::Detector> det;
qDrawPlot *plot; qDrawPlot *plot;
MyTabWidget* tabs; MyTabWidget *tabs;
std::unique_ptr<QScrollArea> scroll[NumberOfTabs]; std::unique_ptr<QScrollArea> scroll[NumberOfTabs];
qTabMeasurement *tabMeasurement; qTabMeasurement *tabMeasurement;
qTabDataOutput *tabDataOutput; qTabDataOutput *tabDataOutput;

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include "ui_form_plot.h"
#include "qDefs.h"
#include "Detector.h" #include "Detector.h"
#include "qDefs.h"
#include "ui_form_plot.h"
#include <mutex> #include <mutex>
class SlsQt1DPlot; class SlsQt1DPlot;

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "ui_form_tab_advanced.h"
#include "Detector.h" #include "Detector.h"
#include "ui_form_tab_advanced.h"
class qDrawPlot; class qDrawPlot;

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "ui_form_tab_dataoutput.h"
#include "Detector.h" #include "Detector.h"
#include "ui_form_tab_dataoutput.h"
class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject { class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject {
Q_OBJECT Q_OBJECT

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "ui_form_tab_debugging.h"
#include "Detector.h" #include "Detector.h"
#include "ui_form_tab_debugging.h"
class QTreeWidget; class QTreeWidget;
class QTreeWidgetItem; class QTreeWidgetItem;

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include "ui_form_tab_developer.h"
#include "Detector.h" #include "Detector.h"
#include "sls_detector_defs.h" #include "sls_detector_defs.h"
#include "ui_form_tab_developer.h"
#include <vector> #include <vector>
class qDacWidget; class qDacWidget;

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "ui_form_tab_measurement.h"
#include "Detector.h" #include "Detector.h"
#include "ui_form_tab_measurement.h"
class qDrawPlot; class qDrawPlot;
class QStandardItemModel; class QStandardItemModel;

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "ui_form_tab_plot.h"
#include "Detector.h" #include "Detector.h"
#include "ui_form_tab_plot.h"
class qDrawPlot; class qDrawPlot;
class QButtonGroup; class QButtonGroup;

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "ui_form_tab_settings.h"
#include "Detector.h" #include "Detector.h"
#include "ui_form_tab_settings.h"
class qTabSettings : public QWidget, private Ui::TabSettingsObject { class qTabSettings : public QWidget, private Ui::TabSettingsObject {
Q_OBJECT Q_OBJECT

View File

@ -1,8 +1,8 @@
#ifndef SLSQT1DPLOT_H #ifndef SLSQT1DPLOT_H
#define SLSQT1DPLOT_H #define SLSQT1DPLOT_H
#include "ansi.h"
#include "SlsQt1DZoomer.h" #include "SlsQt1DZoomer.h"
#include "ansi.h"
#include <qwt_plot.h> #include <qwt_plot.h>
#include <qwt_plot_curve.h> #include <qwt_plot_curve.h>
#include <qwt_plot_marker.h> #include <qwt_plot_marker.h>

View File

@ -1,9 +1,9 @@
#ifndef SLSQT2DZOOMER_H #ifndef SLSQT2DZOOMER_H
#define SLSQT2DZOOMER_H #define SLSQT2DZOOMER_H
#include "SlsQt2DHist.h" #include "SlsQt2DHist.h"
#include <cstdio>
#include <qwt_plot_panner.h> #include <qwt_plot_panner.h>
#include <qwt_plot_zoomer.h> #include <qwt_plot_zoomer.h>
#include <cstdio>
class SlsQt2DZoomer : public QwtPlotZoomer { class SlsQt2DZoomer : public QwtPlotZoomer {
private: private:

View File

@ -1,7 +1,7 @@
/* TODO! short description */ /* TODO! short description */
#include "SlsQt1DPlot.h" #include "SlsQt1DPlot.h"
#include <qwt_symbol.h> #include <iostream>
#include <qwt_legend.h> #include <qwt_legend.h>
#include <qwt_math.h> #include <qwt_math.h>
#include <qwt_painter.h> #include <qwt_painter.h>
@ -10,8 +10,8 @@
#include <qwt_scale_draw.h> #include <qwt_scale_draw.h>
#include <qwt_scale_engine.h> #include <qwt_scale_engine.h>
#include <qwt_scale_widget.h> #include <qwt_scale_widget.h>
#include <qwt_symbol.h>
#include <stdlib.h> #include <stdlib.h>
#include <iostream>
#define QwtLog10ScaleEngine QwtLogScaleEngine // hmm #define QwtLog10ScaleEngine QwtLogScaleEngine // hmm
@ -314,7 +314,8 @@ void SlsQtH1DList::Remove(SlsQtH1D *hist) {
hl = hl->the_next; hl = hl->the_next;
else { // match else { // match
if (!hl->the_next) if (!hl->the_next)
hl->the_hist = nullptr; // first the_hist is zero when there's no next hl->the_hist =
nullptr; // first the_hist is zero when there's no next
else { else {
SlsQtH1DList *t = hl->the_next; SlsQtH1DList *t = hl->the_next;
hl->the_hist = t->the_hist; hl->the_hist = t->the_hist;

View File

@ -1,9 +1,9 @@
/* TODO! short description */ /* TODO! short description */
#include "SlsQt1DZoomer.h" #include "SlsQt1DZoomer.h"
#include "SlsQt1DPlot.h" #include "SlsQt1DPlot.h"
#include <iostream>
#include <qwt_plot.h> #include <qwt_plot.h>
#include <qwt_scale_div.h> #include <qwt_scale_div.h>
#include <iostream>
void SlsQt1DZoomer::ResetZoomBase() { void SlsQt1DZoomer::ResetZoomBase() {
SetZoomBase(x0, y0, x1 - x0, SetZoomBase(x0, y0, x1 - x0,

View File

@ -216,7 +216,7 @@ QwtLinearColorMap *SlsQt2DPlot::myColourMap(QVector<double> colourStops) {
} }
QwtLinearColorMap *SlsQt2DPlot::myColourMap(int log) { QwtLinearColorMap *SlsQt2DPlot::myColourMap(int log) {
QVector<double> cs{0.0, 0.34, 0.61 ,0.84, 1.0}; QVector<double> cs{0.0, 0.34, 0.61, 0.84, 1.0};
if (log) { if (log) {
for (int i = 0; i < cs.size(); ++i) for (int i = 0; i < cs.size(); ++i)
cs[i] = (pow(10, 2 * cs[i]) - 1) / 99.0; cs[i] = (pow(10, 2 * cs[i]) - 1) / 99.0;
@ -224,7 +224,6 @@ QwtLinearColorMap *SlsQt2DPlot::myColourMap(int log) {
return myColourMap(cs); return myColourMap(cs);
} }
void SlsQt2DPlot::Update() { void SlsQt2DPlot::Update() {
if (isLog) if (isLog)
hist->SetMinimumToFirstGreaterThanZero(); hist->SetMinimumToFirstGreaterThanZero();

View File

@ -1,7 +1,6 @@
#include "qDacWidget.h" #include "qDacWidget.h"
#include "qDefs.h" #include "qDefs.h"
qDacWidget::qDacWidget(QWidget *parent, sls::Detector *detector, bool d, qDacWidget::qDacWidget(QWidget *parent, sls::Detector *detector, bool d,
std::string n, slsDetectorDefs::dacIndex i) std::string n, slsDetectorDefs::dacIndex i)
: QWidget(parent), det(detector), isDac(d), index(i) { : QWidget(parent), det(detector), isDac(d), index(i) {
@ -56,8 +55,8 @@ void qDacWidget::GetDac() {
void qDacWidget::SetDac() { void qDacWidget::SetDac() {
int val = (int)spinDac->value(); int val = (int)spinDac->value();
LOG(logINFO) << "Setting dac:" << lblDac->text().toAscii().data() LOG(logINFO) << "Setting dac:" << lblDac->text().toAscii().data() << " : "
<< " : " << val; << val;
try { try {
det->setDAC(index, val, 0, {detectorIndex}); det->setDAC(index, val, 0, {detectorIndex});

View File

@ -19,8 +19,8 @@
#include <QScrollArea> #include <QScrollArea>
#include <QSizePolicy> #include <QSizePolicy>
#include <string>
#include <getopt.h> #include <getopt.h>
#include <string>
#include <sys/stat.h> #include <sys/stat.h>
int main(int argc, char **argv) { int main(int argc, char **argv) {
@ -57,8 +57,7 @@ int main(int argc, char **argv) {
case 'f': case 'f':
fname = optarg; fname = optarg;
LOG(logDEBUG) LOG(logDEBUG) << long_options[option_index].name << " " << optarg;
<< long_options[option_index].name << " " << optarg;
break; break;
case 'd': case 'd':
@ -93,7 +92,7 @@ int main(int argc, char **argv) {
} }
QApplication app(argc, argv); QApplication app(argc, argv);
app.setStyle(new QPlastiqueStyle); //style is deleted by QApplication app.setStyle(new QPlastiqueStyle); // style is deleted by QApplication
try { try {
qDetectorMain det(multiId, fname, isDeveloper); qDetectorMain det(multiId, fname, isDeveloper);
det.show(); det.show();
@ -105,18 +104,18 @@ int main(int argc, char **argv) {
return 0; return 0;
} }
qDetectorMain::qDetectorMain(int multiId, const std::string& fname, bool isDevel) qDetectorMain::qDetectorMain(int multiId, const std::string &fname,
: QMainWindow(nullptr), detType(slsDetectorDefs::GENERIC), isDeveloper(isDevel), bool isDevel)
heightPlotWindow(0), heightCentralWidget(0) { : QMainWindow(nullptr), detType(slsDetectorDefs::GENERIC),
isDeveloper(isDevel), heightPlotWindow(0), heightCentralWidget(0) {
setupUi(this); setupUi(this);
SetUpDetector(fname, multiId); SetUpDetector(fname, multiId);
SetUpWidgetWindow(); SetUpWidgetWindow();
} }
qDetectorMain::~qDetectorMain(){ qDetectorMain::~qDetectorMain() {
disconnect(tabs, SIGNAL(currentChanged(int)), this, disconnect(tabs, SIGNAL(currentChanged(int)), this, SLOT(Refresh(int)));
SLOT(Refresh(int)));
} }
void qDetectorMain::SetUpWidgetWindow() { void qDetectorMain::SetUpWidgetWindow() {
@ -132,8 +131,7 @@ void qDetectorMain::SetUpWidgetWindow() {
layoutTabs->addWidget(tabs); layoutTabs->addWidget(tabs);
// creating all the other tab widgets // creating all the other tab widgets
tabMeasurement = tabMeasurement = new qTabMeasurement(this, det.get(), plot);
new qTabMeasurement(this, det.get(), plot);
tabDataOutput = new qTabDataOutput(this, det.get()); tabDataOutput = new qTabDataOutput(this, det.get());
tabPlot = new qTabPlot(this, det.get(), plot); tabPlot = new qTabPlot(this, det.get(), plot);
tabSettings = new qTabSettings(this, det.get()); tabSettings = new qTabSettings(this, det.get());
@ -206,7 +204,7 @@ void qDetectorMain::SetUpWidgetWindow() {
Initialization(); Initialization();
} }
void qDetectorMain::SetUpDetector(const std::string& config_file, int multiID) { void qDetectorMain::SetUpDetector(const std::string &config_file, int multiID) {
// instantiate detector and set window title // instantiate detector and set window title
det = sls::make_unique<sls::Detector>(multiID); det = sls::make_unique<sls::Detector>(multiID);
@ -260,8 +258,8 @@ void qDetectorMain::Initialization() {
// Measurement tab // Measurement tab
connect(tabMeasurement, SIGNAL(EnableTabsSignal(bool)), this, connect(tabMeasurement, SIGNAL(EnableTabsSignal(bool)), this,
SLOT(EnableTabs(bool))); SLOT(EnableTabs(bool)));
connect(tabMeasurement, SIGNAL(FileNameChangedSignal(QString)), connect(tabMeasurement, SIGNAL(FileNameChangedSignal(QString)), plot,
plot, SLOT(SetSaveFileName(QString))); SLOT(SetSaveFileName(QString)));
// Plot tab // Plot tab
connect(tabPlot, SIGNAL(DisableZoomSignal(bool)), this, connect(tabPlot, SIGNAL(DisableZoomSignal(bool)), this,
SLOT(SetZoomToolTip(bool))); SLOT(SetZoomToolTip(bool)));
@ -269,8 +267,7 @@ void qDetectorMain::Initialization() {
// Plotting // Plotting
connect(plot, SIGNAL(AcquireFinishedSignal()), tabMeasurement, connect(plot, SIGNAL(AcquireFinishedSignal()), tabMeasurement,
SLOT(AcquireFinished())); SLOT(AcquireFinished()));
connect(plot, SIGNAL(AbortSignal()), tabMeasurement, connect(plot, SIGNAL(AbortSignal()), tabMeasurement, SLOT(AbortAcquire()));
SLOT(AbortAcquire()));
// menubar // menubar
// Modes Menu // Modes Menu
@ -284,7 +281,7 @@ void qDetectorMain::Initialization() {
SLOT(ExecuteHelp(QAction *))); SLOT(ExecuteHelp(QAction *)));
} }
void qDetectorMain::LoadConfigFile(const std::string& config_file) { void qDetectorMain::LoadConfigFile(const std::string &config_file) {
LOG(logINFO) << "Loading config file at start up:" << config_file; LOG(logINFO) << "Loading config file at start up:" << config_file;
@ -372,8 +369,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action) {
"The Configuration Parameters have been " "The Configuration Parameters have been "
"configured successfully.", "configured successfully.",
"qDetectorMain::ExecuteUtilities"); "qDetectorMain::ExecuteUtilities");
LOG(logINFO) LOG(logINFO) << "Configuration Parameters loaded successfully";
<< "Configuration Parameters loaded successfully";
} }
} }

View File

@ -277,8 +277,7 @@ void qDrawPlot::SetPlotTitlePrefix(QString title) {
} }
void qDrawPlot::SetXAxisTitle(QString title) { void qDrawPlot::SetXAxisTitle(QString title) {
LOG(logINFO) << "Setting X Axis Title to " LOG(logINFO) << "Setting X Axis Title to " << title.toAscii().constData();
<< title.toAscii().constData();
if (is1d) { if (is1d) {
xTitle1d = title; xTitle1d = title;
} else { } else {
@ -287,8 +286,7 @@ void qDrawPlot::SetXAxisTitle(QString title) {
} }
void qDrawPlot::SetYAxisTitle(QString title) { void qDrawPlot::SetYAxisTitle(QString title) {
LOG(logINFO) << "Setting Y Axis Title to " LOG(logINFO) << "Setting Y Axis Title to " << title.toAscii().constData();
<< title.toAscii().constData();
if (is1d) { if (is1d) {
yTitle1d = title; yTitle1d = title;
} else { } else {
@ -297,8 +295,7 @@ void qDrawPlot::SetYAxisTitle(QString title) {
} }
void qDrawPlot::SetZAxisTitle(QString title) { void qDrawPlot::SetZAxisTitle(QString title) {
LOG(logINFO) << "Setting Z Axis Title to " LOG(logINFO) << "Setting Z Axis Title to " << title.toAscii().constData();
<< title.toAscii().constData();
zTitle2d = title; zTitle2d = title;
} }
@ -309,8 +306,8 @@ void qDrawPlot::SetXYRangeChanged(bool disable, double *xy, bool *isXY) {
std::copy(xy, xy + 4, xyRange); std::copy(xy, xy + 4, xyRange);
std::copy(isXY, isXY + 4, isXYRange); std::copy(isXY, isXY + 4, isXYRange);
LOG(logDEBUG) << "Setting Disable zoom to " << std::boolalpha LOG(logDEBUG) << "Setting Disable zoom to " << std::boolalpha << disable
<< disable << std::noboolalpha; << std::noboolalpha;
disableZoom = disable; disableZoom = disable;
} }
@ -348,8 +345,8 @@ double qDrawPlot::GetYMaximum() {
} }
void qDrawPlot::SetDataCallBack(bool enable) { void qDrawPlot::SetDataCallBack(bool enable) {
LOG(logINFO) << "Setting data call back to " << std::boolalpha LOG(logINFO) << "Setting data call back to " << std::boolalpha << enable
<< enable << std::noboolalpha; << std::noboolalpha;
try { try {
if (enable) { if (enable) {
isPlot = true; isPlot = true;
@ -360,7 +357,8 @@ void qDrawPlot::SetDataCallBack(bool enable) {
det->registerDataCallback(nullptr, this); det->registerDataCallback(nullptr, this);
det->setRxZmqDataStream(false); det->setRxZmqDataStream(false);
} }
} CATCH_DISPLAY("Could not get set rxr data streaming enable.", }
CATCH_DISPLAY("Could not get set rxr data streaming enable.",
"qDrawPlot::SetDataCallBack") "qDrawPlot::SetDataCallBack")
} }
@ -570,8 +568,8 @@ void qDrawPlot::ClonePlot() {
new qCloneWidget(this, cloneplot1D, cloneplot2D, clonegainplot1D, new qCloneWidget(this, cloneplot1D, cloneplot2D, clonegainplot1D,
clonegainplot2D, boxPlot->title(), fileSavePath, clonegainplot2D, boxPlot->title(), fileSavePath,
fileSaveName, currentAcqIndex, displayStatistics, fileSaveName, currentAcqIndex, displayStatistics,
lblMinDisp->text(), lblMaxDisp->text(), lblMinDisp->text(), lblMaxDisp->text(), lblSumDisp->text(),
lblSumDisp->text(), completeImage); completeImage);
} }
void qDrawPlot::SavePlot() { void qDrawPlot::SavePlot() {
@ -673,8 +671,7 @@ void qDrawPlot::AcquireThread() {
// exception in acquire will not call acquisition finished call back, so // exception in acquire will not call acquisition finished call back, so
// handle it // handle it
if (!mess.empty()) { if (!mess.empty()) {
LOG(logERROR) << "Acquisition Finished with an exception: " LOG(logERROR) << "Acquisition Finished with an exception: " << mess;
<< mess;
qDefs::ExceptionMessage("Acquire unsuccessful.", mess, qDefs::ExceptionMessage("Acquire unsuccessful.", mess,
"qDrawPlot::AcquireFinished"); "qDrawPlot::AcquireFinished");
try { try {
@ -739,8 +736,7 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
<< " \t nx: " << data->nx << std::endl << " \t nx: " << data->nx << std::endl
<< " \t ny: " << data->ny << std::endl << " \t ny: " << data->ny << std::endl
<< " \t data bytes: " << data->databytes << std::endl << " \t data bytes: " << data->databytes << std::endl
<< " \t dynamic range: " << data->dynamicRange << " \t dynamic range: " << data->dynamicRange << std::endl
<< std::endl
<< " \t file index: " << data->fileIndex << std::endl << " \t file index: " << data->fileIndex << std::endl
<< " \t complete image: " << data->completeImage << std::endl << " \t complete image: " << data->completeImage << std::endl
<< " ]"; << " ]";
@ -748,8 +744,8 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
progress = (int)data->progressIndex; progress = (int)data->progressIndex;
currentAcqIndex = data->fileIndex; currentAcqIndex = data->fileIndex;
currentFrame = frameIndex; currentFrame = frameIndex;
LOG(logDEBUG) << "[ Progress:" << progress LOG(logDEBUG) << "[ Progress:" << progress << ", Frame:" << currentFrame
<< ", Frame:" << currentFrame << " ]"; << " ]";
// 2d (only image, not gain data, not pedestalvals), // 2d (only image, not gain data, not pedestalvals),
// check if npixelsX and npixelsY is the same (quad is different) // check if npixelsX and npixelsY is the same (quad is different)
@ -757,8 +753,8 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
static_cast<int>(nPixelsY) != data->ny)) { static_cast<int>(nPixelsY) != data->ny)) {
nPixelsX = data->nx; nPixelsX = data->nx;
nPixelsY = data->ny; nPixelsY = data->ny;
LOG(logINFO) << "Change in Detector Shape:\n\tnPixelsX:" LOG(logINFO) << "Change in Detector Shape:\n\tnPixelsX:" << nPixelsX
<< nPixelsX << " nPixelsY:" << nPixelsY; << " nPixelsY:" << nPixelsY;
delete[] data2d; delete[] data2d;
data2d = new double[nPixelsY * nPixelsX]; data2d = new double[nPixelsY * nPixelsX];
@ -815,8 +811,8 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
} }
// calculate the pedestal value // calculate the pedestal value
if (pedestalCount == NUM_PEDESTAL_FRAMES) { if (pedestalCount == NUM_PEDESTAL_FRAMES) {
LOG(logINFO) << "Pedestal Calculated after " LOG(logINFO) << "Pedestal Calculated after " << NUM_PEDESTAL_FRAMES
<< NUM_PEDESTAL_FRAMES << " frames"; << " frames";
for (unsigned int px = 0; px < nPixels; ++px) for (unsigned int px = 0; px < nPixels; ++px)
tempPedestalVals[px] = tempPedestalVals[px] =
tempPedestalVals[px] / (double)NUM_PEDESTAL_FRAMES; tempPedestalVals[px] / (double)NUM_PEDESTAL_FRAMES;
@ -1115,7 +1111,7 @@ void qDrawPlot::UpdatePlot() {
// notify of incomplete images // notify of incomplete images
lblCompleteImage->hide(); lblCompleteImage->hide();
lblInCompleteImage->hide(); lblInCompleteImage->hide();
if(completeImage) { if (completeImage) {
lblCompleteImage->show(); lblCompleteImage->show();
} else { } else {
lblInCompleteImage->show(); lblInCompleteImage->show();

View File

@ -531,8 +531,7 @@ void qTabAdvanced::SetROI() {
roi.xmax = spinXmax->value(); roi.xmax = spinXmax->value();
// set roi // set roi
LOG(logINFO) << "Setting ROI: [" << roi.xmin << ", " << roi.xmax LOG(logINFO) << "Setting ROI: [" << roi.xmin << ", " << roi.xmax << "]";
<< "]";
try { try {
det->setROI(roi, {comboReadout->currentIndex()}); det->setROI(roi, {comboReadout->currentIndex()});
} }
@ -586,8 +585,7 @@ void qTabAdvanced::GetNumStoragecells() {
} }
void qTabAdvanced::SetNumStoragecells(int value) { void qTabAdvanced::SetNumStoragecells(int value) {
LOG(logINFO) << "Setting number of additional stoarge cells: " LOG(logINFO) << "Setting number of additional stoarge cells: " << value;
<< value;
try { try {
det->setNumberOfAdditionalStorageCells(value); det->setNumberOfAdditionalStorageCells(value);
} }
@ -621,8 +619,8 @@ void qTabAdvanced::SetSubExposureTime() {
auto timeNS = qDefs::getNSTime(std::make_pair( auto timeNS = qDefs::getNSTime(std::make_pair(
spinSubExpTime->value(), spinSubExpTime->value(),
static_cast<qDefs::timeUnit>(comboSubExpTimeUnit->currentIndex()))); static_cast<qDefs::timeUnit>(comboSubExpTimeUnit->currentIndex())));
LOG(logINFO) LOG(logINFO) << "Setting sub frame acquisition time to " << timeNS.count()
<< "Setting sub frame acquisition time to " << timeNS.count() << " ns" << " ns"
<< "/" << spinSubExpTime->value() << "/" << spinSubExpTime->value()
<< qDefs::getUnitString( << qDefs::getUnitString(
(qDefs::timeUnit)comboSubExpTimeUnit->currentIndex()); (qDefs::timeUnit)comboSubExpTimeUnit->currentIndex());
@ -661,8 +659,7 @@ void qTabAdvanced::SetSubDeadTime() {
spinSubDeadTime->value(), spinSubDeadTime->value(),
static_cast<qDefs::timeUnit>(comboSubDeadTimeUnit->currentIndex()))); static_cast<qDefs::timeUnit>(comboSubDeadTimeUnit->currentIndex())));
LOG(logINFO) LOG(logINFO) << "Setting sub frame dead time to " << timeNS.count() << " ns"
<< "Setting sub frame dead time to " << timeNS.count() << " ns"
<< "/" << spinSubDeadTime->value() << "/" << spinSubDeadTime->value()
<< qDefs::getUnitString( << qDefs::getUnitString(
(qDefs::timeUnit)comboSubDeadTimeUnit->currentIndex()); (qDefs::timeUnit)comboSubDeadTimeUnit->currentIndex());

View File

@ -334,15 +334,13 @@ void qTabDataOutput::SetRateCorrection() {
// custom dead time // custom dead time
if (radioCustomDeadtime->isChecked()) { if (radioCustomDeadtime->isChecked()) {
int64_t deadtime = spinCustomDeadTime->value(); int64_t deadtime = spinCustomDeadTime->value();
LOG(logINFO) LOG(logINFO) << "Setting Rate Correction with custom dead time: "
<< "Setting Rate Correction with custom dead time: "
<< deadtime; << deadtime;
det->setRateCorrection(sls::ns(deadtime)); det->setRateCorrection(sls::ns(deadtime));
} }
// default dead time // default dead time
else { else {
LOG(logINFO) LOG(logINFO) << "Setting Rate Correction with default dead time";
<< "Setting Rate Correction with default dead time";
det->setDefaultRateCorrection(); det->setDefaultRateCorrection();
} }
} }
@ -398,8 +396,7 @@ void qTabDataOutput::SetFlags() {
auto mode = auto mode =
comboEigerParallelFlag->currentIndex() == PARALLEL ? true : false; comboEigerParallelFlag->currentIndex() == PARALLEL ? true : false;
try { try {
LOG(logINFO) LOG(logINFO) << "Setting Readout Flags to "
<< "Setting Readout Flags to "
<< comboEigerParallelFlag->currentText().toAscii().data(); << comboEigerParallelFlag->currentText().toAscii().data();
det->setParallelMode(mode); det->setParallelMode(mode);
} }

View File

@ -1,6 +1,6 @@
#include "qTabDebugging.h" #include "qTabDebugging.h"
#include "qDefs.h"
#include "ToString.h" #include "ToString.h"
#include "qDefs.h"
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QGridLayout> #include <QGridLayout>
#include <QTreeWidget> #include <QTreeWidget>
@ -105,8 +105,9 @@ void qTabDebugging::GetInfo() {
treeDet->setHeaderLabel("Eiger Detector"); treeDet->setHeaderLabel("Eiger Detector");
// get num modules // get num modules
for (int i = 0; i < comboDetector->count() / 2; ++i) for (int i = 0; i < comboDetector->count() / 2; ++i)
items.append(new QTreeWidgetItem( items.append(
(QTreeWidget *)nullptr, QStringList(QString("Module %1").arg(i)))); new QTreeWidgetItem((QTreeWidget *)nullptr,
QStringList(QString("Module %1").arg(i))));
treeDet->insertTopLevelItems(0, items); treeDet->insertTopLevelItems(0, items);
// gets det names // gets det names
for (int i = 0; i < comboDetector->count(); ++i) { for (int i = 0; i < comboDetector->count(); ++i) {

View File

@ -771,8 +771,7 @@ void qTabMeasurement::AcquireFinished() {
if (startingFnumImplemented) { if (startingFnumImplemented) {
GetStartingFrameNumber(); GetStartingFrameNumber();
} }
LOG(logDEBUG) << "Measurement " << currentMeasurement LOG(logDEBUG) << "Measurement " << currentMeasurement << " finished";
<< " finished";
// next measurement if acq is not stopped // next measurement if acq is not stopped
if (!isAcquisitionStopped && if (!isAcquisitionStopped &&
((currentMeasurement + 1) < numMeasurements)) { ((currentMeasurement + 1) < numMeasurements)) {
@ -801,8 +800,9 @@ void qTabMeasurement::Enable(bool enable) {
frameNotTimeResolved->setEnabled(enable); frameNotTimeResolved->setEnabled(enable);
// shortcut each time, else it doesnt work a second time // shortcut each time, else it doesnt work a second time
btnStart->setShortcut(QApplication::translate( btnStart->setShortcut(QApplication::translate("TabMeasurementObject",
"TabMeasurementObject", "Shift+Space", nullptr, QApplication::UnicodeUTF8)); "Shift+Space", nullptr,
QApplication::UnicodeUTF8));
} }
void qTabMeasurement::Refresh() { void qTabMeasurement::Refresh() {

View File

@ -6,7 +6,6 @@
#include <QStackedLayout> #include <QStackedLayout>
#include <QStandardItemModel> #include <QStandardItemModel>
QString qTabPlot::defaultPlotTitle(""); QString qTabPlot::defaultPlotTitle("");
QString qTabPlot::defaultHistXAxisTitle("Channel Number"); QString qTabPlot::defaultHistXAxisTitle("Channel Number");
QString qTabPlot::defaultHistYAxisTitle("Counts"); QString qTabPlot::defaultHistYAxisTitle("Counts");
@ -290,16 +289,14 @@ void qTabPlot::SetBinary() {
bool binary1D = chkBinary->isChecked(); bool binary1D = chkBinary->isChecked();
bool binary2D = chkBinary_2->isChecked(); bool binary2D = chkBinary_2->isChecked();
if (is1d) { if (is1d) {
LOG(logINFO) << "Binary Plot " LOG(logINFO) << "Binary Plot " << (binary1D ? "enabled" : "disabled");
<< (binary1D ? "enabled" : "disabled");
lblFrom->setEnabled(binary1D); lblFrom->setEnabled(binary1D);
lblTo->setEnabled(binary1D); lblTo->setEnabled(binary1D);
spinFrom->setEnabled(binary1D); spinFrom->setEnabled(binary1D);
spinTo->setEnabled(binary1D); spinTo->setEnabled(binary1D);
plot->SetBinary(binary1D, spinFrom->value(), spinTo->value()); plot->SetBinary(binary1D, spinFrom->value(), spinTo->value());
} else { } else {
LOG(logINFO) << "Binary Plot " LOG(logINFO) << "Binary Plot " << (binary2D ? "enabled" : "disabled");
<< (binary2D ? "enabled" : "disabled");
lblFrom_2->setEnabled(binary2D); lblFrom_2->setEnabled(binary2D);
lblTo_2->setEnabled(binary2D); lblTo_2->setEnabled(binary2D);
spinFrom_2->setEnabled(binary2D); spinFrom_2->setEnabled(binary2D);
@ -434,9 +431,9 @@ void qTabPlot::SetXYRange() {
for (int i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {
if (chkVal[i] && !dispVal[i].isEmpty()) { if (chkVal[i] && !dispVal[i].isEmpty()) {
double val = dispVal[i].toDouble(); double val = dispVal[i].toDouble();
LOG(logDEBUG) LOG(logDEBUG) << "Setting "
<< "Setting " << qDefs::getRangeAsString(
<< qDefs::getRangeAsString(static_cast<qDefs::range>(i)) static_cast<qDefs::range>(i))
<< " to " << val; << " to " << val;
xyRange[i] = val; xyRange[i] = val;
isRange[i] = true; isRange[i] = true;
@ -482,10 +479,10 @@ void qTabPlot::MaintainAspectRatio(int dimension) {
ranges[qDefs::YMAX] = plot->GetYMaximum(); ranges[qDefs::YMAX] = plot->GetYMaximum();
double idealAspectratio = (ranges[qDefs::XMAX] - ranges[qDefs::XMIN]) / double idealAspectratio = (ranges[qDefs::XMAX] - ranges[qDefs::XMIN]) /
(ranges[qDefs::YMAX] - ranges[qDefs::YMIN]); (ranges[qDefs::YMAX] - ranges[qDefs::YMIN]);
LOG(logDEBUG) << "Ideal Aspect ratio: " << idealAspectratio LOG(logDEBUG) << "Ideal Aspect ratio: " << idealAspectratio << " for x("
<< " for x(" << ranges[qDefs::XMIN] << " - " << ranges[qDefs::XMIN] << " - " << ranges[qDefs::XMAX]
<< ranges[qDefs::XMAX] << "), y(" << ranges[qDefs::YMIN] << "), y(" << ranges[qDefs::YMIN] << " - "
<< " - " << ranges[qDefs::YMAX] << ")"; << ranges[qDefs::YMAX] << ")";
// calculate current aspect ratio // calculate current aspect ratio
ranges[qDefs::XMIN] = dispXMin->text().toDouble(); ranges[qDefs::XMIN] = dispXMin->text().toDouble();
@ -494,10 +491,10 @@ void qTabPlot::MaintainAspectRatio(int dimension) {
ranges[qDefs::YMAX] = dispYMax->text().toDouble(); ranges[qDefs::YMAX] = dispYMax->text().toDouble();
double currentAspectRatio = (ranges[qDefs::XMAX] - ranges[qDefs::XMIN]) / double currentAspectRatio = (ranges[qDefs::XMAX] - ranges[qDefs::XMIN]) /
(ranges[qDefs::YMAX] - ranges[qDefs::YMIN]); (ranges[qDefs::YMAX] - ranges[qDefs::YMIN]);
LOG(logDEBUG) << "Current Aspect ratio: " << currentAspectRatio LOG(logDEBUG) << "Current Aspect ratio: " << currentAspectRatio << " for x("
<< " for x(" << ranges[qDefs::XMIN] << " - " << ranges[qDefs::XMIN] << " - " << ranges[qDefs::XMAX]
<< ranges[qDefs::XMAX] << "), y(" << ranges[qDefs::YMIN] << "), y(" << ranges[qDefs::YMIN] << " - "
<< " - " << ranges[qDefs::YMAX] << ")"; << ranges[qDefs::YMAX] << ")";
if (currentAspectRatio != idealAspectratio) { if (currentAspectRatio != idealAspectratio) {
// dimension: 1(x changed: y adjusted), 0(y changed: x adjusted), // dimension: 1(x changed: y adjusted), 0(y changed: x adjusted),

View File

@ -1,6 +1,6 @@
#include "qTabSettings.h" #include "qTabSettings.h"
#include "qDefs.h"
#include "ToString.h" #include "ToString.h"
#include "qDefs.h"
#include <QStandardItemModel> #include <QStandardItemModel>
qTabSettings::qTabSettings(QWidget *parent, sls::Detector *detector) qTabSettings::qTabSettings(QWidget *parent, sls::Detector *detector)

View File

@ -344,9 +344,8 @@ uint32_t Listener::ListenToAnImage(char *buf) {
// copy packet // copy packet
switch (myDetectorType) { switch (myDetectorType) {
// for gotthard, 1st packet: 4 bytes fnum, CACA // for gotthard, 1st packet: 4 bytes fnum, CACA
// + CACA, 639*2 bytes data 2nd packet: 4 bytes // + CACA, 639*2 bytes data 2nd packet: 4
// fnum, previous 1*2 bytes // bytes fnum, previous 1*2 bytes data + 640*2 bytes data !!
// data + 640*2 bytes data !!
case GOTTHARD: case GOTTHARD:
if (!pnum) if (!pnum)
memcpy(buf + fifohsize, &carryOverPacket[hsize + 4], dsize - 2); memcpy(buf + fifohsize, &carryOverPacket[hsize + 4], dsize - 2);
@ -515,9 +514,8 @@ uint32_t Listener::ListenToAnImage(char *buf) {
// copy packet // copy packet
switch (myDetectorType) { switch (myDetectorType) {
// for gotthard, 1st packet: 4 bytes fnum, CACA // for gotthard, 1st packet: 4 bytes fnum, CACA
// + CACA, 639*2 bytes data 2nd packet: 4 bytes // + CACA, 639*2 bytes data 2nd packet: 4
// fnum, previous 1*2 bytes // bytes fnum, previous 1*2 bytes data + 640*2 bytes data !!
// data + 640*2 bytes data !!
case GOTTHARD: case GOTTHARD:
if (!pnum) if (!pnum)
memcpy(buf + fifohsize + (pnum * dsize), memcpy(buf + fifohsize + (pnum * dsize),