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

@ -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;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->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