mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
snapshot works,id works, conversion from seconds to ms,us etc works, number of measurements works
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@14 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
5
slsDetectorGui/include/icons.qrc
Normal file
5
slsDetectorGui/include/icons.qrc
Normal file
@ -0,0 +1,5 @@
|
||||
<RCC version="1.0">
|
||||
<qresource prefix="/icons">
|
||||
<file>../images/mountain.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -13,7 +13,10 @@ class SlsQtH1D;
|
||||
class SlsQt1DPlot;
|
||||
class SlsQt2DPlotLayout;
|
||||
/** Qt Include Headers */
|
||||
#include <QFrame>
|
||||
#include <QMainWindow>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#include <QAction>
|
||||
#include <QGridLayout>
|
||||
#include <QCloseEvent>
|
||||
#include <QGroupBox>
|
||||
@ -31,7 +34,7 @@ using namespace std;
|
||||
/**
|
||||
*@short Sets up the clone plot widget
|
||||
*/
|
||||
class qCloneWidget:public QFrame{
|
||||
class qCloneWidget:public QMainWindow{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@ -77,6 +80,10 @@ private:
|
||||
QVector<SlsQtH1D*> cloneplot1D_hists;
|
||||
|
||||
|
||||
QMenuBar *menubar;
|
||||
// QMenu *menuFile;
|
||||
QAction *actionSave;
|
||||
|
||||
QGridLayout *mainLayout;
|
||||
QGroupBox *cloneBox;
|
||||
QGridLayout *gridClone;
|
||||
@ -90,6 +97,8 @@ private:
|
||||
QCheckBox *chkAutoFName;
|
||||
QCheckBox *chkSaveAll;
|
||||
|
||||
/** Gets the current time stamp for the window title*/
|
||||
char* GetCurrentTimeStamp();
|
||||
|
||||
|
||||
private slots:
|
||||
|
@ -54,6 +54,40 @@ public:
|
||||
return valueNS;
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/** returns the time in the appropriate time unit
|
||||
* @param unit unit of time
|
||||
* @param value time in seconds
|
||||
* returns the corresponding time value
|
||||
*/
|
||||
static float getCorrectTime(timeUnit& unit, float value){
|
||||
int intUnit = (int)SECONDS;
|
||||
|
||||
/** hr, min, sec */
|
||||
if(value>=1){
|
||||
float newVal = value;
|
||||
while((newVal>=1)&&(intUnit>=(int)HOURS)){
|
||||
/** value retains the old value */
|
||||
value = newVal;
|
||||
newVal = value/60;
|
||||
intUnit--;
|
||||
}
|
||||
/** returning the previous value*/
|
||||
unit = (timeUnit)(intUnit+1);
|
||||
return value;
|
||||
}
|
||||
/** ms, us, ns */
|
||||
else{
|
||||
while((value<1)&&(intUnit<(int)NANOSECONDS)){
|
||||
value = value*1000;
|
||||
intUnit++;
|
||||
}
|
||||
unit = (timeUnit)(intUnit);
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**displays an error message
|
||||
|
@ -62,6 +62,8 @@ private:
|
||||
QApplication *theApp;
|
||||
/** The sls detector object */
|
||||
slsDetectorUtils *myDet;
|
||||
/** sls detector id */
|
||||
int detID;
|
||||
/** The Plot widget */
|
||||
qDrawPlot *myPlot;
|
||||
/**Tab Widget */
|
||||
@ -74,6 +76,7 @@ private:
|
||||
int heightCentralWidget;
|
||||
/** The default zooming tool tip */
|
||||
QString zoomToolTip;
|
||||
|
||||
/** The default tab heading color */
|
||||
QColor defaultTabColor;
|
||||
/** enumeration of the tabs */
|
||||
@ -97,6 +100,7 @@ private:
|
||||
/**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
|
||||
*/
|
||||
|
@ -108,22 +108,24 @@ private:
|
||||
|
||||
|
||||
/** Number of Measurements */
|
||||
static int numberOfMeasurements;
|
||||
int number_of_measurements;
|
||||
/** Current Measurement */
|
||||
int currentMeasurement;
|
||||
/** currentFrame */
|
||||
static int currentFrame;
|
||||
int currentFrame;
|
||||
/** Number of Exposures */
|
||||
static int number_of_exposures;
|
||||
int number_of_exposures;
|
||||
/** Duration between Exposures */
|
||||
double framePeriod;
|
||||
double acquisitionPeriod;
|
||||
/** Acquisition Time */
|
||||
double acquisitionTime;
|
||||
double exposureTime;
|
||||
|
||||
|
||||
/**variables for threads */
|
||||
/** */
|
||||
volatile bool stop_signal;
|
||||
/** */
|
||||
static pthread_mutex_t last_image_complete_mutex;
|
||||
pthread_mutex_t last_image_complete_mutex;
|
||||
|
||||
/**variables for histograms */
|
||||
/** X Axis Title in 2D */
|
||||
@ -137,37 +139,38 @@ private:
|
||||
/** Y Axis Title in 1D */
|
||||
QString histYAxisTitle;
|
||||
/** Title for all the graphs in 1D */
|
||||
static std::string histTitle[MAX_1DPLOTS];
|
||||
std::string histTitle[MAX_1DPLOTS];
|
||||
/** Title in 2D */
|
||||
static std::string imageTitle;
|
||||
std::string imageTitle;
|
||||
/** 1D or 2D */
|
||||
static unsigned int plot_in_scope;
|
||||
unsigned int plot_in_scope;
|
||||
/** Number of Pixels in X Axis */
|
||||
static unsigned int nPixelsX;
|
||||
unsigned int nPixelsX;
|
||||
/** Number of Pixels in Y Axis */
|
||||
static unsigned int nPixelsY;
|
||||
unsigned int nPixelsY;
|
||||
/** Current Image Number */
|
||||
static unsigned int lastImageNumber;
|
||||
unsigned int lastImageNumber;
|
||||
int last_plot_number;
|
||||
|
||||
/** Number of graphs in 1D */
|
||||
static unsigned int nHists;
|
||||
unsigned int nHists;
|
||||
/** Total Number of X axis values/channels in 1D */
|
||||
static int histNBins;
|
||||
int histNBins;
|
||||
/** X Axis value in 1D */
|
||||
static double* histXAxis;
|
||||
double* histXAxis;
|
||||
/** Y Axis value in 1D */
|
||||
static double* histYAxis[MAX_1DPLOTS];
|
||||
double* histYAxis[MAX_1DPLOTS];
|
||||
/** Current Image Values in 2D */
|
||||
static double* lastImageArray;
|
||||
double* lastImageArray;
|
||||
/** temporary Y Axis value in 1D */
|
||||
static double* yvalues[MAX_1DPLOTS];
|
||||
double* yvalues[MAX_1DPLOTS];
|
||||
/** temporary Image Values in 2D */
|
||||
static double* image_data;
|
||||
static bool gui_acquisition_thread_running;
|
||||
static int persistency;
|
||||
static int currentPersistency;
|
||||
static int progress;
|
||||
static bool plotEnable;
|
||||
double* image_data;
|
||||
//bool gui_acquisition_thread_running;
|
||||
int persistency;
|
||||
int currentPersistency;
|
||||
int progress;
|
||||
bool plotEnable;
|
||||
|
||||
/** Initializes all its members and the thread */
|
||||
void Initialization();
|
||||
@ -197,8 +200,10 @@ private:
|
||||
int ResetDaqForGui();
|
||||
/** The function which is called when start acquisition thread is created */
|
||||
static void* DataStartAcquireThread(void *this_pointer);
|
||||
/** This is called by the detector class to copt the data it jus acquired */
|
||||
static int GetDataCallBack(detectorData *data);
|
||||
/** This is called by the detector class to copy the data it jus acquired */
|
||||
static int GetDataCallBack(detectorData *data, void *this_pointer);
|
||||
/** This is called by the GetDataCallBack function to copy the data */
|
||||
int GetData(detectorData *data);
|
||||
|
||||
|
||||
public slots:
|
||||
|
@ -23,8 +23,9 @@ public:
|
||||
/** \short The constructor
|
||||
* @param parent is the parent tab widget
|
||||
* @param detector is the detector returned from the detector tab
|
||||
* @param detID is the id of the detector
|
||||
*/
|
||||
qTabSettings(QWidget *parent,slsDetectorUtils*& detector);
|
||||
qTabSettings(QWidget *parent,slsDetectorUtils*& detector,int detID);
|
||||
|
||||
/** Destructor
|
||||
*/
|
||||
@ -35,6 +36,10 @@ private:
|
||||
/** The sls detector object */
|
||||
slsDetectorUtils *myDet;
|
||||
|
||||
/** sls detector id */
|
||||
int detID;
|
||||
|
||||
|
||||
/** Sets up the widget
|
||||
*/
|
||||
void SetupWidgetWindow();
|
||||
@ -43,9 +48,6 @@ private:
|
||||
*/
|
||||
void Initialization();
|
||||
|
||||
/** Enables/Disables all the widgets
|
||||
*/
|
||||
void Enable(bool enable);
|
||||
|
||||
|
||||
private slots:
|
||||
|
Reference in New Issue
Block a user