bug fix: run index, plots only new data, lockimage for clone

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@83 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d 2012-10-01 15:45:47 +00:00
parent 7eb48a300d
commit 9fc66d571e
4 changed files with 87 additions and 73 deletions

View File

@ -21,7 +21,7 @@ public:
qDefs(){}; qDefs(){};
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
#define GUI_VERSION 0.11 #define GUI_VERSION 0.12
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -96,7 +96,7 @@ void qCloneWidget::SetupWidgetWindow(QString title,int numDim,SlsQt1DPlot*& plot
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qCloneWidget::SetCloneHists(int nHists,int histNBins,double* histXAxis,double* histYAxis[],string histTitle[],bool lines,bool markers){ void qCloneWidget::SetCloneHists(int nHists,int histNBins,double* histXAxis,double* histYAxis[],string histTitle[],bool lines,bool markers){
/** for each plot*/cout<<"qclone histYAxis[0][500]:"<<histYAxis[0][500]<<endl; /** for each plot*/
for(int hist_num=0;hist_num<nHists;hist_num++){ for(int hist_num=0;hist_num<nHists;hist_num++){
/** create hists */ /** create hists */
SlsQtH1D* k; SlsQtH1D* k;
@ -131,7 +131,7 @@ void qCloneWidget::SetCloneHists(int nHists,int histNBins,double* histXAxis,doub
void qCloneWidget::SetCloneHists(int nHists,int histNBins,double* histXAxis,double* histYAxis,string histTitle[],bool lines,bool markers){ void qCloneWidget::SetCloneHists(int nHists,int histNBins,double* histXAxis,double* histYAxis,string histTitle[],bool lines,bool markers){
/** for each plot*/cout<<"qclone angle nhists:"<<nHists<<endl; /** for each plot*/
for(int hist_num=0;hist_num<nHists;hist_num++){ for(int hist_num=0;hist_num<nHists;hist_num++){
/** create hists */ /** create hists */
SlsQtH1D* k; SlsQtH1D* k;

View File

@ -894,6 +894,8 @@ void qDrawPlot::UpdatePlot(){
// only if no plot isnt enabled // only if no plot isnt enabled
if(plotEnable){ if(plotEnable){
LockLastImageArray(); LockLastImageArray();
//so that it doesnt plot every single thing
if(lastImageNumber!=last_plot_number){
//1-d plot stuff //1-d plot stuff
if(plot_in_scope==1){ if(plot_in_scope==1){
if(lastImageNumber){ if(lastImageNumber){
@ -964,14 +966,14 @@ void qDrawPlot::UpdatePlot(){
if(saveAll) SavePlotAutomatic(); if(saveAll) SavePlotAutomatic();
} }
} }
} //}
last_plot_number=lastImageNumber; last_plot_number=lastImageNumber;
//set plot title //set plot title
boxPlot->setTitle(plotTitle); boxPlot->setTitle(plotTitle);
}
if(plotEnable) UnlockLastImageArray(); UnlockLastImageArray();
}
//if acqq stopped before this line, it continues from here, shouldnt restart plotting timer //if acqq stopped before this line, it continues from here, shouldnt restart plotting timer
if(!stop_signal){ if(!stop_signal){
@ -1042,15 +1044,16 @@ void qDrawPlot::ClonePlot(){
} }
if(found) winClone[i]->SetRange(IsXYRange,XYRangeValues); if(found) winClone[i]->SetRange(IsXYRange,XYRangeValues);
//copy data //copy data
LockLastImageArray(); //LockLastImageArray();
if(!anglePlot) if(!anglePlot)
winClone[i]->SetCloneHists((int)nHists,histNBins,histXAxis,histYAxis,histTitle,lines,markers); winClone[i]->SetCloneHists((int)nHists,histNBins,histXAxis,histYAxis,histTitle,lines,markers);
else else
winClone[i]->SetCloneHists((int)nHists,histNBins,histXAngleAxis,histYAngleAxis,histTitle,lines,markers); winClone[i]->SetCloneHists((int)nHists,histNBins,histXAngleAxis,histYAngleAxis,histTitle,lines,markers);
UnlockLastImageArray(); //UnlockLastImageArray();
} }
} }
else{ else{
plot2D = new SlsQt2DPlotLayout(boxPlot); plot2D = new SlsQt2DPlotLayout(boxPlot);
plot2D->setFont(QFont("Sans Serif",9,QFont::Normal)); plot2D->setFont(QFont("Sans Serif",9,QFont::Normal));
plot2D->setTitle(GetImageTitle()); plot2D->setTitle(GetImageTitle());

View File

@ -310,7 +310,12 @@ void qTabMeasurement::startStopAcquisition(){
emit StopSignal(); emit StopSignal();
myDet->stopAcquisition(); myDet->stopAcquisition();
progressTimer->stop(); progressTimer->stop();
spinIndex->setValue(myPlot->GetFileIndex()); //spin index
disconnect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(setRunIndex(int)));
spinIndex->setValue(myDet->getFileIndex());
lblProgressIndex->setText(QString::number(spinIndex->value()));
connect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(setRunIndex(int)));
btnStartStop->setText("Start"); btnStartStop->setText("Start");
btnStartStop->setIcon(*iconStart); btnStartStop->setIcon(*iconStart);
btnStartStop->setChecked(false); btnStartStop->setChecked(false);
@ -330,8 +335,14 @@ void qTabMeasurement::UpdateFinished(){
btnStartStop->setChecked(false); btnStartStop->setChecked(false);
Enable(1); Enable(1);
connect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition())); connect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
UpdateProgress(); UpdateProgress();
spinIndex->setValue(myPlot->GetFileIndex()); //spin index
disconnect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(setRunIndex(int)));
spinIndex->setValue(myDet->getFileIndex());
lblProgressIndex->setText(QString::number(spinIndex->value()));
connect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(setRunIndex(int)));
progressTimer->stop(); progressTimer->stop();
} }
} }
@ -352,7 +363,7 @@ void qTabMeasurement::SetCurrentMeasurement(int val){
void qTabMeasurement::UpdateProgress(){ void qTabMeasurement::UpdateProgress(){
progressBar->setValue((int)myPlot->GetProgress()); progressBar->setValue((int)myPlot->GetProgress());
lblProgressIndex->setText(QString::number(myPlot->GetFileIndex())); lblProgressIndex->setText(QString::number(myPlot->GetFileIndex()+1));
} }