mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 14:33:45 +02:00
updated plot to show index instead of frame number
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@36 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
parent
1ce04ef785
commit
cc176ea404
@ -36,6 +36,9 @@ class qCloneWidget;
|
|||||||
class qDrawPlot:public QWidget{
|
class qDrawPlot:public QWidget{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** \short The constructor */
|
/** \short The constructor */
|
||||||
qDrawPlot(QWidget *parent,multiSlsDetector*& detector);
|
qDrawPlot(QWidget *parent,multiSlsDetector*& detector);
|
||||||
@ -100,7 +103,99 @@ public:
|
|||||||
void setTriggerEnabled(bool enable){isTriggerEnabled = enable;};
|
void setTriggerEnabled(bool enable){isTriggerEnabled = enable;};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
/** To select 1D or 2D plot
|
||||||
|
@param i is 1 for 1D, else 2D plot */
|
||||||
|
void SelectPlot(int i=2);
|
||||||
|
/** To select 1D plot */
|
||||||
|
void Select1DPlot() {SelectPlot(1);}
|
||||||
|
/** To select 2D plot */
|
||||||
|
void Select2DPlot() {SelectPlot(2);}
|
||||||
|
/** To clear plot */
|
||||||
|
void Clear1DPlot();
|
||||||
|
/** Creates a clone of the plot */
|
||||||
|
void ClonePlot();
|
||||||
|
/** Closes all the clone plots */
|
||||||
|
void CloseClones();
|
||||||
|
/** To Save plot */
|
||||||
|
void SavePlot();
|
||||||
|
/** Sets persistency from plot tab */
|
||||||
|
void SetPersistency(int val);
|
||||||
|
/** sets style of plot to dotted */
|
||||||
|
void SetDottedPlot(bool enable){plotDotted = enable;};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/** Initializes all its members and the thread */
|
||||||
|
void Initialization();
|
||||||
|
/** Sets up the widget */
|
||||||
|
void SetupWidgetWindow();
|
||||||
|
|
||||||
|
|
||||||
|
/** Gets the image title */
|
||||||
|
const char* GetImageTitle() {return imageTitle.c_str();}
|
||||||
|
/** Gets the hist title for a 1D plot */
|
||||||
|
const char* GetHistTitle(int i) {return (i>=0&&i<MAX_1DPLOTS) ? histTitle[i].c_str():0;} //int for hist number
|
||||||
|
/** Gets the y axis value for the hist in 1D plot */
|
||||||
|
double* GetHistYAxis(int i) {return (i>=0&&i<MAX_1DPLOTS) ? histYAxis[i]:0;} //int for hist number
|
||||||
|
|
||||||
|
|
||||||
|
/** Locks the image to update plot */
|
||||||
|
int LockLastImageArray() {return pthread_mutex_lock(&last_image_complete_mutex); }
|
||||||
|
/** Unocks the image to update plot */
|
||||||
|
int UnlockLastImageArray() {return pthread_mutex_unlock(&last_image_complete_mutex);}
|
||||||
|
/** Starts the acquisition */
|
||||||
|
int StartDaqForGui() {return StartOrStopThread(1) ? 1:0;}
|
||||||
|
/** Stops the acquisition */
|
||||||
|
int StopDaqForGui() {return StartOrStopThread(0) ? 0:1;}
|
||||||
|
/** Starts/stops Acquisition Thread */
|
||||||
|
bool StartOrStopThread(bool start);
|
||||||
|
/** Resets the acquisition parameter like lastimagenumber */
|
||||||
|
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 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);
|
||||||
|
/** This is called by the detector class to copy the scan data it jus acquired */
|
||||||
|
static int GetScanDataCallBack(detectorData *data, void *this_pointer);
|
||||||
|
/** This is called by the GetDataCallBack function to copy the scan data */
|
||||||
|
int GetScanData(detectorData *data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
/** To update plot */
|
||||||
|
void UpdatePlot();
|
||||||
|
/** To stop updating plot */
|
||||||
|
void StopUpdatePlot();
|
||||||
|
/** To start or stop acquisition
|
||||||
|
* @param start is 1 to start and 0 to stop acquisition */
|
||||||
|
void StartDaq(bool start);
|
||||||
|
/** To set the reference to zero after closing a clone
|
||||||
|
* @param id is the id of the clone */
|
||||||
|
void CloneCloseEvent(int id);
|
||||||
|
|
||||||
|
void UpdatePause(){data_pause_over=true;};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** The sls detector object */
|
/** The sls detector object */
|
||||||
multiSlsDetector *myDet;
|
multiSlsDetector *myDet;
|
||||||
|
|
||||||
@ -233,79 +328,10 @@ private:
|
|||||||
/**if trigger is enabled in measurement tab */
|
/**if trigger is enabled in measurement tab */
|
||||||
bool isTriggerEnabled;
|
bool isTriggerEnabled;
|
||||||
|
|
||||||
|
/** scan arguments*/
|
||||||
/** Initializes all its members and the thread */
|
enum scanArguments{None,Level0,Level1,FileIndex,AllFrames};
|
||||||
void Initialization();
|
|
||||||
/** Sets up the widget */
|
|
||||||
void SetupWidgetWindow();
|
|
||||||
|
|
||||||
|
|
||||||
/** Gets the image title */
|
|
||||||
const char* GetImageTitle() {return imageTitle.c_str();}
|
|
||||||
/** Gets the hist title for a 1D plot */
|
|
||||||
const char* GetHistTitle(int i) {return (i>=0&&i<MAX_1DPLOTS) ? histTitle[i].c_str():0;} //int for hist number
|
|
||||||
/** Gets the y axis value for the hist in 1D plot */
|
|
||||||
double* GetHistYAxis(int i) {return (i>=0&&i<MAX_1DPLOTS) ? histYAxis[i]:0;} //int for hist number
|
|
||||||
|
|
||||||
|
|
||||||
/** Locks the image to update plot */
|
|
||||||
int LockLastImageArray() {return pthread_mutex_lock(&last_image_complete_mutex); }
|
|
||||||
/** Unocks the image to update plot */
|
|
||||||
int UnlockLastImageArray() {return pthread_mutex_unlock(&last_image_complete_mutex);}
|
|
||||||
/** Starts the acquisition */
|
|
||||||
int StartDaqForGui() {return StartOrStopThread(1) ? 1:0;}
|
|
||||||
/** Stops the acquisition */
|
|
||||||
int StopDaqForGui() {return StartOrStopThread(0) ? 0:1;}
|
|
||||||
/** Starts/stops Acquisition Thread */
|
|
||||||
bool StartOrStopThread(bool start);
|
|
||||||
/** Resets the acquisition parameter like lastimagenumber */
|
|
||||||
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 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);
|
|
||||||
/** This is called by the detector class to copy the scan data it jus acquired */
|
|
||||||
static int GetScanDataCallBack(detectorData *data, void *this_pointer);
|
|
||||||
/** This is called by the GetDataCallBack function to copy the scan data */
|
|
||||||
int GetScanData(detectorData *data);
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
/** To select 1D or 2D plot
|
|
||||||
@param i is 1 for 1D, else 2D plot */
|
|
||||||
void SelectPlot(int i=2);
|
|
||||||
/** To select 1D plot */
|
|
||||||
void Select1DPlot() {SelectPlot(1);}
|
|
||||||
/** To select 2D plot */
|
|
||||||
void Select2DPlot() {SelectPlot(2);}
|
|
||||||
/** To clear plot */
|
|
||||||
void Clear1DPlot();
|
|
||||||
/** Creates a clone of the plot */
|
|
||||||
void ClonePlot();
|
|
||||||
/** Closes all the clone plots */
|
|
||||||
void CloseClones();
|
|
||||||
/** To Save plot */
|
|
||||||
void SavePlot();
|
|
||||||
/** Sets persistency from plot tab */
|
|
||||||
void SetPersistency(int val);
|
|
||||||
/** sets style of plot to dotted */
|
|
||||||
void SetDottedPlot(bool enable){plotDotted = enable;};
|
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
/** To update plot */
|
|
||||||
void UpdatePlot();
|
|
||||||
/** To stop updating plot */
|
|
||||||
void StopUpdatePlot();
|
|
||||||
/** To start or stop acquisition
|
|
||||||
* @param start is 1 to start and 0 to stop acquisition */
|
|
||||||
void StartDaq(bool start);
|
|
||||||
/** To set the reference to zero after closing a clone
|
|
||||||
* @param id is the id of the clone */
|
|
||||||
void CloneCloseEvent(int id);
|
|
||||||
|
|
||||||
void UpdatePause(){data_pause_over=true;};
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void UpdatingPlotFinished();
|
void UpdatingPlotFinished();
|
||||||
|
@ -534,6 +534,10 @@ void qTabPlot::EnablingNthFrameFunction(bool enable){
|
|||||||
|
|
||||||
void qTabPlot::SetScanArgument(){
|
void qTabPlot::SetScanArgument(){
|
||||||
switch(btnGroupScan->checkedId()){
|
switch(btnGroupScan->checkedId()){
|
||||||
|
|
||||||
|
//let qdrawplot know which scan argument
|
||||||
|
//myPlot->
|
||||||
|
|
||||||
//level0
|
//level0
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user