mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-28 17:10:03 +02:00
bug fix: plot tab refresh doesnt change plot
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@79 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
parent
bdabf9e649
commit
1eb07b31f6
@ -38,7 +38,13 @@ public:
|
|||||||
*/
|
*/
|
||||||
~qTabPlot();
|
~qTabPlot();
|
||||||
|
|
||||||
|
/** Sets the scan argument of the plot
|
||||||
|
*/
|
||||||
|
void SetScanArgument();
|
||||||
|
|
||||||
|
/** To refresh and update widgets
|
||||||
|
*/
|
||||||
|
void Refresh();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -59,7 +65,6 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
/** Set frequency between plots*/
|
/** Set frequency between plots*/
|
||||||
void SetFrequency();
|
void SetFrequency();
|
||||||
@ -74,13 +79,8 @@ void EnableScanBox();
|
|||||||
*/
|
*/
|
||||||
void EnableNthFrame(bool enable){enableNFrame = enable;};
|
void EnableNthFrame(bool enable){enableNFrame = enable;};
|
||||||
|
|
||||||
/** Sets the scan argument of the plot
|
|
||||||
*/
|
|
||||||
void SetScanArgument();
|
|
||||||
|
|
||||||
/** To refresh and update widgets
|
|
||||||
*/
|
|
||||||
void Refresh();
|
|
||||||
|
|
||||||
|
|
||||||
/** Disables scanbox while running
|
/** Disables scanbox while running
|
||||||
|
@ -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)
|
||||||
|
@ -529,14 +529,7 @@ void qDetectorMain::Refresh(int index){
|
|||||||
tabs->setCurrentIndex((index++)<(tabs->count()-1)?index:Measurement);
|
tabs->setCurrentIndex((index++)<(tabs->count()-1)?index:Measurement);
|
||||||
else{
|
else{
|
||||||
switch(tabs->currentIndex()){
|
switch(tabs->currentIndex()){
|
||||||
case Measurement:
|
case Measurement: tab_measurement->Refresh(); break;
|
||||||
if(!myPlot->isRunning()) {
|
|
||||||
tab_measurement->Refresh();
|
|
||||||
//to recover from a trimbit plot mode
|
|
||||||
tab_plot->Refresh();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Settings: tab_settings->Refresh(); break;
|
case Settings: tab_settings->Refresh(); break;
|
||||||
case DataOutput: tab_dataoutput->Refresh(); break;
|
case DataOutput: tab_dataoutput->Refresh(); break;
|
||||||
case Plot: tab_plot->Refresh(); break;
|
case Plot: tab_plot->Refresh(); break;
|
||||||
@ -642,7 +635,7 @@ void qDetectorMain::EnableTabs(){
|
|||||||
//moved to here, so that its all in order, instead of signals and different threads
|
//moved to here, so that its all in order, instead of signals and different threads
|
||||||
if(!enable) {
|
if(!enable) {
|
||||||
//set the plot type first(acccss shared memory)
|
//set the plot type first(acccss shared memory)
|
||||||
tab_plot->Refresh();
|
tab_plot->SetScanArgument();
|
||||||
//sets running to true
|
//sets running to true
|
||||||
myPlot->StartStopDaqToggle();
|
myPlot->StartStopDaqToggle();
|
||||||
}
|
}
|
||||||
|
@ -530,8 +530,6 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
#endif
|
#endif
|
||||||
if(!stop_signal){
|
if(!stop_signal){
|
||||||
|
|
||||||
//set title
|
|
||||||
SetPlotTitle(QString(data->fileName).section('/',-1));
|
|
||||||
//set progress
|
//set progress
|
||||||
progress=(int)data->progressIndex;
|
progress=(int)data->progressIndex;
|
||||||
currentFileIndex = fileIOStatic::getFileIndexFromFileName(string(data->fileName));
|
currentFileIndex = fileIOStatic::getFileIndexFromFileName(string(data->fileName));
|
||||||
@ -548,6 +546,9 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
//angle plotting
|
//angle plotting
|
||||||
if(anglePlot){
|
if(anglePlot){
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
|
//set title
|
||||||
|
SetPlotTitle(QString(data->fileName).section('/',-1));
|
||||||
|
|
||||||
cout<<"angle plot"<<endl;
|
cout<<"angle plot"<<endl;
|
||||||
if(data->angles==NULL){
|
if(data->angles==NULL){
|
||||||
cout<<"\n\nWARNING:RETURNED NULL instead of angles."<<endl;
|
cout<<"\n\nWARNING:RETURNED NULL instead of angles."<<endl;
|
||||||
@ -614,6 +615,8 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
if(scanArgument==AllFrames){
|
if(scanArgument==AllFrames){
|
||||||
while(1){
|
while(1){
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
|
//set title
|
||||||
|
SetPlotTitle(QString(data->fileName).section('/',-1));
|
||||||
//variables
|
//variables
|
||||||
lastImageNumber= currentFrame+1;
|
lastImageNumber= currentFrame+1;
|
||||||
//title
|
//title
|
||||||
@ -634,6 +637,8 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
if(scanArgument==FileIndex){
|
if(scanArgument==FileIndex){
|
||||||
while(1){
|
while(1){
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
|
//set title
|
||||||
|
SetPlotTitle(QString(data->fileName).section('/',-1));
|
||||||
//variables
|
//variables
|
||||||
if(currentFileIndex == minPixelsY) currentScanDivLevel = 0;
|
if(currentFileIndex == minPixelsY) currentScanDivLevel = 0;
|
||||||
lastImageNumber= currentFrame+1;
|
lastImageNumber= currentFrame+1;
|
||||||
@ -655,6 +660,8 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
if(scanArgument==Level0){
|
if(scanArgument==Level0){
|
||||||
while(1){
|
while(1){
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
|
//set title
|
||||||
|
SetPlotTitle(QString(data->fileName).section('/',-1));
|
||||||
//get scanvariable0
|
//get scanvariable0
|
||||||
int ci = 0, p = 0; double cs0 = 0 , cs1 = 0;
|
int ci = 0, p = 0; double cs0 = 0 , cs1 = 0;
|
||||||
fileIOStatic::getVariablesFromFileName(string(data->fileName), ci, p, cs0, cs1);
|
fileIOStatic::getVariablesFromFileName(string(data->fileName), ci, p, cs0, cs1);
|
||||||
@ -683,6 +690,8 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
//level1
|
//level1
|
||||||
while(1){
|
while(1){
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
|
//set title
|
||||||
|
SetPlotTitle(QString(data->fileName).section('/',-1));
|
||||||
//get scanvariable1
|
//get scanvariable1
|
||||||
int ci = 0, p = 0; double cs0 = 0 , cs1 = 0;
|
int ci = 0, p = 0; double cs0 = 0 , cs1 = 0;
|
||||||
fileIOStatic::getVariablesFromFileName(string(data->fileName), ci, p, cs0, cs1);
|
fileIOStatic::getVariablesFromFileName(string(data->fileName), ci, p, cs0, cs1);
|
||||||
@ -710,6 +719,8 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
|
|
||||||
//normal measurement or 1d scans
|
//normal measurement or 1d scans
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
|
//set title
|
||||||
|
SetPlotTitle(QString(data->fileName).section('/',-1));
|
||||||
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
|
||||||
lastImageNumber= currentFrame+1;
|
lastImageNumber= currentFrame+1;
|
||||||
@ -879,8 +890,7 @@ void qDrawPlot::UpdatePlot(){
|
|||||||
cout << "Entering UpdatePlot function" << endl;
|
cout << "Entering UpdatePlot function" << endl;
|
||||||
#endif
|
#endif
|
||||||
plot_update_timer->stop();
|
plot_update_timer->stop();
|
||||||
//set plot title
|
|
||||||
boxPlot->setTitle(plotTitle);
|
|
||||||
// only if no plot isnt enabled
|
// only if no plot isnt enabled
|
||||||
if(plotEnable){
|
if(plotEnable){
|
||||||
LockLastImageArray();
|
LockLastImageArray();
|
||||||
@ -957,6 +967,9 @@ void qDrawPlot::UpdatePlot(){
|
|||||||
}
|
}
|
||||||
last_plot_number=lastImageNumber;
|
last_plot_number=lastImageNumber;
|
||||||
|
|
||||||
|
//set plot title
|
||||||
|
boxPlot->setTitle(plotTitle);
|
||||||
|
|
||||||
if(plotEnable) UnlockLastImageArray();
|
if(plotEnable) UnlockLastImageArray();
|
||||||
|
|
||||||
|
|
||||||
|
@ -150,6 +150,8 @@ void qTabPlot::SetupWidgetWindow(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
Select1DPlot(isOrginallyOneD);
|
Select1DPlot(isOrginallyOneD);
|
||||||
|
if(isOrginallyOneD) myPlot->Select1DPlot();
|
||||||
|
else myPlot->Select2DPlot();
|
||||||
|
|
||||||
//to check if this should be enabled
|
//to check if this should be enabled
|
||||||
EnableScanBox();
|
EnableScanBox();
|
||||||
@ -167,14 +169,12 @@ void qTabPlot::Select1DPlot(bool b){
|
|||||||
chkZAxis->setEnabled(false);
|
chkZAxis->setEnabled(false);
|
||||||
chkZMin->setEnabled(false);
|
chkZMin->setEnabled(false);
|
||||||
chkZMax->setEnabled(false);
|
chkZMax->setEnabled(false);
|
||||||
myPlot->Select1DPlot();
|
|
||||||
}else{
|
}else{
|
||||||
box1D->hide();
|
box1D->hide();
|
||||||
box2D->show();
|
box2D->show();
|
||||||
chkZAxis->setEnabled(true);
|
chkZAxis->setEnabled(true);
|
||||||
chkZMin->setEnabled(true);
|
chkZMin->setEnabled(true);
|
||||||
chkZMax->setEnabled(true);
|
chkZMax->setEnabled(true);
|
||||||
myPlot->Select2DPlot();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,7 +188,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(btnGroupScan, SIGNAL(buttonClicked(QAbstractButton *)),this, SLOT(SetScanArgument()));
|
/*connect(btnGroupScan, SIGNAL(buttonClicked(QAbstractButton *)),this, SLOT(SetScanArgument()));*/
|
||||||
connect(boxScan, SIGNAL(toggled(bool)), this, SLOT(EnableScanBox()));
|
connect(boxScan, SIGNAL(toggled(bool)), this, SLOT(EnableScanBox()));
|
||||||
// Snapshot box
|
// Snapshot box
|
||||||
connect(btnClone, SIGNAL(clicked()),myPlot, SLOT(ClonePlot()));
|
connect(btnClone, SIGNAL(clicked()),myPlot, SLOT(ClonePlot()));
|
||||||
@ -421,6 +421,8 @@ void qTabPlot::SetPlot(){
|
|||||||
if(isOrginallyOneD) {box1D->show(); box2D->hide();}
|
if(isOrginallyOneD) {box1D->show(); box2D->hide();}
|
||||||
if(!isOrginallyOneD) {box2D->show(); box1D->hide();}
|
if(!isOrginallyOneD) {box2D->show(); box1D->hide();}
|
||||||
Select1DPlot(isOrginallyOneD);
|
Select1DPlot(isOrginallyOneD);
|
||||||
|
if(isOrginallyOneD) myPlot->Select1DPlot();
|
||||||
|
else myPlot->Select2DPlot();
|
||||||
boxSnapshot->setEnabled(true);
|
boxSnapshot->setEnabled(true);
|
||||||
boxSave->setEnabled(true);
|
boxSave->setEnabled(true);
|
||||||
boxFrequency->setEnabled(true);
|
boxFrequency->setEnabled(true);
|
||||||
@ -554,7 +556,7 @@ void qTabPlot::EnableScanBox(){
|
|||||||
|
|
||||||
|
|
||||||
//sets the scan argument
|
//sets the scan argument
|
||||||
SetScanArgument();
|
/*SetScanArgument();*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -602,6 +604,8 @@ void qTabPlot::SetScanArgument(){
|
|||||||
myPlot->SetImageZAxisTitle(defaultImageZAxisTitle);
|
myPlot->SetImageZAxisTitle(defaultImageZAxisTitle);
|
||||||
}
|
}
|
||||||
Select1DPlot(isOrginallyOneD);
|
Select1DPlot(isOrginallyOneD);
|
||||||
|
if(isOrginallyOneD) myPlot->Select1DPlot();
|
||||||
|
else myPlot->Select2DPlot();
|
||||||
|
|
||||||
int ang;
|
int ang;
|
||||||
//if scans(1D or 2D)
|
//if scans(1D or 2D)
|
||||||
@ -612,6 +616,8 @@ void qTabPlot::SetScanArgument(){
|
|||||||
dispTitle->setText(mainTitle);
|
dispTitle->setText(mainTitle);
|
||||||
myPlot->SetPlotTitle(mainTitle);
|
myPlot->SetPlotTitle(mainTitle);
|
||||||
Select1DPlot(isOrginallyOneD);
|
Select1DPlot(isOrginallyOneD);
|
||||||
|
if(isOrginallyOneD) myPlot->Select1DPlot();
|
||||||
|
else myPlot->Select2DPlot();
|
||||||
|
|
||||||
}//angles (1D)
|
}//angles (1D)
|
||||||
else if(myDet->getAngularConversion(ang)){
|
else if(myDet->getAngularConversion(ang)){
|
||||||
@ -626,6 +632,8 @@ void qTabPlot::SetScanArgument(){
|
|||||||
dispXAxis->setText("Angles");
|
dispXAxis->setText("Angles");
|
||||||
myPlot->SetHistXAxisTitle("Angles");
|
myPlot->SetHistXAxisTitle("Angles");
|
||||||
Select1DPlot(true);
|
Select1DPlot(true);
|
||||||
|
myPlot->Select1DPlot();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -669,11 +677,10 @@ void qTabPlot::SetScanArgument(){
|
|||||||
}else //done here so that it isnt set by default each time
|
}else //done here so that it isnt set by default each time
|
||||||
myPlot->SetScanArgument(0);
|
myPlot->SetScanArgument(0);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qTabPlot::Refresh(){
|
void qTabPlot::Refresh(){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user