mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 21:37:13 +02:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user