mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 15:00:02 +02:00
made number of measurements static
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@13 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
parent
31b65642cb
commit
b3de7a9051
@ -108,7 +108,7 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
/** Number of Measurements */
|
/** Number of Measurements */
|
||||||
int numberOfMeasurements;
|
static int numberOfMeasurements;
|
||||||
/** currentFrame */
|
/** currentFrame */
|
||||||
static int currentFrame;
|
static int currentFrame;
|
||||||
/** Number of Exposures */
|
/** Number of Exposures */
|
||||||
|
@ -26,14 +26,13 @@ using namespace std;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
//int numberOfMeasurements;
|
/** Static Members */
|
||||||
|
int qDrawPlot::numberOfMeasurements;
|
||||||
int qDrawPlot::currentFrame;
|
int qDrawPlot::currentFrame;
|
||||||
int qDrawPlot::number_of_exposures;
|
int qDrawPlot::number_of_exposures;
|
||||||
//double framePeriod;
|
|
||||||
//double acquisitionTime;
|
|
||||||
pthread_mutex_t qDrawPlot::last_image_complete_mutex;
|
pthread_mutex_t qDrawPlot::last_image_complete_mutex;
|
||||||
//std::string imageTitle;
|
|
||||||
|
|
||||||
unsigned int qDrawPlot::plot_in_scope;
|
unsigned int qDrawPlot::plot_in_scope;
|
||||||
unsigned int qDrawPlot::nPixelsX;
|
unsigned int qDrawPlot::nPixelsX;
|
||||||
@ -57,8 +56,9 @@ int qDrawPlot::currentPersistency;
|
|||||||
int qDrawPlot::progress;
|
int qDrawPlot::progress;
|
||||||
bool qDrawPlot::plotEnable;
|
bool qDrawPlot::plotEnable;
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
qDrawPlot::qDrawPlot(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector),numberOfMeasurements(1){
|
qDrawPlot::qDrawPlot(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector){
|
||||||
if(myDet) {
|
if(myDet) {
|
||||||
SetupWidgetWindow();
|
SetupWidgetWindow();
|
||||||
Initialization();
|
Initialization();
|
||||||
@ -66,6 +66,7 @@ qDrawPlot::qDrawPlot(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
qDrawPlot::~qDrawPlot(){
|
qDrawPlot::~qDrawPlot(){
|
||||||
/** Clear plot*/
|
/** Clear plot*/
|
||||||
@ -78,11 +79,13 @@ qDrawPlot::~qDrawPlot(){
|
|||||||
for(int i=0;i<MAXCloneWindows;i++) delete winClone[i];
|
for(int i=0;i<MAXCloneWindows;i++) delete winClone[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qDrawPlot::SetupWidgetWindow(){
|
void qDrawPlot::SetupWidgetWindow(){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout<<"Setting up plot variables"<<endl;
|
cout<<"Setting up plot variables"<<endl;
|
||||||
#endif
|
#endif
|
||||||
|
numberOfMeasurements=1;
|
||||||
stop_signal = 0;
|
stop_signal = 0;
|
||||||
pthread_mutex_init(&last_image_complete_mutex,NULL);
|
pthread_mutex_init(&last_image_complete_mutex,NULL);
|
||||||
gui_acquisition_thread_running = 0;
|
gui_acquisition_thread_running = 0;
|
||||||
@ -160,8 +163,7 @@ void qDrawPlot::SetupWidgetWindow(){
|
|||||||
plotLayout->addWidget(plot2D,1,1,1,1);
|
plotLayout->addWidget(plot2D,1,1,1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qDrawPlot::Initialization(){
|
void qDrawPlot::Initialization(){
|
||||||
connect(this, SIGNAL(InterpolateSignal(bool)),plot2D, SIGNAL(InterpolateSignal(bool)));
|
connect(this, SIGNAL(InterpolateSignal(bool)),plot2D, SIGNAL(InterpolateSignal(bool)));
|
||||||
@ -173,8 +175,7 @@ void qDrawPlot::Initialization(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qDrawPlot::StartStopDaqToggle(bool stop_if_running){
|
void qDrawPlot::StartStopDaqToggle(bool stop_if_running){
|
||||||
static bool running = 1;
|
static bool running = 1;
|
||||||
@ -187,8 +188,7 @@ void qDrawPlot::StartStopDaqToggle(bool stop_if_running){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qDrawPlot::StartDaq(bool start){
|
void qDrawPlot::StartDaq(bool start){
|
||||||
if(start){
|
if(start){
|
||||||
@ -216,9 +216,7 @@ void qDrawPlot::StartDaq(bool start){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int qDrawPlot::ResetDaqForGui(){
|
int qDrawPlot::ResetDaqForGui(){
|
||||||
if(!StopDaqForGui()) return 0;
|
if(!StopDaqForGui()) return 0;
|
||||||
@ -226,11 +224,7 @@ int qDrawPlot::ResetDaqForGui(){
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool qDrawPlot::StartOrStopThread(bool start){
|
bool qDrawPlot::StartOrStopThread(bool start){
|
||||||
static pthread_t gui_acquisition_thread;
|
static pthread_t gui_acquisition_thread;
|
||||||
@ -274,15 +268,14 @@ bool qDrawPlot::StartOrStopThread(bool start){
|
|||||||
return gui_acquisition_thread_running;
|
return gui_acquisition_thread_running;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void* qDrawPlot::DataStartAcquireThread(void *this_pointer){
|
void* qDrawPlot::DataStartAcquireThread(void *this_pointer){
|
||||||
((qDrawPlot*)this_pointer)->myDet->acquire(1);
|
((qDrawPlot*)this_pointer)->myDet->acquire(1);
|
||||||
return this_pointer;
|
return this_pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
int qDrawPlot::GetDataCallBack(detectorData *data){
|
int qDrawPlot::GetDataCallBack(detectorData *data){
|
||||||
#ifdef VERYVERBOSE
|
#ifdef VERYVERBOSE
|
||||||
@ -350,14 +343,13 @@ int qDrawPlot::GetDataCallBack(detectorData *data){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qDrawPlot::setNumMeasurements(int num){
|
void qDrawPlot::setNumMeasurements(int num){
|
||||||
numberOfMeasurements = num;
|
numberOfMeasurements = num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qDrawPlot::SelectPlot(int i){ //1 for 1D otherwise 2D
|
void qDrawPlot::SelectPlot(int i){ //1 for 1D otherwise 2D
|
||||||
if(i==1){
|
if(i==1){
|
||||||
@ -378,16 +370,14 @@ void qDrawPlot::SelectPlot(int i){ //1 for 1D otherwise 2D
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qDrawPlot::Clear1DPlot(){
|
void qDrawPlot::Clear1DPlot(){
|
||||||
for(QVector<SlsQtH1D*>::iterator h = plot1D_hists.begin();
|
for(QVector<SlsQtH1D*>::iterator h = plot1D_hists.begin();
|
||||||
h!=plot1D_hists.end();h++) (*h)->Detach(plot1D); //clear plot
|
h!=plot1D_hists.end();h++) (*h)->Detach(plot1D); //clear plot
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qDrawPlot::UpdatePlot(){
|
void qDrawPlot::UpdatePlot(){
|
||||||
static int last_plot_number = 0;
|
static int last_plot_number = 0;
|
||||||
@ -448,16 +438,13 @@ void qDrawPlot::UpdatePlot(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qDrawPlot::StopUpdatePlot(){
|
void qDrawPlot::StopUpdatePlot(){
|
||||||
plot_update_timer->stop();
|
plot_update_timer->stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
/**----------------------------CLONES-------------------------*/
|
|
||||||
|
|
||||||
|
|
||||||
void qDrawPlot::ClonePlot(){
|
void qDrawPlot::ClonePlot(){
|
||||||
int i=0;
|
int i=0;
|
||||||
@ -504,9 +491,10 @@ void qDrawPlot::ClonePlot(){
|
|||||||
|
|
||||||
/** to remember which all clone widgets were closed*/
|
/** to remember which all clone widgets were closed*/
|
||||||
connect(winClone[i], SIGNAL(CloneClosedSignal(int)),this, SLOT(CloneCloseEvent(int)));
|
connect(winClone[i], SIGNAL(CloneClosedSignal(int)),this, SLOT(CloneCloseEvent(int)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qDrawPlot::CloseClones(){
|
void qDrawPlot::CloseClones(){
|
||||||
for(int i=0;i<MAXCloneWindows;i++)
|
for(int i=0;i<MAXCloneWindows;i++)
|
||||||
if(winClone[i])
|
if(winClone[i])
|
||||||
@ -514,6 +502,7 @@ void qDrawPlot::CloseClones(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qDrawPlot::CloneCloseEvent(int id){
|
void qDrawPlot::CloneCloseEvent(int id){
|
||||||
winClone[id]=0;
|
winClone[id]=0;
|
||||||
@ -522,12 +511,8 @@ void qDrawPlot::CloneCloseEvent(int id){
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**----------------------------SAVE-------------------------*/
|
|
||||||
void qDrawPlot::SavePlot(QString FName){
|
void qDrawPlot::SavePlot(QString FName){
|
||||||
QImage img(size().width(),size().height(),QImage::Format_RGB32);
|
QImage img(size().width(),size().height(),QImage::Format_RGB32);
|
||||||
QPainter painter(&img);
|
QPainter painter(&img);
|
||||||
@ -535,7 +520,7 @@ void qDrawPlot::SavePlot(QString FName){
|
|||||||
img.save(FName);
|
img.save(FName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qDrawPlot::SetPersistency(int val){
|
void qDrawPlot::SetPersistency(int val){
|
||||||
for(int i=0;i<=val;i++){
|
for(int i=0;i<=val;i++){
|
||||||
@ -545,8 +530,7 @@ void qDrawPlot::SetPersistency(int val){
|
|||||||
persistency = val;
|
persistency = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qDrawPlot::EnablePlot(bool enable){
|
void qDrawPlot::EnablePlot(bool enable){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
@ -557,8 +541,7 @@ void qDrawPlot::EnablePlot(bool enable){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qDrawPlot::DisableZoom(bool disable){
|
void qDrawPlot::DisableZoom(bool disable){
|
||||||
if(plot_in_scope==1)
|
if(plot_in_scope==1)
|
||||||
@ -566,3 +549,5 @@ void qDrawPlot::DisableZoom(bool disable){
|
|||||||
else
|
else
|
||||||
plot2D->GetPlot()->DisableZoom(disable);
|
plot2D->GetPlot()->DisableZoom(disable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user