mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
done with save plot and all resizing options
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@5 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
@ -9,63 +9,93 @@
|
||||
#define QCLONEWIDGET_H_
|
||||
|
||||
/** Qt Project Class Headers */
|
||||
class SlsQtH1D;
|
||||
class SlsQt1DPlot;
|
||||
class SlsQt2DPlotLayout;
|
||||
/** Qt Include Headers */
|
||||
#include <QFrame>
|
||||
#include <QGridLayout>
|
||||
#include <QCloseEvent>
|
||||
#include <QGroupBox>
|
||||
#include <QWidget>
|
||||
#include <QHBoxLayout>
|
||||
#include <QPushButton>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QComboBox>
|
||||
#include <QPushButton>
|
||||
#include <QCheckBox>
|
||||
/** C++ Include Headers */
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
/**
|
||||
*@short Sets up the clone plot widget
|
||||
*/
|
||||
class qCloneWidget:public QMainWindow{
|
||||
class qCloneWidget:public QFrame{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/** \short The constructor
|
||||
*/
|
||||
qCloneWidget(QWidget *parent,int id,QSize fSize,QString title,int numDim,SlsQt1DPlot*& plot1D,SlsQt2DPlotLayout*& plot2D);
|
||||
qCloneWidget(QWidget *parent,int id,QString title,int numDim,SlsQt1DPlot*& plot1D,SlsQt2DPlotLayout*& plot2D,string FilePath);
|
||||
|
||||
/** Destructor
|
||||
*/
|
||||
~qCloneWidget();
|
||||
|
||||
/** Sets up the widget window
|
||||
* @param title title of the image with frame number
|
||||
* @param numDim 1D or 2D
|
||||
* @param plot1D plot1d object reference
|
||||
* @param plot2D plot2d object reference
|
||||
* */
|
||||
void SetupWidgetWindow(QString title,int numDim,SlsQt1DPlot*& plot1D,SlsQt2DPlotLayout*& plot2D);
|
||||
|
||||
/** Get the 1D plot reference
|
||||
*/
|
||||
SlsQt1DPlot* Get1Dplot(){ return cloneplot1D;};
|
||||
|
||||
public slots:
|
||||
|
||||
/** 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
|
||||
* */
|
||||
void SetCloneHists(int nHists,int histNBins,double* histXAxis,double* histYAxis[],string histTitle[]);
|
||||
|
||||
|
||||
private:
|
||||
/** clone window id*/
|
||||
int id;
|
||||
/** clone 1D Plot */
|
||||
SlsQt1DPlot* cloneplot1D;
|
||||
/** Default Save file path */
|
||||
string filePath;
|
||||
|
||||
/** clone 2D Plot */
|
||||
SlsQt2DPlotLayout* cloneplot2D;
|
||||
/** clone 1D Plot */
|
||||
SlsQt1DPlot* cloneplot1D;
|
||||
/** vector of 1D hist values */
|
||||
QVector<SlsQtH1D*> cloneplot1D_hists;
|
||||
|
||||
|
||||
QGridLayout *mainLayout;
|
||||
QGroupBox *boxSave;
|
||||
QWidget *horizontalLayoutWidget;
|
||||
QGroupBox *cloneBox;
|
||||
QGridLayout *gridClone;
|
||||
QGroupBox *boxSave;
|
||||
QHBoxLayout *layoutSave;
|
||||
QLabel *lblFName;
|
||||
QLabel *lblFName;
|
||||
QHBoxLayout *hLayoutSave;
|
||||
QLineEdit *dispFName;
|
||||
QComboBox *comboFormat;
|
||||
QLineEdit *dispFName;
|
||||
QComboBox *comboFormat;
|
||||
QPushButton *btnSave;
|
||||
QCheckBox *chkAutoFName;
|
||||
QCheckBox *chkSaveAll;
|
||||
QCheckBox *chkAutoFName;
|
||||
QCheckBox *chkSaveAll;
|
||||
|
||||
|
||||
|
||||
private slots:
|
||||
/** Save Plot */
|
||||
void SavePlot();
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent* event);
|
||||
|
||||
|
@ -23,6 +23,8 @@ class qCloneWidget;
|
||||
#include <QTimer>
|
||||
#include <QString>
|
||||
|
||||
#define MAX_1DPLOTS 10
|
||||
|
||||
|
||||
/**
|
||||
*@short Sets up the plot widget
|
||||
@ -93,7 +95,7 @@ private:
|
||||
SlsQt2DPlotLayout* plot2D;
|
||||
/** vector of 1D hist values */
|
||||
QVector<SlsQtH1D*> plot1D_hists;
|
||||
QVector<SlsQtH1D*> cloneplot1D_hists;
|
||||
|
||||
|
||||
/**variables for threads */
|
||||
/** */
|
||||
@ -123,7 +125,7 @@ private:
|
||||
/** Number of graphs in 1D */
|
||||
unsigned int nHists;
|
||||
/** Title for all the graphs in 1D */
|
||||
std::string histTitle[10];
|
||||
std::string histTitle[MAX_1DPLOTS];
|
||||
/** X Axis Title in 1D */
|
||||
QString histXAxisTitle;
|
||||
/** Y Axis Title in 1D */
|
||||
@ -133,7 +135,7 @@ private:
|
||||
/** X Axis value in 1D */
|
||||
double* histXAxis;
|
||||
/** Y Axis value in 1D */
|
||||
double* histYAxis[10];
|
||||
double* histYAxis[MAX_1DPLOTS];
|
||||
|
||||
|
||||
/** */
|
||||
@ -148,9 +150,9 @@ private:
|
||||
/** */
|
||||
const char* GetImageTitle() {return imageTitle.c_str();}
|
||||
/** */
|
||||
const char* GetHistTitle(int i) {return (i>=0&&i<10) ? histTitle[i].c_str():0;} //int for hist number
|
||||
const char* GetHistTitle(int i) {return (i>=0&&i<MAX_1DPLOTS) ? histTitle[i].c_str():0;} //int for hist number
|
||||
/** */
|
||||
double* GetHistYAxis(int i) {return (i>=0&&i<10) ? histYAxis[i]:0;} //int for hist number
|
||||
double* GetHistYAxis(int i) {return (i>=0&&i<MAX_1DPLOTS) ? histYAxis[i]:0;} //int for hist number
|
||||
|
||||
|
||||
|
||||
@ -172,7 +174,6 @@ private:
|
||||
void* AcquireImages();
|
||||
|
||||
|
||||
|
||||
public slots:
|
||||
/** Set number of measurements
|
||||
* @param num number of measurements to be set
|
||||
@ -204,7 +205,10 @@ void ClonePlot();
|
||||
* */
|
||||
void CloseClones();
|
||||
|
||||
|
||||
/** To Save plot
|
||||
* @param FName full name of file
|
||||
* */
|
||||
void SavePlot(QString FName);
|
||||
|
||||
private slots:
|
||||
/** To update plot
|
||||
@ -231,6 +235,7 @@ void InterpolateSignal(bool);
|
||||
void ContourSignal(bool);
|
||||
void LogzSignal(bool);
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -85,8 +85,9 @@ void SetTitles();
|
||||
*/
|
||||
void EnableTitles();
|
||||
|
||||
|
||||
|
||||
/** Save Plot
|
||||
*/
|
||||
void SavePlot();
|
||||
|
||||
signals:
|
||||
|
||||
|
Reference in New Issue
Block a user