fixed filedir for gotthard receiver problem

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@113 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d 2012-11-15 13:53:08 +00:00
parent f201a6a32b
commit 832287af9e
6 changed files with 59 additions and 27 deletions

View File

@ -593,7 +593,7 @@
<rect> <rect>
<x>10</x> <x>10</x>
<y>20</y> <y>20</y>
<width>337</width> <width>341</width>
<height>26</height> <height>26</height>
</rect> </rect>
</property> </property>
@ -627,7 +627,7 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>11</width> <width>9</width>
<height>10</height> <height>10</height>
</size> </size>
</property> </property>
@ -656,7 +656,7 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>11</width> <width>9</width>
<height>10</height> <height>10</height>
</size> </size>
</property> </property>
@ -671,7 +671,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>File Index</string> <string>Frame Index</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -685,7 +685,7 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>11</width> <width>9</width>
<height>10</height> <height>10</height>
</size> </size>
</property> </property>

View File

@ -463,8 +463,6 @@ bool backwardScanPlot;
/**if files will be saved and index increased*/ /**if files will be saved and index increased*/
bool fileSaveEnable; bool fileSaveEnable;
/** true if receiver online*/
bool receiver;
signals: signals:
void UpdatingPlotFinished(); void UpdatingPlotFinished();

View File

@ -5,9 +5,11 @@ UI_HEADERS_DIR = forms/include
RESOURCES += icons.qrc RESOURCES += icons.qrc
CONFIG+=debug CONFIG += debug
QMAKE_CXXFLAGS_WARN_ON = -w
QMAKE_CFLAGS_WARN_ON = -w QMAKE_CXXFLAGS_WARN_ON = -w
QMAKE_CFLAGS_WARN_ON = -w
DEFINES += VERBOSE DACS_INT #VERYVERBOSE DEFINES += VERBOSE DACS_INT #VERYVERBOSE
@ -20,7 +22,7 @@ QMAKE_CLEAN += docs/*/* \
$(DESTDIR)* $(DESTDIR)*
LIBS += -Wl,-Bstatic -L../slsDetectorSoftware -lSlsDetector -Wl,-Bdynamic\ LIBS += -Wl,-Bstatic -L../slsDetectorSoftware -lSlsDetector -Wl,-Bdynamic\
-L$(QWTDIR)/lib -lqwt -L$(QWT3D)/lib -L$(QWTDIR)/lib -lqwt -L$(QWT3D)/lib
DEPENDPATH += \ DEPENDPATH += \
@ -31,11 +33,11 @@ DEPENDPATH += \
INCLUDEPATH += \ INCLUDEPATH += \
$(shell echo "/lib/modules/`uname -r`/build/include") \ $(shell echo "/lib/modules/`uname -r`/build/include") \
$(QWTDIR)/include\ $(QWTDIR)/include\
$(QWTDIR) \ $(QWTDIR) \
$(QWTDIR)/src\ $(QWTDIR)/src\
$(QWT3D)/include\ $(QWT3D)/include\
slsDetectorPlotting/include\ slsDetectorPlotting/include\
include\ include\
forms/include\ forms/include\

View File

@ -109,7 +109,6 @@ void qDrawPlot::SetupWidgetWindow(){
currentFileIndex = 0; currentFileIndex = 0;
currentFrameIndex = 0; currentFrameIndex = 0;
receiver=false;
// This is so that it initially stop and plots // This is so that it initially stop and plots
running = 1; running = 1;
for(int i=0;i<MAX_1DPLOTS;i++) for(int i=0;i<MAX_1DPLOTS;i++)
@ -351,8 +350,6 @@ bool qDrawPlot::StartOrStopThread(bool start){
//sets up the measurement parameters //sets up the measurement parameters
SetupMeasurement(); SetupMeasurement();
if(myDet->setReceiverOnline()==slsDetectorDefs::ONLINE_FLAG)
receiver=true;
cout << "Starting new acquisition threadddd ...." << endl; cout << "Starting new acquisition threadddd ...." << endl;
// Start acquiring data from server // Start acquiring data from server
@ -547,19 +544,15 @@ int qDrawPlot::GetData(detectorData *data,int fIndex){
//set progress //set progress
progress=(int)data->progressIndex; progress=(int)data->progressIndex;
currentFrameIndex = fileIOStatic::getIndicesFromFileName(string(data->fileName),currentFileIndex); currentFrameIndex = fileIOStatic::getIndicesFromFileName(string(data->fileName),currentFileIndex);
#ifdef VERYVERBOSE #ifdef VERYVERBOSE
cout << "progress:" << progress << endl; cout << "progress:" << progress << endl;
#endif #endif
//Plot Disabled
if(!plotEnable) return 0;
// secondary title necessary to differentiate between frames when not saving data // secondary title necessary to differentiate between frames when not saving data
char temp_title[2000]; 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.
//findex is used because in the receiver, you cannot know the frame index as many frames are in 1 file. if(fIndex!=-1){
if(fIndex==-1) fIndex=currentFrame; currentFrameIndex=fIndex;
sprintf(temp_title,"#%d",fIndex); sprintf(temp_title,"#%d",fIndex);
}else{ }else{
if(fileSaveEnable) strcpy(temp_title,""); if(fileSaveEnable) strcpy(temp_title,"");
@ -567,6 +560,10 @@ int qDrawPlot::GetData(detectorData *data,int fIndex){
} }
//Plot Disabled
if(!plotEnable) return 0;
//angle plotting //angle plotting
if(anglePlot){ if(anglePlot){
while(1){ while(1){

View File

@ -143,11 +143,40 @@ void qTabDataOutput::setOutputDir(){
QString path = dispOutputDir->text(); QString path = dispOutputDir->text();
string oldPath = myDet->getFilePath();
bool error=false;
//gets rid of the end '/'s //gets rid of the end '/'s
while(path.endsWith('/')) path.chop(1); while(path.endsWith('/')) path.chop(1);
dispOutputDir->setText(path); dispOutputDir->setText(path);
if(QFile::exists(path)){ if(myDet->setReceiverOnline()==slsDetectorDefs::ONLINE_FLAG){
for(int i=0;i<myDet->getNumberOfDetectors();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;i<myDet->getNumberOfDetectors();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->setText("Output Directory: ");
lblOutputDir->setPalette(chkRate->palette()); lblOutputDir->setPalette(chkRate->palette());
lblOutputDir->setToolTip(outDirTip); lblOutputDir->setToolTip(outDirTip);
@ -512,6 +541,12 @@ void qTabDataOutput::Refresh(){
if(myDet->getBadChannelCorrection()) chkDiscardBad->setChecked(true); if(myDet->getBadChannelCorrection()) chkDiscardBad->setChecked(true);
if(myDet->setReceiverOnline()==slsDetectorDefs::ONLINE_FLAG)
btnOutputBrowse->setEnabled(false);
else
btnOutputBrowse->setEnabled(true);
#ifdef VERBOSE #ifdef VERBOSE
cout << "**Updated DataOutput Tab" << endl << endl; cout << "**Updated DataOutput Tab" << endl << endl;
#endif #endif

View File

@ -767,8 +767,8 @@ void qTabPlot::SetScanArgument(){
break; break;
break; break;
case 2://file index case 2://file index
dispYAxis->setText("File Index"); dispYAxis->setText("Frame Index");
myPlot->SetImageYAxisTitle("File Index"); myPlot->SetImageYAxisTitle("Frame Index");
break; break;
case 3://all frames case 3://all frames
dispYAxis->setText("All Frames"); dispYAxis->setText("All Frames");