diff --git a/CMakeLists.txt b/CMakeLists.txt index 50d7415c2..064cc5ca5 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,6 @@ set(ClangFormat_EXCLUDE_PATTERNS "build/" "slsDetectorServers/" "ctbGui/" "manual/" - "slsDetectorGui/" "python/" "sample/" ${CMAKE_BINARY_DIR}) diff --git a/slsDetectorGui/include/qCloneWidget.h b/slsDetectorGui/include/qCloneWidget.h index 831ac33e4..d63d98fe5 100644 --- a/slsDetectorGui/include/qCloneWidget.h +++ b/slsDetectorGui/include/qCloneWidget.h @@ -14,7 +14,8 @@ class qCloneWidget : public QMainWindow, private Ui::ClonePlotObject { qCloneWidget(QWidget *parent, SlsQt1DPlot *p1, SlsQt2DPlot *p2, SlsQt1DPlot *gp1, SlsQt2DPlot *gp, QString title, 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(); diff --git a/slsDetectorGui/include/qDacWidget.h b/slsDetectorGui/include/qDacWidget.h index aaad22756..a903b4807 100644 --- a/slsDetectorGui/include/qDacWidget.h +++ b/slsDetectorGui/include/qDacWidget.h @@ -1,7 +1,7 @@ #pragma once -#include "ui_form_dac.h" #include "Detector.h" #include "sls_detector_defs.h" +#include "ui_form_dac.h" #include class qDacWidget : public QWidget, private Ui::WidgetDacObject { diff --git a/slsDetectorGui/include/qDefs.h b/slsDetectorGui/include/qDefs.h index 2f7220ef5..c0b7ab766 100644 --- a/slsDetectorGui/include/qDefs.h +++ b/slsDetectorGui/include/qDefs.h @@ -6,9 +6,9 @@ #include #include +#include #include #include -#include #include using std::chrono::duration; diff --git a/slsDetectorGui/include/qDetectorMain.h b/slsDetectorGui/include/qDetectorMain.h index c2e1d0f6d..44849c664 100644 --- a/slsDetectorGui/include/qDetectorMain.h +++ b/slsDetectorGui/include/qDetectorMain.h @@ -1,7 +1,7 @@ #pragma once -#include "ui_form_detectormain.h" -#include "qDefs.h" #include "Detector.h" +#include "qDefs.h" +#include "ui_form_detectormain.h" #include class qDrawPlot; @@ -29,7 +29,7 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject { Q_OBJECT public: - qDetectorMain(int multiId, const std::string& fname, bool isDevel); + qDetectorMain(int multiId, const std::string &fname, bool isDevel); ~qDetectorMain(); private slots: @@ -51,9 +51,9 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject { private: void SetUpWidgetWindow(); - void SetUpDetector(const std::string& config_file, int multiID); + void SetUpDetector(const std::string &config_file, int multiID); void Initialization(); - void LoadConfigFile(const std::string& config_file); + void LoadConfigFile(const std::string &config_file); /** enumeration of the tabs */ enum { @@ -70,7 +70,7 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject { slsDetectorDefs::detectorType detType; std::unique_ptr det; qDrawPlot *plot; - MyTabWidget* tabs; + MyTabWidget *tabs; std::unique_ptr scroll[NumberOfTabs]; qTabMeasurement *tabMeasurement; qTabDataOutput *tabDataOutput; diff --git a/slsDetectorGui/include/qDrawPlot.h b/slsDetectorGui/include/qDrawPlot.h index b600c4441..d6d73a42d 100644 --- a/slsDetectorGui/include/qDrawPlot.h +++ b/slsDetectorGui/include/qDrawPlot.h @@ -1,7 +1,7 @@ #pragma once -#include "ui_form_plot.h" -#include "qDefs.h" #include "Detector.h" +#include "qDefs.h" +#include "ui_form_plot.h" #include class SlsQt1DPlot; diff --git a/slsDetectorGui/include/qTabAdvanced.h b/slsDetectorGui/include/qTabAdvanced.h index 3f9a011c5..942dc63da 100644 --- a/slsDetectorGui/include/qTabAdvanced.h +++ b/slsDetectorGui/include/qTabAdvanced.h @@ -1,6 +1,6 @@ #pragma once -#include "ui_form_tab_advanced.h" #include "Detector.h" +#include "ui_form_tab_advanced.h" class qDrawPlot; diff --git a/slsDetectorGui/include/qTabDataOutput.h b/slsDetectorGui/include/qTabDataOutput.h index 02945b03d..0df374e57 100644 --- a/slsDetectorGui/include/qTabDataOutput.h +++ b/slsDetectorGui/include/qTabDataOutput.h @@ -1,6 +1,6 @@ #pragma once -#include "ui_form_tab_dataoutput.h" #include "Detector.h" +#include "ui_form_tab_dataoutput.h" class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject { Q_OBJECT diff --git a/slsDetectorGui/include/qTabDebugging.h b/slsDetectorGui/include/qTabDebugging.h index 0f015d115..4aa4b6a49 100644 --- a/slsDetectorGui/include/qTabDebugging.h +++ b/slsDetectorGui/include/qTabDebugging.h @@ -1,6 +1,6 @@ #pragma once -#include "ui_form_tab_debugging.h" #include "Detector.h" +#include "ui_form_tab_debugging.h" class QTreeWidget; class QTreeWidgetItem; diff --git a/slsDetectorGui/include/qTabDeveloper.h b/slsDetectorGui/include/qTabDeveloper.h index 0e757a467..1c6ba3996 100644 --- a/slsDetectorGui/include/qTabDeveloper.h +++ b/slsDetectorGui/include/qTabDeveloper.h @@ -1,7 +1,7 @@ #pragma once -#include "ui_form_tab_developer.h" #include "Detector.h" #include "sls_detector_defs.h" +#include "ui_form_tab_developer.h" #include class qDacWidget; diff --git a/slsDetectorGui/include/qTabMeasurement.h b/slsDetectorGui/include/qTabMeasurement.h index 3931a93fb..f5c1bb70f 100644 --- a/slsDetectorGui/include/qTabMeasurement.h +++ b/slsDetectorGui/include/qTabMeasurement.h @@ -1,6 +1,6 @@ #pragma once -#include "ui_form_tab_measurement.h" #include "Detector.h" +#include "ui_form_tab_measurement.h" class qDrawPlot; class QStandardItemModel; diff --git a/slsDetectorGui/include/qTabPlot.h b/slsDetectorGui/include/qTabPlot.h index 96d837b97..879e6f259 100644 --- a/slsDetectorGui/include/qTabPlot.h +++ b/slsDetectorGui/include/qTabPlot.h @@ -1,6 +1,6 @@ #pragma once -#include "ui_form_tab_plot.h" #include "Detector.h" +#include "ui_form_tab_plot.h" class qDrawPlot; class QButtonGroup; diff --git a/slsDetectorGui/include/qTabSettings.h b/slsDetectorGui/include/qTabSettings.h index adbe3be81..f1a7f4151 100644 --- a/slsDetectorGui/include/qTabSettings.h +++ b/slsDetectorGui/include/qTabSettings.h @@ -1,6 +1,6 @@ #pragma once -#include "ui_form_tab_settings.h" #include "Detector.h" +#include "ui_form_tab_settings.h" class qTabSettings : public QWidget, private Ui::TabSettingsObject { Q_OBJECT diff --git a/slsDetectorGui/slsDetectorPlotting/include/SlsQt1DPlot.h b/slsDetectorGui/slsDetectorPlotting/include/SlsQt1DPlot.h index fbdb6d082..80fcbc417 100644 --- a/slsDetectorGui/slsDetectorPlotting/include/SlsQt1DPlot.h +++ b/slsDetectorGui/slsDetectorPlotting/include/SlsQt1DPlot.h @@ -1,8 +1,8 @@ #ifndef SLSQT1DPLOT_H #define SLSQT1DPLOT_H -#include "ansi.h" #include "SlsQt1DZoomer.h" +#include "ansi.h" #include #include #include diff --git a/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DZoomer.h b/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DZoomer.h index a89f631c3..a9592c550 100644 --- a/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DZoomer.h +++ b/slsDetectorGui/slsDetectorPlotting/include/SlsQt2DZoomer.h @@ -1,9 +1,9 @@ #ifndef SLSQT2DZOOMER_H #define SLSQT2DZOOMER_H #include "SlsQt2DHist.h" +#include #include #include -#include class SlsQt2DZoomer : public QwtPlotZoomer { private: diff --git a/slsDetectorGui/slsDetectorPlotting/src/SlsQt1DPlot.cpp b/slsDetectorGui/slsDetectorPlotting/src/SlsQt1DPlot.cpp index efb001407..6c04f0124 100644 --- a/slsDetectorGui/slsDetectorPlotting/src/SlsQt1DPlot.cpp +++ b/slsDetectorGui/slsDetectorPlotting/src/SlsQt1DPlot.cpp @@ -1,7 +1,7 @@ /* TODO! short description */ #include "SlsQt1DPlot.h" -#include +#include #include #include #include @@ -10,8 +10,8 @@ #include #include #include +#include #include -#include #define QwtLog10ScaleEngine QwtLogScaleEngine // hmm @@ -314,7 +314,8 @@ void SlsQtH1DList::Remove(SlsQtH1D *hist) { hl = hl->the_next; else { // match 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 { SlsQtH1DList *t = hl->the_next; hl->the_hist = t->the_hist; diff --git a/slsDetectorGui/slsDetectorPlotting/src/SlsQt1DZoomer.cpp b/slsDetectorGui/slsDetectorPlotting/src/SlsQt1DZoomer.cpp index 707e6bca5..3c0bfa09f 100644 --- a/slsDetectorGui/slsDetectorPlotting/src/SlsQt1DZoomer.cpp +++ b/slsDetectorGui/slsDetectorPlotting/src/SlsQt1DZoomer.cpp @@ -1,9 +1,9 @@ /* TODO! short description */ #include "SlsQt1DZoomer.h" #include "SlsQt1DPlot.h" +#include #include #include -#include void SlsQt1DZoomer::ResetZoomBase() { SetZoomBase(x0, y0, x1 - x0, diff --git a/slsDetectorGui/slsDetectorPlotting/src/SlsQt2DPlot.cpp b/slsDetectorGui/slsDetectorPlotting/src/SlsQt2DPlot.cpp index d2abdbe3d..6b6286997 100644 --- a/slsDetectorGui/slsDetectorPlotting/src/SlsQt2DPlot.cpp +++ b/slsDetectorGui/slsDetectorPlotting/src/SlsQt2DPlot.cpp @@ -216,7 +216,7 @@ QwtLinearColorMap *SlsQt2DPlot::myColourMap(QVector colourStops) { } QwtLinearColorMap *SlsQt2DPlot::myColourMap(int log) { - QVector cs{0.0, 0.34, 0.61 ,0.84, 1.0}; + QVector cs{0.0, 0.34, 0.61, 0.84, 1.0}; if (log) { for (int i = 0; i < cs.size(); ++i) cs[i] = (pow(10, 2 * cs[i]) - 1) / 99.0; @@ -224,7 +224,6 @@ QwtLinearColorMap *SlsQt2DPlot::myColourMap(int log) { return myColourMap(cs); } - void SlsQt2DPlot::Update() { if (isLog) hist->SetMinimumToFirstGreaterThanZero(); diff --git a/slsDetectorGui/src/qDacWidget.cpp b/slsDetectorGui/src/qDacWidget.cpp index 7d69f7d16..284f4f0e2 100644 --- a/slsDetectorGui/src/qDacWidget.cpp +++ b/slsDetectorGui/src/qDacWidget.cpp @@ -1,7 +1,6 @@ #include "qDacWidget.h" #include "qDefs.h" - qDacWidget::qDacWidget(QWidget *parent, sls::Detector *detector, bool d, std::string n, slsDetectorDefs::dacIndex i) : QWidget(parent), det(detector), isDac(d), index(i) { @@ -56,8 +55,8 @@ void qDacWidget::GetDac() { void qDacWidget::SetDac() { int val = (int)spinDac->value(); - LOG(logINFO) << "Setting dac:" << lblDac->text().toAscii().data() - << " : " << val; + LOG(logINFO) << "Setting dac:" << lblDac->text().toAscii().data() << " : " + << val; try { det->setDAC(index, val, 0, {detectorIndex}); diff --git a/slsDetectorGui/src/qDetectorMain.cpp b/slsDetectorGui/src/qDetectorMain.cpp index ab417b872..5249af5bb 100644 --- a/slsDetectorGui/src/qDetectorMain.cpp +++ b/slsDetectorGui/src/qDetectorMain.cpp @@ -19,8 +19,8 @@ #include #include -#include #include +#include #include int main(int argc, char **argv) { @@ -57,8 +57,7 @@ int main(int argc, char **argv) { case 'f': fname = optarg; - LOG(logDEBUG) - << long_options[option_index].name << " " << optarg; + LOG(logDEBUG) << long_options[option_index].name << " " << optarg; break; case 'd': @@ -72,7 +71,7 @@ int main(int argc, char **argv) { case 'v': tempval = APIGUI; LOG(logINFO) << "SLS Detector GUI " << GITBRANCH << " (0x" - << std::hex << tempval << ")"; + << std::hex << tempval << ")"; return 0; case 'h': @@ -93,7 +92,7 @@ int main(int argc, char **argv) { } QApplication app(argc, argv); - app.setStyle(new QPlastiqueStyle); //style is deleted by QApplication + app.setStyle(new QPlastiqueStyle); // style is deleted by QApplication try { qDetectorMain det(multiId, fname, isDeveloper); det.show(); @@ -105,18 +104,18 @@ int main(int argc, char **argv) { return 0; } -qDetectorMain::qDetectorMain(int multiId, const std::string& fname, bool isDevel) - : QMainWindow(nullptr), detType(slsDetectorDefs::GENERIC), isDeveloper(isDevel), - heightPlotWindow(0), heightCentralWidget(0) { +qDetectorMain::qDetectorMain(int multiId, const std::string &fname, + bool isDevel) + : QMainWindow(nullptr), detType(slsDetectorDefs::GENERIC), + isDeveloper(isDevel), heightPlotWindow(0), heightCentralWidget(0) { setupUi(this); SetUpDetector(fname, multiId); SetUpWidgetWindow(); } -qDetectorMain::~qDetectorMain(){ - disconnect(tabs, SIGNAL(currentChanged(int)), this, - SLOT(Refresh(int))); +qDetectorMain::~qDetectorMain() { + disconnect(tabs, SIGNAL(currentChanged(int)), this, SLOT(Refresh(int))); } void qDetectorMain::SetUpWidgetWindow() { @@ -132,8 +131,7 @@ void qDetectorMain::SetUpWidgetWindow() { layoutTabs->addWidget(tabs); // creating all the other tab widgets - tabMeasurement = - new qTabMeasurement(this, det.get(), plot); + tabMeasurement = new qTabMeasurement(this, det.get(), plot); tabDataOutput = new qTabDataOutput(this, det.get()); tabPlot = new qTabPlot(this, det.get(), plot); tabSettings = new qTabSettings(this, det.get()); @@ -206,7 +204,7 @@ void qDetectorMain::SetUpWidgetWindow() { 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 det = sls::make_unique(multiID); @@ -260,8 +258,8 @@ void qDetectorMain::Initialization() { // Measurement tab connect(tabMeasurement, SIGNAL(EnableTabsSignal(bool)), this, SLOT(EnableTabs(bool))); - connect(tabMeasurement, SIGNAL(FileNameChangedSignal(QString)), - plot, SLOT(SetSaveFileName(QString))); + connect(tabMeasurement, SIGNAL(FileNameChangedSignal(QString)), plot, + SLOT(SetSaveFileName(QString))); // Plot tab connect(tabPlot, SIGNAL(DisableZoomSignal(bool)), this, SLOT(SetZoomToolTip(bool))); @@ -269,8 +267,7 @@ void qDetectorMain::Initialization() { // Plotting connect(plot, SIGNAL(AcquireFinishedSignal()), tabMeasurement, SLOT(AcquireFinished())); - connect(plot, SIGNAL(AbortSignal()), tabMeasurement, - SLOT(AbortAcquire())); + connect(plot, SIGNAL(AbortSignal()), tabMeasurement, SLOT(AbortAcquire())); // menubar // Modes Menu @@ -284,7 +281,7 @@ void qDetectorMain::Initialization() { 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; @@ -372,8 +369,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action) { "The Configuration Parameters have been " "configured successfully.", "qDetectorMain::ExecuteUtilities"); - LOG(logINFO) - << "Configuration Parameters loaded successfully"; + LOG(logINFO) << "Configuration Parameters loaded successfully"; } } @@ -438,7 +434,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action) { void qDetectorMain::ExecuteHelp(QAction *action) { if (action == actionAbout) { LOG(logINFO) << "About Common GUI for Jungfrau, Eiger, Mythen3, " - "Gotthard, Gotthard2 and Moench detectors"; + "Gotthard, Gotthard2 and Moench detectors"; std::string guiVersion = std::to_string(APIGUI); std::string clientVersion = "unknown"; diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index 518235523..51dd4b4cd 100644 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -51,16 +51,16 @@ void qDrawPlot::SetupWidgetWindow() { gainMask = (3 << 14); gainOffset = 14; LOG(logINFO) << "Pixel Mask: " << std::hex << pixelMask - << ", Gain Mask:" << gainMask - << ", Gain Offset:" << std::dec << gainOffset; + << ", Gain Mask:" << gainMask + << ", Gain Offset:" << std::dec << gainOffset; break; case slsDetectorDefs::GOTTHARD2: pixelMask = ((1 << 12) - 1); gainMask = (3 << 12); gainOffset = 12; LOG(logINFO) << "Pixel Mask: " << std::hex << pixelMask - << ", Gain Mask:" << gainMask - << ", Gain Offset:" << std::dec << gainOffset; + << ", Gain Mask:" << gainMask + << ", Gain Offset:" << std::dec << gainOffset; break; default: break; @@ -277,8 +277,7 @@ void qDrawPlot::SetPlotTitlePrefix(QString title) { } void qDrawPlot::SetXAxisTitle(QString title) { - LOG(logINFO) << "Setting X Axis Title to " - << title.toAscii().constData(); + LOG(logINFO) << "Setting X Axis Title to " << title.toAscii().constData(); if (is1d) { xTitle1d = title; } else { @@ -287,8 +286,7 @@ void qDrawPlot::SetXAxisTitle(QString title) { } void qDrawPlot::SetYAxisTitle(QString title) { - LOG(logINFO) << "Setting Y Axis Title to " - << title.toAscii().constData(); + LOG(logINFO) << "Setting Y Axis Title to " << title.toAscii().constData(); if (is1d) { yTitle1d = title; } else { @@ -297,8 +295,7 @@ void qDrawPlot::SetYAxisTitle(QString title) { } void qDrawPlot::SetZAxisTitle(QString title) { - LOG(logINFO) << "Setting Z Axis Title to " - << title.toAscii().constData(); + LOG(logINFO) << "Setting Z Axis Title to " << title.toAscii().constData(); zTitle2d = title; } @@ -309,8 +306,8 @@ void qDrawPlot::SetXYRangeChanged(bool disable, double *xy, bool *isXY) { std::copy(xy, xy + 4, xyRange); std::copy(isXY, isXY + 4, isXYRange); - LOG(logDEBUG) << "Setting Disable zoom to " << std::boolalpha - << disable << std::noboolalpha; + LOG(logDEBUG) << "Setting Disable zoom to " << std::boolalpha << disable + << std::noboolalpha; disableZoom = disable; } @@ -348,8 +345,8 @@ double qDrawPlot::GetYMaximum() { } void qDrawPlot::SetDataCallBack(bool enable) { - LOG(logINFO) << "Setting data call back to " << std::boolalpha - << enable << std::noboolalpha; + LOG(logINFO) << "Setting data call back to " << std::boolalpha << enable + << std::noboolalpha; try { if (enable) { isPlot = true; @@ -360,13 +357,14 @@ void qDrawPlot::SetDataCallBack(bool enable) { det->registerDataCallback(nullptr, this); 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") } void qDrawPlot::SetBinary(bool enable, int from, int to) { LOG(logINFO) << (enable ? "Enabling" : "Disabling") - << " Binary output from " << from << " to " << to; + << " Binary output from " << from << " to " << to; binaryFrom = from; binaryTo = to; isBinary = enable; @@ -380,7 +378,7 @@ void qDrawPlot::SetPersistency(int val) { void qDrawPlot::SetLines(bool enable) { std::lock_guard lock(mPlots); LOG(logINFO) << "Setting Lines to " << std::boolalpha << enable - << std::noboolalpha; + << std::noboolalpha; isLines = enable; for (int i = 0; i < nHists; ++i) { SlsQtH1D *h = hists1d.at(i); @@ -391,7 +389,7 @@ void qDrawPlot::SetLines(bool enable) { void qDrawPlot::SetMarkers(bool enable) { std::lock_guard lock(mPlots); LOG(logINFO) << "Setting Markers to " << std::boolalpha << enable - << std::noboolalpha; + << std::noboolalpha; isMarkers = enable; for (int i = 0; i < nHists; ++i) { SlsQtH1D *h = hists1d.at(i); @@ -402,28 +400,28 @@ void qDrawPlot::SetMarkers(bool enable) { void qDrawPlot::Set1dLogY(bool enable) { std::lock_guard lock(mPlots); LOG(logINFO) << "Setting Log Y to " << std::boolalpha << enable - << std::noboolalpha; + << std::noboolalpha; plot1d->SetLogY(enable); } void qDrawPlot::SetInterpolate(bool enable) { std::lock_guard lock(mPlots); LOG(logINFO) << "Setting Interpolate to " << std::boolalpha << enable - << std::noboolalpha; + << std::noboolalpha; plot2d->SetInterpolate(enable); } void qDrawPlot::SetContour(bool enable) { std::lock_guard lock(mPlots); LOG(logINFO) << "Setting Countour to " << std::boolalpha << enable - << std::noboolalpha; + << std::noboolalpha; plot2d->SetContour(enable); } void qDrawPlot::SetLogz(bool enable) { std::lock_guard lock(mPlots); LOG(logINFO) << "Setting Log Z to " << std::boolalpha << enable - << std::noboolalpha; + << std::noboolalpha; plot2d->SetLogz(enable, isZRange[0], isZRange[1], zRange[0], zRange[1]); } @@ -455,7 +453,7 @@ void qDrawPlot::ResetAccumulate() { void qDrawPlot::DisplayStatistics(bool enable) { LOG(logINFO) << (enable ? "Enabling" : "Disabling") - << " Statistics Display"; + << " Statistics Display"; displayStatistics = enable; } @@ -471,7 +469,7 @@ void qDrawPlot::EnableGainPlot(bool enable) { void qDrawPlot::SetSaveFileName(QString val) { LOG(logDEBUG) << "Setting Clone/Save File Name to " - << val.toAscii().constData(); + << val.toAscii().constData(); fileSaveName = val; } @@ -570,8 +568,8 @@ void qDrawPlot::ClonePlot() { new qCloneWidget(this, cloneplot1D, cloneplot2D, clonegainplot1D, clonegainplot2D, boxPlot->title(), fileSavePath, fileSaveName, currentAcqIndex, displayStatistics, - lblMinDisp->text(), lblMaxDisp->text(), - lblSumDisp->text(), completeImage); + lblMinDisp->text(), lblMaxDisp->text(), lblSumDisp->text(), + completeImage); } void qDrawPlot::SavePlot() { @@ -673,8 +671,7 @@ void qDrawPlot::AcquireThread() { // exception in acquire will not call acquisition finished call back, so // handle it if (!mess.empty()) { - LOG(logERROR) << "Acquisition Finished with an exception: " - << mess; + LOG(logERROR) << "Acquisition Finished with an exception: " << mess; qDefs::ExceptionMessage("Acquire unsuccessful.", mess, "qDrawPlot::AcquireFinished"); try { @@ -720,7 +717,7 @@ void qDrawPlot::AcquisitionFinished(double currentProgress, LOG(logERROR) << "Acquisition finished [Status: ERROR]"; } else { LOG(logINFO) << "Acquisition finished [ Status:" << status - << ", Progress: " << currentProgress << " ]"; + << ", Progress: " << currentProgress << " ]"; } emit AcquireFinishedSignal(); } @@ -729,27 +726,26 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex, uint32_t subFrameIndex) { std::lock_guard lock(mPlots); LOG(logDEBUG) << "* GetData Callback *" << std::endl - << " frame index: " << frameIndex << std::endl - << " sub frame index: " - << (((int)subFrameIndex == -1) ? (int)-1 : subFrameIndex) - << std::endl - << " Data [" << std::endl - << " \t progress: " << data->progressIndex << std::endl - << " \t file name: " << data->fileName << std::endl - << " \t nx: " << data->nx << std::endl - << " \t ny: " << data->ny << std::endl - << " \t data bytes: " << data->databytes << std::endl - << " \t dynamic range: " << data->dynamicRange - << std::endl - << " \t file index: " << data->fileIndex << std::endl - << " \t complete image: " << data->completeImage << std::endl - << " ]"; + << " frame index: " << frameIndex << std::endl + << " sub frame index: " + << (((int)subFrameIndex == -1) ? (int)-1 : subFrameIndex) + << std::endl + << " Data [" << std::endl + << " \t progress: " << data->progressIndex << std::endl + << " \t file name: " << data->fileName << std::endl + << " \t nx: " << data->nx << std::endl + << " \t ny: " << data->ny << std::endl + << " \t data bytes: " << data->databytes << std::endl + << " \t dynamic range: " << data->dynamicRange << std::endl + << " \t file index: " << data->fileIndex << std::endl + << " \t complete image: " << data->completeImage << std::endl + << " ]"; progress = (int)data->progressIndex; currentAcqIndex = data->fileIndex; currentFrame = frameIndex; - LOG(logDEBUG) << "[ Progress:" << progress - << ", Frame:" << currentFrame << " ]"; + LOG(logDEBUG) << "[ Progress:" << progress << ", Frame:" << currentFrame + << " ]"; // 2d (only image, not gain data, not pedestalvals), // 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(nPixelsY) != data->ny)) { nPixelsX = data->nx; nPixelsY = data->ny; - LOG(logINFO) << "Change in Detector Shape:\n\tnPixelsX:" - << nPixelsX << " nPixelsY:" << nPixelsY; + LOG(logINFO) << "Change in Detector Shape:\n\tnPixelsX:" << nPixelsX + << " nPixelsY:" << nPixelsY; delete[] data2d; data2d = new double[nPixelsY * nPixelsX]; @@ -815,8 +811,8 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex, } // calculate the pedestal value if (pedestalCount == NUM_PEDESTAL_FRAMES) { - LOG(logINFO) << "Pedestal Calculated after " - << NUM_PEDESTAL_FRAMES << " frames"; + LOG(logINFO) << "Pedestal Calculated after " << NUM_PEDESTAL_FRAMES + << " frames"; for (unsigned int px = 0; px < nPixels; ++px) tempPedestalVals[px] = tempPedestalVals[px] / (double)NUM_PEDESTAL_FRAMES; @@ -1115,7 +1111,7 @@ void qDrawPlot::UpdatePlot() { // notify of incomplete images lblCompleteImage->hide(); lblInCompleteImage->hide(); - if(completeImage) { + if (completeImage) { lblCompleteImage->show(); } else { lblInCompleteImage->show(); diff --git a/slsDetectorGui/src/qTabAdvanced.cpp b/slsDetectorGui/src/qTabAdvanced.cpp index cc9db3b28..a8ba59401 100644 --- a/slsDetectorGui/src/qTabAdvanced.cpp +++ b/slsDetectorGui/src/qTabAdvanced.cpp @@ -350,7 +350,7 @@ void qTabAdvanced::GetRxrZMQIP() { void qTabAdvanced::SetDetector() { LOG(logDEBUG) << "Set Detector: " - << comboDetector->currentText().toAscii().data(); + << comboDetector->currentText().toAscii().data(); GetControlPort(); GetStopPort(); @@ -531,8 +531,7 @@ void qTabAdvanced::SetROI() { roi.xmax = spinXmax->value(); // set roi - LOG(logINFO) << "Setting ROI: [" << roi.xmin << ", " << roi.xmax - << "]"; + LOG(logINFO) << "Setting ROI: [" << roi.xmin << ", " << roi.xmax << "]"; try { det->setROI(roi, {comboReadout->currentIndex()}); } @@ -586,8 +585,7 @@ void qTabAdvanced::GetNumStoragecells() { } void qTabAdvanced::SetNumStoragecells(int value) { - LOG(logINFO) << "Setting number of additional stoarge cells: " - << value; + LOG(logINFO) << "Setting number of additional stoarge cells: " << value; try { det->setNumberOfAdditionalStorageCells(value); } @@ -621,11 +619,11 @@ void qTabAdvanced::SetSubExposureTime() { auto timeNS = qDefs::getNSTime(std::make_pair( spinSubExpTime->value(), static_cast(comboSubExpTimeUnit->currentIndex()))); - LOG(logINFO) - << "Setting sub frame acquisition time to " << timeNS.count() << " ns" - << "/" << spinSubExpTime->value() - << qDefs::getUnitString( - (qDefs::timeUnit)comboSubExpTimeUnit->currentIndex()); + LOG(logINFO) << "Setting sub frame acquisition time to " << timeNS.count() + << " ns" + << "/" << spinSubExpTime->value() + << qDefs::getUnitString( + (qDefs::timeUnit)comboSubExpTimeUnit->currentIndex()); try { det->setSubExptime(timeNS); } @@ -661,11 +659,10 @@ void qTabAdvanced::SetSubDeadTime() { spinSubDeadTime->value(), static_cast(comboSubDeadTimeUnit->currentIndex()))); - LOG(logINFO) - << "Setting sub frame dead time to " << timeNS.count() << " ns" - << "/" << spinSubDeadTime->value() - << qDefs::getUnitString( - (qDefs::timeUnit)comboSubDeadTimeUnit->currentIndex()); + LOG(logINFO) << "Setting sub frame dead time to " << timeNS.count() << " ns" + << "/" << spinSubDeadTime->value() + << qDefs::getUnitString( + (qDefs::timeUnit)comboSubDeadTimeUnit->currentIndex()); try { det->setSubDeadTime(timeNS); } diff --git a/slsDetectorGui/src/qTabDataOutput.cpp b/slsDetectorGui/src/qTabDataOutput.cpp index 66e395946..590477855 100644 --- a/slsDetectorGui/src/qTabDataOutput.cpp +++ b/slsDetectorGui/src/qTabDataOutput.cpp @@ -172,7 +172,7 @@ void qTabDataOutput::BrowseOutputDir() { void qTabDataOutput::SetOutputDir() { QString path = dispOutputDir->text(); LOG(logDEBUG) << "Setting output directory to " - << path.toAscii().constData(); + << path.toAscii().constData(); // empty if (path.isEmpty()) { @@ -222,7 +222,7 @@ void qTabDataOutput::GetFileFormat() { void qTabDataOutput::SetFileFormat(int format) { LOG(logINFO) << "Setting File Format to " - << comboFileFormat->currentText().toAscii().data(); + << comboFileFormat->currentText().toAscii().data(); try { det->setFileFormat(static_cast( comboFileFormat->currentIndex())); @@ -334,15 +334,13 @@ void qTabDataOutput::SetRateCorrection() { // custom dead time if (radioCustomDeadtime->isChecked()) { int64_t deadtime = spinCustomDeadTime->value(); - LOG(logINFO) - << "Setting Rate Correction with custom dead time: " - << deadtime; + LOG(logINFO) << "Setting Rate Correction with custom dead time: " + << deadtime; det->setRateCorrection(sls::ns(deadtime)); } // default dead time else { - LOG(logINFO) - << "Setting Rate Correction with default dead time"; + LOG(logINFO) << "Setting Rate Correction with default dead time"; det->setDefaultRateCorrection(); } } @@ -367,7 +365,7 @@ void qTabDataOutput::GetSpeed() { void qTabDataOutput::SetSpeed(int speed) { LOG(logINFO) << "Setting Speed to " - << comboEigerClkDivider->currentText().toAscii().data(); + << comboEigerClkDivider->currentText().toAscii().data(); ; try { det->setSpeed(static_cast(speed)); @@ -398,9 +396,8 @@ void qTabDataOutput::SetFlags() { auto mode = comboEigerParallelFlag->currentIndex() == PARALLEL ? true : false; try { - LOG(logINFO) - << "Setting Readout Flags to " - << comboEigerParallelFlag->currentText().toAscii().data(); + LOG(logINFO) << "Setting Readout Flags to " + << comboEigerParallelFlag->currentText().toAscii().data(); det->setParallelMode(mode); } CATCH_HANDLE("Could not set readout flags.", "qTabDataOutput::SetFlags", diff --git a/slsDetectorGui/src/qTabDebugging.cpp b/slsDetectorGui/src/qTabDebugging.cpp index eae0d1be1..1482f5587 100644 --- a/slsDetectorGui/src/qTabDebugging.cpp +++ b/slsDetectorGui/src/qTabDebugging.cpp @@ -1,6 +1,6 @@ #include "qTabDebugging.h" -#include "qDefs.h" #include "ToString.h" +#include "qDefs.h" #include #include #include @@ -105,8 +105,9 @@ void qTabDebugging::GetInfo() { treeDet->setHeaderLabel("Eiger Detector"); // get num modules for (int i = 0; i < comboDetector->count() / 2; ++i) - items.append(new QTreeWidgetItem( - (QTreeWidget *)nullptr, QStringList(QString("Module %1").arg(i)))); + items.append( + new QTreeWidgetItem((QTreeWidget *)nullptr, + QStringList(QString("Module %1").arg(i)))); treeDet->insertTopLevelItems(0, items); // gets det names for (int i = 0; i < comboDetector->count(); ++i) { diff --git a/slsDetectorGui/src/qTabMeasurement.cpp b/slsDetectorGui/src/qTabMeasurement.cpp index 4057d9c3a..2f7a09c3e 100644 --- a/slsDetectorGui/src/qTabMeasurement.cpp +++ b/slsDetectorGui/src/qTabMeasurement.cpp @@ -297,7 +297,7 @@ void qTabMeasurement::GetTimingMode() { void qTabMeasurement::SetTimingMode(int val) { LOG(logINFO) << "Setting timing mode:" - << comboTimingMode->currentText().toAscii().data(); + << comboTimingMode->currentText().toAscii().data(); try { det->setTimingMode(static_cast(val)); EnableWidgetsforTimingMode(); @@ -438,7 +438,7 @@ void qTabMeasurement::SetExposureTime() { auto val = spinExpTime->value(); auto unit = static_cast(comboExpUnit->currentIndex()); LOG(logINFO) << "Setting exposure time to " << val << " " - << qDefs::getUnitString(unit); + << qDefs::getUnitString(unit); try { auto timeNS = qDefs::getNSTime(std::make_pair(val, unit)); det->setExptime(timeNS); @@ -476,7 +476,7 @@ void qTabMeasurement::SetAcquisitionPeriod() { auto val = spinPeriod->value(); auto unit = static_cast(comboPeriodUnit->currentIndex()); LOG(logINFO) << "Setting acquisition period to " << val << " " - << qDefs::getUnitString(unit); + << qDefs::getUnitString(unit); try { auto timeNS = qDefs::getNSTime(std::make_pair(val, unit)); det->setPeriod(timeNS); @@ -537,7 +537,7 @@ void qTabMeasurement::SetDelay() { auto val = spinDelay->value(); auto unit = static_cast(comboDelayUnit->currentIndex()); LOG(logINFO) << "Setting delay to " << val << " " - << qDefs::getUnitString(unit); + << qDefs::getUnitString(unit); try { auto timeNS = qDefs::getNSTime(std::make_pair(val, unit)); det->setDelayAfterTrigger(timeNS); @@ -573,7 +573,7 @@ void qTabMeasurement::SetBurstPeriod() { auto unit = static_cast(comboBurstPeriodUnit->currentIndex()); LOG(logINFO) << "Setting burst period to " << val << " " - << qDefs::getUnitString(unit); + << qDefs::getUnitString(unit); try { auto timeNS = qDefs::getNSTime(std::make_pair(val, unit)); det->setBurstPeriod(timeNS); @@ -771,8 +771,7 @@ void qTabMeasurement::AcquireFinished() { if (startingFnumImplemented) { GetStartingFrameNumber(); } - LOG(logDEBUG) << "Measurement " << currentMeasurement - << " finished"; + LOG(logDEBUG) << "Measurement " << currentMeasurement << " finished"; // next measurement if acq is not stopped if (!isAcquisitionStopped && ((currentMeasurement + 1) < numMeasurements)) { @@ -801,8 +800,9 @@ void qTabMeasurement::Enable(bool enable) { frameNotTimeResolved->setEnabled(enable); // shortcut each time, else it doesnt work a second time - btnStart->setShortcut(QApplication::translate( - "TabMeasurementObject", "Shift+Space", nullptr, QApplication::UnicodeUTF8)); + btnStart->setShortcut(QApplication::translate("TabMeasurementObject", + "Shift+Space", nullptr, + QApplication::UnicodeUTF8)); } void qTabMeasurement::Refresh() { diff --git a/slsDetectorGui/src/qTabMessages.cpp b/slsDetectorGui/src/qTabMessages.cpp index e111d2f2f..98a195989 100644 --- a/slsDetectorGui/src/qTabMessages.cpp +++ b/slsDetectorGui/src/qTabMessages.cpp @@ -75,8 +75,8 @@ void qTabMessages::ExecuteCommand() { QString command = param.at(0); param.removeFirst(); LOG(logINFO) << "Executing Command:[" << command.toAscii().constData() - << "] with Arguments:[" - << param.join(" ").toAscii().constData() << "]"; + << "] with Arguments:[" + << param.join(" ").toAscii().constData() << "]"; process->setProcessChannelMode(QProcess::MergedChannels); process->start(command, param); @@ -121,7 +121,7 @@ void qTabMessages::SaveLog() { LOG(logINFO) << mess; } else { LOG(logWARNING) << "Attempt to save log file failed: " - << fName.toAscii().constData(); + << fName.toAscii().constData(); qDefs::Message(qDefs::WARNING, "Attempt to save log file failed.", "qTabMessages::SaveLog"); } diff --git a/slsDetectorGui/src/qTabPlot.cpp b/slsDetectorGui/src/qTabPlot.cpp index 216f3cfe3..31eca3458 100644 --- a/slsDetectorGui/src/qTabPlot.cpp +++ b/slsDetectorGui/src/qTabPlot.cpp @@ -6,7 +6,6 @@ #include #include - QString qTabPlot::defaultPlotTitle(""); QString qTabPlot::defaultHistXAxisTitle("Channel Number"); QString qTabPlot::defaultHistYAxisTitle("Counts"); @@ -290,16 +289,14 @@ void qTabPlot::SetBinary() { bool binary1D = chkBinary->isChecked(); bool binary2D = chkBinary_2->isChecked(); if (is1d) { - LOG(logINFO) << "Binary Plot " - << (binary1D ? "enabled" : "disabled"); + LOG(logINFO) << "Binary Plot " << (binary1D ? "enabled" : "disabled"); lblFrom->setEnabled(binary1D); lblTo->setEnabled(binary1D); spinFrom->setEnabled(binary1D); spinTo->setEnabled(binary1D); plot->SetBinary(binary1D, spinFrom->value(), spinTo->value()); } else { - LOG(logINFO) << "Binary Plot " - << (binary2D ? "enabled" : "disabled"); + LOG(logINFO) << "Binary Plot " << (binary2D ? "enabled" : "disabled"); lblFrom_2->setEnabled(binary2D); lblTo_2->setEnabled(binary2D); spinFrom_2->setEnabled(binary2D); @@ -434,10 +431,10 @@ void qTabPlot::SetXYRange() { for (int i = 0; i < 4; ++i) { if (chkVal[i] && !dispVal[i].isEmpty()) { double val = dispVal[i].toDouble(); - LOG(logDEBUG) - << "Setting " - << qDefs::getRangeAsString(static_cast(i)) - << " to " << val; + LOG(logDEBUG) << "Setting " + << qDefs::getRangeAsString( + static_cast(i)) + << " to " << val; xyRange[i] = val; isRange[i] = true; disablezoom = true; @@ -482,10 +479,10 @@ void qTabPlot::MaintainAspectRatio(int dimension) { ranges[qDefs::YMAX] = plot->GetYMaximum(); double idealAspectratio = (ranges[qDefs::XMAX] - ranges[qDefs::XMIN]) / (ranges[qDefs::YMAX] - ranges[qDefs::YMIN]); - LOG(logDEBUG) << "Ideal Aspect ratio: " << idealAspectratio - << " for x(" << ranges[qDefs::XMIN] << " - " - << ranges[qDefs::XMAX] << "), y(" << ranges[qDefs::YMIN] - << " - " << ranges[qDefs::YMAX] << ")"; + LOG(logDEBUG) << "Ideal Aspect ratio: " << idealAspectratio << " for x(" + << ranges[qDefs::XMIN] << " - " << ranges[qDefs::XMAX] + << "), y(" << ranges[qDefs::YMIN] << " - " + << ranges[qDefs::YMAX] << ")"; // calculate current aspect ratio ranges[qDefs::XMIN] = dispXMin->text().toDouble(); @@ -494,10 +491,10 @@ void qTabPlot::MaintainAspectRatio(int dimension) { ranges[qDefs::YMAX] = dispYMax->text().toDouble(); double currentAspectRatio = (ranges[qDefs::XMAX] - ranges[qDefs::XMIN]) / (ranges[qDefs::YMAX] - ranges[qDefs::YMIN]); - LOG(logDEBUG) << "Current Aspect ratio: " << currentAspectRatio - << " for x(" << ranges[qDefs::XMIN] << " - " - << ranges[qDefs::XMAX] << "), y(" << ranges[qDefs::YMIN] - << " - " << ranges[qDefs::YMAX] << ")"; + LOG(logDEBUG) << "Current Aspect ratio: " << currentAspectRatio << " for x(" + << ranges[qDefs::XMIN] << " - " << ranges[qDefs::XMAX] + << "), y(" << ranges[qDefs::YMIN] << " - " + << ranges[qDefs::YMAX] << ")"; if (currentAspectRatio != idealAspectratio) { // dimension: 1(x changed: y adjusted), 0(y changed: x adjusted), @@ -643,7 +640,7 @@ void qTabPlot::SetStreamingFrequency() { det->setRxZmqFrequency(freqVal); } else { LOG(logINFO) << "Setting Streaming Timer to " << timeVal << " " - << qDefs::getUnitString(timeUnit); + << qDefs::getUnitString(timeUnit); auto timeMS = qDefs::getMSTime(std::make_pair(timeVal, timeUnit)); det->setRxZmqTimer(timeMS.count()); } diff --git a/slsDetectorGui/src/qTabSettings.cpp b/slsDetectorGui/src/qTabSettings.cpp index dc151fdf6..b114aff7a 100644 --- a/slsDetectorGui/src/qTabSettings.cpp +++ b/slsDetectorGui/src/qTabSettings.cpp @@ -1,6 +1,6 @@ #include "qTabSettings.h" -#include "qDefs.h" #include "ToString.h" +#include "qDefs.h" #include qTabSettings::qTabSettings(QWidget *parent, sls::Detector *detector) @@ -196,7 +196,7 @@ void qTabSettings::GetDynamicRange() { void qTabSettings::SetDynamicRange(int index) { LOG(logINFO) << "Setting dynamic range to " - << comboDynamicRange->currentText().toAscii().data(); + << comboDynamicRange->currentText().toAscii().data(); try { switch (index) { case DYNAMICRANGE_32: diff --git a/slsReceiverSoftware/src/Listener.cpp b/slsReceiverSoftware/src/Listener.cpp index 6d03067e8..5016bbba0 100644 --- a/slsReceiverSoftware/src/Listener.cpp +++ b/slsReceiverSoftware/src/Listener.cpp @@ -344,9 +344,8 @@ uint32_t Listener::ListenToAnImage(char *buf) { // copy packet switch (myDetectorType) { // for gotthard, 1st packet: 4 bytes fnum, CACA - // + CACA, 639*2 bytes data 2nd packet: 4 bytes - // fnum, previous 1*2 bytes - // data + 640*2 bytes data !! + // + CACA, 639*2 bytes data 2nd packet: 4 + // bytes fnum, previous 1*2 bytes data + 640*2 bytes data !! case GOTTHARD: if (!pnum) memcpy(buf + fifohsize, &carryOverPacket[hsize + 4], dsize - 2); @@ -515,9 +514,8 @@ uint32_t Listener::ListenToAnImage(char *buf) { // copy packet switch (myDetectorType) { // for gotthard, 1st packet: 4 bytes fnum, CACA - // + CACA, 639*2 bytes data 2nd packet: 4 bytes - // fnum, previous 1*2 bytes - // data + 640*2 bytes data !! + // + CACA, 639*2 bytes data 2nd packet: 4 + // bytes fnum, previous 1*2 bytes data + 640*2 bytes data !! case GOTTHARD: if (!pnum) memcpy(buf + fifohsize + (pnum * dsize),