mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-06 21:00:02 +02:00
a rough idea of a scan is implemented with all frames
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@37 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
parent
cc176ea404
commit
73152572a5
@ -126,6 +126,8 @@ void SavePlot();
|
|||||||
void SetPersistency(int val);
|
void SetPersistency(int val);
|
||||||
/** sets style of plot to dotted */
|
/** sets style of plot to dotted */
|
||||||
void SetDottedPlot(bool enable){plotDotted = enable;};
|
void SetDottedPlot(bool enable){plotDotted = enable;};
|
||||||
|
/** sets the scan argument to prepare the plot*/
|
||||||
|
void SetScanArgument(int scanArg){scanArgument = scanArg;};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -166,10 +168,7 @@ static void* DataStartAcquireThread(void *this_pointer);
|
|||||||
static int GetDataCallBack(detectorData *data, void *this_pointer);
|
static int GetDataCallBack(detectorData *data, void *this_pointer);
|
||||||
/** This is called by the GetDataCallBack function to copy the data */
|
/** This is called by the GetDataCallBack function to copy the data */
|
||||||
int GetData(detectorData *data);
|
int GetData(detectorData *data);
|
||||||
/** This is called by the detector class to copy the scan data it jus acquired */
|
|
||||||
static int GetScanDataCallBack(detectorData *data, void *this_pointer);
|
|
||||||
/** This is called by the GetDataCallBack function to copy the scan data */
|
|
||||||
int GetScanData(detectorData *data);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -195,7 +194,7 @@ void UpdatePause(){data_pause_over=true;};
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
/** The sls detector object */
|
/** The sls detector object */
|
||||||
multiSlsDetector *myDet;
|
multiSlsDetector *myDet;
|
||||||
|
|
||||||
@ -329,7 +328,8 @@ bool isFrameEnabled;
|
|||||||
bool isTriggerEnabled;
|
bool isTriggerEnabled;
|
||||||
|
|
||||||
/** scan arguments*/
|
/** scan arguments*/
|
||||||
enum scanArguments{None,Level0,Level1,FileIndex,AllFrames};
|
enum scanArgumentList{None,Level0,Level1,FileIndex,AllFrames};
|
||||||
|
int scanArgument;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ class qDrawPlot;
|
|||||||
#include <QButtonGroup>
|
#include <QButtonGroup>
|
||||||
#include <QAbstractButton>
|
#include <QAbstractButton>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*@short sets up the Plot parameters
|
*@short sets up the Plot parameters
|
||||||
*/
|
*/
|
||||||
@ -70,6 +71,11 @@ private:
|
|||||||
static QString defaultImageYAxisTitle;
|
static QString defaultImageYAxisTitle;
|
||||||
static QString defaultImageZAxisTitle;
|
static QString defaultImageZAxisTitle;
|
||||||
|
|
||||||
|
/** scans */
|
||||||
|
static const QString modeNames[5];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** methods */
|
/** methods */
|
||||||
/** Sets up the widget
|
/** Sets up the widget
|
||||||
*/
|
*/
|
||||||
|
@ -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)
|
||||||
|
@ -86,6 +86,7 @@ void qDrawPlot::SetupWidgetWindow(){
|
|||||||
data_pause_over = true;//to get the first image
|
data_pause_over = true;//to get the first image
|
||||||
isFrameEnabled = false;
|
isFrameEnabled = false;
|
||||||
isTriggerEnabled = false;
|
isTriggerEnabled = false;
|
||||||
|
scanArgument = None;
|
||||||
// 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++) {histYAxis[i]=0;yvalues[i]=0; }
|
for(int i=0;i<MAX_1DPLOTS;i++) {histYAxis[i]=0;yvalues[i]=0; }
|
||||||
@ -183,8 +184,22 @@ void qDrawPlot::StartStopDaqToggle(bool stop_if_running){
|
|||||||
numFrames = ((numFrames==0)?1:numFrames);
|
numFrames = ((numFrames==0)?1:numFrames);
|
||||||
numTriggers = ((numTriggers==0)?1:numTriggers);
|
numTriggers = ((numTriggers==0)?1:numTriggers);
|
||||||
|
|
||||||
number_of_exposures= numFrames * numTriggers;
|
number_of_exposures = numFrames * numTriggers;
|
||||||
|
//cout << "\tNumber of Exposures:" << number_of_exposures << endl;
|
||||||
|
/* have to also look at vector created using npixelsy as size*/
|
||||||
|
if(scanArgument==AllFrames)
|
||||||
|
nPixelsY = number_of_exposures;
|
||||||
|
else nPixelsY = 100;
|
||||||
|
|
||||||
|
//get #pos and #scansets for level 0 and level 1
|
||||||
|
int numPos = myDet->getPositions(); numPos = ((numPos==0)?1:numPos);
|
||||||
|
int numScan0 = myDet->getScanSteps(0); numScan0 = ((numScan0==0)?1:numScan0);
|
||||||
|
int numScan1 = myDet->getScanSteps(1); numScan1 = ((numScan1==0)?1:numScan1);
|
||||||
|
|
||||||
|
number_of_exposures = number_of_exposures * numPos * numScan0 * numScan1;
|
||||||
cout << "\tNumber of Exposures:" << number_of_exposures << endl;
|
cout << "\tNumber of Exposures:" << number_of_exposures << endl;
|
||||||
|
|
||||||
|
|
||||||
// ExposureTime
|
// ExposureTime
|
||||||
exposureTime= ((double)(myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,-1))*1E-9);
|
exposureTime= ((double)(myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,-1))*1E-9);
|
||||||
cout << "\tExposure Time:" << setprecision (10) << exposureTime << endl;
|
cout << "\tExposure Time:" << setprecision (10) << exposureTime << endl;
|
||||||
@ -253,8 +268,15 @@ bool qDrawPlot::StartOrStopThread(bool start){
|
|||||||
stop_signal = 0;
|
stop_signal = 0;
|
||||||
oldFrameNumber = 0;
|
oldFrameNumber = 0;
|
||||||
histNBins = nPixelsX;
|
histNBins = nPixelsX;
|
||||||
if(!image_data) image_data = new double[nPixelsX*nPixelsY];
|
|
||||||
if(!lastImageArray) lastImageArray = new double[nPixelsX*nPixelsY];
|
/**delete it if it exists and create again and for originally 1d, initalize it with all 0*/
|
||||||
|
if(image_data) delete [] image_data;
|
||||||
|
image_data = new double[nPixelsY*nPixelsX];
|
||||||
|
//if(!image_data) image_data = new double[nPixelsY*nPixelsX];
|
||||||
|
//if(!lastImageArray) lastImageArray = new double[nPixelsY*nPixelsX];
|
||||||
|
if(lastImageArray) delete [] lastImageArray;
|
||||||
|
lastImageArray = new double[nPixelsY*nPixelsX];
|
||||||
|
|
||||||
if(!histXAxis) histXAxis = new double [nPixelsX];
|
if(!histXAxis) histXAxis = new double [nPixelsX];
|
||||||
for(unsigned int px=0;px<nPixelsX;px++) histXAxis[px] = px+10;
|
for(unsigned int px=0;px<nPixelsX;px++) histXAxis[px] = px+10;
|
||||||
if(!yvalues[0]) yvalues[0] = new double [nPixelsX];
|
if(!yvalues[0]) yvalues[0] = new double [nPixelsX];
|
||||||
@ -302,56 +324,59 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
cout << "Entering GetDatafunction" << endl;
|
cout << "Entering GetDatafunction" << endl;
|
||||||
#endif
|
#endif
|
||||||
if(!stop_signal){
|
if(!stop_signal){
|
||||||
//not frame factor
|
/** all frames shouldnt go in here */
|
||||||
if(!frameFactor){
|
if(scanArgument!=AllFrames){
|
||||||
//if the time is not over, RETURN
|
//not frame factor
|
||||||
if(!data_pause_over){
|
if(!frameFactor){
|
||||||
//lastImageNumber= currentFrame+1;
|
//if the time is not over, RETURN
|
||||||
currentFrame++;
|
if(!data_pause_over){
|
||||||
currentIndex++;
|
//lastImageNumber= currentFrame+1;
|
||||||
return 0;
|
currentFrame++;
|
||||||
}
|
currentIndex++;
|
||||||
data_pause_over=false;
|
return 0;
|
||||||
data_pause_timer->start((int)(PLOT_TIMER_MS/2));
|
}
|
||||||
}//if frame factor or last frame of last measurement... for all other factors, RETURN
|
data_pause_over=false;
|
||||||
else{
|
data_pause_timer->start((int)(PLOT_TIMER_MS/2));
|
||||||
if(((currentFrame+1==number_of_exposures)&&(currentMeasurement+1==number_of_measurements))
|
}//if frame factor or last frame of last measurement... for all other factors, RETURN
|
||||||
||(!((currentFrame)%frameFactor)))
|
else{
|
||||||
oldCopy = false;//if this works, then we forget old data
|
if(((currentFrame+1==number_of_exposures)&&(currentMeasurement+1==number_of_measurements))
|
||||||
else{
|
||(!((currentFrame)%frameFactor)))
|
||||||
//lastImageNumber= currentFrame+1;
|
oldCopy = false;//if this works, then we forget old data
|
||||||
currentFrame++;
|
else{
|
||||||
currentIndex++;
|
//lastImageNumber= currentFrame+1;
|
||||||
progress=(int)data->progressIndex;
|
currentFrame++;
|
||||||
//if theres an old copy, try to get lock again
|
currentIndex++;
|
||||||
if(oldCopy){
|
progress=(int)data->progressIndex;
|
||||||
#ifdef VERBOSE
|
//if theres an old copy, try to get lock again
|
||||||
cout << "Copying old data: " << oldFrameNumber << endl;
|
if(oldCopy){
|
||||||
#endif
|
#ifdef VERBOSE
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
cout << "Copying old data: " << oldFrameNumber << endl;
|
||||||
char temp_title[2000];
|
#endif
|
||||||
// only if you got the lock, do u need to remember lastimagenumber to plot
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
lastImageNumber= currentFrame;
|
char temp_title[2000];
|
||||||
//1d
|
// only if you got the lock, do u need to remember lastimagenumber to plot
|
||||||
if(plot_in_scope==1){
|
lastImageNumber= currentFrame;
|
||||||
// Titles
|
//1d
|
||||||
sprintf(temp_title,"Frame Index%d",oldFrameNumber); histTitle[0] = temp_title;
|
if(plot_in_scope==1){
|
||||||
// copy data//memcpy(histXAxis, xvalues,nPixelsX*sizeof(double));
|
// Titles
|
||||||
for(int i=currentPersistency;i>0;i--)
|
sprintf(temp_title,"Frame Index%d",oldFrameNumber); histTitle[0] = temp_title;
|
||||||
memcpy(histYAxis[i],yvalues[i-1],nPixelsX*sizeof(double));
|
// copy data//memcpy(histXAxis, xvalues,nPixelsX*sizeof(double));
|
||||||
memcpy(histYAxis[0],yvalues[0],nPixelsX*sizeof(double));
|
for(int i=currentPersistency;i>0;i--)
|
||||||
}//2d
|
memcpy(histYAxis[i],yvalues[i-1],nPixelsX*sizeof(double));
|
||||||
else{
|
memcpy(histYAxis[0],yvalues[0],nPixelsX*sizeof(double));
|
||||||
// Titles
|
}//2d
|
||||||
sprintf(temp_title,"Image Index %d",oldFrameNumber);
|
else{
|
||||||
imageTitle = temp_title;
|
// Titles
|
||||||
// copy data
|
sprintf(temp_title,"Image Index %d",oldFrameNumber);
|
||||||
//memcpy(lastImageArray,image_data,nPixelsX*nPixelsY*sizeof(double));
|
imageTitle = temp_title;
|
||||||
}
|
// copy data
|
||||||
pthread_mutex_unlock(&(last_image_complete_mutex));
|
//memcpy(lastImageArray,image_data,nPixelsX*nPixelsY*sizeof(double));
|
||||||
}
|
}
|
||||||
|
pthread_mutex_unlock(&(last_image_complete_mutex));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if plot disabled, RETURN
|
//if plot disabled, RETURN
|
||||||
@ -369,6 +394,21 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
#ifdef VERYVERBOSE
|
#ifdef VERYVERBOSE
|
||||||
cout << "Reading in image: " << currentIndex << endl;
|
cout << "Reading in image: " << currentIndex << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//if scan argument is all frames
|
||||||
|
if(scanArgument==AllFrames){
|
||||||
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
|
lastImageNumber= currentFrame+1;
|
||||||
|
char temp_title[2000]; sprintf(temp_title,"Image Index %d",currentIndex); imageTitle = temp_title;
|
||||||
|
memcpy(lastImageArray+(currentFrame*nPixelsX),data->values,nPixelsX*sizeof(double));
|
||||||
|
pthread_mutex_unlock(&(last_image_complete_mutex));
|
||||||
|
}
|
||||||
|
currentFrame++;
|
||||||
|
currentIndex++;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
char temp_title[2000];
|
char temp_title[2000];
|
||||||
// only if you got the lock, do u need to remember lastimagenumber to plot
|
// only if you got the lock, do u need to remember lastimagenumber to plot
|
||||||
@ -434,61 +474,6 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
int qDrawPlot::GetScanDataCallBack(detectorData *data, void *this_pointer){
|
|
||||||
((qDrawPlot*)this_pointer)->GetScanData(data);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
int qDrawPlot::GetScanData(detectorData *data){/*
|
|
||||||
#ifdef VERYVERBOSE
|
|
||||||
cout << "Entering GetScanDatafunction"<<endl;
|
|
||||||
#endif
|
|
||||||
if(!stop_signal){
|
|
||||||
//if plot disabled, RETURN
|
|
||||||
if(!plotEnable) {
|
|
||||||
progress=(int)data->progressIndex;
|
|
||||||
//lastImageNumber= currentFrame+1;
|
|
||||||
currentThrehold++;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
//what comes here has plot enabled AND (frame factor OR data pause over )
|
|
||||||
progress=(int)data->progressIndex;
|
|
||||||
|
|
||||||
#ifdef VERYVERBOSE
|
|
||||||
cout<<"Reading in image: "<<currentThrehold<<endl;
|
|
||||||
#endif
|
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
|
||||||
char temp_title[2000];
|
|
||||||
// only if you got the lock, do u need to remember lastimagenumber to plot
|
|
||||||
lastImageNumber= currentThrehold+1;
|
|
||||||
|
|
||||||
nPixelsY = currentThrehold+1;
|
|
||||||
// Titles
|
|
||||||
sprintf(temp_title,"Adding Threshold %f",threhold[currentThrehold]);
|
|
||||||
imageTitle = temp_title;
|
|
||||||
// copy data
|
|
||||||
memcpy(lastImageArray[i],data->values,nPixelsX*sizeof(double));
|
|
||||||
|
|
||||||
pthread_mutex_unlock(&(last_image_complete_mutex));
|
|
||||||
}
|
|
||||||
currentThrehold++;
|
|
||||||
|
|
||||||
}
|
|
||||||
#ifdef VERYVERBOSE
|
|
||||||
cout<<"Exiting GetScanData function"<<endl;
|
|
||||||
#endif*/
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@ -566,6 +551,7 @@ void qDrawPlot::UpdatePlot(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//2-d plot stuff
|
//2-d plot stuff
|
||||||
|
//cout<<"npixelsx:"<<nPixelsX<<
|
||||||
if(lastImageArray){
|
if(lastImageArray){
|
||||||
if(lastImageNumber&&last_plot_number!=(int)lastImageNumber && //there is a new plot
|
if(lastImageNumber&&last_plot_number!=(int)lastImageNumber && //there is a new plot
|
||||||
nPixelsX>0&&nPixelsY>0){
|
nPixelsX>0&&nPixelsY>0){
|
||||||
@ -601,7 +587,7 @@ void qDrawPlot::UpdatePlot(){
|
|||||||
}
|
}
|
||||||
// if a measurement is over
|
// if a measurement is over
|
||||||
else{
|
else{
|
||||||
currentMeasurement++;
|
currentMeasurement++;cout<<"currentMeasurement:"<<currentMeasurement<<endl;
|
||||||
// if all the measurements are over
|
// if all the measurements are over
|
||||||
if(currentMeasurement==number_of_measurements){
|
if(currentMeasurement==number_of_measurements){
|
||||||
StartStopDaqToggle(true);
|
StartStopDaqToggle(true);
|
||||||
|
@ -21,6 +21,7 @@ using namespace std;
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
const QString qTabPlot::modeNames[5]={"None","Energy Scan","Threshold Scan","Trimbits Scan","Custom Script Scan"};
|
||||||
|
|
||||||
QString qTabPlot::defaultPlotTitle("Measurement");
|
QString qTabPlot::defaultPlotTitle("Measurement");
|
||||||
QString qTabPlot::defaultHistXAxisTitle("Channel Number");
|
QString qTabPlot::defaultHistXAxisTitle("Channel Number");
|
||||||
@ -76,8 +77,6 @@ void qTabPlot::SetupWidgetWindow(){
|
|||||||
btnGroupScan->addButton(radioAllFrames,3);
|
btnGroupScan->addButton(radioAllFrames,3);
|
||||||
|
|
||||||
// Plot Axis
|
// Plot Axis
|
||||||
myPlot->SetPlotTitle(defaultPlotTitle);
|
|
||||||
dispTitle->setText(defaultPlotTitle);
|
|
||||||
dispTitle->setEnabled(false);
|
dispTitle->setEnabled(false);
|
||||||
dispXAxis->setEnabled(false);
|
dispXAxis->setEnabled(false);
|
||||||
dispYAxis->setEnabled(false);
|
dispYAxis->setEnabled(false);
|
||||||
@ -128,13 +127,18 @@ void qTabPlot::SetupWidgetWindow(){
|
|||||||
|
|
||||||
// Depending on whether the detector is 1d or 2d
|
// Depending on whether the detector is 1d or 2d
|
||||||
switch(myDet->getDetectorsType()){
|
switch(myDet->getDetectorsType()){
|
||||||
case slsDetectorDefs::MYTHEN: isOrginallyOneD = true; Select1DPlot(true); break;
|
case slsDetectorDefs::MYTHEN: isOrginallyOneD = true; break;
|
||||||
case slsDetectorDefs::EIGER: isOrginallyOneD = false; Select1DPlot(false);break;
|
case slsDetectorDefs::EIGER: isOrginallyOneD = false; break;
|
||||||
case slsDetectorDefs::GOTTHARD: isOrginallyOneD = true; Select1DPlot(true);break;
|
case slsDetectorDefs::GOTTHARD: isOrginallyOneD = true; break;
|
||||||
default:
|
default:
|
||||||
cout << "ERROR: Detector Type is Generic" << endl;
|
cout << "ERROR: Detector Type is Generic" << endl;
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Select1DPlot(isOrginallyOneD);
|
||||||
|
|
||||||
|
//to check if this should be enabled
|
||||||
|
EnableScanBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -143,6 +147,8 @@ void qTabPlot::SetupWidgetWindow(){
|
|||||||
|
|
||||||
void qTabPlot::Select1DPlot(bool b){
|
void qTabPlot::Select1DPlot(bool b){
|
||||||
isOneD = b;
|
isOneD = b;
|
||||||
|
dispTitle->setText(defaultPlotTitle);
|
||||||
|
myPlot->SetPlotTitle(defaultPlotTitle);
|
||||||
if(b){
|
if(b){
|
||||||
box1D->show();
|
box1D->show();
|
||||||
box2D->hide();
|
box2D->hide();
|
||||||
@ -169,7 +175,6 @@ void qTabPlot::Select1DPlot(bool b){
|
|||||||
myPlot->Select2DPlot();
|
myPlot->Select2DPlot();
|
||||||
}
|
}
|
||||||
|
|
||||||
boxScan->setEnabled(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -386,11 +391,13 @@ void qTabPlot::SetPlot(){
|
|||||||
#endif
|
#endif
|
||||||
if(radioNoPlot->isChecked()){
|
if(radioNoPlot->isChecked()){
|
||||||
cout << " - No Plot" << endl;
|
cout << " - No Plot" << endl;
|
||||||
Select1DPlot(isOrginallyOneD);
|
|
||||||
|
//Select1DPlot(isOrginallyOneD);
|
||||||
|
//if(isOrginallyOneD) {box1D->show(); box2D->hide();}
|
||||||
|
//if(!isOrginallyOneD){box2D->show(); box1D->hide();}
|
||||||
myPlot->EnablePlot(false);
|
myPlot->EnablePlot(false);
|
||||||
//if enable is true, disable everything
|
//if enable is true, disable everything
|
||||||
if(isOrginallyOneD) {box1D->show(); box1D->setEnabled(false); box2D->hide();}
|
|
||||||
if(!isOrginallyOneD){box2D->show(); box2D->setEnabled(false); box1D->hide();}
|
|
||||||
boxSnapshot->setEnabled(false);
|
boxSnapshot->setEnabled(false);
|
||||||
boxSave->setEnabled(false);
|
boxSave->setEnabled(false);
|
||||||
boxFrequency->setEnabled(false);
|
boxFrequency->setEnabled(false);
|
||||||
@ -398,10 +405,11 @@ void qTabPlot::SetPlot(){
|
|||||||
boxScan->setEnabled(false);
|
boxScan->setEnabled(false);
|
||||||
}else if(radioDataGraph->isChecked()){
|
}else if(radioDataGraph->isChecked()){
|
||||||
cout << " - DataGraph" << endl;
|
cout << " - DataGraph" << endl;
|
||||||
|
|
||||||
myPlot->EnablePlot(true);
|
myPlot->EnablePlot(true);
|
||||||
//if enable is true, disable everything
|
//if enable is true, disable everything
|
||||||
if(isOrginallyOneD) {box1D->show();box1D->setEnabled(true);} else box1D->hide();
|
if(isOrginallyOneD) {box1D->show(); box2D->hide();}
|
||||||
if(!isOrginallyOneD){box2D->show();box2D->setEnabled(true);} else box2D->hide();
|
if(!isOrginallyOneD) {box2D->show(); box1D->hide();}
|
||||||
Select1DPlot(isOrginallyOneD);
|
Select1DPlot(isOrginallyOneD);
|
||||||
boxSnapshot->setEnabled(true);
|
boxSnapshot->setEnabled(true);
|
||||||
boxSave->setEnabled(true);
|
boxSave->setEnabled(true);
|
||||||
@ -504,6 +512,9 @@ void qTabPlot::EnableScanBox(int mode,int id){
|
|||||||
radioLevel0->setEnabled(mode0);
|
radioLevel0->setEnabled(mode0);
|
||||||
radioLevel1->setEnabled(mode1);
|
radioLevel1->setEnabled(mode1);
|
||||||
}else EnablingNthFrameFunction(enableNFrame);
|
}else EnablingNthFrameFunction(enableNFrame);
|
||||||
|
|
||||||
|
//sets the scan argument
|
||||||
|
SetScanArgument();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -533,27 +544,67 @@ void qTabPlot::EnablingNthFrameFunction(bool enable){
|
|||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qTabPlot::SetScanArgument(){
|
void qTabPlot::SetScanArgument(){
|
||||||
switch(btnGroupScan->checkedId()){
|
|
||||||
|
|
||||||
//let qdrawplot know which scan argument
|
//as default from histogram and default titles are set here if scanbox is disabled
|
||||||
//myPlot->
|
Select1DPlot(isOrginallyOneD);
|
||||||
|
|
||||||
//level0
|
//this function is also called just to update, could be no scan
|
||||||
case 0:
|
if(boxScan->isEnabled()){
|
||||||
break;
|
|
||||||
|
|
||||||
//level1
|
//setting the title according to the scans
|
||||||
case 1:
|
QString mainTitle = QString(" Level 0 : ") + modeNames[myDet->getScanMode(0)] +
|
||||||
break;
|
QString(" | Level 1 : ") + modeNames[myDet->getScanMode(1)] + QString("");
|
||||||
|
dispTitle->setText(mainTitle);
|
||||||
|
myPlot->SetPlotTitle(mainTitle);
|
||||||
|
|
||||||
//file index
|
|
||||||
case 2:
|
|
||||||
break;
|
|
||||||
|
|
||||||
//all frames
|
//let qdrawplot know which scan argument
|
||||||
case 3:
|
myPlot->SetScanArgument(btnGroupScan->checkedId()+1);
|
||||||
break;
|
/** What happens for 2d????*/
|
||||||
}
|
//settings the x and y titles
|
||||||
|
switch(btnGroupScan->checkedId()){
|
||||||
|
//level0
|
||||||
|
case 0:
|
||||||
|
dispXAxis->setText("Channel Number");
|
||||||
|
dispYAxis->setText("Scan Level 0");
|
||||||
|
myPlot->SetHistXAxisTitle("Channel Number");
|
||||||
|
myPlot->SetHistYAxisTitle("Scan Level 0");
|
||||||
|
myPlot->Select1DPlot();
|
||||||
|
break;
|
||||||
|
|
||||||
|
//level1
|
||||||
|
case 1:
|
||||||
|
dispXAxis->setText("Channel Number");
|
||||||
|
dispYAxis->setText("Scan Level 1");
|
||||||
|
myPlot->SetHistXAxisTitle("Channel Number");
|
||||||
|
myPlot->SetHistYAxisTitle("Scan Level 1");
|
||||||
|
myPlot->Select1DPlot();
|
||||||
|
break;
|
||||||
|
|
||||||
|
//file index
|
||||||
|
case 2:
|
||||||
|
dispXAxis->setText("Channel Number");
|
||||||
|
dispYAxis->setText("File Index");
|
||||||
|
myPlot->SetHistXAxisTitle("Channel Number");
|
||||||
|
myPlot->SetHistYAxisTitle("File Index");
|
||||||
|
myPlot->Select1DPlot();
|
||||||
|
break;
|
||||||
|
|
||||||
|
//all frames
|
||||||
|
case 3:
|
||||||
|
Select1DPlot(false);
|
||||||
|
dispXAxis->setText("Channel Number");
|
||||||
|
dispYAxis->setText("Threshold");
|
||||||
|
dispZAxis->setText("Intensity");
|
||||||
|
myPlot->SetImageXAxisTitle("Channel Number");
|
||||||
|
myPlot->SetImageYAxisTitle("Threshold");
|
||||||
|
myPlot->SetImageZAxisTitle("Intensity");
|
||||||
|
myPlot->Select2DPlot();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}else //done here so that it isnt set by default each time
|
||||||
|
myPlot->SetScanArgument(0);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user