mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-06 10:00:40 +02:00
included accumulate, pedestal and binary
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@204 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
parent
12f48fb0d2
commit
d84f95456b
File diff suppressed because it is too large
Load Diff
@ -131,6 +131,9 @@ public:
|
|||||||
*/
|
*/
|
||||||
void UpdateAfterCloning(bool points, bool logy, bool interpolate, bool contour, bool logz);
|
void UpdateAfterCloning(bool points, bool logy, bool interpolate, bool contour, bool logz);
|
||||||
|
|
||||||
|
/** set binary range */
|
||||||
|
void SetBinary(bool enable, int from=0, int to=0);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
/** To select 1D or 2D plot
|
/** To select 1D or 2D plot
|
||||||
@param i is 1 for 1D, else 2D plot */
|
@param i is 1 for 1D, else 2D plot */
|
||||||
@ -161,14 +164,14 @@ void SetMarkers(bool enable){markers = enable;};
|
|||||||
void SetScanArgument(int scanArg);
|
void SetScanArgument(int scanArg);
|
||||||
/** sets stop_signal to true */
|
/** sets stop_signal to true */
|
||||||
void StopAcquisition(){ stop_signal = true; };
|
void StopAcquisition(){ stop_signal = true; };
|
||||||
|
/** Set/unset pedestal */
|
||||||
|
void SetPedestal(bool enable);
|
||||||
//pedestal
|
/** Recalculate Pedestal */
|
||||||
/** reset pedestal */
|
void RecalculatePedestal();
|
||||||
void ResetPedestal();
|
/** Set/unset accumulate */
|
||||||
/** Calculate Pedestal */
|
void SetAccumulate(bool enable);
|
||||||
void CalculatePedestal();
|
/** Reset accumulation */
|
||||||
|
void ResetAccumulate();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -491,12 +494,27 @@ bool originally2D;
|
|||||||
//pedstal
|
//pedstal
|
||||||
/** Number of pedestal frames*/
|
/** Number of pedestal frames*/
|
||||||
static const int NUM_PEDESTAL_FRAMES = 20;
|
static const int NUM_PEDESTAL_FRAMES = 20;
|
||||||
/**reset pedestal*/
|
/** set/unset pedestal*/
|
||||||
bool resetPedestal;
|
bool pedestal;
|
||||||
/** pedestal values */
|
/** pedestal values */
|
||||||
double* pedestalVals;
|
double* pedestalVals;
|
||||||
|
/** temporary pedestal values to hide while recalculating*/
|
||||||
|
double* tempPedestalVals;
|
||||||
/** count for 20 frames to calculate the pedestal */
|
/** count for 20 frames to calculate the pedestal */
|
||||||
int pedestalCount;
|
int pedestalCount;
|
||||||
|
/** start pedestal calculation */
|
||||||
|
bool startPedestalCal;
|
||||||
|
|
||||||
|
//accumulation
|
||||||
|
/** set/unset accumulation */
|
||||||
|
bool accumulate;
|
||||||
|
/** to reset accumulation */
|
||||||
|
bool resetAccumulate;
|
||||||
|
|
||||||
|
/** range for binary plot output */
|
||||||
|
bool binary;
|
||||||
|
int binaryFrom;
|
||||||
|
int binaryTo;
|
||||||
|
|
||||||
/** this is set when client starts/stops acquisition
|
/** this is set when client starts/stops acquisition
|
||||||
* and is reset once the gui really starts/stops */
|
* and is reset once the gui really starts/stops */
|
||||||
|
@ -147,12 +147,14 @@ private slots:
|
|||||||
/** Set Plot to none, data graph, histogram*/
|
/** Set Plot to none, data graph, histogram*/
|
||||||
void SetPlot();
|
void SetPlot();
|
||||||
|
|
||||||
/** Change pages in 1D box*/
|
/** Change pages in plot options box to the right*/
|
||||||
void Set1DPage();
|
void SetPlotOptionsRightPage();
|
||||||
|
|
||||||
/** Change pages in 2D box*/
|
/** Change pages in plot options box to the left*/
|
||||||
void Set2DPage();
|
void SetPlotOptionsLeftPage();
|
||||||
|
|
||||||
|
/** Plot binary plot */
|
||||||
|
void SetBinary();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void DisableZoomSignal(bool);
|
void DisableZoomSignal(bool);
|
||||||
|
@ -179,15 +179,23 @@ void qDrawPlot::SetupWidgetWindow(){
|
|||||||
fileSaveEnable= myDet->enableWriteToFile();
|
fileSaveEnable= myDet->enableWriteToFile();
|
||||||
|
|
||||||
//pedestal
|
//pedestal
|
||||||
resetPedestal = true;
|
pedestal = false;
|
||||||
pedestalVals = 0;
|
pedestalVals = 0;
|
||||||
pedestalCount = -1;
|
tempPedestalVals = 0;
|
||||||
|
pedestalCount = 0;
|
||||||
|
startPedestalCal = false;
|
||||||
|
|
||||||
if(myDet->getDetectorsType()==slsDetectorDefs::GOTTHARD)
|
//accumulate
|
||||||
pedestalCount = 0;
|
accumulate = false;
|
||||||
|
resetAccumulate = false;
|
||||||
|
|
||||||
clientInitiated = false;
|
clientInitiated = false;
|
||||||
|
|
||||||
|
//binary plot output
|
||||||
|
binary = false;
|
||||||
|
binaryFrom = 0;
|
||||||
|
binaryTo = 0;
|
||||||
|
|
||||||
//widget related initialization
|
//widget related initialization
|
||||||
|
|
||||||
// clone
|
// clone
|
||||||
@ -854,70 +862,95 @@ int qDrawPlot::GetData(detectorData *data,int fIndex){
|
|||||||
for(int i=currentPersistency;i>0;i--)
|
for(int i=currentPersistency;i>0;i--)
|
||||||
memcpy(histYAxis[i],histYAxis[i-1],nPixelsX*sizeof(double));
|
memcpy(histYAxis[i],histYAxis[i-1],nPixelsX*sizeof(double));
|
||||||
|
|
||||||
//normal data
|
//recalculating pedestal
|
||||||
if(resetPedestal){
|
if(startPedestalCal){
|
||||||
memcpy(histYAxis[0],data->values,nPixelsX*sizeof(double));
|
pedestalCount++;
|
||||||
}else{
|
|
||||||
//start adding frames to get to the pedestal value
|
//start adding frames to get to the pedestal value
|
||||||
if(pedestalCount<NUM_PEDESTAL_FRAMES){
|
if(pedestalCount<NUM_PEDESTAL_FRAMES){
|
||||||
for(unsigned int px=0;px<nPixelsX;px++)
|
for(unsigned int px=0;px<nPixelsX;px++)
|
||||||
pedestalVals[px] += data->values[px];
|
tempPedestalVals[px] += data->values[px];
|
||||||
memcpy(histYAxis[0],data->values,nPixelsX*sizeof(double));
|
memcpy(histYAxis[0],data->values,nPixelsX*sizeof(double));
|
||||||
}
|
}
|
||||||
//calculate the pedestal value
|
//calculate the pedestal value
|
||||||
else if(pedestalCount==NUM_PEDESTAL_FRAMES){
|
else if(pedestalCount==NUM_PEDESTAL_FRAMES){
|
||||||
cout << "Pedestal Calculated" << endl;
|
cout << "Pedestal Calculated" << endl;
|
||||||
for(unsigned int px=0;px<nPixelsX;px++)
|
for(unsigned int px=0;px<nPixelsX;px++)
|
||||||
pedestalVals[px] = pedestalVals[px]/(double)NUM_PEDESTAL_FRAMES;
|
tempPedestalVals[px] = tempPedestalVals[px]/(double)NUM_PEDESTAL_FRAMES;
|
||||||
memcpy(histYAxis[0],data->values,nPixelsX*sizeof(double));
|
memcpy(pedestalVals,tempPedestalVals,nPixelsX*sizeof(double));
|
||||||
|
startPedestalCal = 0;
|
||||||
}
|
}
|
||||||
//use this pedestal value henceforth
|
|
||||||
else{
|
|
||||||
for(unsigned int px=0;px<nPixelsX;px++)
|
|
||||||
histYAxis[0][px] = data->values[px] - (pedestalVals[px]);
|
|
||||||
}
|
|
||||||
pedestalCount++;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//normal data
|
||||||
|
if(((!pedestal)&(!accumulate)) || (resetAccumulate)){
|
||||||
|
memcpy(histYAxis[0],data->values,nPixelsX*sizeof(double));
|
||||||
|
resetAccumulate = false;
|
||||||
|
}
|
||||||
|
//pedestal or accumulate
|
||||||
|
else{
|
||||||
|
for(unsigned int px=0;px<(nPixelsX*nPixelsY);px++){
|
||||||
|
if(accumulate)
|
||||||
|
histYAxis[0][px] += data->values[px];
|
||||||
|
else
|
||||||
|
histYAxis[0][px] = data->values[px];
|
||||||
|
if(pedestal)
|
||||||
|
histYAxis[0][px] = histYAxis[0][px] - (pedestalVals[px]);
|
||||||
|
if(binary) {
|
||||||
|
if ((histYAxis[0][px] >= binaryFrom) && (histYAxis[0][px] <= binaryTo))
|
||||||
|
histYAxis[0][px] = 1;
|
||||||
|
else
|
||||||
|
histYAxis[0][px] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//2d
|
//2d
|
||||||
else{
|
else{
|
||||||
// Titles
|
// Titles
|
||||||
imageTitle = temp_title;
|
imageTitle = temp_title;
|
||||||
// manufacture data for now
|
//recalculating pedestal
|
||||||
/* default data
|
if(startPedestalCal){
|
||||||
for(unsigned int px=0;px<nPixelsX;px++)
|
pedestalCount++;
|
||||||
for(unsigned int py=0;py<nPixelsY;py++)
|
|
||||||
lastImageArray[py*nPixelsX+px] = sqrt(pow(currentFrame+1,2)*pow(double(px)-nPixelsX/2,2)/pow(nPixelsX/2,2)/pow(number_of_exposures+1,2) + pow(double(py)-nPixelsY/2,2)/pow(nPixelsY/2,2))/sqrt(2);
|
|
||||||
*/
|
|
||||||
// copy data
|
|
||||||
/*memcpy(lastImageArray,data->values,nPixelsX*nPixelsY*sizeof(double));*/
|
|
||||||
//normal data
|
|
||||||
if(resetPedestal){
|
|
||||||
memcpy(lastImageArray,data->values,nPixelsX*nPixelsY*sizeof(double));
|
|
||||||
}else{
|
|
||||||
//start adding frames to get to the pedestal value
|
//start adding frames to get to the pedestal value
|
||||||
if(pedestalCount<NUM_PEDESTAL_FRAMES){
|
if(pedestalCount<NUM_PEDESTAL_FRAMES){
|
||||||
for(unsigned int px=0;px<(nPixelsX*nPixelsY);px++)
|
for(unsigned int px=0;px<(nPixelsX*nPixelsY);px++)
|
||||||
pedestalVals[px] += data->values[px];
|
tempPedestalVals[px] += data->values[px];
|
||||||
memcpy(lastImageArray,data->values,nPixelsX*nPixelsY*sizeof(double));
|
memcpy(lastImageArray,data->values,nPixelsX*nPixelsY*sizeof(double));
|
||||||
}
|
}
|
||||||
//calculate the pedestal value
|
//calculate the pedestal value
|
||||||
else if(pedestalCount==NUM_PEDESTAL_FRAMES){
|
else if(pedestalCount==NUM_PEDESTAL_FRAMES){
|
||||||
cout << "Pedestal Calculated" << endl;
|
cout << "Pedestal Calculated" << endl;
|
||||||
for(unsigned int px=0;px<(nPixelsX*nPixelsY);px++)
|
for(unsigned int px=0;px<(nPixelsX*nPixelsY);px++)
|
||||||
pedestalVals[px] = pedestalVals[px]/(double)NUM_PEDESTAL_FRAMES;
|
tempPedestalVals[px] = tempPedestalVals[px]/(double)NUM_PEDESTAL_FRAMES;
|
||||||
memcpy(lastImageArray,data->values,nPixelsX*nPixelsY*sizeof(double));
|
|
||||||
}
|
|
||||||
//use this pedestal value henceforth
|
|
||||||
else{
|
|
||||||
for(unsigned int px=0;px<(nPixelsX*nPixelsY);px++)
|
|
||||||
lastImageArray[px] = data->values[px] - (pedestalVals[px]);
|
|
||||||
}
|
|
||||||
pedestalCount++;
|
|
||||||
|
|
||||||
|
memcpy(pedestalVals,tempPedestalVals,nPixelsX*nPixelsY*sizeof(double));
|
||||||
|
startPedestalCal = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//normal data
|
||||||
|
if(((!pedestal)&(!accumulate)) || (resetAccumulate)){
|
||||||
|
memcpy(lastImageArray,data->values,nPixelsX*nPixelsY*sizeof(double));
|
||||||
|
resetAccumulate = false;
|
||||||
|
}
|
||||||
|
//pedestal or accumulate or binary
|
||||||
|
else{
|
||||||
|
for(unsigned int px=0;px<(nPixelsX*nPixelsY);px++){
|
||||||
|
if(accumulate)
|
||||||
|
lastImageArray[px] += data->values[px];
|
||||||
|
else
|
||||||
|
lastImageArray[px] = data->values[px];
|
||||||
|
if(pedestal)
|
||||||
|
lastImageArray[px] = lastImageArray[px] - (pedestalVals[px]);
|
||||||
|
if(binary) {
|
||||||
|
if ((lastImageArray[px] >= binaryFrom) && (lastImageArray[px] <= binaryTo))
|
||||||
|
lastImageArray[px] = 1;
|
||||||
|
else
|
||||||
|
lastImageArray[px] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&(last_image_complete_mutex));
|
pthread_mutex_unlock(&(last_image_complete_mutex));
|
||||||
}
|
}
|
||||||
@ -1591,15 +1624,41 @@ int qDrawPlot::UpdateTrimbitPlot(bool fromDetector,bool Histogram){
|
|||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qDrawPlot::ResetPedestal(){
|
void qDrawPlot::SetPedestal(bool enable){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Resetting Pedestal" << endl;
|
cout << "Setting Pedestal to " << enable << endl;
|
||||||
|
#endif
|
||||||
|
if(enable){
|
||||||
|
pedestal = true;
|
||||||
|
if(pedestalVals == 0)
|
||||||
|
RecalculatePedestal();
|
||||||
|
}else{
|
||||||
|
pedestal = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void qDrawPlot::RecalculatePedestal(){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "Recalculating Pedestal" << endl;
|
||||||
#endif
|
#endif
|
||||||
while(1){
|
while(1){
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
pedestalVals = 0;
|
startPedestalCal = 1;
|
||||||
pedestalCount = 0;
|
pedestalCount = 0;
|
||||||
resetPedestal = true;
|
|
||||||
|
//create array
|
||||||
|
if(pedestalVals) delete [] pedestalVals; pedestalVals = new double[nPixelsX*nPixelsY];
|
||||||
|
if(tempPedestalVals) delete [] tempPedestalVals; tempPedestalVals = new double[nPixelsX*nPixelsY];
|
||||||
|
//reset all values
|
||||||
|
for(unsigned int px=0;px<(nPixelsX*nPixelsY);px++)
|
||||||
|
pedestalVals[px] = 0;
|
||||||
|
for(unsigned int px=0;px<(nPixelsX*nPixelsY);px++)
|
||||||
|
tempPedestalVals[px] = 0;
|
||||||
|
|
||||||
pthread_mutex_unlock(&(last_image_complete_mutex));
|
pthread_mutex_unlock(&(last_image_complete_mutex));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1610,20 +1669,23 @@ void qDrawPlot::ResetPedestal(){
|
|||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qDrawPlot::CalculatePedestal(){
|
void qDrawPlot::SetAccumulate(bool enable){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Calculating Pedestal" << endl;
|
cout << "Setting Accumulate to " << enable << endl;
|
||||||
|
#endif
|
||||||
|
accumulate = enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void qDrawPlot::ResetAccumulate(){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "Resetting Accumulation" << endl;
|
||||||
#endif
|
#endif
|
||||||
while(1){
|
while(1){
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
//create array
|
resetAccumulate = true;
|
||||||
if(pedestalVals) delete [] pedestalVals; pedestalVals = new double[nPixelsX*nPixelsY];
|
|
||||||
//reset all values
|
|
||||||
for(unsigned int px=0;px<(nPixelsX*nPixelsY);px++)
|
|
||||||
pedestalVals[px] = 0;
|
|
||||||
|
|
||||||
pedestalCount = 0;
|
|
||||||
resetPedestal = false;
|
|
||||||
pthread_mutex_unlock(&(last_image_complete_mutex));
|
pthread_mutex_unlock(&(last_image_complete_mutex));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1672,3 +1734,19 @@ void qDrawPlot::UpdateAfterCloning(bool points, bool logy, bool interpolate, boo
|
|||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void qDrawPlot::SetBinary(bool enable, int from, int to){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
if(!enable)
|
||||||
|
cout << "Disabling Binary output " << endl;
|
||||||
|
else
|
||||||
|
cout << "Enabling Binary output from " << from << " to " << to << endl;
|
||||||
|
#endif
|
||||||
|
binary = enable;
|
||||||
|
binaryFrom = from;
|
||||||
|
binaryTo = to;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
@ -139,13 +139,37 @@ void qTabPlot::SetupWidgetWindow(){
|
|||||||
stackedLayout->addWidget(spinNthFrame);
|
stackedLayout->addWidget(spinNthFrame);
|
||||||
stackWidget->setLayout(stackedLayout);
|
stackWidget->setLayout(stackedLayout);
|
||||||
|
|
||||||
|
stackedWidget->setCurrentIndex(0);
|
||||||
|
stackedWidget_2->setCurrentIndex(0);
|
||||||
|
|
||||||
// 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: isOriginallyOneD = true; break;
|
case slsDetectorDefs::MYTHEN:
|
||||||
case slsDetectorDefs::EIGER: isOriginallyOneD = false; break;
|
isOriginallyOneD = true;
|
||||||
case slsDetectorDefs::GOTTHARD: isOriginallyOneD = true; break;
|
chkPedestal->setEnabled(false);
|
||||||
case slsDetectorDefs::MOENCH: isOriginallyOneD = false; break;
|
btnRecalPedestal->setEnabled(false);
|
||||||
|
layoutThreshold->setEnabled(false);
|
||||||
|
chkPedestal_2->setEnabled(false);
|
||||||
|
btnRecalPedestal_2->setEnabled(false);
|
||||||
|
chkBinary->setEnabled(false);
|
||||||
|
chkBinary_2->setEnabled(false);
|
||||||
|
break;
|
||||||
|
case slsDetectorDefs::EIGER:
|
||||||
|
isOriginallyOneD = false;
|
||||||
|
chkPedestal->setEnabled(false);
|
||||||
|
btnRecalPedestal->setEnabled(false);
|
||||||
|
layoutThreshold->setEnabled(false);
|
||||||
|
chkPedestal_2->setEnabled(false);
|
||||||
|
btnRecalPedestal_2->setEnabled(false);
|
||||||
|
chkBinary->setEnabled(false);
|
||||||
|
chkBinary_2->setEnabled(false);
|
||||||
|
break;
|
||||||
|
case slsDetectorDefs::GOTTHARD:
|
||||||
|
isOriginallyOneD = true;
|
||||||
|
break;
|
||||||
|
case slsDetectorDefs::MOENCH:
|
||||||
|
isOriginallyOneD = false;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
cout << "ERROR: Detector Type is Generic" << endl;
|
cout << "ERROR: Detector Type is Generic" << endl;
|
||||||
exit(-1);
|
exit(-1);
|
||||||
@ -158,17 +182,6 @@ void qTabPlot::SetupWidgetWindow(){
|
|||||||
//to check if this should be enabled
|
//to check if this should be enabled
|
||||||
EnableScanBox();
|
EnableScanBox();
|
||||||
|
|
||||||
stackedWidget->setCurrentIndex(0);
|
|
||||||
stackedWidget_2->setCurrentIndex(0);
|
|
||||||
if(myDet->getDetectorsType()!=slsDetectorDefs::GOTTHARD){
|
|
||||||
btnCalPedestal->setEnabled(false);
|
|
||||||
btnResetPedestal->setEnabled(false);
|
|
||||||
}
|
|
||||||
if(myDet->getDetectorsType()!=slsDetectorDefs::MOENCH){
|
|
||||||
btnCalPedestal_2->setEnabled(false);
|
|
||||||
btnResetPedestal_2->setEnabled(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,36 +189,44 @@ void qTabPlot::SetupWidgetWindow(){
|
|||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabPlot::Set2DPage(){
|
void qTabPlot::SetPlotOptionsRightPage(){
|
||||||
//QPushButton *clickedButton = qobject_cast<QPushButton *>(sender());
|
if(isOneD){
|
||||||
if(stackedWidget_2->currentIndex()==0){
|
int i = stackedWidget->currentIndex();
|
||||||
stackedWidget_2->setCurrentIndex(1);
|
if(i == (stackedWidget->count()-1))
|
||||||
box2D->setTitle("2D Plot Options 2");
|
stackedWidget->setCurrentIndex(0);
|
||||||
|
else
|
||||||
|
stackedWidget->setCurrentIndex(i+1);
|
||||||
|
box1D->setTitle(QString("1D Plot Options %1").arg(stackedWidget->currentIndex()+1));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
stackedWidget_2->setCurrentIndex(0);
|
int i = stackedWidget_2->currentIndex();
|
||||||
box2D->setTitle("2D Plot Options 1");
|
if(i == (stackedWidget_2->count()-1))
|
||||||
|
stackedWidget_2->setCurrentIndex(0);
|
||||||
|
else
|
||||||
|
stackedWidget_2->setCurrentIndex(i+1);
|
||||||
|
box2D->setTitle(QString("2D Plot Options %1").arg(stackedWidget_2->currentIndex()+1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabPlot::Set1DPage(){
|
void qTabPlot::SetPlotOptionsLeftPage(){
|
||||||
//QPushButton *clickedButton = qobject_cast<QPushButton *>(sender());
|
if(isOneD){
|
||||||
if(stackedWidget->currentIndex()==0){
|
int i = stackedWidget->currentIndex();
|
||||||
//if(clickedButton->icon().pixmap(QSize(16,16)).toImage()==btnLeft->icon().pixmap(QSize(16,16)).toImage())
|
if(i == 0)
|
||||||
stackedWidget->setCurrentIndex(1);
|
stackedWidget->setCurrentIndex(stackedWidget->count()-1);
|
||||||
box1D->setTitle("1D Plot Options 2");
|
else
|
||||||
}
|
stackedWidget->setCurrentIndex(i-1);
|
||||||
else if(stackedWidget->currentIndex()==1){
|
box1D->setTitle(QString("1D Plot Options %1").arg(stackedWidget->currentIndex()+1));
|
||||||
stackedWidget->setCurrentIndex(2);
|
|
||||||
box1D->setTitle("1D Plot Options 3");
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
stackedWidget->setCurrentIndex(0);
|
int i = stackedWidget_2->currentIndex();
|
||||||
box1D->setTitle("1D Plot Options 1");
|
if(i == 0)
|
||||||
|
stackedWidget_2->setCurrentIndex(stackedWidget_2->count()-1);
|
||||||
|
else
|
||||||
|
stackedWidget_2->setCurrentIndex(i-1);
|
||||||
|
box2D->setTitle(QString("2D Plot Options %1").arg(stackedWidget_2->currentIndex()+1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,6 +236,14 @@ void qTabPlot::Set1DPage(){
|
|||||||
|
|
||||||
void qTabPlot::Select1DPlot(bool b){
|
void qTabPlot::Select1DPlot(bool b){
|
||||||
isOneD = b;
|
isOneD = b;
|
||||||
|
lblFrom->setEnabled(false);
|
||||||
|
lblTo->setEnabled(false);
|
||||||
|
lblFrom_2->setEnabled(false);
|
||||||
|
lblTo_2->setEnabled(false);
|
||||||
|
spinFrom->setEnabled(false);
|
||||||
|
spinFrom_2->setEnabled(false);
|
||||||
|
spinTo->setEnabled(false);
|
||||||
|
spinTo_2->setEnabled(false);
|
||||||
if(b){
|
if(b){
|
||||||
box1D->show();
|
box1D->show();
|
||||||
box2D->hide();
|
box2D->hide();
|
||||||
@ -247,22 +276,20 @@ void qTabPlot::Initialization(){
|
|||||||
connect(btnCloseClones, SIGNAL(clicked()),myPlot, SLOT(CloseClones()));
|
connect(btnCloseClones, SIGNAL(clicked()),myPlot, SLOT(CloseClones()));
|
||||||
connect(btnSaveClones, SIGNAL(clicked()),myPlot, SLOT(SaveClones()));
|
connect(btnSaveClones, SIGNAL(clicked()),myPlot, SLOT(SaveClones()));
|
||||||
// 1D Plot box
|
// 1D Plot box
|
||||||
|
//to change pages
|
||||||
|
connect(btnRight, SIGNAL(clicked()), this, SLOT(SetPlotOptionsRightPage()));
|
||||||
|
connect(btnLeft, SIGNAL(clicked()), this, SLOT(SetPlotOptionsLeftPage()));
|
||||||
|
|
||||||
connect(chkSuperimpose, SIGNAL(toggled(bool)), this, SLOT(EnablePersistency(bool)));
|
connect(chkSuperimpose, SIGNAL(toggled(bool)), this, SLOT(EnablePersistency(bool)));
|
||||||
connect(spinPersistency,SIGNAL(valueChanged(int)), myPlot,SLOT(SetPersistency(int)));
|
connect(spinPersistency,SIGNAL(valueChanged(int)), myPlot,SLOT(SetPersistency(int)));
|
||||||
connect(chkPoints, SIGNAL(toggled(bool)), myPlot, SLOT(SetMarkers(bool)));
|
connect(chkPoints, SIGNAL(toggled(bool)), myPlot, SLOT(SetMarkers(bool)));
|
||||||
connect(chkLines, SIGNAL(toggled(bool)), myPlot, SLOT(SetLines(bool)));
|
connect(chkLines, SIGNAL(toggled(bool)), myPlot, SLOT(SetLines(bool)));
|
||||||
connect(chk1DLog, SIGNAL(toggled(bool)), myPlot, SIGNAL(LogySignal(bool)));
|
connect(chk1DLog, SIGNAL(toggled(bool)), myPlot, SIGNAL(LogySignal(bool)));
|
||||||
//to change pages
|
|
||||||
connect(btnRight, SIGNAL(clicked()), this, SLOT(Set1DPage()));
|
|
||||||
connect(btnRight2, SIGNAL(clicked()), this, SLOT(Set1DPage()));
|
|
||||||
connect(btnRight3, SIGNAL(clicked()), this, SLOT(Set1DPage()));
|
|
||||||
// 2D Plot box
|
// 2D Plot box
|
||||||
connect(chkInterpolate, SIGNAL(toggled(bool)),myPlot, SIGNAL(InterpolateSignal(bool)));
|
connect(chkInterpolate, SIGNAL(toggled(bool)),myPlot, SIGNAL(InterpolateSignal(bool)));
|
||||||
connect(chkContour, SIGNAL(toggled(bool)),myPlot, SIGNAL(ContourSignal(bool)));
|
connect(chkContour, SIGNAL(toggled(bool)),myPlot, SIGNAL(ContourSignal(bool)));
|
||||||
connect(chkLogz, SIGNAL(toggled(bool)),myPlot, SIGNAL(LogzSignal(bool)));
|
connect(chkLogz, SIGNAL(toggled(bool)),myPlot, SIGNAL(LogzSignal(bool)));
|
||||||
//to change pages
|
|
||||||
connect(btn2DRight, SIGNAL(clicked()), this, SLOT(Set2DPage()));
|
|
||||||
connect(btn2DRight2, SIGNAL(clicked()), this, SLOT(Set2DPage()));
|
|
||||||
// Plotting frequency box
|
// Plotting frequency box
|
||||||
connect(comboFrequency, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFrequency()));
|
connect(comboFrequency, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFrequency()));
|
||||||
connect(comboTimeGapUnit,SIGNAL(currentIndexChanged(int)), this, SLOT(SetFrequency()));
|
connect(comboTimeGapUnit,SIGNAL(currentIndexChanged(int)), this, SLOT(SetFrequency()));
|
||||||
@ -299,11 +326,24 @@ void qTabPlot::Initialization(){
|
|||||||
connect(this,SIGNAL(SetZRangeSignal(double,double)),myPlot, SIGNAL(SetZRangeSignal(double,double)));
|
connect(this,SIGNAL(SetZRangeSignal(double,double)),myPlot, SIGNAL(SetZRangeSignal(double,double)));
|
||||||
|
|
||||||
//pedstal
|
//pedstal
|
||||||
connect(btnResetPedestal, SIGNAL(clicked()),myPlot, SLOT(ResetPedestal()));
|
connect(chkPedestal, SIGNAL(toggled(bool)), myPlot, SLOT(SetPedestal(bool)));
|
||||||
connect(btnCalPedestal, SIGNAL(clicked()),myPlot, SLOT(CalculatePedestal()));
|
connect(btnRecalPedestal, SIGNAL(clicked()), myPlot, SLOT(RecalculatePedestal()));
|
||||||
connect(btnResetPedestal_2, SIGNAL(clicked()),myPlot, SLOT(ResetPedestal()));
|
connect(chkPedestal_2, SIGNAL(toggled(bool)), myPlot, SLOT(SetPedestal(bool)));
|
||||||
connect(btnCalPedestal_2, SIGNAL(clicked()),myPlot, SLOT(CalculatePedestal()));
|
connect(btnRecalPedestal_2, SIGNAL(clicked()), myPlot, SLOT(RecalculatePedestal()));
|
||||||
|
|
||||||
|
//accumulate
|
||||||
|
connect(chkAccumulate, SIGNAL(toggled(bool)), myPlot, SLOT(SetAccumulate(bool)));
|
||||||
|
connect(btnResetAccumulate, SIGNAL(clicked()), myPlot, SLOT(ResetAccumulate()));
|
||||||
|
connect(chkAccumulate_2, SIGNAL(toggled(bool)), myPlot, SLOT(SetAccumulate(bool)));
|
||||||
|
connect(btnResetAccumulate_2, SIGNAL(clicked()), myPlot, SLOT(ResetAccumulate()));
|
||||||
|
|
||||||
|
//binary
|
||||||
|
connect(chkBinary, SIGNAL(toggled(bool)), this, SLOT(SetBinary()));
|
||||||
|
connect(chkBinary_2, SIGNAL(toggled(bool)), this, SLOT(SetBinary()));
|
||||||
|
connect(spinFrom, SIGNAL(valueChanged(int)), this, SLOT(SetBinary()));
|
||||||
|
connect(spinFrom_2, SIGNAL(valueChanged(int)), this, SLOT(SetBinary()));
|
||||||
|
connect(spinTo, SIGNAL(valueChanged(int)), this, SLOT(SetBinary()));
|
||||||
|
connect(spinTo_2, SIGNAL(valueChanged(int)), this, SLOT(SetBinary()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -906,4 +946,57 @@ void qTabPlot::UpdateAfterCloning(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void qTabPlot::SetBinary(){
|
||||||
|
//1d
|
||||||
|
if(isOneD){
|
||||||
|
if(chkBinary->isChecked()){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << endl << "Enabling Binary" << endl;
|
||||||
|
#endif
|
||||||
|
lblFrom->setEnabled(true);
|
||||||
|
lblTo->setEnabled(true);
|
||||||
|
spinFrom->setEnabled(true);
|
||||||
|
spinTo->setEnabled(true);
|
||||||
|
myPlot->SetBinary(true,spinFrom->value(),spinTo->value());
|
||||||
|
}else{
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << endl << "Disabling Binary" << endl;
|
||||||
|
#endif
|
||||||
|
lblFrom->setEnabled(false);
|
||||||
|
lblTo->setEnabled(false);
|
||||||
|
spinFrom->setEnabled(false);
|
||||||
|
spinTo->setEnabled(false);
|
||||||
|
myPlot->SetBinary(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//2d
|
||||||
|
else{
|
||||||
|
if(chkBinary_2->isChecked()){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << endl << "Enabling Binary" << endl;
|
||||||
|
#endif
|
||||||
|
lblFrom_2->setEnabled(true);
|
||||||
|
lblTo_2->setEnabled(true);
|
||||||
|
spinFrom_2->setEnabled(true);
|
||||||
|
spinTo_2->setEnabled(true);
|
||||||
|
myPlot->SetBinary(true,spinFrom_2->value(),spinTo_2->value());
|
||||||
|
|
||||||
|
}else{
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << endl << "Disabling Binary" << endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
lblFrom_2->setEnabled(false);
|
||||||
|
lblTo_2->setEnabled(false);
|
||||||
|
spinFrom_2->setEnabled(false);
|
||||||
|
spinTo_2->setEnabled(false);
|
||||||
|
myPlot->SetBinary(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user