mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
actions without scan, positions, min plotimer=250,acquisition problem,error showing in actions tab
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@21 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* qTabActions.h
|
||||
* qActionsWidget.h
|
||||
*
|
||||
* Created on: May 10, 2012
|
||||
* Author: l_maliakal_d
|
||||
@ -8,118 +8,60 @@
|
||||
#ifndef QACTIONSWIDGET_H_
|
||||
#define QACTIONSWIDGET_H_
|
||||
|
||||
|
||||
/** Form Header */
|
||||
#include "ui_form_action.h"
|
||||
/** Project Class Headers */
|
||||
class multiSlsDetector;
|
||||
/** Qt Include Headers */
|
||||
#include <QFrame>
|
||||
class QGridLayout;
|
||||
class QComboBox;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QLabel;
|
||||
class QSpinBox;
|
||||
class QGroupBox;
|
||||
class QRadioButton;
|
||||
class QCheckBox;
|
||||
|
||||
/** C++ Include Headers */
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
class ActionsWidget : public QFrame{
|
||||
class qActionsWidget : public QWidget,private Ui::ActionsObject{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/** \short The constructor
|
||||
* @param parent is the parent tab widget
|
||||
* @param detector is the detector returned from the detector tab
|
||||
* @param scanType is if its an energy/threshold scan type
|
||||
* @param id is the id of the widget. to know which one was emitting it
|
||||
*/
|
||||
ActionsWidget(QWidget *parent, multiSlsDetector*& detector, int scanType, int id);
|
||||
qActionsWidget(QWidget *parent, multiSlsDetector*& detector);
|
||||
|
||||
~ActionsWidget();
|
||||
|
||||
/**set variable expand
|
||||
*/
|
||||
void SetExpand(bool expanded){expand = expanded;};
|
||||
|
||||
/**get variable expand
|
||||
*/
|
||||
bool isExpanded(){return expand;};
|
||||
~qActionsWidget();
|
||||
|
||||
/**to update the widgets*/
|
||||
void Refresh();
|
||||
|
||||
/**number of action widgets*/
|
||||
static int NUM_ACTION_WIDGETS;
|
||||
|
||||
|
||||
enum actions{Start,Scan0,Scan1,ActionBefore,NumPositions,
|
||||
HeaderBefore,HeaderAfter,ActionAfter,Stop};
|
||||
|
||||
private:
|
||||
/** The sls detector object */
|
||||
multiSlsDetector *myDet;
|
||||
/**if its a scan type*/
|
||||
int scanType;
|
||||
/**id of the action widget*/
|
||||
int id;
|
||||
/**if this widget has been expanded*/
|
||||
bool expand;
|
||||
|
||||
QGridLayout *layout;
|
||||
QComboBox *comboScript;
|
||||
QLineEdit *dispScript;
|
||||
QPushButton *btnBrowse;
|
||||
QLabel *lblParameter;
|
||||
QLineEdit *dispParameter;
|
||||
QLabel *lblSteps;
|
||||
QSpinBox *spinSteps;
|
||||
QLabel *lblPrecision;
|
||||
QSpinBox *spinPrecision;
|
||||
QGroupBox *group;
|
||||
QRadioButton *radioConstant;
|
||||
QRadioButton *radioSpecific;
|
||||
QRadioButton *radioValue;
|
||||
QLabel *lblFrom;
|
||||
QSpinBox *spinFrom;
|
||||
QLabel *lblTo;
|
||||
QSpinBox *spinTo;
|
||||
QLabel *lblSize;
|
||||
QSpinBox *spinSize;
|
||||
QComboBox *comboSpecific;
|
||||
QLineEdit *dispValues;
|
||||
QPushButton *btnValues;
|
||||
QSpinBox *spinNumPos;
|
||||
QComboBox *comboPos;
|
||||
QPushButton *btnDelete;
|
||||
QCheckBox *chkInvert;
|
||||
QCheckBox *chkSeparate;
|
||||
QCheckBox *chkReturn;
|
||||
|
||||
/** Sets up the widget
|
||||
*/
|
||||
void SetupWidgetWindow();
|
||||
|
||||
/** Sets up all the slots and signals */
|
||||
/** Sets up all the slots and signals
|
||||
* */
|
||||
void Initialization();
|
||||
|
||||
/**Gets the sls class action index using the gui index
|
||||
* @param index gui index
|
||||
*/
|
||||
int GetActionIndex(int gIndex);
|
||||
|
||||
|
||||
|
||||
private slots:
|
||||
/** Sets the scan or script. Accordingly enables, disables other widgets
|
||||
* @param index value chosen*/
|
||||
* @param index value chosen
|
||||
* */
|
||||
void SetScript(int index);
|
||||
|
||||
/** Enables widgets depending on which size is clicked.
|
||||
* Options: constant size,specific values,values from file */
|
||||
void EnableSizeWidgets();
|
||||
|
||||
/** Browse for the script
|
||||
* */
|
||||
void BrowsePath();
|
||||
@ -133,17 +75,6 @@ void SetScriptFile();
|
||||
* */
|
||||
void SetParameter(const QString& parameter);
|
||||
|
||||
/** Sets the number of positions
|
||||
* */
|
||||
void SetNumPositions(int index);
|
||||
|
||||
/** Deletes current position
|
||||
* */
|
||||
void DeletePosition();
|
||||
|
||||
|
||||
signals:
|
||||
void EnableScanBox(bool,int);
|
||||
};
|
||||
|
||||
|
||||
|
@ -212,7 +212,7 @@ private:
|
||||
bool IsXYRange[4];
|
||||
|
||||
/** Default timer between plots*/
|
||||
static const double PLOT_TIMER_MS = 500;
|
||||
static const double PLOT_TIMER_MS = 250;
|
||||
/** Specific timer value between plots */
|
||||
double timerValue;
|
||||
/** every nth frame when to plot */
|
||||
|
99
slsDetectorGui/include/qScanWidget.h
Normal file
99
slsDetectorGui/include/qScanWidget.h
Normal file
@ -0,0 +1,99 @@
|
||||
/*
|
||||
* qScanWidget.h
|
||||
*
|
||||
* Created on: May 10, 2012
|
||||
* Author: l_maliakal_d
|
||||
*/
|
||||
|
||||
#ifndef QSCANWIDGET_H_
|
||||
#define QSCANWIDGET_H_
|
||||
|
||||
/** Form Header */
|
||||
#include "ui_form_scan.h"
|
||||
/** Project Class Headers */
|
||||
class multiSlsDetector;
|
||||
/** Qt Include Headers */
|
||||
#include <QStackedLayout>
|
||||
/** C++ Include Headers */
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
|
||||
class qScanWidget : public QWidget,private Ui::ScanObject{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/** \short The constructor
|
||||
* @param parent is the parent tab widget
|
||||
* @param detector is the detector returned from the detector tab
|
||||
*/
|
||||
qScanWidget(QWidget *parent, multiSlsDetector*& detector);
|
||||
|
||||
~qScanWidget();
|
||||
|
||||
/**to update the widgets*/
|
||||
void Refresh();
|
||||
|
||||
/**number of scan widgets*/
|
||||
static int NUM_SCAN_WIDGETS;
|
||||
|
||||
private:
|
||||
/** The sls detector object */
|
||||
multiSlsDetector *myDet;
|
||||
/**id of the scan widget*/
|
||||
int id;
|
||||
|
||||
QStackedLayout *stackedLayout;
|
||||
QLabel *lblFrom;
|
||||
QSpinBox *spinFrom;
|
||||
QLabel *lblTo;
|
||||
QSpinBox *spinTo;
|
||||
QLabel *lblSize;
|
||||
QSpinBox *spinSize;
|
||||
QComboBox *comboSpecific;
|
||||
QLineEdit *dispValues;
|
||||
QPushButton *btnValues;
|
||||
|
||||
|
||||
/** Sets up the widget
|
||||
*/
|
||||
void SetupWidgetWindow();
|
||||
|
||||
/** Sets up all the slots and signals */
|
||||
void Initialization();
|
||||
|
||||
|
||||
|
||||
private slots:
|
||||
/** Sets the scan or script. Accordingly enables, disables other widgets
|
||||
* @param index value chosen*/
|
||||
void SetScript(int index);
|
||||
|
||||
/** Enables widgets depending on which size is clicked.
|
||||
* Options: constant size,specific values,values from file */
|
||||
void EnableSizeWidgets();
|
||||
|
||||
/** Browse for the script
|
||||
* */
|
||||
void BrowsePath();
|
||||
|
||||
/** Sets the script file
|
||||
* */
|
||||
void SetScriptFile();
|
||||
|
||||
/** Set Parameter
|
||||
* @param parameter is the parameter to be set to
|
||||
* */
|
||||
void SetParameter(const QString& parameter);
|
||||
|
||||
|
||||
|
||||
signals:
|
||||
void EnableScanBox(bool,int);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* QSCANWIDGET_H_ */
|
||||
|
@ -8,12 +8,19 @@
|
||||
#ifndef QTABACTIONS_H_
|
||||
#define QTABACTIONS_H_
|
||||
|
||||
|
||||
/* Qt Project Class Headers */
|
||||
#include "qActionsWidget.h"
|
||||
#include "qScanWidget.h"
|
||||
/** Project Class Headers */
|
||||
class multiSlsDetector;
|
||||
class ActionsWidget;
|
||||
class qActionsWidget;
|
||||
/** Qt Include Headers */
|
||||
#include <QWidget>
|
||||
#include <QPushButton>
|
||||
#include <QSpinBox>
|
||||
#include <QComboBox>
|
||||
#include <QCheckBox>
|
||||
#include <QLabel>
|
||||
#include <QScrollArea>
|
||||
#include <QGridLayout>
|
||||
@ -46,16 +53,33 @@ private:
|
||||
/** The sls detector object */
|
||||
multiSlsDetector *myDet;
|
||||
|
||||
static const int NUM_ACTION_WIDGETS = 9;
|
||||
enum actionIndex{Scan0=1, Scan1, NumPositions=4, NumTotalActions=9};
|
||||
|
||||
QGridLayout *gridLayout;
|
||||
QButtonGroup *group;
|
||||
QPalette *palette;
|
||||
|
||||
/** action widget objects */
|
||||
ActionsWidget *actionWidget[NUM_ACTION_WIDGETS];
|
||||
QPushButton *btnExpand[NUM_ACTION_WIDGETS];
|
||||
QLabel *lblName[NUM_ACTION_WIDGETS];
|
||||
/** all action widget objects */
|
||||
qActionsWidget *actionWidget[6];
|
||||
qScanWidget *scanWidget[2];
|
||||
QWidget *positionWidget;
|
||||
QPushButton *btnExpand[NumTotalActions];
|
||||
QLabel *lblName[NumTotalActions];
|
||||
|
||||
|
||||
/** NumPositions widget */
|
||||
QLabel *lblNumPos;
|
||||
QLabel *lblPosList;
|
||||
QSpinBox *spinNumPos;
|
||||
QComboBox *comboPos;
|
||||
QPushButton *btnDelete;
|
||||
QCheckBox *chkInvert;
|
||||
QCheckBox *chkSeparate;
|
||||
QCheckBox *chkReturn;
|
||||
|
||||
float *positions;
|
||||
QPalette normal;
|
||||
|
||||
|
||||
/** Sets up the widget */
|
||||
void SetupWidgetWindow();
|
||||
@ -63,12 +87,28 @@ private:
|
||||
/** Sets up all the slots and signals */
|
||||
void Initialization();
|
||||
|
||||
/** creates the Num Positions object */
|
||||
void CreatePositionsWidget();
|
||||
|
||||
/** Returns the index in each of the classes
|
||||
* of actionwidget and scanwidget
|
||||
* @param index the index in the list of all widgets
|
||||
* returns actual index of the class
|
||||
*/
|
||||
int GetActualIndex(int index);
|
||||
|
||||
private slots:
|
||||
/** To Expand the Action Widget */
|
||||
/** To Expand the Action Widget
|
||||
* */
|
||||
void Expand(QAbstractButton *button);
|
||||
|
||||
/** Sets the positions list and the number of positions
|
||||
* */
|
||||
void SetPosition();
|
||||
|
||||
/** Deletes current position
|
||||
* */
|
||||
void DeletePosition();
|
||||
|
||||
signals:
|
||||
void EnableScanBox(bool,int);
|
||||
|
Reference in New Issue
Block a user