l_maliakal_d 63fadd3633 added color to collapse in actions, changed angular for number of data to be received, corrected constant size scan widget
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@48 af1100a4-978c-4157-bff7-07162d2ba061
2012-09-04 10:30:18 +00:00

133 lines
2.5 KiB
C++

/*
* qTabActions.h
*
* Created on: May 10, 2012
* Author: l_maliakal_d
*/
#ifndef QTABACTIONS_H_
#define QTABACTIONS_H_
/* Qt Project Class Headers */
#include "qActionsWidget.h"
#include "qScanWidget.h"
/** C++ Project Class Headers */
class multiSlsDetector;
#include "sls_detector_defs.h"
/** Qt Include Headers */
#include <QWidget>
#include <QPushButton>
#include <QSpinBox>
#include <QComboBox>
#include <QCheckBox>
#include <QLabel>
#include <QScrollArea>
#include <QGridLayout>
#include <QPalette>
/**
*@short sets up the acions parameters
*/
class qTabActions:public QWidget{
Q_OBJECT
public:
/** \short The constructor
* @param parent is the parent tab widget
* @param detector is the detector returned from the detector tab
*/
qTabActions(QWidget *parent,multiSlsDetector*& detector);
/** Destructor
*/
~qTabActions();
/** To refresh and update widgets
*/
void Refresh();
public slots:
/** Disable Positions
* @param enable true if to disable
* */
void EnablePositions(bool enable);
private:
/** Sets up the widget */
void SetupWidgetWindow();
/** 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);
/** Updates to green color if collapsed and mode not none
*/
void UpdateCollapseColors();
/** The sls detector object */
multiSlsDetector *myDet;
slsDetectorDefs::detectorType detType;
enum actionIndex{Scan0=1, Scan1, NumPositions=4, NumTotalActions=9};
QGridLayout *gridLayout;
QButtonGroup *group;
QPalette *palette;
/** 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;
double *positions;
QPalette normal;
private slots:
/** 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();
};
#endif /* QTABACTIONS_H_ */