bug fix: update measurement index, update index does not use sharedmemory, start run index updated after measurement

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@78 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d 2012-09-25 16:08:10 +00:00
parent cfce337c46
commit bdabf9e649
3 changed files with 14 additions and 19 deletions

View File

@ -163,8 +163,6 @@ private:
enum{None, Auto, Trigger_Exp_Series, Trigger_Frame, Trigger_Readout, Gated, Gated_Start, Trigger_Window, NumTimingModes};
/** timer to update the progress*/
QTimer *progressTimer;
/** current measurement */
int currentMeasurement;
/** tool tip variables*/
QString acqPeriodTip;
QString errPeriodTip;

View File

@ -618,7 +618,7 @@ int qDrawPlot::GetData(detectorData *data){
lastImageNumber= currentFrame+1;
//title
char temp_title[2000];
sprintf(temp_title,"Image Index %d",fileIOStatic::getFileIndexFromFileName(string(data->fileName)));
sprintf(temp_title,"Image Index %d",currentFileIndex);
imageTitle = temp_title;
//copy data
memcpy(lastImageArray+(currentScanDivLevel*nPixelsX),data->values,nPixelsX*sizeof(double));
@ -635,12 +635,11 @@ int qDrawPlot::GetData(detectorData *data){
while(1){
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
//variables
int currentIndex = fileIOStatic::getFileIndexFromFileName(string(data->fileName));
if(currentIndex == minPixelsY) currentScanDivLevel = 0;
if(currentFileIndex == minPixelsY) currentScanDivLevel = 0;
lastImageNumber= currentFrame+1;
//title
char temp_title[2000];
sprintf(temp_title,"Image Index %d",currentIndex);
sprintf(temp_title,"Image Index %d",currentFileIndex);
imageTitle = temp_title;
//copy data
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
@ -657,8 +656,8 @@ int qDrawPlot::GetData(detectorData *data){
while(1){
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
//get scanvariable0
int currentIndex = 0, p = 0; double cs0 = 0 , cs1 = 0;
fileIOStatic::getVariablesFromFileName(string(data->fileName), currentIndex, p, cs0, cs1);
int ci = 0, p = 0; double cs0 = 0 , cs1 = 0;
fileIOStatic::getVariablesFromFileName(string(data->fileName), ci, p, cs0, cs1);
cout<<"currentScanValue:"<<currentScanValue<<endl;
cout<<"cs0:"<<cs0<<endl;
//variables
@ -670,7 +669,7 @@ int qDrawPlot::GetData(detectorData *data){
lastImageNumber= currentFrame+1;
//title
char temp_title[2000];
sprintf(temp_title,"Image Index %d",currentIndex);
sprintf(temp_title,"Image Index %d",currentFileIndex);
imageTitle = temp_title;
//copy data
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
@ -685,8 +684,8 @@ int qDrawPlot::GetData(detectorData *data){
while(1){
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
//get scanvariable1
int currentIndex = 0, p = 0; double cs0 = 0 , cs1 = 0;
fileIOStatic::getVariablesFromFileName(string(data->fileName), currentIndex, p, cs0, cs1);
int ci = 0, p = 0; double cs0 = 0 , cs1 = 0;
fileIOStatic::getVariablesFromFileName(string(data->fileName), ci, p, cs0, cs1);
//variables
if(cs1!=currentScanValue){
if(backwardScanPlot) currentScanDivLevel--;
@ -696,7 +695,7 @@ int qDrawPlot::GetData(detectorData *data){
lastImageNumber= currentFrame+1;
//title
char temp_title[2000];
sprintf(temp_title,"Image Index %d",currentIndex);
sprintf(temp_title,"Image Index %d",currentFileIndex);
imageTitle = temp_title;
//copy data
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
@ -731,7 +730,7 @@ int qDrawPlot::GetData(detectorData *data){
//2d
else{
// Titles
sprintf(temp_title,"Image Index %d",fileIOStatic::getFileIndexFromFileName(string(data->fileName)));
sprintf(temp_title,"Image Index %d",currentFileIndex);
imageTitle = temp_title;
// manufacture data for now
for(unsigned int px=0;px<nPixelsX;px++)

View File

@ -75,7 +75,6 @@ void qTabMeasurement::SetupWidgetWindow(){
lblProgressIndex->setText(QString::number(myDet->getFileIndex()));
//ly initially
progressBar->setValue(0);
currentMeasurement = 0;
//timing mode
SetupTimingMode();
@ -301,8 +300,6 @@ void qTabMeasurement::startStopAcquisition(){
btnStartStop->setIcon(*iconStop);
Enable(0);
progressBar->setValue(0);
//the progress which keeps adding up for all the measurements
currentMeasurement = 0;
progressTimer->start(100);
emit StartSignal();
@ -313,6 +310,7 @@ void qTabMeasurement::startStopAcquisition(){
emit StopSignal();
myDet->stopAcquisition();
progressTimer->stop();
spinIndex->setValue(myPlot->GetFileIndex());
btnStartStop->setText("Start");
btnStartStop->setIcon(*iconStart);
btnStartStop->setChecked(false);
@ -333,6 +331,7 @@ void qTabMeasurement::UpdateFinished(){
Enable(1);
connect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
UpdateProgress();
spinIndex->setValue(myPlot->GetFileIndex());
progressTimer->stop();
}
}
@ -342,8 +341,8 @@ void qTabMeasurement::UpdateFinished(){
void qTabMeasurement::SetCurrentMeasurement(int val){
currentMeasurement = val;
lblCurrentMeasurement->setText(QString::number(val+1));
if((val)<spinNumMeasurements->value())
lblCurrentMeasurement->setText(QString::number(val+1));
}
@ -352,7 +351,6 @@ void qTabMeasurement::SetCurrentMeasurement(int val){
void qTabMeasurement::UpdateProgress(){
//progressBar->setValue((int)(((currentMeasurement*100)+(myPlot->GetProgress()))/spinNumMeasurements->value()));
progressBar->setValue((int)myPlot->GetProgress());
lblProgressIndex->setText(QString::number(myPlot->GetFileIndex()));
}