included number of triggers for number of measurements, script and parameters work for non scan types

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@20 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d
2012-07-24 15:39:36 +00:00
parent 3b59d03526
commit 111608bdc8
10 changed files with 501 additions and 182 deletions

View File

@ -7,6 +7,11 @@
#ifndef QACTIONSWIDGET_H_
#define QACTIONSWIDGET_H_
/** Project Class Headers */
class multiSlsDetector;
/** Qt Include Headers */
#include <QFrame>
class QGridLayout;
class QComboBox;
@ -16,6 +21,11 @@ class QLabel;
class QSpinBox;
class QGroupBox;
class QRadioButton;
class QCheckBox;
/** C++ Include Headers */
#include <string>
using namespace std;
class ActionsWidget : public QFrame{
@ -24,18 +34,38 @@ class ActionsWidget : public QFrame{
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, int scanType, int id);
ActionsWidget(QWidget *parent, multiSlsDetector*& detector, int scanType, int id);
~ActionsWidget();
/**set variable expand
*/
void SetExpand(bool expanded){expand = expanded;};
/**get variable expand
*/
bool isExpanded(){return expand;};
/**to update the widgets*/
void Refresh();
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;
@ -60,6 +90,12 @@ private:
QComboBox *comboSpecific;
QLineEdit *dispValues;
QPushButton *btnValues;
QSpinBox *spinNumPos;
QComboBox *comboPos;
QPushButton *btnDelete;
QCheckBox *chkInvert;
QCheckBox *chkSeparate;
QCheckBox *chkReturn;
/** Sets up the widget
*/
@ -68,6 +104,12 @@ private:
/** 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
@ -82,10 +124,26 @@ void EnableSizeWidgets();
* */
void BrowsePath();
/** Sets the script file
* */
void SetScriptFile();
/** Set Parameter
* @param parameter is the parameter to be set to
* */
void SetParameter(const QString& parameter);
/** Sets the number of positions
* */
void SetNumPositions(int index);
/** Deletes current position
* */
void DeletePosition();
signals:
void EnableScanBox(bool,int);
void SetScriptSignal(QString&,int);
};

View File

@ -91,7 +91,13 @@ public:
void StartStopDaqToggle(bool stop_if_running=0);
/** Set number of measurements
* @param num number of measurements to be set */
void setNumMeasurements(int num);
void setNumMeasurements(int num){number_of_measurements = num;};
/** Set frame enabled
* @param enable enable*/
void setFrameEnabled(bool enable){isFrameEnabled = enable;};
/** Set trigger enabled
* @param enable enable */
void setTriggerEnabled(bool enable){isTriggerEnabled = enable;};
private:
@ -212,6 +218,10 @@ private:
/** every nth frame when to plot */
int frameFactor;
bool plotLock;
/**if frame is enabled in measurement tab */
bool isFrameEnabled;
/**if trigger is enabled in measurement tab */
bool isTriggerEnabled;
/** Initializes all its members and the thread */

View File

@ -11,7 +11,7 @@
/** Project Class Headers */
class multiSlsDetector;
class ActionsWidget;
/** Qt Include Headers */
#include <QWidget>
#include <QPushButton>
#include <QLabel>
@ -57,9 +57,6 @@ private:
QPushButton *btnExpand[NUM_ACTION_WIDGETS];
QLabel *lblName[NUM_ACTION_WIDGETS];
enum{Start,Scan0,Scan1,ActionBefore,NumPositions,
HeaderBefore,HeaderAfter,ActionAfter,Stop};
/** Sets up the widget */
void SetupWidgetWindow();
@ -67,14 +64,11 @@ private:
void Initialization();
private slots:
/** To Expand the Action Widget */
void Expand(QAbstractButton *button);
/** To set the script of action widget
* @param fName name of script
* @param index id of action widget*/
void SetScript(const QString& fName,int index);
signals:
void EnableScanBox(bool,int);

View File

@ -53,9 +53,6 @@ private:
*/
void Initialization();
/** Enables/Disables all the widgets
*/
void Enable(bool enable);
};