mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 07:20:01 +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>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Output Directory:</string>
|
||||
<string>Output Directory :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -53,8 +53,8 @@ public:
|
||||
/** gets the file index to the measurement tab*/
|
||||
int GetFileIndex(){return currentFileIndex;};
|
||||
|
||||
/** sets plot Title */
|
||||
void SetPlotTitle(QString title) {plotTitle = title;}
|
||||
/** sets plot Title prefix*/
|
||||
void SetPlotTitlePrefix(QString title) {plotTitle_prefix = title;}
|
||||
/** sets 1D X Axis Title */
|
||||
void SetHistXAxisTitle(QString title) {histXAxisTitle = title;}
|
||||
/** sets 1D Y Axis Title */
|
||||
@ -338,6 +338,8 @@ std::string histTitle[MAX_1DPLOTS];
|
||||
std::string imageTitle;
|
||||
/** plot Title */
|
||||
QString plotTitle;
|
||||
/** plot Title prefix */
|
||||
QString plotTitle_prefix;
|
||||
/** 1D or 2D */
|
||||
unsigned int plot_in_scope;
|
||||
/** Number of Pixels in X Axis */
|
||||
|
@ -91,7 +91,7 @@ void qDetectorMain::SetUpWidgetWindow(){
|
||||
centralwidget->setLayout(layoutTabs);
|
||||
|
||||
// plot setup
|
||||
myPlot = new qDrawPlot(dockWidgetPlot,myDet);
|
||||
myPlot = new qDrawPlot(dockWidgetPlot,myDet);cout<<"DockPlot ready"<<endl;
|
||||
dockWidgetPlot->setWidget(myPlot);
|
||||
|
||||
//tabs setup
|
||||
|
@ -119,7 +119,7 @@ void qDrawPlot::SetupWidgetWindow(){
|
||||
setFont(QFont("Sans Serif",9));
|
||||
layout = new QGridLayout;
|
||||
this->setLayout(layout);
|
||||
boxPlot = new QGroupBox("Measurement");
|
||||
boxPlot = new QGroupBox("");
|
||||
layout->addWidget(boxPlot,1,1);
|
||||
boxPlot->setAlignment(Qt::AlignHCenter);
|
||||
boxPlot->setFont(QFont("Sans Serif",11,QFont::Normal));
|
||||
@ -131,8 +131,8 @@ void qDrawPlot::SetupWidgetWindow(){
|
||||
// Default titles- only for the initial picture
|
||||
histXAxisTitle="Channel Number";
|
||||
histYAxisTitle="Counts";
|
||||
plotTitle = "Measurement";
|
||||
|
||||
plotTitle = "";
|
||||
plotTitle_prefix = "";
|
||||
|
||||
for(int i=0;i<MAX_1DPLOTS;i++){
|
||||
histTitle[i] = "";
|
||||
@ -489,14 +489,14 @@ void qDrawPlot::SetupMeasurement(int currentIndex){
|
||||
endPixel = maxPixelsY + (pixelWidth/2);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
cout<<"nPixelsX:"<<nPixelsX<<endl;
|
||||
cout<<"nPixelsY:"<<nPixelsY<<endl;
|
||||
cout<<"minPixelsY:"<<minPixelsY<<endl;
|
||||
cout<<"maxPixelsY:"<<maxPixelsY<<endl;
|
||||
cout<<"startPixel:"<<startPixel<<endl;
|
||||
cout<<"endPixel:"<<endPixel<<endl<<endl;
|
||||
|
||||
*/
|
||||
UnlockLastImageArray();
|
||||
}
|
||||
|
||||
@ -545,35 +545,38 @@ int qDrawPlot::GetData(detectorData *data){
|
||||
|
||||
//angle plotting
|
||||
if(anglePlot){
|
||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||
//set title
|
||||
SetPlotTitle(QString(data->fileName).section('/',-1));
|
||||
while(1){
|
||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||
//set title
|
||||
plotTitle=QString(plotTitle_prefix)+QString(data->fileName).section('/',-1);
|
||||
|
||||
cout<<"angle plot"<<endl;
|
||||
if(data->angles==NULL){
|
||||
cout<<"\n\nWARNING:RETURNED NULL instead of angles."<<endl;
|
||||
lastImageNumber= currentFrame+1;
|
||||
nAnglePixelsX = nPixelsX;
|
||||
histNBins = nAnglePixelsX;
|
||||
nHists=1;
|
||||
memcpy(histXAngleAxis,histXAxis,nAnglePixelsX*sizeof(double));
|
||||
memcpy(histYAngleAxis,data->values,nAnglePixelsX*sizeof(double));
|
||||
SetHistXAxisTitle("Channel Number");
|
||||
cout<<endl<<"angle plot"<<endl<<endl;
|
||||
if(data->angles==NULL){
|
||||
cout<<"\n\nWARNING:RETURNED NULL instead of angles."<<endl;
|
||||
lastImageNumber= currentFrame+1;
|
||||
nAnglePixelsX = nPixelsX;
|
||||
histNBins = nAnglePixelsX;
|
||||
nHists=1;
|
||||
memcpy(histXAngleAxis,histXAxis,nAnglePixelsX*sizeof(double));
|
||||
memcpy(histYAngleAxis,data->values,nAnglePixelsX*sizeof(double));
|
||||
SetHistXAxisTitle("Channel Number");
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
lastImageNumber= currentFrame+1;
|
||||
nAnglePixelsX = data->npoints;
|
||||
histNBins = nAnglePixelsX;
|
||||
nHists=1;
|
||||
if(histXAngleAxis) delete [] histXAngleAxis; histXAngleAxis = new double[nAnglePixelsX];
|
||||
if(histYAngleAxis) delete [] histYAngleAxis; histYAngleAxis = new double[nAnglePixelsX];
|
||||
memcpy(histXAngleAxis,data->angles,nAnglePixelsX*sizeof(double));
|
||||
memcpy(histYAngleAxis,data->values,nAnglePixelsX*sizeof(double));
|
||||
SetHistXAxisTitle("Angles");
|
||||
}
|
||||
pthread_mutex_unlock(&(last_image_complete_mutex));
|
||||
break;
|
||||
}
|
||||
else{
|
||||
|
||||
lastImageNumber= currentFrame+1;
|
||||
nAnglePixelsX = data->npoints;
|
||||
histNBins = nAnglePixelsX;
|
||||
nHists=1;
|
||||
if(histXAngleAxis) delete [] histXAngleAxis; histXAngleAxis = new double[nAnglePixelsX];
|
||||
if(histYAngleAxis) delete [] histYAngleAxis; histYAngleAxis = new double[nAnglePixelsX];
|
||||
memcpy(histXAngleAxis,data->angles,nAnglePixelsX*sizeof(double));
|
||||
memcpy(histYAngleAxis,data->values,nAnglePixelsX*sizeof(double));
|
||||
SetHistXAxisTitle("Angles");
|
||||
}
|
||||
pthread_mutex_unlock(&(last_image_complete_mutex));
|
||||
}
|
||||
currentFrame++;
|
||||
return 0;
|
||||
@ -616,7 +619,7 @@ int qDrawPlot::GetData(detectorData *data){
|
||||
while(1){
|
||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||
//set title
|
||||
SetPlotTitle(QString(data->fileName).section('/',-1));
|
||||
plotTitle=QString(plotTitle_prefix)+QString(data->fileName).section('/',-1);
|
||||
//variables
|
||||
lastImageNumber= currentFrame+1;
|
||||
//title
|
||||
@ -638,7 +641,7 @@ int qDrawPlot::GetData(detectorData *data){
|
||||
while(1){
|
||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||
//set title
|
||||
SetPlotTitle(QString(data->fileName).section('/',-1));
|
||||
plotTitle=QString(plotTitle_prefix)+QString(data->fileName).section('/',-1);
|
||||
//variables
|
||||
if(currentFileIndex == minPixelsY) currentScanDivLevel = 0;
|
||||
lastImageNumber= currentFrame+1;
|
||||
@ -661,7 +664,7 @@ int qDrawPlot::GetData(detectorData *data){
|
||||
while(1){
|
||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||
//set title
|
||||
SetPlotTitle(QString(data->fileName).section('/',-1));
|
||||
plotTitle=QString(plotTitle_prefix)+QString(data->fileName).section('/',-1);
|
||||
//get scanvariable0
|
||||
int ci = 0, p = 0; double cs0 = 0 , cs1 = 0;
|
||||
fileIOStatic::getVariablesFromFileName(string(data->fileName), ci, p, cs0, cs1);
|
||||
@ -691,7 +694,7 @@ int qDrawPlot::GetData(detectorData *data){
|
||||
while(1){
|
||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||
//set title
|
||||
SetPlotTitle(QString(data->fileName).section('/',-1));
|
||||
plotTitle=QString(plotTitle_prefix)+QString(data->fileName).section('/',-1);
|
||||
//get scanvariable1
|
||||
int ci = 0, p = 0; double cs0 = 0 , cs1 = 0;
|
||||
fileIOStatic::getVariablesFromFileName(string(data->fileName), ci, p, cs0, cs1);
|
||||
@ -720,7 +723,7 @@ int qDrawPlot::GetData(detectorData *data){
|
||||
//normal measurement or 1d scans
|
||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||
//set title
|
||||
SetPlotTitle(QString(data->fileName).section('/',-1));
|
||||
plotTitle=QString(plotTitle_prefix)+QString(data->fileName).section('/',-1);
|
||||
char temp_title[2000];
|
||||
// only if you got the lock, do u need to remember lastimagenumber to plot
|
||||
lastImageNumber= currentFrame+1;
|
||||
@ -1285,7 +1288,7 @@ int qDrawPlot::UpdateTrimbitPlot(bool fromDetector,bool Histogram){
|
||||
//data
|
||||
memcpy(histYAxis[0],histTrimbits,nPixelsX*sizeof(double));
|
||||
//title
|
||||
boxPlot->setTitle("Trimbits Plot - Data Graph");
|
||||
boxPlot->setTitle("Trimbits_Plot_Data Graph");
|
||||
plot1D->SetXTitle("Channel Number");
|
||||
plot1D->SetYTitle("Trimbits");
|
||||
//set plot parameters
|
||||
@ -1314,7 +1317,7 @@ int qDrawPlot::UpdateTrimbitPlot(bool fromDetector,bool Histogram){
|
||||
|
||||
//delete [] histTrimbits;
|
||||
//title
|
||||
boxPlot->setTitle("Trimbits Plot - Histogram");
|
||||
boxPlot->setTitle("Trimbits_Plot_Histogram");
|
||||
plot1D->SetXTitle("Trimbits");
|
||||
plot1D->SetYTitle("Frequency");
|
||||
//set plot parameters
|
||||
|
@ -119,7 +119,7 @@ void qTabDataOutput::SetupWidgetWindow(){
|
||||
void qTabDataOutput::Initialization(){
|
||||
//output dir
|
||||
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(setOutputDir()));
|
||||
connect(btnOutputBrowse, SIGNAL(clicked()), this, SLOT(browseOutputDir()));
|
||||
connect(btnOutputBrowse, SIGNAL(clicked()), this, SLOT(browseOutputDir()));
|
||||
//flat field correction
|
||||
connect(chkFlatField, SIGNAL(toggled(bool)), this, SLOT(SetFlatField()));
|
||||
connect(btnFlatField, SIGNAL(clicked()), this, SLOT(BrowseFlatFieldPath()));
|
||||
@ -138,19 +138,22 @@ void qTabDataOutput::Initialization(){
|
||||
|
||||
|
||||
void qTabDataOutput::setOutputDir(){
|
||||
disconnect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(setOutputDir()));
|
||||
|
||||
QString path = dispOutputDir->text();
|
||||
|
||||
//gets rid of the end '/'s
|
||||
disconnect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(setOutputDir()));
|
||||
while(path.endsWith('/')) path.chop(1);
|
||||
dispOutputDir->setText(path);
|
||||
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(setOutputDir()));
|
||||
|
||||
//if(QFile::exists(path))
|
||||
|
||||
|
||||
myDet->setFilePath(string(path.toAscii().constData()));
|
||||
#ifdef VERBOSE
|
||||
cout << "Output Directory changed to :"<<myDet->getFilePath() << endl;
|
||||
#endif
|
||||
|
||||
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(setOutputDir()));
|
||||
}
|
||||
|
||||
|
||||
|
@ -81,6 +81,7 @@ void qTabMeasurement::SetupWidgetWindow(){
|
||||
|
||||
//file write enabled/disabled
|
||||
chkFile->setChecked(myDet->enableWriteToFile());
|
||||
dispFileName->setEnabled(myDet->enableWriteToFile());
|
||||
|
||||
//creating the icons for the buttons
|
||||
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"};
|
||||
|
||||
QString qTabPlot::defaultPlotTitle("Measurement");
|
||||
QString qTabPlot::defaultPlotTitle("");
|
||||
QString qTabPlot::defaultHistXAxisTitle("Channel Number");
|
||||
QString qTabPlot::defaultHistYAxisTitle("Counts");
|
||||
QString qTabPlot::defaultImageXAxisTitle("Pixel");
|
||||
@ -95,8 +95,8 @@ void qTabPlot::SetupWidgetWindow(){
|
||||
dispZMax->setValidator(new QDoubleValidator(dispZMax));
|
||||
|
||||
//default titles
|
||||
dispTitle->setText(defaultPlotTitle);
|
||||
myPlot->SetPlotTitle(defaultPlotTitle);
|
||||
dispTitle->setText("");
|
||||
myPlot->SetPlotTitlePrefix("");
|
||||
dispXAxis->setText(defaultHistXAxisTitle);
|
||||
dispYAxis->setText(defaultHistYAxisTitle);
|
||||
myPlot->SetHistXAxisTitle(defaultHistXAxisTitle);
|
||||
@ -261,7 +261,7 @@ void qTabPlot::EnablePersistency(bool enable){
|
||||
void qTabPlot::SetTitles(){
|
||||
// Plot Title
|
||||
if(dispTitle->isEnabled())
|
||||
myPlot->SetPlotTitle(dispTitle->text());
|
||||
myPlot->SetPlotTitlePrefix(dispTitle->text());
|
||||
// X Axis
|
||||
if(dispXAxis->isEnabled()){
|
||||
if(isOneD) myPlot->SetHistXAxisTitle(dispXAxis->text());
|
||||
@ -285,8 +285,8 @@ void qTabPlot::EnableTitles(){
|
||||
// Plot Title
|
||||
dispTitle->setEnabled(chkTitle->isChecked());
|
||||
if(!chkTitle->isChecked()){
|
||||
myPlot->SetPlotTitle(defaultPlotTitle);
|
||||
dispTitle->setText(defaultPlotTitle);
|
||||
myPlot->SetPlotTitlePrefix("");
|
||||
dispTitle->setText("");
|
||||
}
|
||||
// X Axis
|
||||
dispXAxis->setEnabled(chkXAxis->isChecked());
|
||||
@ -588,8 +588,6 @@ void qTabPlot::EnablingNthFrameFunction(bool enable){
|
||||
void qTabPlot::SetScanArgument(){
|
||||
|
||||
//as default from histogram and default titles are set here if scanbox is disabled
|
||||
dispTitle->setText(defaultPlotTitle);
|
||||
myPlot->SetPlotTitle(defaultPlotTitle);
|
||||
if(isOrginallyOneD){
|
||||
dispXAxis->setText(defaultHistXAxisTitle);
|
||||
dispYAxis->setText(defaultHistYAxisTitle);
|
||||
@ -611,10 +609,6 @@ void qTabPlot::SetScanArgument(){
|
||||
//if scans(1D or 2D)
|
||||
if(boxScan->isEnabled()){
|
||||
//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);
|
||||
if(isOrginallyOneD) myPlot->Select1DPlot();
|
||||
else myPlot->Select2DPlot();
|
||||
@ -624,10 +618,6 @@ void qTabPlot::SetScanArgument(){
|
||||
//else if(myDet->getPositions()){
|
||||
//if scan, change title
|
||||
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");
|
||||
myPlot->SetHistXAxisTitle("Angles");
|
||||
|
Loading…
x
Reference in New Issue
Block a user