included position scan

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@40 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d 2012-08-29 09:06:49 +00:00
parent 51e7feb605
commit c9ecec183f
11 changed files with 116 additions and 303 deletions

View File

@ -369,6 +369,11 @@
<string>Trimbits Scan</string> <string>Trimbits Scan</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>Position Scan</string>
</property>
</item>
<item> <item>
<property name="text"> <property name="text">
<string>Custom Script</string> <string>Custom Script</string>

View File

@ -31,208 +31,6 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>25</x>
<y>83</y>
<width>740</width>
<height>93</height>
</rect>
</property>
<property name="title">
<string>Files:</string>
</property>
<layout class="QGridLayout" name="gridLayout_2" rowstretch="0,0,0">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>5</number>
</property>
<property name="horizontalSpacing">
<number>-1</number>
</property>
<property name="verticalSpacing">
<number>9</number>
</property>
<item row="1" column="0">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Trimbit File:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="pushButton_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Load</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QPushButton" name="pushButton_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Save</string>
</property>
</widget>
</item>
<item row="1" column="4">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>120</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="5">
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Calibration File:</string>
</property>
</widget>
</item>
<item row="1" column="6">
<widget class="QPushButton" name="pushButton_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Load</string>
</property>
</widget>
</item>
<item row="1" column="7">
<widget class="QPushButton" name="pushButton_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Save</string>
</property>
</widget>
</item>
<item row="1" column="8">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" colspan="7">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Output File:</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit"/>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="groupBox_2">
<property name="geometry"> <property name="geometry">
<rect> <rect>
@ -310,19 +108,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="checkBox_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Offline Improvement</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>

View File

@ -68,6 +68,8 @@ private:
multiSlsDetector *myDet; multiSlsDetector *myDet;
/** sls detector id */ /** sls detector id */
int detID; int detID;
/** true for mythen and eiger */
bool digitalDetector;
/** The Plot widget */ /** The Plot widget */
qDrawPlot *myPlot; qDrawPlot *myPlot;
/**Tab Widget */ /**Tab Widget */

View File

@ -206,6 +206,7 @@ private:
multiSlsDetector *myDet; multiSlsDetector *myDet;
/** Widgets needed to plot the clone */ /** Widgets needed to plot the clone */
/** Max Number of Clone Windows */ /** Max Number of Clone Windows */
static const int MAXCloneWindows = 50; static const int MAXCloneWindows = 50;

View File

@ -45,7 +45,7 @@ private:
int id; int id;
/**type of steps*/ /**type of steps*/
enum sizeIndex{RangeValues, CustomValues, FileValues}; enum sizeIndex{RangeValues, CustomValues, FileValues};
enum modes{None,EnergyScan,ThresholdScan,TrimbitsScan,CustomScript,NumModes}; enum modes{None,EnergyScan,ThresholdScan,TrimbitsScan,PositionScan,CustomScript,NumModes};
static const string modeNames[NumModes]; static const string modeNames[NumModes];
/**values*/ /**values*/

View File

@ -6,7 +6,7 @@ UI_HEADERS_DIR = forms/include
RESOURCES += icons.qrc RESOURCES += icons.qrc
DEFINES += VERBOSE DACS_INT #VERYVERBOSE DEFINES += VERBOSE DACS_INT VERYVERBOSE
target.path += $(DESTDIR) target.path += $(DESTDIR)

View File

@ -79,7 +79,7 @@ void qCloneWidget::SetupWidgetWindow(QString title,int numDim,SlsQt1DPlot*& plot
//cloneplot2D->setContentsMargins(0,0,0,0); //cloneplot2D->setContentsMargins(0,0,0,0);
gridClone->addWidget(cloneplot2D,0,0); gridClone->addWidget(cloneplot2D,0,0);
cloneBox->setFlat(true); cloneBox->setFlat(true);
cloneBox->setContentsMargins(0,5,0,0); cloneBox->setContentsMargins(0,20,0,0);
} }
/** main window widgets */ /** main window widgets */

View File

@ -147,10 +147,10 @@ void qDetectorMain::SetUpWidgetWindow(){
tabs->setTabEnabled(Debugging,false); tabs->setTabEnabled(Debugging,false);
//beamline mode to false //beamline mode to false
tabs->setTabEnabled(Advanced,false); tabs->setTabEnabled(Advanced,false);
actionLoadTrimbits->hide(); actionLoadTrimbits->setVisible(false);
actionSaveTrimbits->hide(); actionSaveTrimbits->setVisible(false);
actionLoadCalibration->hide(); actionLoadCalibration->setVisible(false);
actionSaveCalibration->hide(); actionSaveCalibration->setVisible(false);
dockWidgetPlot->setFloating(false); dockWidgetPlot->setFloating(false);
dockWidgetPlot->setFeatures(QDockWidget::NoDockWidgetFeatures); dockWidgetPlot->setFeatures(QDockWidget::NoDockWidgetFeatures);
tabs->setTabEnabled(Developer,isDeveloper); tabs->setTabEnabled(Developer,isDeveloper);
@ -193,10 +193,11 @@ void qDetectorMain::SetUpDetector(){
else{ else{
slsDetectorDefs::detectorType detType = myDet->getDetectorsType(); slsDetectorDefs::detectorType detType = myDet->getDetectorsType();
// Check if type valid. If not, exit // Check if type valid. If not, exit
switch(detType){ switch(detType){//digitalDetector decides if trimbits should be shown
case slsDetectorDefs::MYTHEN: break; case slsDetectorDefs::MYTHEN: digitalDetector = true; break;
case slsDetectorDefs::EIGER: break; case slsDetectorDefs::EIGER: digitalDetector = true; break;
case slsDetectorDefs::GOTTHARD: break; case slsDetectorDefs::GOTTHARD: digitalDetector = false;break;
case slsDetectorDefs::AGIPD: digitalDetector = false;break;
default: default:
string detName = myDet->slsDetectorBase::getDetectorType(detType); string detName = myDet->slsDetectorBase::getDetectorType(detType);
string errorMess = host+string(" has unknown detector type \"")+ string errorMess = host+string(" has unknown detector type \"")+
@ -275,16 +276,16 @@ void qDetectorMain::EnableModes(QAction *action){
else if(action==actionExpert){ else if(action==actionExpert){
enable = actionExpert->isChecked(); enable = actionExpert->isChecked();
tabs->setTabEnabled(Advanced,enable); tabs->setTabEnabled(Advanced,enable);
if(enable){ if((enable)&&(digitalDetector)){
actionLoadTrimbits->show(); actionLoadTrimbits->setVisible(true);
actionSaveTrimbits->show(); actionSaveTrimbits->setVisible(true);
actionLoadCalibration->show(); actionLoadCalibration->setVisible(true);
actionSaveCalibration->show(); actionSaveCalibration->setVisible(true);
}else{ }else{
actionLoadTrimbits->hide(); actionLoadTrimbits->setVisible(false);
actionSaveTrimbits->hide(); actionSaveTrimbits->setVisible(false);
actionLoadCalibration->hide(); actionLoadCalibration->setVisible(false);
actionSaveCalibration->hide(); actionSaveCalibration->setVisible(false);
} }
#ifdef VERBOSE #ifdef VERBOSE
cout << "Setting Expert Mode to " << enable << endl; cout << "Setting Expert Mode to " << enable << endl;
@ -373,6 +374,20 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
qDefs::InfoMessage("The configuration parameters have been successfully saved.","Main"); qDefs::InfoMessage("The configuration parameters have been successfully saved.","Main");
} }
} }
else if(action==actionLoadTrimbits){
#ifdef VERBOSE
cout << "Loading Trimbits" << endl;
#endif
QString fName = QString(myDet->getFilePath().c_str());
fName = QFileDialog::getOpenFileName(this,
tr("Load Detector Trimbits"),fName,
tr("Trimbit files (*.trim *.sn*)"));
// Gets called when cancelled as well
if (!fName.isEmpty()){
//myDet->readConfigurationFile(string(fName.toAscii().constData()));
qDefs::InfoMessage("The parameters have been successfully configured.","Main");
}
}
Refresh(tabs->currentIndex()); Refresh(tabs->currentIndex());
} }
@ -492,10 +507,10 @@ void qDetectorMain::EnableTabs(){
if(enable==false){ if(enable==false){
tabs->setTabEnabled(Debugging,enable); tabs->setTabEnabled(Debugging,enable);
tabs->setTabEnabled(Advanced,enable); tabs->setTabEnabled(Advanced,enable);
actionLoadTrimbits->hide(); actionLoadTrimbits->setVisible(false);
actionSaveTrimbits->hide(); actionSaveTrimbits->setVisible(false);
actionLoadCalibration->hide(); actionLoadCalibration->setVisible(false);
actionSaveCalibration->hide(); actionSaveCalibration->setVisible(false);
tabs->setTabEnabled(Developer,enable); tabs->setTabEnabled(Developer,enable);
} }
else{ else{
@ -504,16 +519,16 @@ void qDetectorMain::EnableTabs(){
tabs->setTabEnabled(Debugging,enable); tabs->setTabEnabled(Debugging,enable);
if(actionExpert->isChecked()){ if(actionExpert->isChecked()){
tabs->setTabEnabled(Advanced,enable); tabs->setTabEnabled(Advanced,enable);
if(enable){ if((enable)&&(digitalDetector)){
actionLoadTrimbits->show(); actionLoadTrimbits->setVisible(true);
actionSaveTrimbits->show(); actionSaveTrimbits->setVisible(true);
actionLoadCalibration->show(); actionLoadCalibration->setVisible(true);
actionSaveCalibration->show(); actionSaveCalibration->setVisible(true);
}else{ }else{
actionLoadTrimbits->hide(); actionLoadTrimbits->setVisible(false);
actionSaveTrimbits->hide(); actionSaveTrimbits->setVisible(false);
actionLoadCalibration->hide(); actionLoadCalibration->setVisible(false);
actionSaveCalibration->hide(); actionSaveCalibration->setVisible(false);
} }
} }
if(isDeveloper) if(isDeveloper)

View File

@ -264,6 +264,7 @@ bool qDrawPlot::StartOrStopThread(bool start){
progress = 0; progress = 0;
currentFrame = 0; currentFrame = 0;
stop_signal = 0; stop_signal = 0;
histTitle[0] = "";
//for 2d scans //for 2d scans
int currentIndex = myDet->getFileIndex(); int currentIndex = myDet->getFileIndex();
@ -283,7 +284,6 @@ bool qDrawPlot::StartOrStopThread(bool start){
}else if(scanArgument==Level0){ }else if(scanArgument==Level0){
//no need to check if numsteps=0,cuz otherwise this mode wont be set in plot tab //no need to check if numsteps=0,cuz otherwise this mode wont be set in plot tab
int numSteps = myDet->getScanSteps(0); int numSteps = myDet->getScanSteps(0);
//if(values) delete [] values;
double *values = new double[numSteps]; double *values = new double[numSteps];
myDet->getScanSteps(0,values); myDet->getScanSteps(0,values);
@ -292,6 +292,17 @@ bool qDrawPlot::StartOrStopThread(bool start){
nPixelsY = numSteps; nPixelsY = numSteps;
currentScanValue = values[0]; currentScanValue = values[0];
} }
else {
//no need to check if numsteps=0,cuz otherwise this mode wont be set in plot tab
int numSteps = myDet->getScanSteps(1);
double *values = new double[numSteps];
myDet->getScanSteps(1,values);
maxPixelsY = values[numSteps-1];
minPixelsY = values[0];
nPixelsY = numSteps;
currentScanValue = values[0];
}
pixelWidth = (maxPixelsY -minPixelsY)/(nPixelsY-1); pixelWidth = (maxPixelsY -minPixelsY)/(nPixelsY-1);
startPixel = minPixelsY -(pixelWidth/2); startPixel = minPixelsY -(pixelWidth/2);
endPixel = maxPixelsY + (pixelWidth/2); endPixel = maxPixelsY + (pixelWidth/2);
@ -375,6 +386,8 @@ int qDrawPlot::GetData(detectorData *data){
cout << "Entering GetDatafunction" << endl; cout << "Entering GetDatafunction" << endl;
#endif #endif
if(!stop_signal){ if(!stop_signal){
//set title
SetPlotTitle(QString(data->fileName).section('/',-1));
//Plot Disabled //Plot Disabled
if(!plotEnable) { if(!plotEnable) {
@ -432,7 +445,6 @@ int qDrawPlot::GetData(detectorData *data){
//if scan argument is 2d //if scan argument is 2d
if(scanArgument!=None){ if(scanArgument!=None){
if(scanArgument==AllFrames){ if(scanArgument==AllFrames){
/*title should include which scan, also by measurement tab*/
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){ if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
lastImageNumber= currentFrame+1; lastImageNumber= currentFrame+1;
char temp_title[2000]; sprintf(temp_title,"Image Index %d",currentIndex); imageTitle = temp_title; char temp_title[2000]; sprintf(temp_title,"Image Index %d",currentIndex); imageTitle = temp_title;
@ -444,12 +456,10 @@ int qDrawPlot::GetData(detectorData *data){
return 0; return 0;
} }
else if(scanArgument==FileIndex){ else if(scanArgument==FileIndex){
/*title should include which scan, also by measurement tab*/
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){ if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
if(currentIndex == minPixelsY) currentScanDivLevel = 0; if(currentIndex == minPixelsY) currentScanDivLevel = 0;
lastImageNumber= currentFrame+1; lastImageNumber= currentFrame+1;
char temp_title[2000]; sprintf(temp_title,"Image Index %d",currentIndex); imageTitle = temp_title; char temp_title[2000]; sprintf(temp_title,"Image Index %d",currentIndex); imageTitle = temp_title;
//memcpy(lastImageArray+(currentIndex*nPixelsX),data->values,nPixelsX*sizeof(double));
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px]; for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
pthread_mutex_unlock(&(last_image_complete_mutex)); pthread_mutex_unlock(&(last_image_complete_mutex));
} }
@ -458,28 +468,29 @@ int qDrawPlot::GetData(detectorData *data){
return 0; return 0;
} }
else if(scanArgument==Level0){ else if(scanArgument==Level0){
/*title should include which scan, also by measurement tab*/
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){ if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
if(currentScanVariable0!=currentScanValue) currentScanDivLevel++; if(currentScanVariable0!=currentScanValue) currentScanDivLevel++;
currentScanValue = currentScanVariable0; currentScanValue = currentScanVariable0;
lastImageNumber= currentFrame+1; lastImageNumber= currentFrame+1;
char temp_title[2000]; sprintf(temp_title,"Image Index %d",currentIndex); imageTitle = temp_title; char temp_title[2000]; sprintf(temp_title,"Image Index %d",currentIndex); imageTitle = temp_title;
//memcpy(lastImageArray+(currentIndex*nPixelsX),data->values,nPixelsX*sizeof(double));
//for(int i=values[currentScan];i<values[currentScan+1];i++)
//memcpy(lastImageArray+(currentScanVariable0-1*nPixelsX),data->values,nPixelsX*sizeof(double));
//memcpy(lastImageArray+(currentScanDivLevel*nPixelsX),data->values,nPixelsX*sizeof(double));
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px]; for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
cout<<"lastImageArray[0*1280+500]:"<<lastImageArray[currentScanDivLevel*nPixelsX+500]<<endl;
//lastImageArray + ((pixelWidth/2) + currentScanDivLevel * pixelWidth) * nPixelsX + px += data->values[px];
pthread_mutex_unlock(&(last_image_complete_mutex)); pthread_mutex_unlock(&(last_image_complete_mutex));
} }
currentFrame++; currentFrame++;
return 0; return 0;
} }
else {
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
if(currentScanVariable1!=currentScanValue) currentScanDivLevel++;
currentScanValue = currentScanVariable1;
lastImageNumber= currentFrame+1;
char temp_title[2000]; sprintf(temp_title,"Image Index %d",currentIndex); imageTitle = temp_title;
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
pthread_mutex_unlock(&(last_image_complete_mutex));
}
currentFrame++;
return 0;
}
} }
//normal measurement or 1d scans //normal measurement or 1d scans
@ -490,8 +501,9 @@ int qDrawPlot::GetData(detectorData *data){
//1d //1d
if(plot_in_scope==1){ if(plot_in_scope==1){
// Titles // Titles changed to "" inside startstopthread
sprintf(temp_title,"Frame Index %d",currentIndex); histTitle[0] = temp_title; //sprintf(temp_title,"Frame Index %d",currentIndex); histTitle[0] = temp_title;
// Persistency // Persistency
if(currentPersistency < persistency)currentPersistency++; if(currentPersistency < persistency)currentPersistency++;
else currentPersistency=persistency; else currentPersistency=persistency;

View File

@ -25,7 +25,7 @@ using namespace std;
int qScanWidget::NUM_SCAN_WIDGETS(0); int qScanWidget::NUM_SCAN_WIDGETS(0);
const string qScanWidget::modeNames[NumModes]={"","energy","threshold","trimbits","custom script"}; const string qScanWidget::modeNames[NumModes]={"","energy","threshold","trimbits","position","custom script"};
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
qScanWidget::qScanWidget(QWidget *parent,multiSlsDetector*& detector): qScanWidget::qScanWidget(QWidget *parent,multiSlsDetector*& detector):
@ -331,7 +331,7 @@ void qScanWidget::SetMode(int mode){
EnableSizeWidgets(); EnableSizeWidgets();
//set the mode //set the mode
SetScan(mode); /*SetScan(mode);*/
} }
@ -354,27 +354,15 @@ int qScanWidget::SetScan(int mode){
else values = NULL; else values = NULL;
for(int i=0;i<actualNumSteps;i++) values[i] = positions[i]; for(int i=0;i<actualNumSteps;i++) values[i] = positions[i];
cout<<"modeNames[mode]:"<<modeNames[mode]<<endl;cout<<"actualNumSteps:"<<actualNumSteps<<endl;
//setting the mode //setting the mode
switch(mode){ if(mode==CustomScript)
case None:
myDet->setScan(id,modeNames[mode],actualNumSteps,values,parameter);
break;
case EnergyScan:
myDet->setScan(id,modeNames[mode],actualNumSteps,values,parameter);
break;
case ThresholdScan:
myDet->setScan(id,modeNames[mode],actualNumSteps,values,parameter);
break;
case TrimbitsScan:
myDet->setScan(id,modeNames[mode],actualNumSteps,values,parameter);
break;
case CustomScript:
myDet->setScan(id,script,actualNumSteps,values,parameter); myDet->setScan(id,script,actualNumSteps,values,parameter);
break; else
} cout<<"return values:"<<myDet->setScan(id,modeNames[mode],actualNumSteps,values,parameter)<<endl;
//custom script //custom script
int actualMode = myDet->getScanMode(id); int actualMode = myDet->getScanMode(id);cout<<"actualmode:"<<actualMode<<endl;
if((mode==CustomScript)&&((script=="")||(script=="none"))){ if((mode==CustomScript)&&((script=="")||(script=="none"))){
return qDefs::OK; return qDefs::OK;
}else{//mode NOT set }else{//mode NOT set
@ -429,13 +417,18 @@ void qScanWidget::SetScriptFile(){
//blank //blank
if(fName.isEmpty()) if(fName.isEmpty())
set = true; set = true;
else if( (!fName.compare("none"))|| //none isnt in the modeNames list, so check separately
(!fName.compare("energy"))|| else if(!fName.compare("none"))
(!fName.compare("threshold"))||
(!fName.compare("trimbits")) )
set = true; set = true;
//not blank else{//if one of the other modes
else{ for(int i=1;i<NumModes;i++)
if(!fName.compare(QString(modeNames[i].c_str()))){
set = true;
break;
}
}
//not blank and custom script mode
if(!set){
QString file = dispScript->text().section('/',-1); QString file = dispScript->text().section('/',-1);
//is a file //is a file
if(file.contains('.')){ if(file.contains('.')){
@ -468,12 +461,12 @@ void qScanWidget::SetScriptFile(){
//dont display if theres a none //dont display if theres a none
fName = dispScript->text(); fName = dispScript->text();
if( (!fName.compare("none"))|| //none isnt in the modeNames list, so check separately
(!fName.compare("energy"))|| if(!fName.compare("none"))
(!fName.compare("threshold"))|| dispScript->setText("");
(!fName.compare("trimbits")) ) for(int i=1;i<NumModes;i++)
if(!fName.compare(QString(modeNames[i].c_str())))
dispScript->setText(""); dispScript->setText("");
} }
@ -492,10 +485,11 @@ void qScanWidget::SetParameter(){
myDet->setScanParameter(id,parameter.toAscii().constData()); myDet->setScanParameter(id,parameter.toAscii().constData());
//dont display if theres a none //dont display if theres a none
parameter = dispParameter->text(); parameter = dispParameter->text();
if( (!parameter.compare("none"))|| //none isnt in the modeNames list, so check separately
(!parameter.compare("energy"))|| if(!parameter.compare("none"))
(!parameter.compare("threshold"))|| dispParameter->setText("");
(!parameter.compare("trimbits")) ) for(int i=1;i<NumModes;i++)
if(!parameter.compare(QString(modeNames[i].c_str())))
dispParameter->setText(""); dispParameter->setText("");
} }

View File

@ -572,7 +572,6 @@ void qTabPlot::SetScanArgument(){
//if scans //if scans
if(boxScan->isEnabled()){ if(boxScan->isEnabled()){
//setting the title according to the scans //setting the title according to the scans
QString mainTitle = QString(" Level 0 : ") + modeNames[myDet->getScanMode(0)] + QString mainTitle = QString(" Level 0 : ") + modeNames[myDet->getScanMode(0)] +
QString(" | Level 1 : ") + modeNames[myDet->getScanMode(1)] + QString(""); QString(" | Level 1 : ") + modeNames[myDet->getScanMode(1)] + QString("");
@ -641,7 +640,7 @@ void qTabPlot::SetScanArgument(){
void qTabPlot::Refresh(){ void qTabPlot::Refresh(){
SetFrequency(); SetFrequency();
EnableScanBox(); if(!myPlot->isRunning()) EnableScanBox();
} }