diff --git a/slsDetectorGui/forms/form_tab_plot.ui b/slsDetectorGui/forms/form_tab_plot.ui index 0c905f491..f0d754300 100644 --- a/slsDetectorGui/forms/form_tab_plot.ui +++ b/slsDetectorGui/forms/form_tab_plot.ui @@ -593,7 +593,7 @@ 10 20 - 337 + 341 26 @@ -627,7 +627,7 @@ - 11 + 9 10 @@ -656,7 +656,7 @@ - 11 + 9 10 @@ -671,7 +671,7 @@ - File Index + Frame Index @@ -685,7 +685,7 @@ - 11 + 9 10 diff --git a/slsDetectorGui/include/qDrawPlot.h b/slsDetectorGui/include/qDrawPlot.h index f53cfdf99..0ab31038d 100644 --- a/slsDetectorGui/include/qDrawPlot.h +++ b/slsDetectorGui/include/qDrawPlot.h @@ -463,8 +463,6 @@ bool backwardScanPlot; /**if files will be saved and index increased*/ bool fileSaveEnable; -/** true if receiver online*/ -bool receiver; signals: void UpdatingPlotFinished(); diff --git a/slsDetectorGui/slsDetectorGui.pro b/slsDetectorGui/slsDetectorGui.pro index 1119523c7..ac0af2ac1 100644 --- a/slsDetectorGui/slsDetectorGui.pro +++ b/slsDetectorGui/slsDetectorGui.pro @@ -5,9 +5,11 @@ UI_HEADERS_DIR = forms/include RESOURCES += icons.qrc -CONFIG+=debug -QMAKE_CXXFLAGS_WARN_ON = -w -QMAKE_CFLAGS_WARN_ON = -w +CONFIG += debug + +QMAKE_CXXFLAGS_WARN_ON = -w +QMAKE_CFLAGS_WARN_ON = -w + DEFINES += VERBOSE DACS_INT #VERYVERBOSE @@ -20,7 +22,7 @@ QMAKE_CLEAN += docs/*/* \ $(DESTDIR)* -LIBS += -Wl,-Bstatic -L../slsDetectorSoftware -lSlsDetector -Wl,-Bdynamic\ +LIBS += -Wl,-Bstatic -L../slsDetectorSoftware -lSlsDetector -Wl,-Bdynamic\ -L$(QWTDIR)/lib -lqwt -L$(QWT3D)/lib DEPENDPATH += \ @@ -31,11 +33,11 @@ DEPENDPATH += \ INCLUDEPATH += \ - $(shell echo "/lib/modules/`uname -r`/build/include") \ + $(shell echo "/lib/modules/`uname -r`/build/include") \ $(QWTDIR)/include\ $(QWTDIR) \ - $(QWTDIR)/src\ - $(QWT3D)/include\ + $(QWTDIR)/src\ + $(QWT3D)/include\ slsDetectorPlotting/include\ include\ forms/include\ diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index 9f4d386a0..1cab23125 100644 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -109,7 +109,6 @@ void qDrawPlot::SetupWidgetWindow(){ currentFileIndex = 0; currentFrameIndex = 0; - receiver=false; // This is so that it initially stop and plots running = 1; for(int i=0;isetReceiverOnline()==slsDetectorDefs::ONLINE_FLAG) - receiver=true; cout << "Starting new acquisition threadddd ...." << endl; // Start acquiring data from server @@ -547,19 +544,15 @@ int qDrawPlot::GetData(detectorData *data,int fIndex){ //set progress progress=(int)data->progressIndex; currentFrameIndex = fileIOStatic::getIndicesFromFileName(string(data->fileName),currentFileIndex); - #ifdef VERYVERBOSE cout << "progress:" << progress << endl; #endif - //Plot Disabled - if(!plotEnable) return 0; - // secondary title necessary to differentiate between frames when not saving data char temp_title[2000]; - if(receiver){ - //findex is used because in the receiver, you cannot know the frame index as many frames are in 1 file. - if(fIndex==-1) fIndex=currentFrame; + //findex is used because in the receiver, you cannot know the frame index as many frames are in 1 file. + if(fIndex!=-1){ + currentFrameIndex=fIndex; sprintf(temp_title,"#%d",fIndex); }else{ if(fileSaveEnable) strcpy(temp_title,""); @@ -567,6 +560,10 @@ int qDrawPlot::GetData(detectorData *data,int fIndex){ } + //Plot Disabled + if(!plotEnable) return 0; + + //angle plotting if(anglePlot){ while(1){ diff --git a/slsDetectorGui/src/qTabDataOutput.cpp b/slsDetectorGui/src/qTabDataOutput.cpp index 50d841b93..a58ba931e 100644 --- a/slsDetectorGui/src/qTabDataOutput.cpp +++ b/slsDetectorGui/src/qTabDataOutput.cpp @@ -143,11 +143,40 @@ void qTabDataOutput::setOutputDir(){ QString path = dispOutputDir->text(); + string oldPath = myDet->getFilePath(); + bool error=false; + //gets rid of the end '/'s while(path.endsWith('/')) path.chop(1); dispOutputDir->setText(path); - if(QFile::exists(path)){ + if(myDet->setReceiverOnline()==slsDetectorDefs::ONLINE_FLAG){ + for(int i=0;igetNumberOfDetectors();i++){ + slsDetector *det = myDet->getSlsDetector(i); + det->setFilePath(string(path.toAscii().constData())); + if(det->getFilePath()!=(string(path.toAscii().constData()))){ + error=true; + break; + } + } + if(error){ + //set it back for the ones which got set + for(int i=0;igetNumberOfDetectors();i++){ + slsDetector *det = myDet->getSlsDetector(i); + det->setFilePath(oldPath); + } + }//set it in multi as well if it worked so that they reflect the same + else + myDet->setFilePath(string(path.toAscii().constData())); + } + else { + myDet->setFilePath(string(path.toAscii().constData())); + if(myDet->getFilePath()!=(string(path.toAscii().constData()))) + error=true; + } + + if(!error){ + //if(QFile::exists(path)){ lblOutputDir->setText("Output Directory: "); lblOutputDir->setPalette(chkRate->palette()); lblOutputDir->setToolTip(outDirTip); @@ -512,6 +541,12 @@ void qTabDataOutput::Refresh(){ if(myDet->getBadChannelCorrection()) chkDiscardBad->setChecked(true); + if(myDet->setReceiverOnline()==slsDetectorDefs::ONLINE_FLAG) + btnOutputBrowse->setEnabled(false); + else + btnOutputBrowse->setEnabled(true); + + #ifdef VERBOSE cout << "**Updated DataOutput Tab" << endl << endl; #endif diff --git a/slsDetectorGui/src/qTabPlot.cpp b/slsDetectorGui/src/qTabPlot.cpp index 3c3737aaa..aa110685d 100644 --- a/slsDetectorGui/src/qTabPlot.cpp +++ b/slsDetectorGui/src/qTabPlot.cpp @@ -767,8 +767,8 @@ void qTabPlot::SetScanArgument(){ break; break; case 2://file index - dispYAxis->setText("File Index"); - myPlot->SetImageYAxisTitle("File Index"); + dispYAxis->setText("Frame Index"); + myPlot->SetImageYAxisTitle("Frame Index"); break; case 3://all frames dispYAxis->setText("All Frames");