mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 23:30:03 +02:00
bug fix: got rid of title as measurement,as it should be empty
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@85 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
parent
918765e06f
commit
b703e52563
@ -300,8 +300,14 @@
|
|||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Output Directory:</string>
|
<string>Output Directory :</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -53,8 +53,8 @@ public:
|
|||||||
/** gets the file index to the measurement tab*/
|
/** gets the file index to the measurement tab*/
|
||||||
int GetFileIndex(){return currentFileIndex;};
|
int GetFileIndex(){return currentFileIndex;};
|
||||||
|
|
||||||
/** sets plot Title */
|
/** sets plot Title prefix*/
|
||||||
void SetPlotTitle(QString title) {plotTitle = title;}
|
void SetPlotTitlePrefix(QString title) {plotTitle_prefix = title;}
|
||||||
/** sets 1D X Axis Title */
|
/** sets 1D X Axis Title */
|
||||||
void SetHistXAxisTitle(QString title) {histXAxisTitle = title;}
|
void SetHistXAxisTitle(QString title) {histXAxisTitle = title;}
|
||||||
/** sets 1D Y Axis Title */
|
/** sets 1D Y Axis Title */
|
||||||
@ -338,6 +338,8 @@ std::string histTitle[MAX_1DPLOTS];
|
|||||||
std::string imageTitle;
|
std::string imageTitle;
|
||||||
/** plot Title */
|
/** plot Title */
|
||||||
QString plotTitle;
|
QString plotTitle;
|
||||||
|
/** plot Title prefix */
|
||||||
|
QString plotTitle_prefix;
|
||||||
/** 1D or 2D */
|
/** 1D or 2D */
|
||||||
unsigned int plot_in_scope;
|
unsigned int plot_in_scope;
|
||||||
/** Number of Pixels in X Axis */
|
/** Number of Pixels in X Axis */
|
||||||
|
@ -91,7 +91,7 @@ void qDetectorMain::SetUpWidgetWindow(){
|
|||||||
centralwidget->setLayout(layoutTabs);
|
centralwidget->setLayout(layoutTabs);
|
||||||
|
|
||||||
// plot setup
|
// plot setup
|
||||||
myPlot = new qDrawPlot(dockWidgetPlot,myDet);
|
myPlot = new qDrawPlot(dockWidgetPlot,myDet);cout<<"DockPlot ready"<<endl;
|
||||||
dockWidgetPlot->setWidget(myPlot);
|
dockWidgetPlot->setWidget(myPlot);
|
||||||
|
|
||||||
//tabs setup
|
//tabs setup
|
||||||
|
@ -119,7 +119,7 @@ void qDrawPlot::SetupWidgetWindow(){
|
|||||||
setFont(QFont("Sans Serif",9));
|
setFont(QFont("Sans Serif",9));
|
||||||
layout = new QGridLayout;
|
layout = new QGridLayout;
|
||||||
this->setLayout(layout);
|
this->setLayout(layout);
|
||||||
boxPlot = new QGroupBox("Measurement");
|
boxPlot = new QGroupBox("");
|
||||||
layout->addWidget(boxPlot,1,1);
|
layout->addWidget(boxPlot,1,1);
|
||||||
boxPlot->setAlignment(Qt::AlignHCenter);
|
boxPlot->setAlignment(Qt::AlignHCenter);
|
||||||
boxPlot->setFont(QFont("Sans Serif",11,QFont::Normal));
|
boxPlot->setFont(QFont("Sans Serif",11,QFont::Normal));
|
||||||
@ -131,8 +131,8 @@ void qDrawPlot::SetupWidgetWindow(){
|
|||||||
// Default titles- only for the initial picture
|
// Default titles- only for the initial picture
|
||||||
histXAxisTitle="Channel Number";
|
histXAxisTitle="Channel Number";
|
||||||
histYAxisTitle="Counts";
|
histYAxisTitle="Counts";
|
||||||
plotTitle = "Measurement";
|
plotTitle = "";
|
||||||
|
plotTitle_prefix = "";
|
||||||
|
|
||||||
for(int i=0;i<MAX_1DPLOTS;i++){
|
for(int i=0;i<MAX_1DPLOTS;i++){
|
||||||
histTitle[i] = "";
|
histTitle[i] = "";
|
||||||
@ -489,14 +489,14 @@ void qDrawPlot::SetupMeasurement(int currentIndex){
|
|||||||
endPixel = maxPixelsY + (pixelWidth/2);
|
endPixel = maxPixelsY + (pixelWidth/2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
cout<<"nPixelsX:"<<nPixelsX<<endl;
|
cout<<"nPixelsX:"<<nPixelsX<<endl;
|
||||||
cout<<"nPixelsY:"<<nPixelsY<<endl;
|
cout<<"nPixelsY:"<<nPixelsY<<endl;
|
||||||
cout<<"minPixelsY:"<<minPixelsY<<endl;
|
cout<<"minPixelsY:"<<minPixelsY<<endl;
|
||||||
cout<<"maxPixelsY:"<<maxPixelsY<<endl;
|
cout<<"maxPixelsY:"<<maxPixelsY<<endl;
|
||||||
cout<<"startPixel:"<<startPixel<<endl;
|
cout<<"startPixel:"<<startPixel<<endl;
|
||||||
cout<<"endPixel:"<<endPixel<<endl<<endl;
|
cout<<"endPixel:"<<endPixel<<endl<<endl;
|
||||||
|
*/
|
||||||
UnlockLastImageArray();
|
UnlockLastImageArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -545,11 +545,12 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
|
|
||||||
//angle plotting
|
//angle plotting
|
||||||
if(anglePlot){
|
if(anglePlot){
|
||||||
|
while(1){
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
//set title
|
//set title
|
||||||
SetPlotTitle(QString(data->fileName).section('/',-1));
|
plotTitle=QString(plotTitle_prefix)+QString(data->fileName).section('/',-1);
|
||||||
|
|
||||||
cout<<"angle plot"<<endl;
|
cout<<endl<<"angle plot"<<endl<<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;
|
||||||
lastImageNumber= currentFrame+1;
|
lastImageNumber= currentFrame+1;
|
||||||
@ -574,6 +575,8 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
SetHistXAxisTitle("Angles");
|
SetHistXAxisTitle("Angles");
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&(last_image_complete_mutex));
|
pthread_mutex_unlock(&(last_image_complete_mutex));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
currentFrame++;
|
currentFrame++;
|
||||||
return 0;
|
return 0;
|
||||||
@ -616,7 +619,7 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
while(1){
|
while(1){
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
//set title
|
//set title
|
||||||
SetPlotTitle(QString(data->fileName).section('/',-1));
|
plotTitle=QString(plotTitle_prefix)+QString(data->fileName).section('/',-1);
|
||||||
//variables
|
//variables
|
||||||
lastImageNumber= currentFrame+1;
|
lastImageNumber= currentFrame+1;
|
||||||
//title
|
//title
|
||||||
@ -638,7 +641,7 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
while(1){
|
while(1){
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
//set title
|
//set title
|
||||||
SetPlotTitle(QString(data->fileName).section('/',-1));
|
plotTitle=QString(plotTitle_prefix)+QString(data->fileName).section('/',-1);
|
||||||
//variables
|
//variables
|
||||||
if(currentFileIndex == minPixelsY) currentScanDivLevel = 0;
|
if(currentFileIndex == minPixelsY) currentScanDivLevel = 0;
|
||||||
lastImageNumber= currentFrame+1;
|
lastImageNumber= currentFrame+1;
|
||||||
@ -661,7 +664,7 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
while(1){
|
while(1){
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
//set title
|
//set title
|
||||||
SetPlotTitle(QString(data->fileName).section('/',-1));
|
plotTitle=QString(plotTitle_prefix)+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);
|
||||||
@ -691,7 +694,7 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
while(1){
|
while(1){
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
//set title
|
//set title
|
||||||
SetPlotTitle(QString(data->fileName).section('/',-1));
|
plotTitle=QString(plotTitle_prefix)+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);
|
||||||
@ -720,7 +723,7 @@ 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
|
//set title
|
||||||
SetPlotTitle(QString(data->fileName).section('/',-1));
|
plotTitle=QString(plotTitle_prefix)+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;
|
||||||
@ -1285,7 +1288,7 @@ int qDrawPlot::UpdateTrimbitPlot(bool fromDetector,bool Histogram){
|
|||||||
//data
|
//data
|
||||||
memcpy(histYAxis[0],histTrimbits,nPixelsX*sizeof(double));
|
memcpy(histYAxis[0],histTrimbits,nPixelsX*sizeof(double));
|
||||||
//title
|
//title
|
||||||
boxPlot->setTitle("Trimbits Plot - Data Graph");
|
boxPlot->setTitle("Trimbits_Plot_Data Graph");
|
||||||
plot1D->SetXTitle("Channel Number");
|
plot1D->SetXTitle("Channel Number");
|
||||||
plot1D->SetYTitle("Trimbits");
|
plot1D->SetYTitle("Trimbits");
|
||||||
//set plot parameters
|
//set plot parameters
|
||||||
@ -1314,7 +1317,7 @@ int qDrawPlot::UpdateTrimbitPlot(bool fromDetector,bool Histogram){
|
|||||||
|
|
||||||
//delete [] histTrimbits;
|
//delete [] histTrimbits;
|
||||||
//title
|
//title
|
||||||
boxPlot->setTitle("Trimbits Plot - Histogram");
|
boxPlot->setTitle("Trimbits_Plot_Histogram");
|
||||||
plot1D->SetXTitle("Trimbits");
|
plot1D->SetXTitle("Trimbits");
|
||||||
plot1D->SetYTitle("Frequency");
|
plot1D->SetYTitle("Frequency");
|
||||||
//set plot parameters
|
//set plot parameters
|
||||||
|
@ -138,19 +138,22 @@ void qTabDataOutput::Initialization(){
|
|||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::setOutputDir(){
|
void qTabDataOutput::setOutputDir(){
|
||||||
|
disconnect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(setOutputDir()));
|
||||||
|
|
||||||
QString path = dispOutputDir->text();
|
QString path = dispOutputDir->text();
|
||||||
|
|
||||||
//gets rid of the end '/'s
|
//gets rid of the end '/'s
|
||||||
disconnect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(setOutputDir()));
|
|
||||||
while(path.endsWith('/')) path.chop(1);
|
while(path.endsWith('/')) path.chop(1);
|
||||||
dispOutputDir->setText(path);
|
dispOutputDir->setText(path);
|
||||||
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(setOutputDir()));
|
|
||||||
|
//if(QFile::exists(path))
|
||||||
|
|
||||||
|
|
||||||
myDet->setFilePath(string(path.toAscii().constData()));
|
myDet->setFilePath(string(path.toAscii().constData()));
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Output Directory changed to :"<<myDet->getFilePath() << endl;
|
cout << "Output Directory changed to :"<<myDet->getFilePath() << endl;
|
||||||
#endif
|
#endif
|
||||||
|
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(setOutputDir()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -81,6 +81,7 @@ void qTabMeasurement::SetupWidgetWindow(){
|
|||||||
|
|
||||||
//file write enabled/disabled
|
//file write enabled/disabled
|
||||||
chkFile->setChecked(myDet->enableWriteToFile());
|
chkFile->setChecked(myDet->enableWriteToFile());
|
||||||
|
dispFileName->setEnabled(myDet->enableWriteToFile());
|
||||||
|
|
||||||
//creating the icons for the buttons
|
//creating the icons for the buttons
|
||||||
iconStart = new QIcon(":/icons/images/start.png");
|
iconStart = new QIcon(":/icons/images/start.png");
|
||||||
|
@ -23,7 +23,7 @@ using namespace std;
|
|||||||
|
|
||||||
const QString qTabPlot::modeNames[5]={"None","Energy Scan","Threshold Scan","Trimbits Scan","Custom Script Scan"};
|
const QString qTabPlot::modeNames[5]={"None","Energy Scan","Threshold Scan","Trimbits Scan","Custom Script Scan"};
|
||||||
|
|
||||||
QString qTabPlot::defaultPlotTitle("Measurement");
|
QString qTabPlot::defaultPlotTitle("");
|
||||||
QString qTabPlot::defaultHistXAxisTitle("Channel Number");
|
QString qTabPlot::defaultHistXAxisTitle("Channel Number");
|
||||||
QString qTabPlot::defaultHistYAxisTitle("Counts");
|
QString qTabPlot::defaultHistYAxisTitle("Counts");
|
||||||
QString qTabPlot::defaultImageXAxisTitle("Pixel");
|
QString qTabPlot::defaultImageXAxisTitle("Pixel");
|
||||||
@ -95,8 +95,8 @@ void qTabPlot::SetupWidgetWindow(){
|
|||||||
dispZMax->setValidator(new QDoubleValidator(dispZMax));
|
dispZMax->setValidator(new QDoubleValidator(dispZMax));
|
||||||
|
|
||||||
//default titles
|
//default titles
|
||||||
dispTitle->setText(defaultPlotTitle);
|
dispTitle->setText("");
|
||||||
myPlot->SetPlotTitle(defaultPlotTitle);
|
myPlot->SetPlotTitlePrefix("");
|
||||||
dispXAxis->setText(defaultHistXAxisTitle);
|
dispXAxis->setText(defaultHistXAxisTitle);
|
||||||
dispYAxis->setText(defaultHistYAxisTitle);
|
dispYAxis->setText(defaultHistYAxisTitle);
|
||||||
myPlot->SetHistXAxisTitle(defaultHistXAxisTitle);
|
myPlot->SetHistXAxisTitle(defaultHistXAxisTitle);
|
||||||
@ -261,7 +261,7 @@ void qTabPlot::EnablePersistency(bool enable){
|
|||||||
void qTabPlot::SetTitles(){
|
void qTabPlot::SetTitles(){
|
||||||
// Plot Title
|
// Plot Title
|
||||||
if(dispTitle->isEnabled())
|
if(dispTitle->isEnabled())
|
||||||
myPlot->SetPlotTitle(dispTitle->text());
|
myPlot->SetPlotTitlePrefix(dispTitle->text());
|
||||||
// X Axis
|
// X Axis
|
||||||
if(dispXAxis->isEnabled()){
|
if(dispXAxis->isEnabled()){
|
||||||
if(isOneD) myPlot->SetHistXAxisTitle(dispXAxis->text());
|
if(isOneD) myPlot->SetHistXAxisTitle(dispXAxis->text());
|
||||||
@ -285,8 +285,8 @@ void qTabPlot::EnableTitles(){
|
|||||||
// Plot Title
|
// Plot Title
|
||||||
dispTitle->setEnabled(chkTitle->isChecked());
|
dispTitle->setEnabled(chkTitle->isChecked());
|
||||||
if(!chkTitle->isChecked()){
|
if(!chkTitle->isChecked()){
|
||||||
myPlot->SetPlotTitle(defaultPlotTitle);
|
myPlot->SetPlotTitlePrefix("");
|
||||||
dispTitle->setText(defaultPlotTitle);
|
dispTitle->setText("");
|
||||||
}
|
}
|
||||||
// X Axis
|
// X Axis
|
||||||
dispXAxis->setEnabled(chkXAxis->isChecked());
|
dispXAxis->setEnabled(chkXAxis->isChecked());
|
||||||
@ -588,8 +588,6 @@ void qTabPlot::EnablingNthFrameFunction(bool enable){
|
|||||||
void qTabPlot::SetScanArgument(){
|
void qTabPlot::SetScanArgument(){
|
||||||
|
|
||||||
//as default from histogram and default titles are set here if scanbox is disabled
|
//as default from histogram and default titles are set here if scanbox is disabled
|
||||||
dispTitle->setText(defaultPlotTitle);
|
|
||||||
myPlot->SetPlotTitle(defaultPlotTitle);
|
|
||||||
if(isOrginallyOneD){
|
if(isOrginallyOneD){
|
||||||
dispXAxis->setText(defaultHistXAxisTitle);
|
dispXAxis->setText(defaultHistXAxisTitle);
|
||||||
dispYAxis->setText(defaultHistYAxisTitle);
|
dispYAxis->setText(defaultHistYAxisTitle);
|
||||||
@ -611,10 +609,6 @@ void qTabPlot::SetScanArgument(){
|
|||||||
//if scans(1D or 2D)
|
//if scans(1D or 2D)
|
||||||
if(boxScan->isEnabled()){
|
if(boxScan->isEnabled()){
|
||||||
//setting the title according to the scans
|
//setting the title according to the scans
|
||||||
QString mainTitle = QString(" Level 0 : ") + modeNames[myDet->getScanMode(0)] +
|
|
||||||
QString(" | Level 1 : ") + modeNames[myDet->getScanMode(1)] + QString("");
|
|
||||||
dispTitle->setText(mainTitle);
|
|
||||||
myPlot->SetPlotTitle(mainTitle);
|
|
||||||
Select1DPlot(isOrginallyOneD);
|
Select1DPlot(isOrginallyOneD);
|
||||||
if(isOrginallyOneD) myPlot->Select1DPlot();
|
if(isOrginallyOneD) myPlot->Select1DPlot();
|
||||||
else myPlot->Select2DPlot();
|
else myPlot->Select2DPlot();
|
||||||
@ -624,10 +618,6 @@ void qTabPlot::SetScanArgument(){
|
|||||||
//else if(myDet->getPositions()){
|
//else if(myDet->getPositions()){
|
||||||
//if scan, change title
|
//if scan, change title
|
||||||
if((myDet->getScanMode(0))||(myDet->getScanMode(1))){
|
if((myDet->getScanMode(0))||(myDet->getScanMode(1))){
|
||||||
QString mainTitle = QString(" Level 0 : ") + modeNames[myDet->getScanMode(0)] +
|
|
||||||
QString(" | Level 1 : ") + modeNames[myDet->getScanMode(1)] + QString("");
|
|
||||||
dispTitle->setText(mainTitle);
|
|
||||||
myPlot->SetPlotTitle(mainTitle);
|
|
||||||
}
|
}
|
||||||
dispXAxis->setText("Angles");
|
dispXAxis->setText("Angles");
|
||||||
myPlot->SetHistXAxisTitle("Angles");
|
myPlot->SetHistXAxisTitle("Angles");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user