removed redundant includes etc.

This commit is contained in:
Erik Frojdh
2020-03-10 11:12:00 +01:00
parent ae3189d836
commit ee799b540a
33 changed files with 33 additions and 189 deletions

View File

@ -1,17 +1,12 @@
#pragma once #pragma once
#include "ui_form_cloneplot.h" #include "ui_form_cloneplot.h"
#include <QMainWindow>
#include <QString>
class SlsQtH1D; class SlsQtH1D;
class SlsQt1DPlot; class SlsQt1DPlot;
class SlsQt2DPlot; class SlsQt2DPlot;
#include <QMainWindow>
#include <QString>
#include <iostream>
#include <string>
class qCloneWidget : public QMainWindow, private Ui::ClonePlotObject { class qCloneWidget : public QMainWindow, private Ui::ClonePlotObject {
Q_OBJECT Q_OBJECT

View File

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

View File

@ -8,8 +8,9 @@
#include <chrono> #include <chrono>
#include <iostream> #include <iostream>
#include <ostream> #include <ostream>
#include <stdint.h> #include <cstdint>
#include <string> #include <string>
using std::chrono::duration; using std::chrono::duration;
using std::chrono::duration_cast; using std::chrono::duration_cast;
using std::chrono::hours; using std::chrono::hours;

View File

@ -1,8 +1,9 @@
#pragma once #pragma once
#include "ui_form_detectormain.h" #include "ui_form_detectormain.h"
#include "qDefs.h" #include "qDefs.h"
#include "Detector.h"
#include <QTabWidget>
class qDrawPlot; class qDrawPlot;
class qTabMeasurement; class qTabMeasurement;
class qTabDataOutput; class qTabDataOutput;
@ -12,11 +13,6 @@ class qTabSettings;
class qTabDebugging; class qTabDebugging;
class qTabDeveloper; class qTabDeveloper;
class qTabMessages; class qTabMessages;
#include "Detector.h"
#include <QTabWidget>
class QScrollArea; class QScrollArea;
class QResizeEvent; class QResizeEvent;

View File

@ -1,20 +1,16 @@
#pragma once #pragma once
#include "ui_form_plot.h" #include "ui_form_plot.h"
#include "qDefs.h" #include "qDefs.h"
#include "Detector.h"
#include <mutex>
class SlsQt1DPlot; class SlsQt1DPlot;
class SlsQtH1D; class SlsQtH1D;
class SlsQt2DPlot; class SlsQt2DPlot;
class qCloneWidget; class qCloneWidget;
class detectorData; class detectorData;
#include "Detector.h"
class QResizeEvent; class QResizeEvent;
#include <mutex>
class qDrawPlot : public QWidget, private Ui::PlotObject { class qDrawPlot : public QWidget, private Ui::PlotObject {
Q_OBJECT Q_OBJECT

View File

@ -1,11 +1,9 @@
#pragma once #pragma once
#include "ui_form_tab_advanced.h" #include "ui_form_tab_advanced.h"
#include "Detector.h"
class qDrawPlot; class qDrawPlot;
#include "Detector.h"
class qTabAdvanced : public QWidget, private Ui::TabAdvancedObject { class qTabAdvanced : public QWidget, private Ui::TabAdvancedObject {
Q_OBJECT Q_OBJECT

View File

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

View File

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

View File

@ -1,14 +1,11 @@
#pragma once #pragma once
#include "ui_form_tab_developer.h" #include "ui_form_tab_developer.h"
class qDacWidget;
#include "Detector.h" #include "Detector.h"
#include "sls_detector_defs.h" #include "sls_detector_defs.h"
#include <string>
#include <vector> #include <vector>
class qDacWidget;
class qTabDeveloper : public QWidget, private Ui::TabDeveloperObject { class qTabDeveloper : public QWidget, private Ui::TabDeveloperObject {
Q_OBJECT Q_OBJECT

View File

@ -1,11 +1,8 @@
#pragma once #pragma once
#include "ui_form_tab_measurement.h" #include "ui_form_tab_measurement.h"
class qDrawPlot;
#include "Detector.h" #include "Detector.h"
class qDrawPlot;
class QStandardItemModel; class QStandardItemModel;
class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject { class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {

View File

@ -1,5 +1,4 @@
#pragma once #pragma once
#include "ui_form_tab_messages.h" #include "ui_form_tab_messages.h"
class QProcess; class QProcess;

View File

@ -1,11 +1,8 @@
#pragma once #pragma once
#include "ui_form_tab_plot.h" #include "ui_form_tab_plot.h"
class qDrawPlot;
#include "Detector.h" #include "Detector.h"
class qDrawPlot;
class QButtonGroup; class QButtonGroup;
class qTabPlot : public QWidget, private Ui::TabPlotObject { class qTabPlot : public QWidget, private Ui::TabPlotObject {

View File

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

View File

@ -1,24 +1,8 @@
/**
* @author Ian Johnson
* @version 1.0
* Modifications:
* 19.06.2012: {Some functions have been added by Dhanya to enable zooming in
* and out without using mouse control: DisableZoom, SetXMinMax,SetYMinMax,
* GetXMinimum,GetXMaximum,GetYMinimum,GetYMaximum}
* */
#ifndef SLSQT1DPLOT_H #ifndef SLSQT1DPLOT_H
#define SLSQT1DPLOT_H #define SLSQT1DPLOT_H
typedef double double32_t;
typedef float float32_t;
typedef int int32_t;
#include "ansi.h" #include "ansi.h"
#include "SlsQt1DZoomer.h" #include "SlsQt1DZoomer.h"
#include <iostream>
#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,4 @@
/**
* @author Ian Johnson
* @version 1.0
*/
#ifndef SLSQT1DZOOMER_H #ifndef SLSQT1DZOOMER_H
#define SLSQT1DZOOMER_H #define SLSQT1DZOOMER_H

View File

@ -1,15 +1,7 @@
/**
* @author Ian Johnson
* @version 1.0
*/
#ifndef SLSQT2DHIST_H #ifndef SLSQT2DHIST_H
#define SLSQT2DHIST_H #define SLSQT2DHIST_H
#if QT_VERSION >= 0x040000
#include <qprintdialog.h>
#endif
#include <qwt_color_map.h> #include <qwt_color_map.h>
#include <qwt_plot_spectrogram.h> #include <qwt_plot_spectrogram.h>
#include <qwt_scale_draw.h> #include <qwt_scale_draw.h>

View File

@ -1,12 +1,10 @@
#pragma once #pragma once
#include "SlsQt2DHist.h"
#include "SlsQt2DZoomer.h"
#include <qlist.h> #include <qlist.h>
#include <qwt_plot.h> #include <qwt_plot.h>
#include <qwt_plot_spectrogram.h> #include <qwt_plot_spectrogram.h>
#include "SlsQt2DHist.h"
#include "SlsQt2DZoomer.h"
class QwtPlotPanner; class QwtPlotPanner;
class QwtScaleWidget; class QwtScaleWidget;
class QwtLinearColorMap; class QwtLinearColorMap;

View File

@ -1,22 +1,9 @@
/**
* @author Ian Johnson
* @version 1.0
* Dhanya-05.12.2012- included an additional header
*/
#ifndef SLSQT2DZOOMER_H #ifndef SLSQT2DZOOMER_H
#define SLSQT2DZOOMER_H #define SLSQT2DZOOMER_H
#include "SlsQt2DHist.h"
/**included by Dhanya on 05.12.2012 to avoid compile time errors with the latest
* gcc*/
#include <cstdio>
/**end of Change by Dhanya*/
#include <qwt_plot_panner.h> #include <qwt_plot_panner.h>
#include <qwt_plot_zoomer.h> #include <qwt_plot_zoomer.h>
#include <cstdio>
#include "SlsQt2DHist.h"
class SlsQt2DZoomer : public QwtPlotZoomer { class SlsQt2DZoomer : public QwtPlotZoomer {
private: private:

View File

@ -1,12 +1,7 @@
/** /* TODO! short description */
* @author Ian Johnson
* @version 1.0
*/
#include "SlsQt1DPlot.h" #include "SlsQt1DPlot.h"
#include "qwt_symbol.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>
@ -16,6 +11,7 @@
#include <qwt_scale_engine.h> #include <qwt_scale_engine.h>
#include <qwt_scale_widget.h> #include <qwt_scale_widget.h>
#include <stdlib.h> #include <stdlib.h>
#include <iostream>
#define QwtLog10ScaleEngine QwtLogScaleEngine // hmm #define QwtLog10ScaleEngine QwtLogScaleEngine // hmm
@ -500,14 +496,9 @@ void SlsQt1DPlot::SetupZoom() {
// Ctrl+RighButton: zoom out to full size // Ctrl+RighButton: zoom out to full size
zoomer = new SlsQt1DZoomer(canvas()); zoomer = new SlsQt1DZoomer(canvas());
#if QT_VERSION < 0x040000
zoomer->setMousePattern(QwtEventPattern::MouseSelect2, Qt::RightButton,
Qt::ControlButton);
#else
zoomer->setMousePattern(QwtEventPattern::MouseSelect2, Qt::RightButton, zoomer->setMousePattern(QwtEventPattern::MouseSelect2, Qt::RightButton,
Qt::ControlModifier); Qt::ControlModifier);
#endif
zoomer->setMousePattern(QwtEventPattern::MouseSelect3, Qt::RightButton); zoomer->setMousePattern(QwtEventPattern::MouseSelect3, Qt::RightButton);
panner = new QwtPlotPanner((QwtPlotCanvas *)canvas()); panner = new QwtPlotPanner((QwtPlotCanvas *)canvas());

View File

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

View File

@ -1,9 +1,4 @@
/* TODO! short description */
/**
* @author Ian Johnson
* @version 1.0
*/
#include "SlsQt2DHist.h" #include "SlsQt2DHist.h"
#include "ansi.h" #include "ansi.h"
#include <cmath> #include <cmath>

View File

@ -1,15 +1,9 @@
#include "SlsQt2DPlot.h" #include "SlsQt2DPlot.h"
#include "ansi.h" #include "ansi.h"
#include <cmath>
#include <iostream>
#include <qlist.h> #include <qlist.h>
#include <qprinter.h> #include <qprinter.h>
#include <qtoolbutton.h> #include <qtoolbutton.h>
#if QT_VERSION >= 0x040000
#include <qprintdialog.h>
#endif
#include <qwt_color_map.h> #include <qwt_color_map.h>
#include <qwt_plot_layout.h> #include <qwt_plot_layout.h>
#include <qwt_plot_panner.h> #include <qwt_plot_panner.h>
@ -19,7 +13,8 @@
#include <qwt_scale_engine.h> #include <qwt_scale_engine.h>
#include <qwt_scale_widget.h> #include <qwt_scale_widget.h>
#define QwtLog10ScaleEngine QwtLogScaleEngine // hmm remove? #include <cmath>
#include <iostream>
SlsQt2DPlot::SlsQt2DPlot(QWidget *parent) : QwtPlot(parent) { SlsQt2DPlot::SlsQt2DPlot(QWidget *parent) : QwtPlot(parent) {
isLog = 0; isLog = 0;
@ -137,16 +132,9 @@ void SlsQt2DPlot::SetupZoom() {
zoomer = new SlsQt2DZoomer(canvas()); zoomer = new SlsQt2DZoomer(canvas());
zoomer->SetHist(hist); zoomer->SetHist(hist);
#if QT_VERSION < 0x040000
zoomer->setMousePattern(QwtEventPattern::MouseSelect2, Qt::RightButton,
Qt::ControlButton);
#else
zoomer->setMousePattern(QwtEventPattern::MouseSelect2, Qt::RightButton, zoomer->setMousePattern(QwtEventPattern::MouseSelect2, Qt::RightButton,
Qt::ControlModifier); Qt::ControlModifier);
#endif
zoomer->setMousePattern(QwtEventPattern::MouseSelect3, Qt::RightButton); zoomer->setMousePattern(QwtEventPattern::MouseSelect3, Qt::RightButton);
panner = new QwtPlotPanner(canvas()); panner = new QwtPlotPanner(canvas());
panner->setAxisEnabled(QwtPlot::yRight, false); panner->setAxisEnabled(QwtPlot::yRight, false);
panner->setMouseButton(Qt::MidButton); panner->setMouseButton(Qt::MidButton);
@ -163,13 +151,6 @@ void SlsQt2DPlot::SetupZoom() {
zoomer->setTrackerPen(c); zoomer->setTrackerPen(c);
} }
/*void SlsQt2DPlot::CompletelyUnZoom(){
setAxisScale(QwtPlot::xBottom,hist->GetXMin(),hist->GetXMin()+(hist->GetXMax()-hist->GetXMin()));
setAxisScale(QwtPlot::yLeft,hist->GetYMin(),hist->GetYMin()+(hist->GetYMax()-hist->GetYMin()));
zoomer->setZoomBase();
//replot();
}*/
void SlsQt2DPlot::UnZoom(bool replot) { void SlsQt2DPlot::UnZoom(bool replot) {
zoomer->setZoomBase(QRectF(hist->GetXMin(), hist->GetYMin(), zoomer->setZoomBase(QRectF(hist->GetXMin(), hist->GetYMin(),
@ -199,13 +180,8 @@ void SlsQt2DPlot::DisableZoom(bool disable) {
if (zoomer) { if (zoomer) {
zoomer->setMousePattern(QwtEventPattern::MouseSelect1, zoomer->setMousePattern(QwtEventPattern::MouseSelect1,
Qt::NoButton); Qt::NoButton);
#if QT_VERSION < 0x040000
zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
Qt::NoButton, Qt::ControlButton);
#else
zoomer->setMousePattern(QwtEventPattern::MouseSelect2, zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
Qt::NoButton, Qt::ControlModifier); Qt::NoButton, Qt::ControlModifier);
#endif
zoomer->setMousePattern(QwtEventPattern::MouseSelect3, zoomer->setMousePattern(QwtEventPattern::MouseSelect3,
Qt::NoButton); Qt::NoButton);
} }
@ -215,13 +191,8 @@ void SlsQt2DPlot::DisableZoom(bool disable) {
if (zoomer) { if (zoomer) {
zoomer->setMousePattern(QwtEventPattern::MouseSelect1, zoomer->setMousePattern(QwtEventPattern::MouseSelect1,
Qt::LeftButton); Qt::LeftButton);
#if QT_VERSION < 0x040000
zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlButton);
#else
zoomer->setMousePattern(QwtEventPattern::MouseSelect2, zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier); Qt::RightButton, Qt::ControlModifier);
#endif
zoomer->setMousePattern(QwtEventPattern::MouseSelect3, zoomer->setMousePattern(QwtEventPattern::MouseSelect3,
Qt::RightButton); Qt::RightButton);
} }
@ -325,7 +296,7 @@ void SlsQt2DPlot::LogZ(bool on) {
if (on) { if (on) {
isLog = 1; isLog = 1;
d_spectrogram->setColorMap(myColourMap(isLog)); d_spectrogram->setColorMap(myColourMap(isLog));
setAxisScaleEngine(QwtPlot::yRight, new QwtLog10ScaleEngine); setAxisScaleEngine(QwtPlot::yRight, new QwtLogScaleEngine);
d_spectrogram->setContourLevels(contourLevelsLog); d_spectrogram->setContourLevels(contourLevelsLog);
} else { } else {
isLog = 0; isLog = 0;

View File

@ -1,7 +1,6 @@
#include "qDacWidget.h" #include "qDacWidget.h"
#include "qDefs.h" #include "qDefs.h"
#include <iostream>
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)

View File

@ -19,9 +19,8 @@
#include <QScrollArea> #include <QScrollArea>
#include <QSizePolicy> #include <QSizePolicy>
#include <getopt.h>
#include <iostream>
#include <string> #include <string>
#include <getopt.h>
#include <sys/stat.h> #include <sys/stat.h>
int main(int argc, char **argv) { int main(int argc, char **argv) {

View File

@ -1,5 +1,4 @@
#include "qDrawPlot.h" #include "qDrawPlot.h"
#include "SlsQt1DPlot.h" #include "SlsQt1DPlot.h"
#include "SlsQt2DPlot.h" #include "SlsQt2DPlot.h"
#include "detectorData.h" #include "detectorData.h"

View File

@ -3,8 +3,6 @@
#include "qDefs.h" #include "qDefs.h"
#include "qDrawPlot.h" #include "qDrawPlot.h"
#include <iostream>
qTabAdvanced::qTabAdvanced(QWidget *parent, sls::Detector *detector, qTabAdvanced::qTabAdvanced(QWidget *parent, sls::Detector *detector,
qDrawPlot *p) qDrawPlot *p)
: QWidget(parent), det(detector), plot(p) { : QWidget(parent), det(detector), plot(p) {

View File

@ -5,8 +5,6 @@
#include <QFileDialog> #include <QFileDialog>
#include <QStandardItemModel> #include <QStandardItemModel>
#include <QString> #include <QString>
#include <iostream>
#include <string> #include <string>
qTabDataOutput::qTabDataOutput(QWidget *parent, sls::Detector *detector) qTabDataOutput::qTabDataOutput(QWidget *parent, sls::Detector *detector)

View File

@ -1,14 +1,10 @@
#include "qTabDebugging.h" #include "qTabDebugging.h"
#include "qDefs.h" #include "qDefs.h"
#include "ToString.h" #include "ToString.h"
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QGridLayout> #include <QGridLayout>
#include <QTreeWidget> #include <QTreeWidget>
#include <iostream>
qTabDebugging::qTabDebugging(QWidget *parent, sls::Detector *detector) qTabDebugging::qTabDebugging(QWidget *parent, sls::Detector *detector)
: QWidget(parent), det(detector), treeDet(nullptr), : QWidget(parent), det(detector), treeDet(nullptr),
lblDetectorHostname(nullptr), lblDetectorFirmware(nullptr), lblDetectorHostname(nullptr), lblDetectorFirmware(nullptr),

View File

@ -2,8 +2,6 @@
#include "qDacWidget.h" #include "qDacWidget.h"
#include "qDefs.h" #include "qDefs.h"
#include <iostream>
qTabDeveloper::qTabDeveloper(QWidget *parent, sls::Detector *detector) qTabDeveloper::qTabDeveloper(QWidget *parent, sls::Detector *detector)
: QWidget(parent), det(detector) { : QWidget(parent), det(detector) {
setupUi(this); setupUi(this);

View File

@ -1,15 +1,10 @@
#include "qTabMeasurement.h" #include "qTabMeasurement.h"
#include "qDefs.h" #include "qDefs.h"
#include "qDrawPlot.h" #include "qDrawPlot.h"
#include "string_utils.h" #include "string_utils.h"
#include <QStandardItemModel> #include <QStandardItemModel>
#include <QTimer> #include <QTimer>
#include <cmath>
#include <iostream>
qTabMeasurement::qTabMeasurement(QWidget *parent, sls::Detector *detector, qTabMeasurement::qTabMeasurement(QWidget *parent, sls::Detector *detector,
qDrawPlot *p) qDrawPlot *p)
: QWidget(parent), det(detector), plot(p), progressTimer(nullptr) { : QWidget(parent), det(detector), plot(p), progressTimer(nullptr) {

View File

@ -7,8 +7,6 @@
#include <QKeyEvent> #include <QKeyEvent>
#include <QProcess> #include <QProcess>
#include <QTextStream> #include <QTextStream>
#include <iostream>
#include <string> #include <string>
qTabMessages::qTabMessages(QWidget *parent) : QWidget(parent) { qTabMessages::qTabMessages(QWidget *parent) : QWidget(parent) {

View File

@ -1,15 +1,11 @@
#include "qTabPlot.h" #include "qTabPlot.h"
#include "qDefs.h" #include "qDefs.h"
#include "qDrawPlot.h" #include "qDrawPlot.h"
#include <QAbstractButton> #include <QAbstractButton>
#include <QButtonGroup> #include <QButtonGroup>
#include <QStackedLayout> #include <QStackedLayout>
#include <QStandardItemModel> #include <QStandardItemModel>
#include <iostream>
#include <math.h>
#include <string>
QString qTabPlot::defaultPlotTitle(""); QString qTabPlot::defaultPlotTitle("");
QString qTabPlot::defaultHistXAxisTitle("Channel Number"); QString qTabPlot::defaultHistXAxisTitle("Channel Number");

View File

@ -1,13 +1,8 @@
#include "qTabSettings.h" #include "qTabSettings.h"
#include "qDefs.h" #include "qDefs.h"
#include "ToString.h" #include "ToString.h"
#include <QStandardItemModel> #include <QStandardItemModel>
#include <cmath>
#include <iostream>
qTabSettings::qTabSettings(QWidget *parent, sls::Detector *detector) qTabSettings::qTabSettings(QWidget *parent, sls::Detector *detector)
: QWidget(parent), det(detector) { : QWidget(parent), det(detector) {
setupUi(this); setupUi(this);