mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 06:50:02 +02:00
WIP
This commit is contained in:
parent
e6361c73fc
commit
5d2567005d
@ -1,147 +1,102 @@
|
||||
#pragma once
|
||||
|
||||
class SlsQtH1D;
|
||||
#include "SlsQt1DPlot.h"
|
||||
#include "SlsQt2DPlotLayout.h"
|
||||
class SlsQt1DPlot;
|
||||
class SlsQt2DPlotLayout;
|
||||
|
||||
#include <QAction>
|
||||
#include <QCheckBox>
|
||||
#include <QCloseEvent>
|
||||
#include <QComboBox>
|
||||
#include <QGridLayout>
|
||||
#include <QGroupBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QMainWindow>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#include <QPushButton>
|
||||
#include <QSpacerItem>
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
#include <QMainWindow>
|
||||
class QwtSymbol;
|
||||
class QGridLayout;
|
||||
class QGroupBox;
|
||||
class QLabel;
|
||||
class QCloseEvent;
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
*@short Sets up the clone plot widget
|
||||
*/
|
||||
class qCloneWidget : public QMainWindow {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* The constructor
|
||||
*/
|
||||
qCloneWidget(QWidget *parent, int id, QString title, QString xTitle, QString yTitle, QString zTitle, int numDim, std::string FilePath,
|
||||
bool displayStats, QString min, QString max, QString sum);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~qCloneWidget();
|
||||
|
||||
/**
|
||||
* Sets up the widget window
|
||||
* @param title title of the image with frame number
|
||||
* @param xTitle title of x axis
|
||||
* @param yTitle title of y axis
|
||||
* @param zTitle title of z axis
|
||||
* @param numDim 1D or 2D
|
||||
* */
|
||||
void SetupWidgetWindow(QString title, QString xTitle, QString yTitle, QString zTitle, int numDim);
|
||||
|
||||
/**
|
||||
* Get the 1D hist values to plot
|
||||
* @param nHists Number of graphs in 1D
|
||||
* @param histNBins Total Number of X axis values/channels in 1D
|
||||
* @param histXAxis X Axis value in 1D
|
||||
* @param histYAxis Y Axis value in 1D
|
||||
* @param histTitle Title for all the graphs in 1D
|
||||
* @param lines style of plot if lines or dots
|
||||
* @param markers style of plot markers or not
|
||||
*/
|
||||
* @param nHists Number of graphs in 1D
|
||||
* @param histNBins Total Number of X axis values/channels in 1D
|
||||
* @param histXAxis X Axis value in 1D
|
||||
* @param histYAxis Y Axis value in 1D
|
||||
* @param histTitle Title for all the graphs in 1D
|
||||
* @param lines style of plot if lines or dots
|
||||
* @param markers style of plot markers or not
|
||||
*/
|
||||
void SetCloneHists(int nHists, int histNBins, double *histXAxis, double *histYAxis[], std::string histTitle[], bool lines, bool markers);
|
||||
|
||||
/**
|
||||
* Get the 1D hist values to plot for angle plotting
|
||||
* @param nHists Number of graphs in 1D
|
||||
* @param histNBins Total Number of X axis values/channels in 1D
|
||||
* @param histXAxis X Axis value in 1D
|
||||
* @param histYAxis Y Axis value in 1D
|
||||
* @param histTitle Title for all the graphs in 1D
|
||||
* @param lines style of plot if lines or dots
|
||||
* @param markers style of plot markers or not
|
||||
*/
|
||||
* @param nHists Number of graphs in 1D
|
||||
* @param histNBins Total Number of X axis values/channels in 1D
|
||||
* @param histXAxis X Axis value in 1D
|
||||
* @param histYAxis Y Axis value in 1D
|
||||
* @param histTitle Title for all the graphs in 1D
|
||||
* @param lines style of plot if lines or dots
|
||||
* @param markers style of plot markers or not
|
||||
*/
|
||||
void SetCloneHists(int nHists, int histNBins, double *histXAxis, double *histYAxis, std::string histTitle[], bool lines, bool markers);
|
||||
|
||||
/**
|
||||
* Get the 1D hist values to plot for angle plotting
|
||||
* @param nbinsx number of bins in x axis
|
||||
* @param xmin minimum in x axis
|
||||
* @param xmax maximum in x axis
|
||||
* @param nbinsy number of bins in y axis
|
||||
* @param ymin minimum in y axis
|
||||
* @param ymax maximum in y axis
|
||||
* @param d data
|
||||
*/
|
||||
* @param nbinsx number of bins in x axis
|
||||
* @param xmin minimum in x axis
|
||||
* @param xmax maximum in x axis
|
||||
* @param nbinsy number of bins in y axis
|
||||
* @param ymin minimum in y axis
|
||||
* @param ymax maximum in y axis
|
||||
* @param d data
|
||||
*/
|
||||
void SetCloneHists2D(int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, double *d);
|
||||
|
||||
/**
|
||||
* Set the range of the 1d plot
|
||||
* @param IsXYRange array of x,y,min,max if these values are set
|
||||
* @param XYRangeValues array of set values of x,y, min, max
|
||||
*/
|
||||
* @param IsXYRange array of x,y,min,max if these values are set
|
||||
* @param XYRangeValues array of set values of x,y, min, max
|
||||
*/
|
||||
void SetRange(bool IsXYRange[], double XYRangeValues[]);
|
||||
|
||||
/**
|
||||
* Returns the 1d plot
|
||||
*/
|
||||
SlsQt1DPlot *Get1dPlot();
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* Save Plots automatically by save all clones
|
||||
* returns -1 if fail
|
||||
*/
|
||||
int SavePlotAutomatic();
|
||||
|
||||
private:
|
||||
/** Gets the current time stamp for the window title*/
|
||||
char *GetCurrentTimeStamp();
|
||||
|
||||
/** Display Statistics */
|
||||
void DisplayStats(bool enable, QString min, QString max, QString sum);
|
||||
|
||||
/** clone window id*/
|
||||
int id;
|
||||
/** Default Save file path */
|
||||
std::string filePath;
|
||||
/** clone 1D Plot */
|
||||
SlsQt1DPlot *cloneplot1D;
|
||||
/** clone 2D Plot */
|
||||
SlsQt2DPlotLayout *cloneplot2D;
|
||||
/** vector of 1D hist values */
|
||||
QVector<SlsQtH1D *> cloneplot1D_hists;
|
||||
|
||||
/** markers for the plot*/
|
||||
QwtSymbol *marker;
|
||||
QwtSymbol *nomarker;
|
||||
|
||||
QGridLayout *mainLayout;
|
||||
QGroupBox *cloneBox;
|
||||
|
||||
QLabel *lblHistTitle;
|
||||
|
||||
private slots:
|
||||
/** Save Plot */
|
||||
void SavePlot();
|
||||
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
||||
private:
|
||||
char *GetCurrentTimeStamp();
|
||||
void DisplayStats(bool enable, QString min, QString max, QString sum);
|
||||
|
||||
signals:
|
||||
void CloneClosedSignal(int);
|
||||
|
||||
private:
|
||||
int id;
|
||||
std::string filePath;
|
||||
SlsQt1DPlot *cloneplot1D;
|
||||
SlsQt2DPlotLayout *cloneplot2D;
|
||||
QVector<SlsQtH1D *> cloneplot1D_hists;
|
||||
|
||||
QwtSymbol *marker;
|
||||
QwtSymbol *nomarker;
|
||||
QGridLayout *mainLayout;
|
||||
QGroupBox *cloneBox;
|
||||
QLabel *lblHistTitle;
|
||||
};
|
||||
|
||||
|
@ -1,10 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "qDefs.h"
|
||||
#include "qDrawPlot.h"
|
||||
#include "qTabDataOutput.h"
|
||||
#include "qTabMeasurement.h"
|
||||
#include "ui_form_detectormain.h"
|
||||
|
||||
#include "qDefs.h"
|
||||
class qDrawPlot;
|
||||
class qTabMeasurement;
|
||||
class qTabDataOutput;
|
||||
class qTabPlot;
|
||||
class qTabAdvanced;
|
||||
class qTabSettings;
|
||||
@ -15,12 +16,8 @@ class qServer;
|
||||
|
||||
class multiSlsDetector;
|
||||
|
||||
#include <QGridLayout>
|
||||
#include <QResizeEvent>
|
||||
#include <QScrollArea>
|
||||
#include <QTabWidget>
|
||||
|
||||
#include <iostream>
|
||||
class QResizeEvent;
|
||||
|
||||
/** To Over-ride the QTabWidget class to get the tabBar */
|
||||
class MyTabWidget : public QTabWidget {
|
||||
@ -30,27 +27,12 @@ class MyTabWidget : public QTabWidget {
|
||||
QTabBar *tabBar() { return QTabWidget::tabBar(); }
|
||||
};
|
||||
|
||||
/**
|
||||
*@short Main window of the GUI.
|
||||
*/
|
||||
class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* Main Window constructor.
|
||||
* This is mainly used to create detector object and all the tabs
|
||||
* @param argc number of command line arguments for server options
|
||||
* @param argv server options
|
||||
* @param app the qapplication3
|
||||
* @param parent makes the parent window 0 by default
|
||||
*/
|
||||
qDetectorMain(int argc, char **argv, QApplication *app,
|
||||
QWidget *parent = 0);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~qDetectorMain();
|
||||
|
||||
/**
|
||||
@ -59,37 +41,13 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
|
||||
* @returns success or fail
|
||||
*/
|
||||
int StartStopAcquisitionFromClient(bool start);
|
||||
|
||||
/**
|
||||
* Returns if plot is running
|
||||
*/
|
||||
bool isPlotRunning();
|
||||
|
||||
/**
|
||||
* Returns progress bar value
|
||||
*/
|
||||
int GetProgress();
|
||||
|
||||
private slots:
|
||||
/**
|
||||
* Enables modes as selected -Debug, Expert, Dockable: calls setdockablemode
|
||||
*/
|
||||
void EnableModes(QAction *action);
|
||||
|
||||
/**
|
||||
* Executes actions in the utilities menu as selected
|
||||
*/
|
||||
void ExecuteUtilities(QAction *action);
|
||||
|
||||
/**
|
||||
* Executes actions in the utilities menu as selected
|
||||
*/
|
||||
void ExecuteHelp(QAction *action);
|
||||
|
||||
/**
|
||||
* Refreshes the tab each time the tab is changed. Also displays the next
|
||||
* enabled tab
|
||||
*/
|
||||
void Refresh(int index);
|
||||
|
||||
/**
|
||||
@ -97,51 +55,17 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
|
||||
* @param b bool TRUE if undocked(outside main window), FALSE docked
|
||||
*/
|
||||
void ResizeMainWindow(bool b);
|
||||
|
||||
/**
|
||||
* Enables/disables tabs depending on if acquisition is currently in
|
||||
* progress
|
||||
*/
|
||||
void EnableTabs();
|
||||
|
||||
/**
|
||||
* Set the tool tip of mouse controlled zooming depening on if its
|
||||
* enabled/disabled
|
||||
*/
|
||||
void SetZoomToolTip(bool disable);
|
||||
|
||||
/**
|
||||
* Uncheck the Listen to gui client mode when the server has exited
|
||||
*/
|
||||
void UncheckServer();
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Adjust the resizing to resize plot
|
||||
*/
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Sets up the layout of the widget
|
||||
*/
|
||||
void SetUpWidgetWindow();
|
||||
|
||||
/**
|
||||
* Sets up detector
|
||||
* @param fName file name of the config file at start up
|
||||
* @param multi detector ID
|
||||
*/
|
||||
void SetUpDetector(const std::string fName, int multiID);
|
||||
|
||||
/**
|
||||
* Sets up the signals and the slots
|
||||
*/
|
||||
void Initialization();
|
||||
|
||||
/**
|
||||
* Loads config file at start up
|
||||
*/
|
||||
void LoadConfigFile(const std::string fName);
|
||||
|
||||
/** enumeration of the tabs */
|
||||
@ -156,40 +80,22 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
|
||||
MESSAGES,
|
||||
NumberOfTabs
|
||||
};
|
||||
/** Detector Type */
|
||||
slsDetectorDefs::detectorType detType;
|
||||
/** The sls detector object */
|
||||
multiSlsDetector* myDet;
|
||||
/** The Plot widget */
|
||||
qDrawPlot* myPlot;
|
||||
/**Tab Widget */
|
||||
MyTabWidget* tabs;
|
||||
/**Measurement tab */
|
||||
qTabMeasurement* tabMeasurement;
|
||||
/**DataOutput tab */
|
||||
qTabDataOutput* tabDataOutput;
|
||||
/**Plot tab */
|
||||
qTabPlot* tabPlot;
|
||||
/**Settings tab */
|
||||
qTabSettings* tabSettings;
|
||||
/**Advanced tab */
|
||||
qTabAdvanced* tabAdvanced;
|
||||
/**Debugging tab */
|
||||
qTabDebugging* tabDebugging;
|
||||
/**Developer tab */
|
||||
qTabDeveloper* tabDeveloper;
|
||||
/**Messages tab */
|
||||
qTabMessages* tabMessages;
|
||||
/** server object*/
|
||||
qServer* myServer;
|
||||
/**if the developer tab should be enabled,known from command line */
|
||||
int isDeveloper;
|
||||
/** default height of Plot Window when docked */
|
||||
int heightPlotWindow;
|
||||
/** default height of central widgetwhen plot Window when docked */
|
||||
int heightCentralWidget;
|
||||
/** The default zooming tool tip */
|
||||
QString zoomToolTip;
|
||||
/** The default tab heading color */
|
||||
QColor defaultTabColor;
|
||||
};
|
||||
|
@ -27,6 +27,11 @@ class qServer : public QWidget {
|
||||
void Acquire(sls::ServerInterface2* socket);
|
||||
void ExitServer(sls::ServerInterface2* socket);
|
||||
|
||||
signals:
|
||||
// to update the Listening to Gui check box
|
||||
void ServerStoppedSignal();
|
||||
|
||||
private:
|
||||
void (qServer::*flist[qDefs::QF_NUM_FUNCTIONS])(sls::ServerInterface2 &socket);
|
||||
qDetectorMain *mainTab;
|
||||
bool tcpThreadCreated{false};
|
||||
@ -38,7 +43,5 @@ class qServer : public QWidget {
|
||||
std::unique_ptr<sls::ServerSocket> controlSocket{nullptr};
|
||||
std::unique_ptr<sls::ServerSocket> stopSocket{nullptr};
|
||||
|
||||
signals:
|
||||
// to update the Listening to Gui check box
|
||||
void ServerStoppedSignal();
|
||||
|
||||
};
|
||||
|
@ -64,6 +64,13 @@ private:
|
||||
void Enable(bool enable);
|
||||
int VerifyOutputDirectoryError();
|
||||
|
||||
signals:
|
||||
void StartSignal();
|
||||
void StopSignal();
|
||||
void CheckPlotIntervalSignal();
|
||||
|
||||
|
||||
private:
|
||||
multiSlsDetector *myDet;
|
||||
qDrawPlot *myPlot;
|
||||
// enum for the timing mode
|
||||
@ -81,9 +88,4 @@ private:
|
||||
QPalette red;
|
||||
bool delayImplemented;
|
||||
bool sampleImplemented;
|
||||
|
||||
signals:
|
||||
void StartSignal();
|
||||
void StopSignal();
|
||||
void CheckPlotIntervalSignal();
|
||||
};
|
||||
|
@ -1,64 +1,70 @@
|
||||
/*
|
||||
* qTabPlot.h
|
||||
*
|
||||
* Created on: May 10, 2012
|
||||
* Author: l_maliakal_d
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifndef QTABPLOT_H_
|
||||
#define QTABPLOT_H_
|
||||
|
||||
#include "qDefs.h"
|
||||
|
||||
|
||||
/** Form Header */
|
||||
#include "ui_form_tab_plot.h"
|
||||
/** Project Class Headers */
|
||||
class multiSlsDetector;
|
||||
/** Qt Project Class Headers */
|
||||
|
||||
class qDrawPlot;
|
||||
/** Qt Include Headers */
|
||||
#include <QStackedLayout>
|
||||
#include <QButtonGroup>
|
||||
#include <QAbstractButton>
|
||||
|
||||
class multiSlsDetector;
|
||||
|
||||
class QStackedLayout;
|
||||
class QSpinBox;
|
||||
class QDoubleSpinBox;
|
||||
class QComboBox;
|
||||
class QButtonGroup;
|
||||
class QPalette;
|
||||
|
||||
/**
|
||||
*@short sets up the Plot parameters
|
||||
*/
|
||||
class qTabPlot:public QWidget, private Ui::TabPlotObject{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/** \short The constructor
|
||||
* @param parent is the parent tab widget
|
||||
* @param detector is the detector returned from the detector tab
|
||||
* @param plot plot object reference
|
||||
*/
|
||||
qTabPlot(QWidget *parent,multiSlsDetector* detector, qDrawPlot* plot);
|
||||
|
||||
/** Destructor
|
||||
*/
|
||||
~qTabPlot();
|
||||
|
||||
/** Sets the scan argument of the plot
|
||||
*/
|
||||
void SetScanArgument();
|
||||
|
||||
/** To refresh and update widgets
|
||||
*/
|
||||
void Refresh();
|
||||
|
||||
public slots:
|
||||
void SetFrequency();
|
||||
void EnableScanBox();
|
||||
|
||||
private slots:
|
||||
void Select1DPlot(bool b);
|
||||
|
||||
/**Enables Persistency depending on Superimpose checkbox */
|
||||
void EnablePersistency(bool enable);
|
||||
void SetTitles();
|
||||
void EnableTitles();
|
||||
void checkAspectRatio();
|
||||
|
||||
/** maintain aspect ratio
|
||||
* @param axis axis to be changed: 0 for x(y axis values changed), 1 for y (xaxis values changes), -1 for the larger one (aspect ratio checked)
|
||||
*/
|
||||
void maintainAspectRatio(int axis);
|
||||
void EnableXRange();
|
||||
void EnableYRange();
|
||||
void EnableRange();
|
||||
void SetXAxisRange();
|
||||
void SetYAxisRange();
|
||||
void SetAxesRange();
|
||||
void SetZRange();
|
||||
void EnableZRange();
|
||||
bool CheckZRange(QString value);
|
||||
void SetPlot();
|
||||
void SetPlotOptionsRightPage();
|
||||
void SetPlotOptionsLeftPage();
|
||||
void SetBinary();
|
||||
void SetHistogramOptions();
|
||||
void EnableGapPixels(bool enable);
|
||||
|
||||
signals:
|
||||
void DisableZoomSignal(bool);
|
||||
void ResetZMinZMaxSignal(bool,bool,double,double);
|
||||
|
||||
private:
|
||||
/** The sls detector object */
|
||||
void SetupWidgetWindow();
|
||||
void Initialization();
|
||||
|
||||
multiSlsDetector *myDet;
|
||||
|
||||
/** The Plot widget */
|
||||
qDrawPlot *myPlot;
|
||||
|
||||
|
||||
/** 1d/2d plot */
|
||||
bool isOneD;
|
||||
bool isOriginallyOneD;
|
||||
|
||||
@ -72,6 +78,8 @@ private:
|
||||
QButtonGroup *btnGroupScan;
|
||||
QButtonGroup *btnGroupPlotType;
|
||||
QButtonGroup *btnGroupHistogram;
|
||||
QPalette *red;
|
||||
QString intervalTip;
|
||||
|
||||
/** some Default Values */
|
||||
static QString defaultPlotTitle;
|
||||
@ -84,105 +92,6 @@ private:
|
||||
/** scans */
|
||||
static const QString modeNames[5];
|
||||
|
||||
/** error palette*/
|
||||
QPalette *red;
|
||||
QString intervalTip;
|
||||
|
||||
|
||||
|
||||
|
||||
/** Sets up the widget
|
||||
*/
|
||||
void SetupWidgetWindow();
|
||||
|
||||
/** Sets up all the slots and signals
|
||||
*/
|
||||
void Initialization();
|
||||
|
||||
|
||||
public slots:
|
||||
/** Set frequency between plots*/
|
||||
void SetFrequency();
|
||||
|
||||
/** Enable Scan box
|
||||
*/
|
||||
void EnableScanBox();
|
||||
|
||||
|
||||
private slots:
|
||||
/** Selects the plot to display, enables/disables widgets
|
||||
* @param b true to select plot dimension 1, else false to select 2D
|
||||
*/
|
||||
void Select1DPlot(bool b);
|
||||
|
||||
/**Enables Persistency depending on Superimpose checkbox */
|
||||
void EnablePersistency(bool enable);
|
||||
|
||||
/**Sets the titles in plot axis */
|
||||
void SetTitles();
|
||||
|
||||
/** Enables/Sets default Titles to default */
|
||||
void EnableTitles();
|
||||
|
||||
/** check aspect ratio */
|
||||
void checkAspectRatio();
|
||||
|
||||
/** maintain aspect ratio
|
||||
* @param axis axis to be changed: 0 for x(y axis values changed), 1 for y (xaxis values changes), -1 for the larger one (aspect ratio checked)
|
||||
*/
|
||||
void maintainAspectRatio(int axis);
|
||||
|
||||
/** Enables range of the X axis */
|
||||
void EnableXRange();
|
||||
|
||||
/** Enables range of the Y axis */
|
||||
void EnableYRange();
|
||||
|
||||
/** Enables range of all axes, called by EnableXRange and EnableYRange */
|
||||
void EnableRange();
|
||||
|
||||
/** Sets the range of the x axis */
|
||||
void SetXAxisRange();
|
||||
|
||||
/** Sets the range of the y axis */
|
||||
void SetYAxisRange();
|
||||
|
||||
/** Sets the range of both axes, called by SetXAxisRange and SetYAxisRange */
|
||||
void SetAxesRange();
|
||||
|
||||
/** Sets the range of the z axis */
|
||||
void SetZRange();
|
||||
|
||||
/** Enables the range of the z axis */
|
||||
void EnableZRange();
|
||||
|
||||
/** Return true if valid */
|
||||
bool CheckZRange(QString value);
|
||||
|
||||
/** Set Plot to none, data graph, histogram*/
|
||||
void SetPlot();
|
||||
|
||||
/** Change pages in plot options box to the right*/
|
||||
void SetPlotOptionsRightPage();
|
||||
|
||||
/** Change pages in plot options box to the left*/
|
||||
void SetPlotOptionsLeftPage();
|
||||
|
||||
/** Plot binary plot */
|
||||
void SetBinary();
|
||||
|
||||
/** Set histogram options */
|
||||
void SetHistogramOptions();
|
||||
|
||||
/** Enable Gap pixels */
|
||||
void EnableGapPixels(bool enable);
|
||||
|
||||
signals:
|
||||
void DisableZoomSignal(bool);
|
||||
void ResetZMinZMaxSignal(bool,bool,double,double);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /* QTABPLOT_H_ */
|
||||
|
@ -1,7 +1,23 @@
|
||||
#include "qCloneWidget.h"
|
||||
#include "qDefs.h"
|
||||
#include "SlsQt1DPlot.h"
|
||||
#include "SlsQt2DPlotLayout.h"
|
||||
|
||||
#include "qwt_symbol.h"
|
||||
#include <QWidget>
|
||||
#include <QCloseEvent>
|
||||
#include <QGridLayout>
|
||||
#include <QGroupBox>
|
||||
#include <QLabel>
|
||||
#include <QAction>
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLineEdit>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#include <QPushButton>
|
||||
#include <QSpacerItem>
|
||||
#include <QFileDialog>
|
||||
#include <QImage>
|
||||
#include <QPainter>
|
||||
@ -24,7 +40,6 @@ qCloneWidget::qCloneWidget(QWidget *parent, int id, QString title, QString xTitl
|
||||
DisplayStats(displayStats, min, max, sum);
|
||||
}
|
||||
|
||||
|
||||
qCloneWidget::~qCloneWidget() {
|
||||
delete cloneplot1D;
|
||||
delete cloneplot2D;
|
||||
@ -32,12 +47,10 @@ qCloneWidget::~qCloneWidget() {
|
||||
cloneplot1D_hists.clear();
|
||||
}
|
||||
|
||||
|
||||
SlsQt1DPlot* qCloneWidget::Get1dPlot() {
|
||||
return cloneplot1D;
|
||||
}
|
||||
|
||||
|
||||
void qCloneWidget::SetupWidgetWindow(QString title, QString xTitle, QString yTitle, QString zTitle, int numDim) {
|
||||
|
||||
QMenuBar* menubar = new QMenuBar(this);
|
||||
@ -97,7 +110,6 @@ void qCloneWidget::SetupWidgetWindow(QString title, QString xTitle, QString yTit
|
||||
resize(500, 350);
|
||||
}
|
||||
|
||||
|
||||
void qCloneWidget::SetCloneHists(int nHists, int histNBins, double *histXAxis, double *histYAxis[], std::string histTitle[], bool lines, bool markers) {
|
||||
//for each plot, create hists
|
||||
for (int hist_num = 0; hist_num < nHists; ++hist_num) {
|
||||
@ -134,7 +146,6 @@ void qCloneWidget::SetCloneHists(int nHists, int histNBins, double *histXAxis, d
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void qCloneWidget::SetCloneHists(int nHists, int histNBins, double *histXAxis, double *histYAxis, std::string histTitle[], bool lines, bool markers) {
|
||||
// for each plot create hists
|
||||
for (int hist_num = 0; hist_num < nHists; ++hist_num) {
|
||||
@ -174,13 +185,11 @@ void qCloneWidget::SetCloneHists(int nHists, int histNBins, double *histXAxis, d
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void qCloneWidget::SetCloneHists2D(int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, double *d) {
|
||||
cloneplot2D->GetPlot()->SetData(nbinsx, xmin, xmax, nbinsy, ymin, ymax, d);
|
||||
cloneplot2D->UpdateNKeepSetRangeIfSet();
|
||||
}
|
||||
|
||||
|
||||
void qCloneWidget::SetRange(bool IsXYRange[], double XYRangeValues[]) {
|
||||
double XYCloneRangeValues[4];
|
||||
|
||||
@ -226,7 +235,6 @@ void qCloneWidget::SetRange(bool IsXYRange[], double XYRangeValues[]) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void qCloneWidget::SavePlot() {
|
||||
char cID[10];
|
||||
sprintf(cID, "%d", id);
|
||||
@ -257,7 +265,6 @@ void qCloneWidget::SavePlot() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int qCloneWidget::SavePlotAutomatic() {
|
||||
char cID[10];
|
||||
sprintf(cID, "%d", id);
|
||||
@ -280,13 +287,11 @@ int qCloneWidget::SavePlotAutomatic() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
void qCloneWidget::closeEvent(QCloseEvent *event) {
|
||||
emit CloneClosedSignal(id);
|
||||
event->accept();
|
||||
}
|
||||
|
||||
|
||||
char *qCloneWidget::GetCurrentTimeStamp() {
|
||||
char output[30];
|
||||
char *result;
|
||||
@ -300,7 +305,6 @@ char *qCloneWidget::GetCurrentTimeStamp() {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void qCloneWidget::DisplayStats(bool enable, QString min, QString max, QString sum) {
|
||||
if (enable) {
|
||||
QWidget *widgetStatistics = new QWidget(this);
|
||||
|
@ -1,22 +1,26 @@
|
||||
#include "qDetectorMain.h"
|
||||
#include "qDefs.h"
|
||||
#include "qServer.h"
|
||||
#include "qTabAdvanced.h"
|
||||
#include "qDrawPlot.h"
|
||||
#include "qTabMeasurement.h"
|
||||
#include "qTabDataOutput.h"
|
||||
#include "qTabPlot.h"
|
||||
#include "qTabAdvanced.h"
|
||||
#include "qTabSettings.h"
|
||||
#include "qTabDebugging.h"
|
||||
#include "qTabDeveloper.h"
|
||||
#include "qTabMessages.h"
|
||||
#include "qTabPlot.h"
|
||||
#include "qTabSettings.h"
|
||||
#include "qServer.h"
|
||||
|
||||
#include "multiSlsDetector.h"
|
||||
#include "sls_detector_defs.h"
|
||||
#include "versionAPI.h"
|
||||
|
||||
#include <QGridLayout>
|
||||
#include <QResizeEvent>
|
||||
#include <QScrollArea>
|
||||
#include <QFileDialog>
|
||||
#include <QPlastiqueStyle>
|
||||
#include <QSizePolicy>
|
||||
|
||||
#include <iostream>
|
||||
#include <getopt.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
@ -111,7 +115,6 @@ qDetectorMain::qDetectorMain(int argc, char **argv, QApplication *app,
|
||||
setupUi(this);
|
||||
SetUpDetector(fname, multiId);
|
||||
SetUpWidgetWindow();
|
||||
Initialization();
|
||||
}
|
||||
|
||||
qDetectorMain::~qDetectorMain() {
|
||||
@ -277,6 +280,8 @@ void qDetectorMain::SetUpDetector(const std::string fName, int multiID) {
|
||||
//FIXME: not needed anymore due to client creating socket each time
|
||||
//myDet->setOnline(slsDetectorDefs::ONLINE_FLAG);
|
||||
//myDet->setReceiverOnline(slsDetectorDefs::ONLINE_FLAG);
|
||||
|
||||
Initialization();
|
||||
}
|
||||
|
||||
void qDetectorMain::Initialization() {
|
||||
|
@ -1,17 +1,17 @@
|
||||
#include "qTabPlot.h"
|
||||
#include "qDefs.h"
|
||||
#include "qDrawPlot.h"
|
||||
// Project Class Headers
|
||||
#include "multiSlsDetector.h"
|
||||
// Qt Include Headers
|
||||
|
||||
#include <QStandardItemModel>
|
||||
// C++ Include Headers
|
||||
#include <QStackedLayout>
|
||||
#include <QButtonGroup>
|
||||
#include <QAbstractButton>
|
||||
|
||||
#include <iostream>
|
||||
#include <math.h>
|
||||
#include <string>
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// const QString qTabPlot::modeNames[5] = {"None", "Energy Scan", "Threshold Scan", "Trimbits Scan", "Custom Script Scan"};
|
||||
|
||||
QString qTabPlot::defaultPlotTitle("");
|
||||
QString qTabPlot::defaultHistXAxisTitle("Channel Number");
|
||||
@ -20,7 +20,6 @@ QString qTabPlot::defaultImageXAxisTitle("Pixel");
|
||||
QString qTabPlot::defaultImageYAxisTitle("Pixel");
|
||||
QString qTabPlot::defaultImageZAxisTitle("Intensity");
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
qTabPlot::qTabPlot(QWidget *parent, multiSlsDetector *detector, qDrawPlot *plot) : QWidget(parent),
|
||||
myDet(detector),
|
||||
@ -41,15 +40,12 @@ qTabPlot::qTabPlot(QWidget *parent, multiSlsDetector *detector, qDrawPlot *plot)
|
||||
FILE_LOG(logDEBUG) << "Plot ready";
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
qTabPlot::~qTabPlot() {
|
||||
delete myDet;
|
||||
delete myPlot;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetupWidgetWindow() {
|
||||
//error for interval between plots
|
||||
red = new QPalette();
|
||||
@ -181,7 +177,6 @@ void qTabPlot::SetupWidgetWindow() {
|
||||
qDefs::checkErrorMessage(myDet, "qTabPlot::SetupWidgetWindow");
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetPlotOptionsRightPage() {
|
||||
if (isOneD) {
|
||||
@ -201,8 +196,6 @@ void qTabPlot::SetPlotOptionsRightPage() {
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetPlotOptionsLeftPage() {
|
||||
if (isOneD) {
|
||||
int i = stackedWidget->currentIndex();
|
||||
@ -221,8 +214,6 @@ void qTabPlot::SetPlotOptionsLeftPage() {
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::Select1DPlot(bool b) {
|
||||
#ifdef VERBOSE
|
||||
if (b)
|
||||
@ -256,8 +247,6 @@ void qTabPlot::Select1DPlot(bool b) {
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::Initialization() {
|
||||
// Plot arguments box
|
||||
connect(btnGroupPlotType, SIGNAL(buttonClicked(int)), this, SLOT(SetPlot()));
|
||||
@ -349,8 +338,6 @@ void qTabPlot::Initialization() {
|
||||
connect(chkGapPixels, SIGNAL(toggled(bool)), this, SLOT(EnableGapPixels(bool)));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::EnablePersistency(bool enable) {
|
||||
#ifdef VERBOSE
|
||||
if (enable)
|
||||
@ -366,8 +353,6 @@ void qTabPlot::EnablePersistency(bool enable) {
|
||||
myPlot->SetPersistency(0);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetTitles() {
|
||||
#ifdef VERBOSE
|
||||
cout << "Setting Plot Titles" << endl;
|
||||
@ -394,8 +379,6 @@ void qTabPlot::SetTitles() {
|
||||
myPlot->SetImageZAxisTitle(dispZAxis->text());
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::EnableTitles() {
|
||||
// Plot Title
|
||||
dispTitle->setEnabled(chkTitle->isChecked());
|
||||
@ -433,15 +416,12 @@ void qTabPlot::EnableTitles() {
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::checkAspectRatio() {
|
||||
if (chkAspectRatio->isChecked()) {
|
||||
maintainAspectRatio(-1);
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::maintainAspectRatio(int axis) {
|
||||
#ifdef VERBOSE
|
||||
@ -581,8 +561,6 @@ void qTabPlot::maintainAspectRatio(int axis) {
|
||||
myPlot->SetXYRange(true);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::EnableXRange() {
|
||||
#ifdef VERBOSE
|
||||
cout << "Enable X Axis Range" << endl;
|
||||
@ -620,8 +598,6 @@ void qTabPlot::EnableXRange() {
|
||||
EnableRange();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::EnableYRange() {
|
||||
#ifdef VERBOSE
|
||||
cout << "Enable Y Axis Range" << endl;
|
||||
@ -659,8 +635,6 @@ void qTabPlot::EnableYRange() {
|
||||
EnableRange();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::EnableRange() {
|
||||
#ifdef VERBOSE
|
||||
cout << "Enable Axes Range" << endl;
|
||||
@ -673,8 +647,6 @@ void qTabPlot::EnableRange() {
|
||||
SetAxesRange();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetXAxisRange() {
|
||||
#ifdef VERBOSE
|
||||
cout << "Setting X Axis Range" << endl;
|
||||
@ -705,8 +677,6 @@ void qTabPlot::SetXAxisRange() {
|
||||
SetAxesRange();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetYAxisRange() {
|
||||
#ifdef VERBOSE
|
||||
cout << "Setting Y Axis Range" << endl;
|
||||
@ -737,8 +707,6 @@ void qTabPlot::SetYAxisRange() {
|
||||
SetAxesRange();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetAxesRange() {
|
||||
#ifdef VERBOSE
|
||||
cout << "Setting Axes Range" << endl;
|
||||
@ -773,7 +741,6 @@ void qTabPlot::SetAxesRange() {
|
||||
myPlot->SetXYRange(true);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetZRange() {
|
||||
emit ResetZMinZMaxSignal(
|
||||
@ -783,7 +750,6 @@ void qTabPlot::SetZRange() {
|
||||
dispZMax->text().toDouble());
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::EnableZRange() {
|
||||
|
||||
@ -802,7 +768,6 @@ void qTabPlot::EnableZRange() {
|
||||
connect(dispZMax, SIGNAL(editingFinished()), this, SLOT(SetZRange()));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
bool qTabPlot::CheckZRange(QString value) {
|
||||
if (value.isEmpty())
|
||||
@ -820,7 +785,6 @@ bool qTabPlot::CheckZRange(QString value) {
|
||||
return true;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetPlot() {
|
||||
#ifdef VERBOSE
|
||||
@ -890,7 +854,6 @@ void qTabPlot::SetPlot() {
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetFrequency() {
|
||||
#ifdef VERBOSE
|
||||
@ -1029,8 +992,6 @@ void qTabPlot::SetFrequency() {
|
||||
qDefs::checkErrorMessage(myDet, "qTabPlot::SetFrequency");
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::EnableScanBox(){
|
||||
#ifdef VERBOSE
|
||||
cout << "Entering Enable Scan Box"<< endl;
|
||||
@ -1218,7 +1179,6 @@ void qTabPlot::SetFrequency() {
|
||||
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetScanArgument(){
|
||||
#ifdef VERYVERBOSE
|
||||
@ -1332,7 +1292,6 @@ void qTabPlot::SetFrequency() {
|
||||
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetBinary() {
|
||||
//1d
|
||||
@ -1387,7 +1346,6 @@ void qTabPlot::SetBinary() {
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetHistogramOptions() {
|
||||
if (radioHistIntensity->isChecked()) {
|
||||
@ -1399,7 +1357,6 @@ void qTabPlot::SetHistogramOptions() {
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::EnableGapPixels(bool enable) {
|
||||
#ifdef VERBOSE
|
||||
@ -1415,7 +1372,6 @@ void qTabPlot::EnableGapPixels(bool enable) {
|
||||
connect(chkGapPixels, SIGNAL(toggled(bool)), this, SLOT(EnableGapPixels(bool)));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::Refresh() {
|
||||
#ifdef VERBOSE
|
||||
|
Loading…
x
Reference in New Issue
Block a user