mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 07:20:01 +02:00
verifying output directory works for receiver based detectors.. before acquisition
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@206 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
parent
b6145510ad
commit
6ea6f44824
@ -35,9 +35,9 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>20</x>
|
<x>20</x>
|
||||||
<y>110</y>
|
<y>160</y>
|
||||||
<width>731</width>
|
<width>731</width>
|
||||||
<height>206</height>
|
<height>166</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
@ -47,12 +47,15 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>15</x>
|
<x>15</x>
|
||||||
<y>20</y>
|
<y>25</y>
|
||||||
<width>701</width>
|
<width>701</width>
|
||||||
<height>176</height>
|
<height>126</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<property name="verticalSpacing">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QCheckBox" name="chkFlatField">
|
<widget class="QCheckBox" name="chkFlatField">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
@ -85,6 +88,9 @@
|
|||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::ClickFocus</enum>
|
||||||
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Flat field corrections.
|
<string>Flat field corrections.
|
||||||
#flatfield# filename</string>
|
#flatfield# filename</string>
|
||||||
@ -270,15 +276,43 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QGroupBox" name="boxOutDir">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>20</x>
|
||||||
|
<y>25</y>
|
||||||
|
<width>731</width>
|
||||||
|
<height>116</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><nobr>
|
||||||
|
Directory where one saves the data.
|
||||||
|
</nobr><br>
|
||||||
|
#outdir#
|
||||||
|
<br>
|
||||||
|
</string>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Output Directory</string>
|
||||||
|
</property>
|
||||||
<widget class="QFrame" name="frameOutput">
|
<widget class="QFrame" name="frameOutput">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>19</x>
|
<x>5</x>
|
||||||
<y>20</y>
|
<y>10</y>
|
||||||
<width>746</width>
|
<width>721</width>
|
||||||
<height>41</height>
|
<height>96</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><nobr>
|
||||||
|
Directory where one saves the data.
|
||||||
|
</nobr><br>
|
||||||
|
#outdir#
|
||||||
|
<br>
|
||||||
|
</string>
|
||||||
|
</property>
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -289,49 +323,16 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>6</y>
|
<y>10</y>
|
||||||
<width>706</width>
|
<width>701</width>
|
||||||
<height>28</height>
|
<height>86</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="layoutOutput">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="spacing">
|
<property name="verticalSpacing">
|
||||||
<number>-1</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item row="2" column="3">
|
||||||
<widget class="QLabel" name="lblOutputDir">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><nobr>
|
|
||||||
Directory where one saves the data.
|
|
||||||
</nobr><br>
|
|
||||||
#outdir#
|
|
||||||
<br>
|
|
||||||
</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Output Directory :</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="dispOutputDir">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><nobr>
|
|
||||||
Directory where one saves the data.
|
|
||||||
</nobr><br>
|
|
||||||
#outdir#
|
|
||||||
<br>
|
|
||||||
</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="btnOutputBrowse">
|
<widget class="QPushButton" name="btnOutputBrowse">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string><nobr>
|
<string><nobr>
|
||||||
@ -350,13 +351,142 @@ Directory where one saves the data.
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QLineEdit" name="dispReadOutputDir">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><nobr>
|
||||||
|
Directory where one saves the data.
|
||||||
|
</nobr><br>
|
||||||
|
#outdir#
|
||||||
|
<br>
|
||||||
|
</string>
|
||||||
|
</property>
|
||||||
|
<property name="frame">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="echoMode">
|
||||||
|
<enum>QLineEdit::Normal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<widget class="QLineEdit" name="dispOutputDir">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::StrongFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><nobr>
|
||||||
|
Directory where one saves the data.
|
||||||
|
</nobr><br>
|
||||||
|
#outdir#
|
||||||
|
<br>
|
||||||
|
</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lblDetector">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>2</red>
|
||||||
|
<green>2</green>
|
||||||
|
<blue>2</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>119</red>
|
||||||
|
<green>119</green>
|
||||||
|
<blue>119</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><nobr>
|
||||||
|
Directory where one saves the data.
|
||||||
|
</nobr><br>
|
||||||
|
#outdir#
|
||||||
|
<br>
|
||||||
|
</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Readout:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QComboBox" name="comboDetector">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>180</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>dispOutputDir</tabstop>
|
<tabstop>dispReadOutputDir</tabstop>
|
||||||
<tabstop>btnOutputBrowse</tabstop>
|
|
||||||
<tabstop>chkFlatField</tabstop>
|
<tabstop>chkFlatField</tabstop>
|
||||||
<tabstop>dispFlatField</tabstop>
|
<tabstop>dispFlatField</tabstop>
|
||||||
<tabstop>btnFlatField</tabstop>
|
<tabstop>btnFlatField</tabstop>
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
/** Qt Project Class Headers */
|
/** Qt Project Class Headers */
|
||||||
#include "qDrawPlot.h"
|
#include "qDrawPlot.h"
|
||||||
#include "qTabMeasurement.h"
|
#include "qTabMeasurement.h"
|
||||||
class qTabDataOutput;
|
#include "qTabDataOutput.h"
|
||||||
class qTabPlot;
|
class qTabPlot;
|
||||||
class qTabActions;
|
class qTabActions;
|
||||||
class qTabAdvanced;
|
class qTabAdvanced;
|
||||||
@ -80,6 +80,9 @@ public:
|
|||||||
/** Returns file path */
|
/** Returns file path */
|
||||||
QString GetFilePath(){QString s = QString(myDet->getFilePath().c_str());qDefs::checkErrorMessage(myDet); return s;};
|
QString GetFilePath(){QString s = QString(myDet->getFilePath().c_str());qDefs::checkErrorMessage(myDet); return s;};
|
||||||
|
|
||||||
|
/** Verifies if output directories for all the receivers exist */
|
||||||
|
int DoesOutputDirExist(){return tab_dataoutput->VerifyOutputDirectory();};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** The Qt Application */
|
/** The Qt Application */
|
||||||
QApplication *theApp;
|
QApplication *theApp;
|
||||||
|
@ -40,6 +40,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
void Refresh();
|
void Refresh();
|
||||||
|
|
||||||
|
/** verify output directories
|
||||||
|
* /returns success or fail
|
||||||
|
*/
|
||||||
|
int VerifyOutputDirectory();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -53,6 +57,9 @@ private:
|
|||||||
QString errFlatFieldTip;
|
QString errFlatFieldTip;
|
||||||
QString outDirTip;
|
QString outDirTip;
|
||||||
QPalette red;
|
QPalette red;
|
||||||
|
QPalette black;
|
||||||
|
QPalette *red1;
|
||||||
|
QPalette *black1;
|
||||||
|
|
||||||
/** methods */
|
/** methods */
|
||||||
/** Sets up the widget */
|
/** Sets up the widget */
|
||||||
@ -61,11 +68,12 @@ private:
|
|||||||
/** Sets up all the slots and signals */
|
/** Sets up all the slots and signals */
|
||||||
void Initialization();
|
void Initialization();
|
||||||
|
|
||||||
|
/** Populate the readouts
|
||||||
|
*/
|
||||||
|
void PopulateDetectors();
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/** Sets the output directory
|
|
||||||
*/
|
|
||||||
void setOutputDir();
|
|
||||||
|
|
||||||
/** Open dialog to choose the output directory */
|
/** Open dialog to choose the output directory */
|
||||||
void browseOutputDir();
|
void browseOutputDir();
|
||||||
@ -91,6 +99,12 @@ void SetAngularCorrection();
|
|||||||
/**discard bad channels*/
|
/**discard bad channels*/
|
||||||
void DiscardBadChannels();
|
void DiscardBadChannels();
|
||||||
|
|
||||||
|
/** set output directory*/
|
||||||
|
void SetOutputDir();
|
||||||
|
|
||||||
|
/** set output directory*/
|
||||||
|
void GetOutputDir();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
/**signal to enable/disable positions in Actions*/
|
/**signal to enable/disable positions in Actions*/
|
||||||
void AngularConversionSignal(bool);
|
void AngularConversionSignal(bool);
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
class multiSlsDetector;
|
class multiSlsDetector;
|
||||||
/** Qt Project Class Headers */
|
/** Qt Project Class Headers */
|
||||||
#include "qDrawPlot.h"
|
#include "qDrawPlot.h"
|
||||||
|
class qDetectorMain;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*@short sets up the measurement parameters
|
*@short sets up the measurement parameters
|
||||||
@ -33,7 +34,7 @@ public:
|
|||||||
* @param detector is the detector returned from the detector tab
|
* @param detector is the detector returned from the detector tab
|
||||||
* @param plot plot object reference
|
* @param plot plot object reference
|
||||||
*/
|
*/
|
||||||
qTabMeasurement(QWidget *parent,multiSlsDetector*& detector, qDrawPlot*& plot);
|
qTabMeasurement(qDetectorMain *parent,multiSlsDetector*& detector, qDrawPlot*& plot);
|
||||||
|
|
||||||
/** Destructor
|
/** Destructor
|
||||||
*/
|
*/
|
||||||
@ -167,6 +168,8 @@ private slots:
|
|||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/** parent widget */
|
||||||
|
qDetectorMain *thisParent;
|
||||||
/** The sls detector object */
|
/** The sls detector object */
|
||||||
multiSlsDetector *myDet;
|
multiSlsDetector *myDet;
|
||||||
/** The Plot widget */
|
/** The Plot widget */
|
||||||
|
@ -57,23 +57,28 @@ void qTabDataOutput::SetupWidgetWindow(){
|
|||||||
/** error message **/
|
/** error message **/
|
||||||
red = QPalette();
|
red = QPalette();
|
||||||
red.setColor(QPalette::Active,QPalette::WindowText,Qt::red);
|
red.setColor(QPalette::Active,QPalette::WindowText,Qt::red);
|
||||||
|
black = QPalette();
|
||||||
|
black.setColor(QPalette::Active,QPalette::WindowText,Qt::black);
|
||||||
|
|
||||||
|
red1 = new QPalette();
|
||||||
|
red1->setColor(QPalette::Text,Qt::red);
|
||||||
|
black1 = new QPalette();
|
||||||
|
black1->setColor(QPalette::Text,Qt::black);
|
||||||
|
|
||||||
flatFieldTip = dispFlatField->toolTip();
|
flatFieldTip = dispFlatField->toolTip();
|
||||||
errFlatFieldTip = QString("<nobr>Flat field corrections.</nobr><br>"
|
errFlatFieldTip = QString("<nobr>Flat field corrections.</nobr><br>"
|
||||||
"<nobr> #flatfield# filename</nobr><br><br>")+
|
"<nobr> #flatfield# filename</nobr><br><br>")+
|
||||||
QString("<nobr><font color=\"red\">"
|
QString("<nobr><font color=\"red\">"
|
||||||
"Enter a valid file to enable Flat Field.</font></nobr>");
|
"Enter a valid file to enable Flat Field.</font></nobr>");
|
||||||
|
outDirTip = boxOutDir->toolTip();
|
||||||
|
|
||||||
|
|
||||||
outDirTip = dispOutputDir->toolTip();
|
|
||||||
|
|
||||||
Initialization();
|
Initialization();
|
||||||
|
|
||||||
|
disconnect(comboDetector, SIGNAL(currentIndexChanged(int)), this, SLOT(GetOutputDir()));
|
||||||
// output dir
|
PopulateDetectors();
|
||||||
#ifdef VERBOSE
|
connect(comboDetector, SIGNAL(currentIndexChanged(int)), this, SLOT(GetOutputDir()));
|
||||||
cout << "Getting output directory" << endl;
|
|
||||||
#endif
|
|
||||||
dispOutputDir->setText(QString(myDet->getFilePath().c_str()));
|
|
||||||
|
|
||||||
|
|
||||||
//flat field correction from server
|
//flat field correction from server
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
@ -131,7 +136,10 @@ void qTabDataOutput::SetupWidgetWindow(){
|
|||||||
|
|
||||||
void qTabDataOutput::Initialization(){
|
void qTabDataOutput::Initialization(){
|
||||||
//output dir
|
//output dir
|
||||||
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(setOutputDir()));
|
connect(comboDetector, SIGNAL(currentIndexChanged(int)), this, SLOT(GetOutputDir()));
|
||||||
|
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(SetOutputDir()));
|
||||||
|
|
||||||
|
|
||||||
connect(btnOutputBrowse, SIGNAL(clicked()), this, SLOT(browseOutputDir()));
|
connect(btnOutputBrowse, SIGNAL(clicked()), this, SLOT(browseOutputDir()));
|
||||||
//flat field correction
|
//flat field correction
|
||||||
connect(chkFlatField, SIGNAL(toggled(bool)), this, SLOT(SetFlatField()));
|
connect(chkFlatField, SIGNAL(toggled(bool)), this, SLOT(SetFlatField()));
|
||||||
@ -149,7 +157,7 @@ void qTabDataOutput::Initialization(){
|
|||||||
}
|
}
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/*
|
||||||
void qTabDataOutput::setOutputDir(){
|
void qTabDataOutput::setOutputDir(){
|
||||||
disconnect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(setOutputDir()));
|
disconnect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(setOutputDir()));
|
||||||
|
|
||||||
@ -199,9 +207,6 @@ void qTabDataOutput::setOutputDir(){
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* myDet->setFilePath(string(path.toAscii().constData()));
|
|
||||||
if(myDet->getFilePath()!=(string(path.toAscii().constData())))
|
|
||||||
error=true;*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!error){
|
if(!error){
|
||||||
@ -233,7 +238,7 @@ void qTabDataOutput::setOutputDir(){
|
|||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@ -242,7 +247,7 @@ void qTabDataOutput::browseOutputDir()
|
|||||||
QString directory = QFileDialog::getExistingDirectory(this,tr("Choose Output Directory "),dispOutputDir->text());
|
QString directory = QFileDialog::getExistingDirectory(this,tr("Choose Output Directory "),dispOutputDir->text());
|
||||||
if (!directory.isEmpty())
|
if (!directory.isEmpty())
|
||||||
dispOutputDir->setText(directory);
|
dispOutputDir->setText(directory);
|
||||||
setOutputDir();
|
SetOutputDir();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -542,14 +547,10 @@ void qTabDataOutput::Refresh(){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Getting output directory" << endl;
|
cout << "Getting output directory" << endl;
|
||||||
#endif
|
#endif
|
||||||
dispOutputDir->setText(QString(myDet->getFilePath().c_str()));
|
disconnect(comboDetector, SIGNAL(currentIndexChanged(int)), this, SLOT(GetOutputDir()));
|
||||||
lblOutputDir->setText("Output Directory: ");
|
PopulateDetectors();
|
||||||
lblOutputDir->setPalette(chkRate->palette());
|
connect(comboDetector, SIGNAL(currentIndexChanged(int)), this, SLOT(GetOutputDir()));
|
||||||
lblOutputDir->setToolTip(outDirTip);
|
|
||||||
dispOutputDir->setToolTip(outDirTip);
|
|
||||||
btnOutputBrowse->setToolTip(outDirTip);
|
|
||||||
//making sure it is set
|
|
||||||
setOutputDir();
|
|
||||||
|
|
||||||
//flat field correction from server
|
//flat field correction from server
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
@ -611,3 +612,208 @@ void qTabDataOutput::Refresh(){
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void qTabDataOutput::PopulateDetectors(){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "Populating detectors" << endl;
|
||||||
|
#endif
|
||||||
|
comboDetector->clear();
|
||||||
|
if(myDet->setReceiverOnline() == slsDetectorDefs::OFFLINE_FLAG){
|
||||||
|
boxOutDir->setTitle("Output Directory");
|
||||||
|
comboDetector->addItem("All");
|
||||||
|
}
|
||||||
|
|
||||||
|
//if receiver, add detectors
|
||||||
|
else{
|
||||||
|
boxOutDir->setTitle("Receiver Output Directory");
|
||||||
|
for(int i=0;i<myDet->getNumberOfDetectors();i++)
|
||||||
|
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
||||||
|
}
|
||||||
|
GetOutputDir();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void qTabDataOutput::GetOutputDir(){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "Getting output directory" << endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(!comboDetector->itemText(0).compare("All")){
|
||||||
|
dispReadOutputDir->setText(QString(myDet->getFilePath().c_str()));
|
||||||
|
}else{
|
||||||
|
slsDetector *det = myDet->getSlsDetector(comboDetector->currentIndex());
|
||||||
|
qDefs::checkErrorMessage(myDet);
|
||||||
|
dispReadOutputDir->setText(QString(det->getFilePath().c_str()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
VerifyOutputDirectory();
|
||||||
|
|
||||||
|
//clear field to write
|
||||||
|
disconnect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(SetOutputDir()));
|
||||||
|
dispOutputDir->setText("");
|
||||||
|
dispOutputDir->setPalette(*black1);
|
||||||
|
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(SetOutputDir()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
int qTabDataOutput::VerifyOutputDirectory(){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "Verifying output directory" << endl;
|
||||||
|
#endif
|
||||||
|
bool error = false;
|
||||||
|
QString path = "";
|
||||||
|
QString errTip = outDirTip;
|
||||||
|
QString detName = "";
|
||||||
|
|
||||||
|
path = dispReadOutputDir->text();
|
||||||
|
|
||||||
|
//no receiver
|
||||||
|
if(!comboDetector->itemText(0).compare("All")){
|
||||||
|
if(myDet->setFilePath(string(path.toAscii().constData())).empty()){
|
||||||
|
qDefs::Message(qDefs::WARNING,string("Enter a valid output directory"),"Data Output");
|
||||||
|
error = true;
|
||||||
|
dispReadOutputDir->setText(QString(myDet->getFilePath().c_str()));
|
||||||
|
boxOutDir->setTitle("Receiver Output Directory*");
|
||||||
|
}else if(!qDefs::checkErrorMessage(myDet).empty()){
|
||||||
|
error = true;
|
||||||
|
dispReadOutputDir->setText(QString(myDet->getFilePath().c_str()));
|
||||||
|
dispReadOutputDir->setPalette(*red1);
|
||||||
|
boxOutDir->setPalette(red);
|
||||||
|
boxOutDir->setTitle("Output Directory*");
|
||||||
|
errTip = outDirTip +
|
||||||
|
QString("<nobr><font color=\"red\">"
|
||||||
|
"Enter a valid path to change <b>Output Directory</b>.</font></nobr>");
|
||||||
|
boxOutDir->setToolTip(errTip);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//receiver
|
||||||
|
else{
|
||||||
|
for(int i=0;i<myDet->getNumberOfDetectors();i++){
|
||||||
|
detName = comboDetector->itemText(i);
|
||||||
|
slsDetector *det = myDet->getSlsDetector(i);
|
||||||
|
qDefs::checkErrorMessage(myDet);
|
||||||
|
if(det->setFilePath(det->getFilePath()).empty()){
|
||||||
|
qDefs::Message(qDefs::WARNING,string("Enter a valid output directory for ") +
|
||||||
|
string(detName.toAscii().constData()) + string(" readout"),"Data Output");
|
||||||
|
error = true;
|
||||||
|
dispReadOutputDir->setText(QString(det->getFilePath().c_str()));
|
||||||
|
boxOutDir->setTitle("Receiver Output Directory*");
|
||||||
|
}else if(!qDefs::checkErrorMessage(det).empty()){
|
||||||
|
error = true;
|
||||||
|
dispReadOutputDir->setText(QString(det->getFilePath().c_str()));
|
||||||
|
boxOutDir->setTitle("Receiver Output Directory*");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//if error, display in red
|
||||||
|
if(error){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "The output path doesnt exist anymore" << endl;
|
||||||
|
#endif
|
||||||
|
dispReadOutputDir->setPalette(*red1);
|
||||||
|
boxOutDir->setPalette(red);
|
||||||
|
errTip = errTip +
|
||||||
|
QString("<br><nobr><font color=\"red\">"
|
||||||
|
"Enter a valid path for ") + detName +
|
||||||
|
QString( " readout to change <b>Output Directory</b>.</font></nobr>");
|
||||||
|
boxOutDir->setToolTip(errTip);
|
||||||
|
|
||||||
|
return slsDetectorDefs::FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
//no error
|
||||||
|
else{
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "The output path has been verified" << endl;
|
||||||
|
#endif
|
||||||
|
dispReadOutputDir->setPalette(*black1);
|
||||||
|
boxOutDir->setPalette(black);
|
||||||
|
if(!comboDetector->itemText(0).compare("All"))
|
||||||
|
boxOutDir->setTitle("Output Directory");
|
||||||
|
else
|
||||||
|
boxOutDir->setTitle("Receiver Output Directory");
|
||||||
|
boxOutDir->setToolTip(outDirTip);
|
||||||
|
}
|
||||||
|
|
||||||
|
return slsDetectorDefs::OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void qTabDataOutput::SetOutputDir(){
|
||||||
|
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "Setting output directory" << endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bool error = false;
|
||||||
|
QString path = dispOutputDir->text();
|
||||||
|
|
||||||
|
if(path.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
disconnect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(SetOutputDir()));
|
||||||
|
|
||||||
|
//gets rid of the end '/'s
|
||||||
|
while(path.endsWith('/')) path.chop(1);
|
||||||
|
dispOutputDir->setText(path);
|
||||||
|
|
||||||
|
if(!comboDetector->itemText(0).compare("All")){
|
||||||
|
myDet->setFilePath(string(dispOutputDir->text().toAscii().constData()));
|
||||||
|
if(!qDefs::checkErrorMessage(myDet).empty()){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "The output path could not be set" << endl;
|
||||||
|
#endif
|
||||||
|
myDet->setFilePath(string(dispReadOutputDir->text().toAscii().constData()));
|
||||||
|
error = true;
|
||||||
|
dispOutputDir->setPalette(*red1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else{
|
||||||
|
slsDetector *det = myDet->getSlsDetector(comboDetector->currentIndex());
|
||||||
|
qDefs::checkErrorMessage(myDet);
|
||||||
|
det->setFilePath(string(dispOutputDir->text().toAscii().constData()));
|
||||||
|
if(!qDefs::checkErrorMessage(det).empty()){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "The output path could not be set" << endl;
|
||||||
|
#endif
|
||||||
|
det->setFilePath(string(dispReadOutputDir->text().toAscii().constData()));
|
||||||
|
error = true;
|
||||||
|
dispOutputDir->setPalette(*red1);
|
||||||
|
}
|
||||||
|
|
||||||
|
cout<<"filepath:"<<det->getFilePath()<<endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(!error){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "The output path has been modified" << endl;
|
||||||
|
#endif
|
||||||
|
dispOutputDir->setPalette(*black1);
|
||||||
|
dispReadOutputDir->setText(dispOutputDir->text());
|
||||||
|
dispOutputDir->setText("");
|
||||||
|
VerifyOutputDirectory();
|
||||||
|
}
|
||||||
|
|
||||||
|
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(SetOutputDir()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
//Qt Project Class Headers
|
//Qt Project Class Headers
|
||||||
#include "qTabMeasurement.h"
|
#include "qTabMeasurement.h"
|
||||||
|
#include "qDetectorMain.h"
|
||||||
//Project Class Headers
|
//Project Class Headers
|
||||||
#include "slsDetector.h"
|
#include "slsDetector.h"
|
||||||
#include "multiSlsDetector.h"
|
#include "multiSlsDetector.h"
|
||||||
@ -23,8 +24,8 @@ using namespace std;
|
|||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
qTabMeasurement::qTabMeasurement(QWidget *parent,multiSlsDetector*& detector, qDrawPlot*& plot):
|
qTabMeasurement::qTabMeasurement(qDetectorMain *parent,multiSlsDetector*& detector, qDrawPlot*& plot):
|
||||||
QWidget(parent),myDet(detector),myPlot(plot),expertMode(false){
|
thisParent(parent),myDet(detector),myPlot(plot),expertMode(false){
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
SetupWidgetWindow();
|
SetupWidgetWindow();
|
||||||
Initialization();
|
Initialization();
|
||||||
@ -38,6 +39,7 @@ qTabMeasurement::qTabMeasurement(QWidget *parent,multiSlsDetector*& detector, qD
|
|||||||
qTabMeasurement::~qTabMeasurement(){
|
qTabMeasurement::~qTabMeasurement(){
|
||||||
delete myDet;
|
delete myDet;
|
||||||
delete myPlot;
|
delete myPlot;
|
||||||
|
delete thisParent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -308,6 +310,14 @@ void qTabMeasurement::setRunIndex(int index){
|
|||||||
|
|
||||||
void qTabMeasurement::startStopAcquisition(){
|
void qTabMeasurement::startStopAcquisition(){
|
||||||
if(btnStartStop->isChecked()){
|
if(btnStartStop->isChecked()){
|
||||||
|
|
||||||
|
if(thisParent->DoesOutputDirExist() == slsDetectorDefs::FAIL){
|
||||||
|
disconnect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
|
||||||
|
btnStartStop->click();
|
||||||
|
connect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << endl << endl << "Starting Acquisition" << endl;
|
cout << endl << endl << "Starting Acquisition" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user