mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 01:58:00 +02:00
Version 1 with the action tab working
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@6 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
84
slsDetectorGui/include/qActionsWidget.h
Normal file
84
slsDetectorGui/include/qActionsWidget.h
Normal file
@ -0,0 +1,84 @@
|
||||
/*
|
||||
* qTabActions.h
|
||||
*
|
||||
* Created on: May 10, 2012
|
||||
* Author: l_maliakal_d
|
||||
*/
|
||||
|
||||
#ifndef QACTIONSWIDGET_H_
|
||||
#define QACTIONSWIDGET_H_
|
||||
#include <QFrame>
|
||||
class QGridLayout;
|
||||
class QComboBox;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QLabel;
|
||||
class QSpinBox;
|
||||
class QGroupBox;
|
||||
class QRadioButton;
|
||||
|
||||
|
||||
class ActionsWidget : public QFrame{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/** \short The constructor
|
||||
* @param parent is the parent tab widget
|
||||
* @param detector is the detector returned from the detector tab
|
||||
*/
|
||||
ActionsWidget(QWidget *parent, int scanType);
|
||||
|
||||
~ActionsWidget();
|
||||
|
||||
private:
|
||||
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;
|
||||
|
||||
/** Sets up the widget
|
||||
* @param scanType 1 if it includes Threshold Scan,Energy Scan and Trimbits Scan, else 0*/
|
||||
void SetupWidgetWindow(int scanType);
|
||||
|
||||
/** 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();
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* QACTIONSWIDGET_H_ */
|
||||
|
@ -25,6 +25,23 @@ class slsDetectorUtils;
|
||||
/** Qt Include Headers */
|
||||
#include <QScrollArea>
|
||||
#include <QGridLayout>
|
||||
#include <QResizeEvent>
|
||||
|
||||
class MyTabWidget:public QTabWidget
|
||||
{
|
||||
public:
|
||||
MyTabWidget(QWidget* parent = 0)
|
||||
{
|
||||
setParent(parent);
|
||||
}
|
||||
|
||||
//Overridden method from QTabWidget
|
||||
QTabBar* tabBar()
|
||||
{
|
||||
return QTabWidget::tabBar();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
*@short Main window of the GUI.
|
||||
@ -56,12 +73,13 @@ private:
|
||||
/** The Plot widget */
|
||||
qDrawPlot *myPlot;
|
||||
/**Tab Widget */
|
||||
QTabWidget *tabs;
|
||||
MyTabWidget *tabs;
|
||||
/**Layout of the central Widget */
|
||||
QGridLayout *layoutTabs;
|
||||
/** height of Plot Window when undocked */
|
||||
/** default height of Plot Window when docked */
|
||||
int heightPlotWindow;
|
||||
|
||||
/** default height of central widgetwhen plot Window when docked */
|
||||
int heightCentralWidget;
|
||||
/** enumeration of the tabs */
|
||||
enum {Measurement, DataOutput, Plot, Actions, Settings, Advanced, Debugging, Developer, NumberOfTabs };
|
||||
|
||||
@ -83,6 +101,8 @@ private:
|
||||
qTabDebugging *tab_debugging;
|
||||
/**Developer tab */
|
||||
qTabDeveloper *tab_developer;
|
||||
/**if the developer tab should be enabled,known from command line */
|
||||
int isDeveloper;
|
||||
|
||||
|
||||
/**Sets up the layout of the widget
|
||||
@ -163,6 +183,12 @@ void ResizeMainWindow(bool b);
|
||||
*/
|
||||
void SetTerminalWindowSize(bool b);
|
||||
|
||||
/** Enables/disables tabs depending on if acquisition is currently in progress
|
||||
*/
|
||||
void EnableTabs();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
|
||||
signals:
|
||||
|
||||
|
@ -8,15 +8,25 @@
|
||||
#ifndef QTABACTIONS_H_
|
||||
#define QTABACTIONS_H_
|
||||
|
||||
|
||||
/** Form Header */
|
||||
#include "ui_form_tab_actions.h"
|
||||
/** Project Class Headers */
|
||||
class slsDetectorUtils;
|
||||
class ActionsWidget;
|
||||
|
||||
|
||||
class QPushButton;
|
||||
class QLabel;
|
||||
class QScrollArea;
|
||||
class QGridLayout;
|
||||
class QPalette;
|
||||
|
||||
|
||||
/**
|
||||
*@short sets up the acions parameters
|
||||
*/
|
||||
class qTabActions:public QWidget, private Ui::TabActionsObject{
|
||||
class qTabActions:public QWidget,private Ui::TabActionsObject{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@ -35,18 +45,32 @@ private:
|
||||
/** The sls detector object */
|
||||
slsDetectorUtils *myDet;
|
||||
|
||||
/** Sets up the widget
|
||||
*/
|
||||
static const int NUM_ACTION_WIDGETS = 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];
|
||||
|
||||
/** Sets up the widget */
|
||||
void SetupWidgetWindow();
|
||||
|
||||
/** Sets up all the slots and signals
|
||||
*/
|
||||
/** Sets up all the slots and signals */
|
||||
void Initialization();
|
||||
|
||||
/** Enables/Disables all the widgets
|
||||
*/
|
||||
/** Enables/Disables all the widgets */
|
||||
void Enable(bool enable);
|
||||
|
||||
|
||||
private slots:
|
||||
/** To Expand the Action Widget */
|
||||
void Expand(QAbstractButton *button);
|
||||
|
||||
};
|
||||
|
||||
#endif /* QTABACTIONS_H_ */
|
||||
|
||||
|
@ -12,6 +12,9 @@
|
||||
#include "ui_form_tab_dataoutput.h"
|
||||
/** Project Class Headers */
|
||||
class slsDetectorUtils;
|
||||
/** Qt Include Headers */
|
||||
#include <QString>
|
||||
|
||||
|
||||
/**
|
||||
*@short sets up the DataOutput parameters
|
||||
@ -35,18 +38,28 @@ private:
|
||||
/** The sls detector object */
|
||||
slsDetectorUtils *myDet;
|
||||
|
||||
/** Sets up the widget
|
||||
*/
|
||||
/** Output Directory */
|
||||
QString outputDir;
|
||||
|
||||
/** methods */
|
||||
/** Sets up the widget */
|
||||
void SetupWidgetWindow();
|
||||
|
||||
/** Sets up all the slots and signals
|
||||
*/
|
||||
/** Sets up all the slots and signals */
|
||||
void Initialization();
|
||||
|
||||
/** Enables/Disables all the widgets
|
||||
*/
|
||||
/** Enables/Disables all the widgets */
|
||||
void Enable(bool enable);
|
||||
|
||||
|
||||
private slots:
|
||||
/** Sets the output directory
|
||||
* @param path output path to be set
|
||||
*/
|
||||
void setOutputDir(const QString& path);
|
||||
|
||||
/** Open dialog to choose the output directory */
|
||||
void browseOutputDir();
|
||||
};
|
||||
|
||||
|
||||
|
@ -70,6 +70,7 @@ private:
|
||||
|
||||
|
||||
public slots:
|
||||
|
||||
/** update plot is finished,
|
||||
* changes start/stop text and enables/disables all widgets
|
||||
*/
|
||||
@ -77,7 +78,6 @@ void UpdateFinished();
|
||||
|
||||
|
||||
|
||||
|
||||
private slots:
|
||||
/** Set file name
|
||||
* @param fName name of file
|
||||
@ -133,7 +133,8 @@ void setNumProbes(int val);
|
||||
|
||||
signals:
|
||||
|
||||
|
||||
void StartSignal();
|
||||
void StopSignal();
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user