mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-07 18:40:42 +02:00
updated plot to show index instead of frame number
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@35 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
parent
40af9384b5
commit
1ce04ef785
@ -519,6 +519,9 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Level 0</string>
|
<string>Level 0</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@ -607,7 +610,7 @@
|
|||||||
<string>All Frames</string>
|
<string>All Frames</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checked">
|
<property name="checked">
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -1051,7 +1054,7 @@
|
|||||||
<item row="0" column="2">
|
<item row="0" column="2">
|
||||||
<widget class="QRadioButton" name="radioHistogram">
|
<widget class="QRadioButton" name="radioHistogram">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
@ -137,6 +137,8 @@ private:
|
|||||||
int currentMeasurement;
|
int currentMeasurement;
|
||||||
/** currentFrame */
|
/** currentFrame */
|
||||||
int currentFrame;
|
int currentFrame;
|
||||||
|
/** current Index */
|
||||||
|
int currentIndex;
|
||||||
/** Number of Exposures */
|
/** Number of Exposures */
|
||||||
int number_of_exposures;
|
int number_of_exposures;
|
||||||
/** Duration between Exposures */
|
/** Duration between Exposures */
|
||||||
|
@ -167,6 +167,7 @@ signals:
|
|||||||
void StartSignal();
|
void StartSignal();
|
||||||
void StopSignal();
|
void StopSignal();
|
||||||
void CheckPlotIntervalSignal();
|
void CheckPlotIntervalSignal();
|
||||||
|
void EnableNthFrameSignal(bool);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,6 +16,8 @@ class multiSlsDetector;
|
|||||||
class qDrawPlot;
|
class qDrawPlot;
|
||||||
/** Qt Include Headers */
|
/** Qt Include Headers */
|
||||||
#include <QStackedLayout>
|
#include <QStackedLayout>
|
||||||
|
#include <QButtonGroup>
|
||||||
|
#include <QAbstractButton>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*@short sets up the Plot parameters
|
*@short sets up the Plot parameters
|
||||||
@ -51,12 +53,14 @@ private:
|
|||||||
bool isOneD;
|
bool isOneD;
|
||||||
bool isOrginallyOneD;
|
bool isOrginallyOneD;
|
||||||
|
|
||||||
int scanLevel[2];
|
/**whether to enable nth frame according to timing mode*/
|
||||||
|
bool enableNFrame;
|
||||||
|
|
||||||
QStackedLayout *stackedLayout;
|
QStackedLayout *stackedLayout;
|
||||||
QSpinBox *spinNthFrame;
|
QSpinBox *spinNthFrame;
|
||||||
QDoubleSpinBox *spinTimeGap;
|
QDoubleSpinBox *spinTimeGap;
|
||||||
QComboBox *comboTimeGapUnit;
|
QComboBox *comboTimeGapUnit;
|
||||||
|
QButtonGroup *btnGroupScan;
|
||||||
|
|
||||||
/** some Default Values */
|
/** some Default Values */
|
||||||
static QString defaultPlotTitle;
|
static QString defaultPlotTitle;
|
||||||
@ -75,6 +79,11 @@ private:
|
|||||||
*/
|
*/
|
||||||
void Initialization();
|
void Initialization();
|
||||||
|
|
||||||
|
/** This enabled/disables the nth frame from frequency plot
|
||||||
|
* @param enable enable/disable
|
||||||
|
*/
|
||||||
|
void EnablingNthFrameFunction(bool enable);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -85,9 +94,18 @@ void SetFrequency();
|
|||||||
* @param enable to enable the scan group box
|
* @param enable to enable the scan group box
|
||||||
* @param id is 0 if its scan level 0 or scan level 1
|
* @param id is 0 if its scan level 0 or scan level 1
|
||||||
*/
|
*/
|
||||||
void EnableScanBox(int mode,int id);
|
void EnableScanBox(int mode=-1,int id=-1);
|
||||||
|
|
||||||
|
/** a variable is set when timing mode has been changed.
|
||||||
|
* This variable is also disabled if exptime>acq period to be on safe side
|
||||||
|
* Its to check whether to enabled nth frame for frequency plot
|
||||||
|
* @param enable enable/disable
|
||||||
|
*/
|
||||||
|
void EnableNthFrame(bool enable){enableNFrame = enable;};
|
||||||
|
|
||||||
|
/** Sets the scan argument of the plot
|
||||||
|
*/
|
||||||
|
void SetScanArgument();
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -119,7 +137,6 @@ signals:
|
|||||||
void DisableZoomSignal(bool);
|
void DisableZoomSignal(bool);
|
||||||
void SetZRangeSignal(double,double);
|
void SetZRangeSignal(double,double);
|
||||||
void EnableZRangeSignal(bool);
|
void EnableZRangeSignal(bool);
|
||||||
void ThresholdScanSignal(int);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -222,6 +222,7 @@ void qDetectorMain::Initialization(){
|
|||||||
connect(tab_measurement, SIGNAL(StartSignal()), this,SLOT(EnableTabs()));
|
connect(tab_measurement, SIGNAL(StartSignal()), this,SLOT(EnableTabs()));
|
||||||
connect(tab_measurement, SIGNAL(StopSignal()), this,SLOT(EnableTabs()));
|
connect(tab_measurement, SIGNAL(StopSignal()), this,SLOT(EnableTabs()));
|
||||||
connect(tab_measurement, SIGNAL(CheckPlotIntervalSignal()), tab_plot,SLOT(SetFrequency()));
|
connect(tab_measurement, SIGNAL(CheckPlotIntervalSignal()), tab_plot,SLOT(SetFrequency()));
|
||||||
|
connect(tab_measurement, SIGNAL(EnableNthFrameSignal(bool)), tab_plot,SLOT(EnableNthFrame(bool)));
|
||||||
// Plot tab
|
// Plot tab
|
||||||
connect(tab_plot, SIGNAL(DisableZoomSignal(bool)), this,SLOT(SetZoomToolTip(bool)));
|
connect(tab_plot, SIGNAL(DisableZoomSignal(bool)), this,SLOT(SetZoomToolTip(bool)));
|
||||||
// Actions tab
|
// Actions tab
|
||||||
|
@ -191,6 +191,9 @@ void qDrawPlot::StartStopDaqToggle(bool stop_if_running){
|
|||||||
// Acquisition Period
|
// Acquisition Period
|
||||||
acquisitionPeriod= ((double)(myDet->setTimer(slsDetectorDefs::FRAME_PERIOD,-1))*1E-9);
|
acquisitionPeriod= ((double)(myDet->setTimer(slsDetectorDefs::FRAME_PERIOD,-1))*1E-9);
|
||||||
cout << "\tAcquisition Period:" << setprecision (10) << acquisitionPeriod << endl;
|
cout << "\tAcquisition Period:" << setprecision (10) << acquisitionPeriod << endl;
|
||||||
|
// Current Index
|
||||||
|
currentIndex = myDet->getFileIndex();
|
||||||
|
cout << "\tCurrent Index:" << currentIndex << endl;
|
||||||
|
|
||||||
StartDaq(true);
|
StartDaq(true);
|
||||||
running=!running;
|
running=!running;
|
||||||
@ -305,6 +308,7 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
if(!data_pause_over){
|
if(!data_pause_over){
|
||||||
//lastImageNumber= currentFrame+1;
|
//lastImageNumber= currentFrame+1;
|
||||||
currentFrame++;
|
currentFrame++;
|
||||||
|
currentIndex++;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
data_pause_over=false;
|
data_pause_over=false;
|
||||||
@ -317,6 +321,7 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
else{
|
else{
|
||||||
//lastImageNumber= currentFrame+1;
|
//lastImageNumber= currentFrame+1;
|
||||||
currentFrame++;
|
currentFrame++;
|
||||||
|
currentIndex++;
|
||||||
progress=(int)data->progressIndex;
|
progress=(int)data->progressIndex;
|
||||||
//if theres an old copy, try to get lock again
|
//if theres an old copy, try to get lock again
|
||||||
if(oldCopy){
|
if(oldCopy){
|
||||||
@ -330,7 +335,7 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
//1d
|
//1d
|
||||||
if(plot_in_scope==1){
|
if(plot_in_scope==1){
|
||||||
// Titles
|
// Titles
|
||||||
sprintf(temp_title,"Frame %d",oldFrameNumber); histTitle[0] = temp_title;
|
sprintf(temp_title,"Frame Index%d",oldFrameNumber); histTitle[0] = temp_title;
|
||||||
// copy data//memcpy(histXAxis, xvalues,nPixelsX*sizeof(double));
|
// copy data//memcpy(histXAxis, xvalues,nPixelsX*sizeof(double));
|
||||||
for(int i=currentPersistency;i>0;i--)
|
for(int i=currentPersistency;i>0;i--)
|
||||||
memcpy(histYAxis[i],yvalues[i-1],nPixelsX*sizeof(double));
|
memcpy(histYAxis[i],yvalues[i-1],nPixelsX*sizeof(double));
|
||||||
@ -338,7 +343,7 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
}//2d
|
}//2d
|
||||||
else{
|
else{
|
||||||
// Titles
|
// Titles
|
||||||
sprintf(temp_title,"Image Number %d",oldFrameNumber);
|
sprintf(temp_title,"Image Index %d",oldFrameNumber);
|
||||||
imageTitle = temp_title;
|
imageTitle = temp_title;
|
||||||
// copy data
|
// copy data
|
||||||
//memcpy(lastImageArray,image_data,nPixelsX*nPixelsY*sizeof(double));
|
//memcpy(lastImageArray,image_data,nPixelsX*nPixelsY*sizeof(double));
|
||||||
@ -354,6 +359,7 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
progress=(int)data->progressIndex;
|
progress=(int)data->progressIndex;
|
||||||
//lastImageNumber= currentFrame+1;
|
//lastImageNumber= currentFrame+1;
|
||||||
currentFrame++;
|
currentFrame++;
|
||||||
|
currentIndex++;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//what comes here has plot enabled AND (frame factor OR data pause over )
|
//what comes here has plot enabled AND (frame factor OR data pause over )
|
||||||
@ -361,7 +367,7 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
|
|
||||||
if((currentFrame)<(number_of_exposures)){
|
if((currentFrame)<(number_of_exposures)){
|
||||||
#ifdef VERYVERBOSE
|
#ifdef VERYVERBOSE
|
||||||
cout<<"Reading in image: "<<currentFrame<<endl;
|
cout << "Reading in image: " << currentIndex << endl;
|
||||||
#endif
|
#endif
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
char temp_title[2000];
|
char temp_title[2000];
|
||||||
@ -371,7 +377,7 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
//1d
|
//1d
|
||||||
if(plot_in_scope==1){
|
if(plot_in_scope==1){
|
||||||
// Titles
|
// Titles
|
||||||
sprintf(temp_title,"Frame %d",currentFrame); 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;
|
||||||
@ -386,7 +392,7 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
//2d
|
//2d
|
||||||
else{
|
else{
|
||||||
// Titles
|
// Titles
|
||||||
sprintf(temp_title,"Image Number %d",currentFrame);
|
sprintf(temp_title,"Image Index %d",currentIndex);
|
||||||
imageTitle = temp_title;
|
imageTitle = temp_title;
|
||||||
// manufacture data for now
|
// manufacture data for now
|
||||||
for(unsigned int px=0;px<nPixelsX;px++)
|
for(unsigned int px=0;px<nPixelsX;px++)
|
||||||
@ -400,7 +406,7 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
}//copies old data only if its frame factor
|
}//copies old data only if its frame factor
|
||||||
else if(frameFactor){
|
else if(frameFactor){
|
||||||
oldCopy = true;
|
oldCopy = true;
|
||||||
oldFrameNumber = currentFrame;
|
oldFrameNumber = currentIndex;
|
||||||
//1D
|
//1D
|
||||||
if(plot_in_scope==1){
|
if(plot_in_scope==1){
|
||||||
// Persistency
|
// Persistency
|
||||||
@ -419,6 +425,7 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
currentFrame++;
|
currentFrame++;
|
||||||
|
currentIndex++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef VERYVERBOSE
|
#ifdef VERYVERBOSE
|
||||||
@ -602,6 +609,7 @@ void qDrawPlot::UpdatePlot(){
|
|||||||
}// To start the next measurement
|
}// To start the next measurement
|
||||||
else{
|
else{
|
||||||
emit SetCurrentMeasurementSignal(currentMeasurement);
|
emit SetCurrentMeasurementSignal(currentMeasurement);
|
||||||
|
currentIndex++;
|
||||||
StopDaqForGui();
|
StopDaqForGui();
|
||||||
StartDaq(true);
|
StartDaq(true);
|
||||||
}
|
}
|
||||||
|
@ -404,14 +404,17 @@ void qTabMeasurement::setAcquisitionPeriod(){
|
|||||||
lblPeriod->setToolTip(errPeriodTip);
|
lblPeriod->setToolTip(errPeriodTip);
|
||||||
lblPeriod->setPalette(red);
|
lblPeriod->setPalette(red);
|
||||||
lblPeriod->setText("Acquisition Period:*");
|
lblPeriod->setText("Acquisition Period:*");
|
||||||
|
emit EnableNthFrameSignal(false);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
spinPeriod->setToolTip(acqPeriodTip);
|
spinPeriod->setToolTip(acqPeriodTip);
|
||||||
lblPeriod->setToolTip(acqPeriodTip);
|
lblPeriod->setToolTip(acqPeriodTip);
|
||||||
lblPeriod->setPalette(lblTimingMode->palette());
|
lblPeriod->setPalette(lblTimingMode->palette());
|
||||||
lblPeriod->setText("Acquisition Period:");
|
lblPeriod->setText("Acquisition Period:");
|
||||||
|
emit EnableNthFrameSignal(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Check if the interval between plots is ok
|
//Check if the interval between plots is ok
|
||||||
emit CheckPlotIntervalSignal();
|
emit CheckPlotIntervalSignal();
|
||||||
}
|
}
|
||||||
@ -558,6 +561,7 @@ void qTabMeasurement::SetTimingMode(int mode){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(mode!=None){//Number of Probes
|
if(mode!=None){//Number of Probes
|
||||||
if(myDet->getDetectorsType()==slsDetectorDefs::MYTHEN){
|
if(myDet->getDetectorsType()==slsDetectorDefs::MYTHEN){
|
||||||
lblNumProbes->setEnabled(true); spinNumProbes->setEnabled(true);
|
lblNumProbes->setEnabled(true); spinNumProbes->setEnabled(true);
|
||||||
@ -668,9 +672,19 @@ void qTabMeasurement::SetTimingMode(int mode){
|
|||||||
myPlot->setFrameEnabled(lblNumFrames->isEnabled());
|
myPlot->setFrameEnabled(lblNumFrames->isEnabled());
|
||||||
myPlot->setTriggerEnabled(lblNumTriggers->isEnabled());
|
myPlot->setTriggerEnabled(lblNumTriggers->isEnabled());
|
||||||
|
|
||||||
|
|
||||||
|
//check if period is enabled and alright, only then the nth frame frequency is enabled
|
||||||
|
if((lblPeriod->isEnabled())&&(lblPeriod->text()=="Acquisition Period:"))
|
||||||
|
emit EnableNthFrameSignal(true);
|
||||||
|
else emit EnableNthFrameSignal(false);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabMeasurement::EnableFileWrite(bool enable){
|
void qTabMeasurement::EnableFileWrite(bool enable){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Enable File Write:" << enable << endl;
|
cout << "Enable File Write:" << enable << endl;
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include "slsDetector.h"
|
#include "slsDetector.h"
|
||||||
#include "multiSlsDetector.h"
|
#include "multiSlsDetector.h"
|
||||||
// Qt Include Headers
|
// Qt Include Headers
|
||||||
|
#include <QStandardItemModel>
|
||||||
// C++ Include Headers
|
// C++ Include Headers
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -52,8 +53,27 @@ qTabPlot::~qTabPlot(){
|
|||||||
|
|
||||||
|
|
||||||
void qTabPlot::SetupWidgetWindow(){
|
void qTabPlot::SetupWidgetWindow(){
|
||||||
scanLevel[0]=false;
|
//check if nth frame should be enabled
|
||||||
scanLevel[1]=false;
|
enableNFrame = true;
|
||||||
|
//according to timing mode
|
||||||
|
slsDetectorDefs::externalCommunicationMode mode = myDet->setExternalCommunicationMode();
|
||||||
|
if( (mode==slsDetectorDefs::GATE_FIX_NUMBER)||
|
||||||
|
(mode==slsDetectorDefs::TRIGGER_FRAME) ||
|
||||||
|
(mode==slsDetectorDefs::TRIGGER_WINDOW) ||
|
||||||
|
((mode==slsDetectorDefs::AUTO_TIMING)&&((int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,-1)==1)&&((int)myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,-1)==1)) )
|
||||||
|
enableNFrame = false;
|
||||||
|
//according to if exptime > acq period
|
||||||
|
if((myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,-1)*(1E-9))>(myDet->setTimer(slsDetectorDefs::FRAME_PERIOD,-1)*(1E-9)))
|
||||||
|
enableNFrame = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//scan arguments
|
||||||
|
btnGroupScan = new QButtonGroup(this);
|
||||||
|
btnGroupScan->addButton(radioLevel0,0);
|
||||||
|
btnGroupScan->addButton(radioLevel1,1);
|
||||||
|
btnGroupScan->addButton(radioFileIndex,2);
|
||||||
|
btnGroupScan->addButton(radioAllFrames,3);
|
||||||
|
|
||||||
// Plot Axis
|
// Plot Axis
|
||||||
myPlot->SetPlotTitle(defaultPlotTitle);
|
myPlot->SetPlotTitle(defaultPlotTitle);
|
||||||
@ -129,10 +149,10 @@ void qTabPlot::Select1DPlot(bool b){
|
|||||||
chkZAxis->setEnabled(false);
|
chkZAxis->setEnabled(false);
|
||||||
chkZMin->setEnabled(false);
|
chkZMin->setEnabled(false);
|
||||||
chkZMax->setEnabled(false);
|
chkZMax->setEnabled(false);
|
||||||
myPlot->SetHistXAxisTitle(defaultHistXAxisTitle);
|
|
||||||
dispXAxis->setText(defaultHistXAxisTitle);
|
dispXAxis->setText(defaultHistXAxisTitle);
|
||||||
myPlot->SetHistYAxisTitle(defaultHistYAxisTitle);
|
|
||||||
dispYAxis->setText(defaultHistYAxisTitle);
|
dispYAxis->setText(defaultHistYAxisTitle);
|
||||||
|
myPlot->SetHistXAxisTitle(defaultHistXAxisTitle);
|
||||||
|
myPlot->SetHistYAxisTitle(defaultHistYAxisTitle);
|
||||||
myPlot->Select1DPlot();
|
myPlot->Select1DPlot();
|
||||||
}else{
|
}else{
|
||||||
box1D->hide();
|
box1D->hide();
|
||||||
@ -140,22 +160,12 @@ void qTabPlot::Select1DPlot(bool b){
|
|||||||
chkZAxis->setEnabled(true);
|
chkZAxis->setEnabled(true);
|
||||||
chkZMin->setEnabled(true);
|
chkZMin->setEnabled(true);
|
||||||
chkZMax->setEnabled(true);
|
chkZMax->setEnabled(true);
|
||||||
|
|
||||||
//threshold scan
|
|
||||||
if((scanLevel[0]==2)||(scanLevel[1]==2)){
|
|
||||||
myPlot->SetImageXAxisTitle("Channel Number");
|
|
||||||
dispXAxis->setText("Channel Number");
|
|
||||||
dispYAxis->setText("Threshold");
|
|
||||||
myPlot->SetImageYAxisTitle("Threshold");
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
myPlot->SetImageXAxisTitle(defaultImageXAxisTitle);
|
|
||||||
dispXAxis->setText(defaultImageXAxisTitle);
|
dispXAxis->setText(defaultImageXAxisTitle);
|
||||||
dispYAxis->setText(defaultImageYAxisTitle);
|
dispYAxis->setText(defaultImageYAxisTitle);
|
||||||
myPlot->SetImageYAxisTitle(defaultImageYAxisTitle);
|
|
||||||
}
|
|
||||||
myPlot->SetImageZAxisTitle(defaultImageZAxisTitle);
|
|
||||||
dispZAxis->setText(defaultImageZAxisTitle);
|
dispZAxis->setText(defaultImageZAxisTitle);
|
||||||
|
myPlot->SetImageXAxisTitle(defaultImageXAxisTitle);
|
||||||
|
myPlot->SetImageYAxisTitle(defaultImageYAxisTitle);
|
||||||
|
myPlot->SetImageZAxisTitle(defaultImageZAxisTitle);
|
||||||
myPlot->Select2DPlot();
|
myPlot->Select2DPlot();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,7 +182,7 @@ void qTabPlot::Initialization(){
|
|||||||
connect(radioHistogram, SIGNAL(toggled(bool)),this, SLOT(SetPlot()));
|
connect(radioHistogram, SIGNAL(toggled(bool)),this, SLOT(SetPlot()));
|
||||||
connect(radioDataGraph, SIGNAL(toggled(bool)),this, SLOT(SetPlot()));
|
connect(radioDataGraph, SIGNAL(toggled(bool)),this, SLOT(SetPlot()));
|
||||||
// Scan box
|
// Scan box
|
||||||
//connect(scna, SIGNAL(toggled(bool)),this, SLOT(scanstuff(bool)));
|
connect(btnGroupScan, SIGNAL(buttonClicked(QAbstractButton *)),this, SLOT(SetScanArgument()));
|
||||||
// Snapshot box
|
// Snapshot box
|
||||||
connect(btnClone, SIGNAL(clicked()),myPlot, SLOT(ClonePlot()));
|
connect(btnClone, SIGNAL(clicked()),myPlot, SLOT(ClonePlot()));
|
||||||
connect(btnCloseClones, SIGNAL(clicked()),myPlot, SLOT(CloseClones()));
|
connect(btnCloseClones, SIGNAL(clicked()),myPlot, SLOT(CloseClones()));
|
||||||
@ -213,6 +223,7 @@ void qTabPlot::Initialization(){
|
|||||||
connect(dispYMax, SIGNAL(returnPressed()), this, SLOT(SetAxesRange()));
|
connect(dispYMax, SIGNAL(returnPressed()), this, SLOT(SetAxesRange()));
|
||||||
connect(dispZMin, SIGNAL(returnPressed()), this, SLOT(SetZRange()));
|
connect(dispZMin, SIGNAL(returnPressed()), this, SLOT(SetZRange()));
|
||||||
connect(dispZMax, SIGNAL(returnPressed()), this, SLOT(SetZRange()));
|
connect(dispZMax, SIGNAL(returnPressed()), this, SLOT(SetZRange()));
|
||||||
|
|
||||||
connect(this,SIGNAL(SetZRangeSignal(double,double)),myPlot, SIGNAL(SetZRangeSignal(double,double)));
|
connect(this,SIGNAL(SetZRangeSignal(double,double)),myPlot, SIGNAL(SetZRangeSignal(double,double)));
|
||||||
|
|
||||||
// Common Buttons
|
// Common Buttons
|
||||||
@ -396,20 +407,10 @@ void qTabPlot::SetPlot(){
|
|||||||
boxSave->setEnabled(true);
|
boxSave->setEnabled(true);
|
||||||
boxFrequency->setEnabled(true);
|
boxFrequency->setEnabled(true);
|
||||||
boxPlotAxis->setEnabled(true);
|
boxPlotAxis->setEnabled(true);
|
||||||
|
EnableScanBox();
|
||||||
}else{
|
}else{
|
||||||
cout << " - Histogram" << endl;
|
cout << " - Histogram" << endl;
|
||||||
myPlot->EnablePlot(true);
|
//select(2d) will set oneD to false, but originallyoneD will remember
|
||||||
Select1DPlot(false);
|
|
||||||
box1D->hide();
|
|
||||||
box2D->show();
|
|
||||||
box2D->setEnabled(true);
|
|
||||||
boxSnapshot->setEnabled(true);
|
|
||||||
boxSave->setEnabled(true);
|
|
||||||
boxFrequency->setEnabled(false);
|
|
||||||
boxPlotAxis->setEnabled(true);
|
|
||||||
boxScan->setEnabled(false);
|
|
||||||
myPlot->SetPlotTimer(250);
|
|
||||||
emit ThresholdScanSignal(0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -452,7 +453,7 @@ void qTabPlot::SetFrequency(){
|
|||||||
timeMS = (spinNthFrame->value())*acqPeriodMS;
|
timeMS = (spinNthFrame->value())*acqPeriodMS;
|
||||||
// To make sure the period between plotting is not less than minimum plot timer in ms
|
// To make sure the period between plotting is not less than minimum plot timer in ms
|
||||||
if(timeMS<minPlotTimer){
|
if(timeMS<minPlotTimer){
|
||||||
int minFrame = (ceil)(minPlotTimer/acqPeriodMS);
|
int minFrame = (int)(ceil)(minPlotTimer/acqPeriodMS);
|
||||||
qDefs::WarningMessage("<b>Plot Tab:</b> Interval between Plots - The nth Image must be larger.<br><br>"
|
qDefs::WarningMessage("<b>Plot Tab:</b> Interval between Plots - The nth Image must be larger.<br><br>"
|
||||||
"Condition to be satisfied:\n(Acquisition Period)*(nth Image) >= 250ms."
|
"Condition to be satisfied:\n(Acquisition Period)*(nth Image) >= 250ms."
|
||||||
"<br><br>Nth image adjusted to minimum, "
|
"<br><br>Nth image adjusted to minimum, "
|
||||||
@ -477,57 +478,87 @@ void qTabPlot::SetFrequency(){
|
|||||||
|
|
||||||
|
|
||||||
void qTabPlot::EnableScanBox(int mode,int id){
|
void qTabPlot::EnableScanBox(int mode,int id){
|
||||||
#ifdef VERBOSE
|
#ifdef VERYVERBOSE
|
||||||
cout << "Entering Enable Scan Box()" << endl;
|
cout << "Entering Enable Scan Box() \t mode:" << mode << " \t id:" << id << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int mode0 = myDet->getScanMode(0);
|
||||||
|
int mode1 = myDet->getScanMode(1);
|
||||||
|
|
||||||
scanLevel[id]=mode;
|
boxScan->setEnabled(mode0||mode1);
|
||||||
//both are disabled
|
|
||||||
if((!scanLevel[0])&&(!scanLevel[1])){
|
|
||||||
boxScan->setEnabled(false);
|
|
||||||
}//both are enabled
|
|
||||||
else if((scanLevel[0])&&(scanLevel[1])){
|
|
||||||
//disable none and check the other
|
|
||||||
if(id) {radioLevel1->setEnabled(true);radioLevel1->setChecked(true);}
|
|
||||||
else {radioLevel0->setEnabled(true);radioLevel0->setChecked(true);}
|
|
||||||
}//either 1 is enabled/disabled
|
|
||||||
else{
|
|
||||||
if(!boxScan->isEnabled()) {
|
|
||||||
boxScan->setEnabled(true);
|
|
||||||
radioFileIndex->setEnabled(false);/**???*/
|
|
||||||
}
|
|
||||||
//disable one and check the other
|
|
||||||
if(id) {
|
|
||||||
radioLevel0->setEnabled(!mode);
|
|
||||||
radioLevel0->setChecked(!mode);
|
|
||||||
radioLevel1->setEnabled(mode);
|
|
||||||
radioLevel1->setChecked(mode);
|
|
||||||
}else{
|
|
||||||
radioLevel0->setEnabled(mode);
|
|
||||||
radioLevel0->setChecked(mode);
|
|
||||||
radioLevel1->setEnabled(!mode);
|
|
||||||
radioLevel1->setChecked(!mode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//check for threshold
|
|
||||||
if((scanLevel[0]==2)||(scanLevel[1]==2))
|
|
||||||
radioHistogram->setChecked(true);
|
|
||||||
else
|
|
||||||
radioDataGraph->setChecked(true);
|
|
||||||
|
|
||||||
/*
|
|
||||||
if(boxScan->isEnabled()){
|
if(boxScan->isEnabled()){
|
||||||
myDet->setPlotType(i);
|
//make sure nth frame frequency plot is disabled
|
||||||
}*/
|
EnablingNthFrameFunction(false);
|
||||||
|
|
||||||
|
//if level0 or 1, check argument to find which scan enabled last from actions tab
|
||||||
|
if((btnGroupScan->checkedId()!=2)&&(btnGroupScan->checkedId()!=3)){
|
||||||
|
cout<<"mode:"<<mode<<" id:"<<id<<endl;
|
||||||
|
//if mode is not none(doesnt check them if called form refresh)
|
||||||
|
if(mode>0){
|
||||||
|
if(!id) radioLevel0->setChecked(true);
|
||||||
|
else radioLevel1->setChecked(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
radioLevel0->setEnabled(mode0);
|
||||||
|
radioLevel1->setEnabled(mode1);
|
||||||
|
}else EnablingNthFrameFunction(enableNFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void qTabPlot::EnablingNthFrameFunction(bool enable){
|
||||||
|
#ifdef VERYVERBOSE
|
||||||
|
cout << "Enabling Nth Frame : " << enable << endl;
|
||||||
|
#endif
|
||||||
|
QStandardItemModel* model = qobject_cast<QStandardItemModel*>(comboFrequency->model());
|
||||||
|
QStandardItem* item = model->itemFromIndex(model->index(1, comboFrequency->modelColumn(), comboFrequency->rootModelIndex()));
|
||||||
|
|
||||||
|
//enabling/disabling is easy if it wasnt selected anyway
|
||||||
|
if(comboFrequency->currentIndex()!=1)
|
||||||
|
item->setEnabled(enable);
|
||||||
|
else{
|
||||||
|
//only when it was enabled before and now to disable is a problem
|
||||||
|
if(!enable){
|
||||||
|
spinTimeGap->setValue(myPlot->GetMinimumPlotTimer());
|
||||||
|
comboFrequency->setCurrentIndex(0);
|
||||||
|
item->setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void qTabPlot::SetScanArgument(){
|
||||||
|
switch(btnGroupScan->checkedId()){
|
||||||
|
//level0
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
|
||||||
|
//level1
|
||||||
|
case 1:
|
||||||
|
break;
|
||||||
|
|
||||||
|
//file index
|
||||||
|
case 2:
|
||||||
|
break;
|
||||||
|
|
||||||
|
//all frames
|
||||||
|
case 3:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabPlot::Refresh(){
|
void qTabPlot::Refresh(){
|
||||||
SetFrequency();
|
SetFrequency();
|
||||||
|
EnableScanBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user