mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-08 22:00:03 +02:00
WIP
This commit is contained in:
parent
ff3e5001e6
commit
862dc824ba
@ -145,6 +145,9 @@ Directory where one saves the data.
|
|||||||
</item>
|
</item>
|
||||||
<item row="1" column="5" colspan="2">
|
<item row="1" column="5" colspan="2">
|
||||||
<widget class="QSpinBox" name="spinDeadTime">
|
<widget class="QSpinBox" name="spinDeadTime">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@ -216,6 +219,9 @@ Compression using Root. Available only for Gotthard in Expert Mode.
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="widgetEiger" native="true">
|
<widget class="QWidget" name="widgetEiger" native="true">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>3</x>
|
<x>3</x>
|
||||||
@ -306,11 +312,6 @@ Compression using Root. Available only for Gotthard in Expert Mode.
|
|||||||
<string>Quarter Speed</string>
|
<string>Quarter Speed</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Super Slow Speed</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="3">
|
<item row="1" column="3">
|
||||||
@ -366,6 +367,9 @@ Compression using Root. Available only for Gotthard in Expert Mode.
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QGroupBox" name="boxFileWriteEnabled">
|
<widget class="QGroupBox" name="boxFileWriteEnabled">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>20</x>
|
<x>20</x>
|
||||||
@ -404,8 +408,7 @@ Directory where one saves the data.
|
|||||||
</nobr><br>
|
</nobr><br>
|
||||||
#outdir#
|
#outdir#
|
||||||
<br>
|
<br>
|
||||||
Disabled if a receiver is utilized in acquisition.
|
Disabled if receiver pc is not same as client pc.
|
||||||
<br>
|
|
||||||
</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -70,11 +70,6 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
|
|||||||
*/
|
*/
|
||||||
int GetProgress();
|
int GetProgress();
|
||||||
|
|
||||||
/**
|
|
||||||
* Verifies if output directories for all the receivers exist
|
|
||||||
*/
|
|
||||||
int DoesOutputDirExist();
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/**
|
/**
|
||||||
* Enables modes as selected -Debug, Expert, Dockable: calls setdockablemode
|
* Enables modes as selected -Debug, Expert, Dockable: calls setdockablemode
|
||||||
|
@ -33,15 +33,13 @@ public:
|
|||||||
*/
|
*/
|
||||||
void Refresh();
|
void Refresh();
|
||||||
|
|
||||||
/**
|
|
||||||
* Verify output directories
|
|
||||||
* @returns success or fail
|
|
||||||
*/
|
|
||||||
int VerifyOutputDirectory();
|
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get output directory
|
||||||
|
*/
|
||||||
|
void GetOutputDir();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open dialog to choose the output directory
|
* Open dialog to choose the output directory
|
||||||
*/
|
*/
|
||||||
@ -53,30 +51,34 @@ public:
|
|||||||
void SetOutputDir();
|
void SetOutputDir();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get output directory
|
* Set file format
|
||||||
|
* @param format file format
|
||||||
*/
|
*/
|
||||||
void GetOutputDir();
|
void SetFileFormat(int format);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set overwrite enable
|
||||||
|
* @param enable enable
|
||||||
|
*/
|
||||||
|
void SetOverwriteEnable(bool enable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable/Disable 10GbE
|
||||||
|
* @param enable enable
|
||||||
|
*/
|
||||||
|
void SetTenGigaEnable(bool enable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set rate correction
|
* Set rate correction
|
||||||
|
* @param deadtime dead time
|
||||||
*/
|
*/
|
||||||
void SetRateCorrection(int deadtime=0);
|
void SetRateCorrection(int deadtime = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set default rate correction
|
* Set default rate correction
|
||||||
*/
|
*/
|
||||||
void SetDefaultRateCorrection();
|
void SetDefaultRateCorrection();
|
||||||
|
|
||||||
/**
|
|
||||||
* Set update rate correction from server
|
|
||||||
*/
|
|
||||||
void UpdateRateCorrectionFromServer();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable/Disable 10GbE
|
|
||||||
*/
|
|
||||||
void EnableTenGigabitEthernet(bool enable, int get=0);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set speed
|
* Set speed
|
||||||
*/
|
*/
|
||||||
@ -87,17 +89,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
void SetFlags();
|
void SetFlags();
|
||||||
|
|
||||||
/**
|
|
||||||
* Set file format
|
|
||||||
*/
|
|
||||||
void SetFileFormat(int format);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set overwrite enable
|
|
||||||
*/
|
|
||||||
void SetOverwriteEnable(bool enable);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -115,45 +106,66 @@ public:
|
|||||||
*/
|
*/
|
||||||
void PopulateDetectors();
|
void PopulateDetectors();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update speed
|
* Enable browse
|
||||||
*/
|
*/
|
||||||
void UpdateSpeedFromServer();
|
void EnableBrowse();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update flags
|
* Get file format
|
||||||
*/
|
*/
|
||||||
void UpdateFlagsFromServer();
|
void GetFileFormat();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update file format
|
* Get overwrite enable
|
||||||
*/
|
*/
|
||||||
void UpdateFileFormatFromServer();
|
void GetFileOverwrite();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update overwrite enable
|
* Get Ten Giga Enable
|
||||||
*/
|
*/
|
||||||
void UpdateFileOverwriteFromServer();
|
void GetTenGigaEnable();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set Get rate correction
|
||||||
|
*/
|
||||||
|
void GetRateCorrection();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get speed
|
||||||
|
*/
|
||||||
|
void GetSpeed();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get flags
|
||||||
|
*/
|
||||||
|
void GetFlags();
|
||||||
|
|
||||||
/** The sls detector object */
|
/** The sls detector object */
|
||||||
multiSlsDetector *myDet;
|
multiSlsDetector *myDet;
|
||||||
|
|
||||||
/** detector type */
|
/** Palette */
|
||||||
slsDetectorDefs::detectorType detType;
|
QPalette red;
|
||||||
|
|
||||||
QString outDirTip;
|
|
||||||
QPalette red;
|
|
||||||
QPalette black;
|
|
||||||
QPalette *red1;
|
|
||||||
QPalette *black1;
|
|
||||||
|
|
||||||
/** enum for the Eiger clock divider */
|
/** enum for the Eiger clock divider */
|
||||||
enum {FULLSPEED, HALFSPEED, QUARTERSPEED, SUPERSLOWSPEED, NUMBEROFSPEEDS};
|
enum {
|
||||||
/** enum for the Eiger readout flags1 */
|
FULLSPEED,
|
||||||
enum {CONTINUOUS, STOREINRAM};
|
HALFSPEED,
|
||||||
/** enum for the Eiger readout flags2 */
|
QUARTERSPEED,
|
||||||
enum {PARALLEL, NONPARALLEL, SAFE};
|
SUPERSLOWSPEED,
|
||||||
|
NUMBEROFSPEEDS
|
||||||
|
};
|
||||||
|
|
||||||
|
/** enum for the Eiger readout flags1 */
|
||||||
|
enum {
|
||||||
|
CONTINUOUS,
|
||||||
|
STOREINRAM
|
||||||
|
};
|
||||||
|
|
||||||
|
/** enum for the Eiger readout flags2 */
|
||||||
|
enum {
|
||||||
|
PARALLEL,
|
||||||
|
NONPARALLEL
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -145,10 +145,6 @@ bool qDetectorMain::isPlotRunning() { return myPlot->isRunning(); }
|
|||||||
|
|
||||||
int qDetectorMain::GetProgress() { return tabMeasurement->GetProgress(); }
|
int qDetectorMain::GetProgress() { return tabMeasurement->GetProgress(); }
|
||||||
|
|
||||||
int qDetectorMain::DoesOutputDirExist() {
|
|
||||||
return tabDataOutput->VerifyOutputDirectory();
|
|
||||||
}
|
|
||||||
|
|
||||||
void qDetectorMain::SetUpWidgetWindow() {
|
void qDetectorMain::SetUpWidgetWindow() {
|
||||||
|
|
||||||
// Layout
|
// Layout
|
||||||
|
@ -16,14 +16,14 @@ QWidget(parent), myDet(detector) {
|
|||||||
qTabAdvanced::~qTabAdvanced(){}
|
qTabAdvanced::~qTabAdvanced(){}
|
||||||
|
|
||||||
void qTabAdvanced::SetupWidgetWindow(){
|
void qTabAdvanced::SetupWidgetWindow(){
|
||||||
|
// palette
|
||||||
red = QPalette();
|
red = QPalette();
|
||||||
red.setColor(QPalette::Active,QPalette::WindowText,Qt::red);
|
red.setColor(QPalette::Active,QPalette::WindowText,Qt::red);
|
||||||
detOnlineTip = dispOnline->toolTip();
|
detOnlineTip = dispOnline->toolTip();
|
||||||
rxrOnlineTip = dispRxrOnline->toolTip();
|
rxrOnlineTip = dispRxrOnline->toolTip();
|
||||||
errOnlineTip = QString("<nobr><br><br><font color=\"red\"><nobr>It is offline!</nobr></font>");
|
errOnlineTip = QString("<nobr><br><br><font color=\"red\"><nobr>It is offline!</nobr></font>");
|
||||||
|
|
||||||
|
// enabling according to det type
|
||||||
switch((int)myDet->getDetectorTypeAsEnum()) {
|
switch((int)myDet->getDetectorTypeAsEnum()) {
|
||||||
case slsDetectorDefs::EIGER:
|
case slsDetectorDefs::EIGER:
|
||||||
// trimming
|
// trimming
|
||||||
@ -41,7 +41,8 @@ void qTabAdvanced::SetupWidgetWindow(){
|
|||||||
// roi
|
// roi
|
||||||
tab_roi->setEnabled(true);
|
tab_roi->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set initially to network tab
|
// set initially to network tab
|
||||||
@ -108,6 +109,7 @@ void qTabAdvanced::PopulateDetectors() {
|
|||||||
FILE_LOG(logDEBUG) << "Populating detectors";
|
FILE_LOG(logDEBUG) << "Populating detectors";
|
||||||
disconnect(comboDetector, SIGNAL(currentIndexChanged(int)), this, SLOT(SetDetector(int)));
|
disconnect(comboDetector, SIGNAL(currentIndexChanged(int)), this, SLOT(SetDetector(int)));
|
||||||
|
|
||||||
|
comboDetector->clear();
|
||||||
for(int i = 0; i < myDet->getNumberOfDetectors(); ++i)
|
for(int i = 0; i < myDet->getNumberOfDetectors(); ++i)
|
||||||
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
||||||
comboDetector->setCurrentIndex(0);
|
comboDetector->setCurrentIndex(0);
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
qTabDataOutput::qTabDataOutput(QWidget *parent, multiSlsDetector *detector) : QWidget(parent), myDet(detector) {
|
qTabDataOutput::qTabDataOutput(QWidget *parent, multiSlsDetector *detector) : QWidget(parent), myDet(detector) {
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
SetupWidgetWindow();
|
SetupWidgetWindow();
|
||||||
Refresh();
|
|
||||||
FILE_LOG(logDEBUG) << "DataOutput ready";
|
FILE_LOG(logDEBUG) << "DataOutput ready";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21,104 +20,99 @@ qTabDataOutput::~qTabDataOutput() {}
|
|||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::SetupWidgetWindow() {
|
void qTabDataOutput::SetupWidgetWindow() {
|
||||||
|
// palette
|
||||||
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();
|
// enabling according to det type
|
||||||
red1->setColor(QPalette::Text, Qt::red);
|
switch((int)myDet->getDetectorTypeAsEnum()) {
|
||||||
black1 = new QPalette();
|
case slsDetectorDefs::EIGER:
|
||||||
black1->setColor(QPalette::Text, Qt::black);
|
chkTenGiga->setEnabled(true);
|
||||||
|
chkRate->setEnabled(true);
|
||||||
outDirTip = lblOutputDir->toolTip();
|
widgetEiger->setVisible(true);
|
||||||
|
widgetEiger->setEnabled(true);
|
||||||
// Detector Type
|
break;
|
||||||
detType = myDet->getDetectorTypeAsEnum();
|
case slsDetectorDefs::MOENCH:
|
||||||
|
chkTenGiga->setEnabled(true);
|
||||||
// disabling depening on detector type
|
break;
|
||||||
chkRate->setEnabled(false);
|
default:
|
||||||
widgetEiger->setVisible(false);
|
break;
|
||||||
if (detType == slsDetectorDefs::EIGER) {
|
|
||||||
chkRate->setEnabled(true);
|
|
||||||
widgetEiger->setVisible(true);
|
|
||||||
}
|
}
|
||||||
chkTenGiga->setEnabled(false);
|
PopulateDetectors();
|
||||||
if (detType == slsDetectorDefs::EIGER || detType == slsDetectorDefs::MOENCH) {
|
EnableBrowse();
|
||||||
chkTenGiga->setEnabled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
Initialization();
|
Initialization();
|
||||||
|
|
||||||
// populate detectors, get output dir
|
GetOutputDir();
|
||||||
PopulateDetectors();
|
GetFileOverwrite();
|
||||||
|
GetFileFormat();
|
||||||
VerifyOutputDirectory();
|
|
||||||
|
|
||||||
// over write
|
|
||||||
UpdateFileOverwriteFromServer();
|
|
||||||
|
|
||||||
// file format
|
|
||||||
UpdateFileFormatFromServer();
|
|
||||||
|
|
||||||
// rate correction
|
|
||||||
if (chkRate->isEnabled()) {
|
if (chkRate->isEnabled()) {
|
||||||
UpdateRateCorrectionFromServer();
|
GetRateCorrection();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 10 gbe
|
|
||||||
if (chkTenGiga->isEnabled()) {
|
if (chkTenGiga->isEnabled()) {
|
||||||
EnableTenGigabitEthernet(-1, 1);
|
GetTenGigaEnable();
|
||||||
}
|
}
|
||||||
|
if (widgetEiger->isEnabled()) {
|
||||||
//Eiger specific
|
GetSpeed();
|
||||||
if (widgetEiger->isVisible()) {
|
GetFlags();
|
||||||
//speed
|
|
||||||
UpdateSpeedFromServer();
|
|
||||||
//flags
|
|
||||||
UpdateFlagsFromServer();
|
|
||||||
}
|
}
|
||||||
|
Refresh();
|
||||||
qDefs::checkErrorMessage(myDet, "qTabDataOutput::SetupWidgetWindow");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::Initialization() {
|
void qTabDataOutput::Initialization() {
|
||||||
//output dir
|
|
||||||
connect(comboDetector, SIGNAL(currentIndexChanged(int)), this, SLOT(GetOutputDir()));
|
connect(comboDetector, SIGNAL(currentIndexChanged(int)), this, SLOT(GetOutputDir()));
|
||||||
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(SetOutputDir()));
|
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(SetOutputDir()));
|
||||||
connect(btnOutputBrowse, SIGNAL(clicked()), this, SLOT(BrowseOutputDir()));
|
connect(btnOutputBrowse, SIGNAL(clicked()), this, SLOT(BrowseOutputDir()));
|
||||||
|
|
||||||
//overwrite enable
|
|
||||||
connect(chkOverwriteEnable, SIGNAL(toggled(bool)), this, SLOT(SetOverwriteEnable(bool)));
|
|
||||||
|
|
||||||
//file format
|
|
||||||
connect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFileFormat(int)));
|
connect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFileFormat(int)));
|
||||||
|
connect(chkOverwriteEnable, SIGNAL(toggled(bool)), this, SLOT(SetOverwriteEnable(bool)));
|
||||||
//rate correction
|
if (chkTenGiga->isEnabled()) {
|
||||||
connect(chkRate, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection()));
|
connect(chkTenGiga, SIGNAL(toggled(bool)), this, SLOT(SetTenGigaEnable(bool)));
|
||||||
connect(btnDefaultRate, SIGNAL(clicked()), this, SLOT(SetDefaultRateCorrection()));
|
}
|
||||||
connect(spinDeadTime, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection()));
|
if (chkRate->isEnabled()) {
|
||||||
|
connect(chkRate, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection()));
|
||||||
//10GbE
|
connect(btnDefaultRate, SIGNAL(clicked()), this, SLOT(SetDefaultRateCorrection()));
|
||||||
connect(chkTenGiga, SIGNAL(toggled(bool)), this, SLOT(EnableTenGigabitEthernet(bool)));
|
connect(spinDeadTime, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection()));
|
||||||
|
}
|
||||||
//eiger
|
if (widgetEiger->isEnabled()) {
|
||||||
if (widgetEiger->isVisible()) {
|
|
||||||
//speed
|
|
||||||
connect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSpeed()));
|
connect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSpeed()));
|
||||||
//flags
|
|
||||||
connect(comboEigerFlags1, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFlags()));
|
connect(comboEigerFlags1, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFlags()));
|
||||||
connect(comboEigerFlags2, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFlags()));
|
connect(comboEigerFlags2, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFlags()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabDataOutput::PopulateDetectors() {
|
||||||
|
FILE_LOG(logDEBUG) << "Populating detectors";
|
||||||
|
|
||||||
void qTabDataOutput::BrowseOutputDir() {
|
comboDetector->clear();
|
||||||
QString directory = QFileDialog::getExistingDirectory(this, tr("Choose Output Directory "), dispOutputDir->text());
|
comboDetector->addItem("All");
|
||||||
if (!directory.isEmpty())
|
if (myDet->getNumberOfDetectors() > 1) {
|
||||||
dispOutputDir->setText(directory);
|
for (int i = 0; i < myDet->getNumberOfDetectors(); ++i)
|
||||||
SetOutputDir();
|
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabDataOutput::EnableBrowse() {
|
||||||
|
try {
|
||||||
|
std::string receiverHostname = myDet->getReceiverHostname(comboDetector->currentIndex() - 1);
|
||||||
|
if (receiverHostname == "localhost") {
|
||||||
|
btnOutputBrowse->setEnabled(true);
|
||||||
|
} else {
|
||||||
|
std::string hostname;
|
||||||
|
size_t len = 15;
|
||||||
|
char host[len]{};
|
||||||
|
if (gethostname(host, len) == 0) {
|
||||||
|
hostname.assign(host);
|
||||||
|
}
|
||||||
|
// client pc (hostname) same as reciever hostname
|
||||||
|
if (hostname == receiverHostname) {
|
||||||
|
btnOutputBrowse->setEnabled(true);
|
||||||
|
} else {
|
||||||
|
btnOutputBrowse->setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (const sls::RuntimeError &e) {
|
||||||
|
qDefs::ExceptionMessage("Could not get receiver hostname.", e.what(), "qTabDataOutput::EnableBrowse");
|
||||||
|
btnOutputBrowse->setEnabled(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -126,166 +120,79 @@ void qTabDataOutput::GetOutputDir() {
|
|||||||
FILE_LOG(logDEBUG) << "Getting output directory";
|
FILE_LOG(logDEBUG) << "Getting output directory";
|
||||||
|
|
||||||
disconnect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(SetOutputDir()));
|
disconnect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(SetOutputDir()));
|
||||||
//all
|
|
||||||
if (!comboDetector->currentIndex()) {
|
|
||||||
dispOutputDir->setText(QString(myDet->getFilePath().c_str()));
|
|
||||||
qDefs::checkErrorMessage(myDet, "qTabDataOutput::GetOutputDir");
|
|
||||||
|
|
||||||
//multi file path blank means sls file paths are different
|
qDefs::IgnoreNonCriticalExceptions<QLineEdit>(
|
||||||
if (dispOutputDir->text().isEmpty()) {
|
myDet,
|
||||||
qDefs::Message(qDefs::INFORMATION, "The file path for individual readouts are different.\n"
|
"Could not get output file path."
|
||||||
"Hence, leaving the common field blank.", "qTabDataOutput::GetOutputDir");
|
"qTabDataOutput::GetOutputDir",
|
||||||
FILE_LOG(logWARNING) << "The file path for individual units are different.";
|
dispOutputDir,
|
||||||
QString errTip = QString("<br><nobr><font color=\"red\">"
|
&QLineEdit::setText,
|
||||||
"<b>Output Directory</b> Information only: The file path for individual readouts are different.<br>"
|
&multiSlsDetector::getFilePath, comboDetector->currentIndex() - 1);
|
||||||
"Hence, leaving the common field blank.</font></nobr>");
|
|
||||||
lblOutputDir->setText("Path*:");
|
|
||||||
lblOutputDir->setPalette(red);
|
|
||||||
lblOutputDir->setToolTip(errTip);
|
|
||||||
btnOutputBrowse->setToolTip(errTip);
|
|
||||||
dispOutputDir->setToolTip(errTip);
|
|
||||||
} else {
|
|
||||||
lblOutputDir->setText("Path:");
|
|
||||||
lblOutputDir->setPalette(*black1);
|
|
||||||
lblOutputDir->setToolTip(outDirTip);
|
|
||||||
btnOutputBrowse->setToolTip(outDirTip);
|
|
||||||
dispOutputDir->setToolTip(outDirTip);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//specific
|
|
||||||
else {
|
|
||||||
dispOutputDir->setText(QString(myDet->getFilePath(comboDetector->currentIndex() - 1).c_str()));
|
|
||||||
qDefs::checkErrorMessage(myDet, comboDetector->currentIndex() - 1, "qTabDataOutput::GetOutputDir");
|
|
||||||
}
|
|
||||||
|
|
||||||
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(SetOutputDir()));
|
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(SetOutputDir()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabDataOutput::BrowseOutputDir() {
|
||||||
int qTabDataOutput::VerifyOutputDirectory() {
|
FILE_LOG(logDEBUG) << "Browsing output directory";
|
||||||
FILE_LOG(logDEBUG) << "Verifying output directory";
|
QString directory = QFileDialog::getExistingDirectory(this, tr("Choose Output Directory "), dispOutputDir->text());
|
||||||
|
if (!directory.isEmpty())
|
||||||
GetOutputDir();
|
dispOutputDir->setText(directory);
|
||||||
|
|
||||||
bool error = false;
|
|
||||||
std::string detName = "";
|
|
||||||
std::string mess = "";
|
|
||||||
|
|
||||||
//common (check only if no +, different values)
|
|
||||||
std::string fpath = myDet->getFilePath();
|
|
||||||
if (fpath.find('+') == std::string::npos) {
|
|
||||||
myDet->setFilePath(myDet->getFilePath());
|
|
||||||
if (!qDefs::checkErrorMessage(myDet, "qTabDataOutput::VerifyOutputDirectory").empty())
|
|
||||||
error = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//for each detector
|
|
||||||
for (int i = 0; i < myDet->getNumberOfDetectors(); ++i) {
|
|
||||||
detName = std::string("\n - ") + std::string(comboDetector->itemText(i+1).toAscii().constData());
|
|
||||||
myDet->setFilePath(myDet->getFilePath(i), i);
|
|
||||||
if(!qDefs::checkErrorMessage(myDet, i, "qTabDataOutput::VerifyOutputDirectory").empty()) {
|
|
||||||
mess. append(detName);
|
|
||||||
error = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//invalid
|
|
||||||
if (error) {
|
|
||||||
qDefs::Message(qDefs::WARNING, std::string("Invalid Output Directory ") + mess, "qTabDataOutput::VerifyOutputDirectory");
|
|
||||||
FILE_LOG(logWARNING) << "The output path doesnt exist anymore";
|
|
||||||
//replace all \n with <br>
|
|
||||||
size_t pos = 0;
|
|
||||||
while ((pos = mess.find("\n", pos)) != std::string::npos) {
|
|
||||||
mess.replace(pos, 1, "<br>");
|
|
||||||
pos += 1;
|
|
||||||
}
|
|
||||||
QString errTip = outDirTip +
|
|
||||||
QString("<br><nobr><font color=\"red\">"
|
|
||||||
"Invalid <b>Output Directory</b>") +
|
|
||||||
QString(mess.c_str()) +
|
|
||||||
QString(".</font></nobr>");
|
|
||||||
lblOutputDir->setText("Path*:");
|
|
||||||
lblOutputDir->setPalette(red);
|
|
||||||
lblOutputDir->setToolTip(errTip);
|
|
||||||
btnOutputBrowse->setToolTip(errTip);
|
|
||||||
dispOutputDir->setToolTip(errTip);
|
|
||||||
|
|
||||||
return slsDetectorDefs::FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
//valid
|
|
||||||
else {
|
|
||||||
FILE_LOG(logDEBUG) << "The output path is valid";
|
|
||||||
lblOutputDir->setText("Path:");
|
|
||||||
lblOutputDir->setPalette(*black1);
|
|
||||||
lblOutputDir->setToolTip(outDirTip);
|
|
||||||
btnOutputBrowse->setToolTip(outDirTip);
|
|
||||||
dispOutputDir->setToolTip(outDirTip);
|
|
||||||
}
|
|
||||||
|
|
||||||
return slsDetectorDefs::OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::SetOutputDir() {
|
void qTabDataOutput::SetOutputDir() {
|
||||||
|
|
||||||
FILE_LOG(logDEBUG) << "Setting output directory";
|
FILE_LOG(logDEBUG) << "Setting output directory";
|
||||||
|
|
||||||
disconnect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(SetOutputDir()));
|
|
||||||
|
|
||||||
bool error = false;
|
|
||||||
QString path = dispOutputDir->text();
|
QString path = dispOutputDir->text();
|
||||||
|
// empty
|
||||||
//empty
|
|
||||||
if (path.isEmpty()) {
|
if (path.isEmpty()) {
|
||||||
qDefs::Message(qDefs::WARNING, "Invalid Output Path. Must not be empty.", "qTabDataOutput::SetOutputDir");
|
qDefs::Message(qDefs::WARNING, "Invalid Output Path. Must not be empty.", "qTabDataOutput::SetOutputDir");
|
||||||
FILE_LOG(logWARNING) << "Invalid Output Path. Must not be empty.";
|
FILE_LOG(logWARNING) << "Invalid Output Path. Must not be empty.";
|
||||||
error = true;
|
GetOutputDir();
|
||||||
}
|
|
||||||
//gets rid of the end '/'s
|
|
||||||
else if (path.endsWith('/')) {
|
|
||||||
while (path.endsWith('/'))
|
|
||||||
path.chop(1);
|
|
||||||
dispOutputDir->setText(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
//specific
|
|
||||||
if (comboDetector->currentIndex()) {
|
|
||||||
myDet->setFilePath(std::string(dispOutputDir->text().toAscii().constData()), comboDetector->currentIndex() - 1);
|
|
||||||
if (!qDefs::checkErrorMessage(myDet, comboDetector->currentIndex() - 1, "qTabDataOutput::SetOutputDir").empty())
|
|
||||||
error = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//multi
|
|
||||||
else {
|
|
||||||
myDet->setFilePath(std::string(path.toAscii().constData()));
|
|
||||||
if (!qDefs::checkErrorMessage(myDet, "qTabDataOutput::SetOutputDir").empty())
|
|
||||||
error = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (error) {
|
|
||||||
FILE_LOG(logWARNING) << "The output path could not be set";
|
|
||||||
QString errTip = outDirTip + QString("<br><nobr><font color=\"red\">"
|
|
||||||
"Invalid <b>File Path</b></font></nobr>");
|
|
||||||
|
|
||||||
lblOutputDir->setText("Path*:");
|
|
||||||
lblOutputDir->setPalette(red);
|
|
||||||
lblOutputDir->setToolTip(errTip);
|
|
||||||
btnOutputBrowse->setToolTip(errTip);
|
|
||||||
dispOutputDir->setToolTip(errTip);
|
|
||||||
} else {
|
} else {
|
||||||
FILE_LOG(logINFO) << "Output dir set to " << path.toAscii().constData();
|
// chop off trailing '/'
|
||||||
lblOutputDir->setText("Path:");
|
if (path.endsWith('/')) {
|
||||||
lblOutputDir->setPalette(*black1);
|
while (path.endsWith('/')) {
|
||||||
lblOutputDir->setToolTip(outDirTip);
|
path.chop(1);
|
||||||
btnOutputBrowse->setToolTip(outDirTip);
|
}
|
||||||
dispOutputDir->setToolTip(outDirTip);
|
}
|
||||||
|
std::string spath = std::string(path.toAscii().constData());
|
||||||
|
try {
|
||||||
|
myDet->setFilePath(spath, comboDetector->currentIndex() - 1);
|
||||||
|
} catch (const sls::NonCriticalError &e) {
|
||||||
|
qDefs::ExceptionMessage("Could not set output file path.", e.what(), "qTabDataOutput::SetOutputDir");
|
||||||
|
GetOutputDir();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(SetOutputDir()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabDataOutput::GetFileFormat() {
|
||||||
|
FILE_LOG(logDEBUG) << "Getting File Format";
|
||||||
|
disconnect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFileFormat(int)));
|
||||||
|
|
||||||
|
qDefs::IgnoreNonCriticalExceptions<QComboBox>(
|
||||||
|
myDet,
|
||||||
|
"Could not get file format."
|
||||||
|
"qTabAdvanced::GetFileFormat",
|
||||||
|
comboFileFormat,
|
||||||
|
&QComboBox::setCurrentIndex,
|
||||||
|
&multiSlsDetector::getFileFormat, -1);
|
||||||
|
|
||||||
|
connect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFileFormat(int)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabDataOutput::SetFileFormat(int format) {
|
||||||
|
FILE_LOG(logINFO) << "Setting File Format";
|
||||||
|
try {
|
||||||
|
myDet->setFileFormat((slsDetectorDefs::fileFormat)comboFileFormat->currentIndex());
|
||||||
|
} catch (const sls::NonCriticalError &e) {
|
||||||
|
qDefs::ExceptionMessage("Could not set file format.", e.what(), "qTabDataOutput::SetFileFormat");
|
||||||
|
GetFileFormat();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::SetRateCorrection(int deadtime) {
|
void qTabDataOutput::SetRateCorrection(int deadtime) {
|
||||||
@ -323,7 +230,7 @@ void qTabDataOutput::SetRateCorrection(int deadtime) {
|
|||||||
double rate = (double)myDet->getRateCorrection();
|
double rate = (double)myDet->getRateCorrection();
|
||||||
spinDeadTime->setValue((double)rate);
|
spinDeadTime->setValue((double)rate);
|
||||||
if (rate == -1) {
|
if (rate == -1) {
|
||||||
qDefs::Message(qDefs::WARNING, "Dead time is inconsistent for all detectors. Returned Value: -1.", "qTabDataOutput::UpdateRateCorrectionFromServer");
|
qDefs::Message(qDefs::WARNING, "Dead time is inconsistent for all detectors. Returned Value: -1.", "qTabDataOutput::GetRateCorrection");
|
||||||
QString errorTip = QString("<nobr>Rate Corrections.</nobr><br>"
|
QString errorTip = QString("<nobr>Rate Corrections.</nobr><br>"
|
||||||
"<nobr> #ratecorr# tau in seconds</nobr><br><br>") +
|
"<nobr> #ratecorr# tau in seconds</nobr><br><br>") +
|
||||||
QString("<nobr><font color=\"red\">"
|
QString("<nobr><font color=\"red\">"
|
||||||
@ -337,7 +244,7 @@ void qTabDataOutput::SetRateCorrection(int deadtime) {
|
|||||||
"<nobr> #ratecorr# tau in seconds</nobr><br><br>");
|
"<nobr> #ratecorr# tau in seconds</nobr><br><br>");
|
||||||
chkRate->setToolTip(normalTip);
|
chkRate->setToolTip(normalTip);
|
||||||
spinDeadTime->setToolTip(normalTip);
|
spinDeadTime->setToolTip(normalTip);
|
||||||
chkRate->setPalette(chkDiscardBad->palette());
|
chkRate->setPalette(lblDeadTime->palette());
|
||||||
chkRate->setText("Rate:");
|
chkRate->setText("Rate:");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,14 +258,14 @@ void qTabDataOutput::SetDefaultRateCorrection() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::UpdateRateCorrectionFromServer() {
|
void qTabDataOutput::GetRateCorrection() {
|
||||||
disconnect(chkRate, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection()));
|
disconnect(chkRate, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection()));
|
||||||
disconnect(btnDefaultRate, SIGNAL(clicked()), this, SLOT(SetDefaultRateCorrection()));
|
disconnect(btnDefaultRate, SIGNAL(clicked()), this, SLOT(SetDefaultRateCorrection()));
|
||||||
disconnect(spinDeadTime, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection()));
|
disconnect(spinDeadTime, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection()));
|
||||||
|
|
||||||
double rate;
|
double rate;
|
||||||
rate = (double)myDet->getRateCorrection();
|
rate = (double)myDet->getRateCorrection();
|
||||||
qDefs::checkErrorMessage(myDet, "qTabDataOutput::UpdateRateCorrectionFromServer");
|
qDefs::checkErrorMessage(myDet, "qTabDataOutput::GetRateCorrection");
|
||||||
FILE_LOG(logDEBUG) << "Getting rate correction from server: " << rate << '\n';
|
FILE_LOG(logDEBUG) << "Getting rate correction from server: " << rate << '\n';
|
||||||
if (rate == 0) {
|
if (rate == 0) {
|
||||||
chkRate->setChecked(false);
|
chkRate->setChecked(false);
|
||||||
@ -376,7 +283,7 @@ void qTabDataOutput::UpdateRateCorrectionFromServer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (rate == -1) {
|
if (rate == -1) {
|
||||||
qDefs::Message(qDefs::WARNING, "Dead time is inconsistent for all detectors. Returned Value: -1.", "qTabDataOutput::UpdateRateCorrectionFromServer");
|
qDefs::Message(qDefs::WARNING, "Dead time is inconsistent for all detectors. Returned Value: -1.", "qTabDataOutput::GetRateCorrection");
|
||||||
FILE_LOG(logWARNING) << "Dead time is inconsistent for all detectors.";
|
FILE_LOG(logWARNING) << "Dead time is inconsistent for all detectors.";
|
||||||
QString errorTip = QString("<nobr>Rate Corrections.</nobr><br>"
|
QString errorTip = QString("<nobr>Rate Corrections.</nobr><br>"
|
||||||
"<nobr> #ratecorr# tau in seconds</nobr><br><br>") +
|
"<nobr> #ratecorr# tau in seconds</nobr><br><br>") +
|
||||||
@ -401,55 +308,41 @@ void qTabDataOutput::UpdateRateCorrectionFromServer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::PopulateDetectors() {
|
|
||||||
disconnect(comboDetector, SIGNAL(currentIndexChanged(int)), this, SLOT(GetOutputDir()));
|
|
||||||
|
|
||||||
FILE_LOG(logDEBUG) << "Populating detectors";
|
|
||||||
comboDetector->clear();
|
|
||||||
comboDetector->addItem("All");
|
|
||||||
lblOutputDir->setText("Path:");
|
|
||||||
//add specific detector options only if more than 1 detector
|
|
||||||
if (myDet->getNumberOfDetectors() > 1) {
|
|
||||||
for (int i = 0; i < myDet->getNumberOfDetectors(); i++)
|
|
||||||
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
|
||||||
}
|
|
||||||
GetOutputDir();
|
|
||||||
connect(comboDetector, SIGNAL(currentIndexChanged(int)), this, SLOT(GetOutputDir()));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::EnableTenGigabitEthernet(bool enable, int get) {
|
|
||||||
|
void qTabDataOutput::GetTenGigaEnable(bool enable, int get) {
|
||||||
if (get || enable == -1) {
|
if (get || enable == -1) {
|
||||||
FILE_LOG(logDEBUG) << "Getting 10Gbe enable";
|
FILE_LOG(logDEBUG) << "Getting 10Gbe enable";
|
||||||
} else {
|
} else {
|
||||||
FILE_LOG(logINFO) << (enable == 0 ? "Disabling" : "Enabling") << "10GbE";
|
FILE_LOG(logINFO) << (enable == 0 ? "Disabling" : "Enabling") << "10GbE";
|
||||||
}
|
}
|
||||||
disconnect(chkTenGiga, SIGNAL(toggled(bool)), this, SLOT(EnableTenGigabitEthernet(bool)));
|
disconnect(chkTenGiga, SIGNAL(toggled(bool)), this, SLOT(GetTenGigaEnable(bool)));
|
||||||
int ret;
|
int ret;
|
||||||
if (get)
|
if (get)
|
||||||
ret = myDet->enableTenGigabitEthernet(-1);
|
ret = myDet->GetTenGigaEnable(-1);
|
||||||
else
|
else
|
||||||
ret = myDet->enableTenGigabitEthernet(enable);
|
ret = myDet->GetTenGigaEnable(enable);
|
||||||
if (ret > 0)
|
if (ret > 0)
|
||||||
chkTenGiga->setChecked(true);
|
chkTenGiga->setChecked(true);
|
||||||
else
|
else
|
||||||
chkTenGiga->setChecked(false);
|
chkTenGiga->setChecked(false);
|
||||||
connect(chkTenGiga, SIGNAL(toggled(bool)), this, SLOT(EnableTenGigabitEthernet(bool)));
|
connect(chkTenGiga, SIGNAL(toggled(bool)), this, SLOT(GetTenGigaEnable(bool)));
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet, "qTabDataOutput::EnableTenGigabitEthernet");
|
qDefs::checkErrorMessage(myDet, "qTabDataOutput::GetTenGigaEnable");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::UpdateSpeedFromServer() {
|
void qTabDataOutput::GetSpeed() {
|
||||||
int ret;
|
int ret;
|
||||||
if (widgetEiger->isVisible()) {
|
if (widgetEiger->isVisible()) {
|
||||||
disconnect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSpeed()));
|
disconnect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSpeed()));
|
||||||
|
|
||||||
//get speed
|
//get speed
|
||||||
ret = myDet->setSpeed(slsDetectorDefs::CLOCK_DIVIDER, -1);
|
ret = myDet->setSpeed(slsDetectorDefs::CLOCK_DIVIDER, -1);
|
||||||
qDefs::checkErrorMessage(myDet, "qTabDataOutput::updateSpeedFromServer");
|
qDefs::checkErrorMessage(myDet, "qTabDataOutput::GetSpeed");
|
||||||
|
|
||||||
//valid speed
|
//valid speed
|
||||||
if (ret >= 0 && ret < NUMBEROFSPEEDS)
|
if (ret >= 0 && ret < NUMBEROFSPEEDS)
|
||||||
@ -459,12 +352,12 @@ void qTabDataOutput::UpdateSpeedFromServer() {
|
|||||||
else {
|
else {
|
||||||
qDefs::Message(qDefs::WARNING, "Inconsistent value from clock divider.\n"
|
qDefs::Message(qDefs::WARNING, "Inconsistent value from clock divider.\n"
|
||||||
"Setting it for all detectors involved to half speed.",
|
"Setting it for all detectors involved to half speed.",
|
||||||
"qTabDataOutput::updateSpeedFromServer");
|
"qTabDataOutput::GetSpeed");
|
||||||
FILE_LOG(logWARNING) << "Inconsistent value from clock divider.";
|
FILE_LOG(logWARNING) << "Inconsistent value from clock divider.";
|
||||||
//set to default
|
//set to default
|
||||||
comboEigerClkDivider->setCurrentIndex(HALFSPEED);
|
comboEigerClkDivider->setCurrentIndex(HALFSPEED);
|
||||||
myDet->setSpeed(slsDetectorDefs::CLOCK_DIVIDER, HALFSPEED);
|
myDet->setSpeed(slsDetectorDefs::CLOCK_DIVIDER, HALFSPEED);
|
||||||
qDefs::checkErrorMessage(myDet, "qTabDataOutput::updateSpeedFromServer");
|
qDefs::checkErrorMessage(myDet, "qTabDataOutput::GetSpeed");
|
||||||
}
|
}
|
||||||
connect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSpeed()));
|
connect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSpeed()));
|
||||||
}
|
}
|
||||||
@ -475,12 +368,12 @@ void qTabDataOutput::SetSpeed() {
|
|||||||
FILE_LOG(logINFO) << "Setting Speed";
|
FILE_LOG(logINFO) << "Setting Speed";
|
||||||
myDet->setSpeed(slsDetectorDefs::CLOCK_DIVIDER, comboEigerClkDivider->currentIndex());
|
myDet->setSpeed(slsDetectorDefs::CLOCK_DIVIDER, comboEigerClkDivider->currentIndex());
|
||||||
qDefs::checkErrorMessage(myDet, "qTabDataOutput::SetSpeed");
|
qDefs::checkErrorMessage(myDet, "qTabDataOutput::SetSpeed");
|
||||||
UpdateSpeedFromServer();
|
GetSpeed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::UpdateFlagsFromServer() {
|
void qTabDataOutput::GetFlags() {
|
||||||
int ret;
|
int ret;
|
||||||
if (widgetEiger->isVisible()) {
|
if (widgetEiger->isVisible()) {
|
||||||
disconnect(comboEigerFlags1, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFlags()));
|
disconnect(comboEigerFlags1, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFlags()));
|
||||||
@ -488,21 +381,21 @@ void qTabDataOutput::UpdateFlagsFromServer() {
|
|||||||
|
|
||||||
//get speed
|
//get speed
|
||||||
ret = myDet->setReadOutFlags(slsDetectorDefs::GET_READOUT_FLAGS);
|
ret = myDet->setReadOutFlags(slsDetectorDefs::GET_READOUT_FLAGS);
|
||||||
qDefs::checkErrorMessage(myDet, "qTabDataOutput::updateFlagsFromServer");
|
qDefs::checkErrorMessage(myDet, "qTabDataOutput::GetFlags");
|
||||||
|
|
||||||
//invalid flags
|
//invalid flags
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
qDefs::Message(qDefs::WARNING, "Inconsistent value for readout flags.\n"
|
qDefs::Message(qDefs::WARNING, "Inconsistent value for readout flags.\n"
|
||||||
"Setting it for all detectors involved to continous nonparallel mode.",
|
"Setting it for all detectors involved to continous nonparallel mode.",
|
||||||
"qTabDataOutput::updateFlagsFromServer");
|
"qTabDataOutput::GetFlags");
|
||||||
FILE_LOG(logWARNING) << "Inconsistent value for readout flags.";
|
FILE_LOG(logWARNING) << "Inconsistent value for readout flags.";
|
||||||
//set to default
|
//set to default
|
||||||
comboEigerFlags1->setCurrentIndex(CONTINUOUS);
|
comboEigerFlags1->setCurrentIndex(CONTINUOUS);
|
||||||
myDet->setReadOutFlags(slsDetectorDefs::CONTINOUS_RO);
|
myDet->setReadOutFlags(slsDetectorDefs::CONTINOUS_RO);
|
||||||
qDefs::checkErrorMessage(myDet, "qTabDataOutput::updateFlagsFromServer");
|
qDefs::checkErrorMessage(myDet, "qTabDataOutput::GetFlags");
|
||||||
comboEigerFlags2->setCurrentIndex(NONPARALLEL);
|
comboEigerFlags2->setCurrentIndex(NONPARALLEL);
|
||||||
myDet->setReadOutFlags(slsDetectorDefs::NONPARALLEL);
|
myDet->setReadOutFlags(slsDetectorDefs::NONPARALLEL);
|
||||||
qDefs::checkErrorMessage(myDet, "qTabDataOutput::updateFlagsFromServer");
|
qDefs::checkErrorMessage(myDet, "qTabDataOutput::GetFlags");
|
||||||
}
|
}
|
||||||
|
|
||||||
//valid flags
|
//valid flags
|
||||||
@ -557,36 +450,15 @@ void qTabDataOutput::SetFlags() {
|
|||||||
qDefs::checkErrorMessage(myDet, "qTabDataOutput::setFlags");
|
qDefs::checkErrorMessage(myDet, "qTabDataOutput::setFlags");
|
||||||
|
|
||||||
//update flags
|
//update flags
|
||||||
UpdateFlagsFromServer();
|
GetFlags();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::UpdateFileFormatFromServer() {
|
|
||||||
FILE_LOG(logDEBUG) << "Getting File Format";
|
|
||||||
disconnect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFileFormat(int)));
|
|
||||||
|
|
||||||
comboFileFormat->setCurrentIndex((int)myDet->getFileFormat());
|
|
||||||
|
|
||||||
connect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFileFormat(int)));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::SetFileFormat(int format) {
|
|
||||||
FILE_LOG(logINFO) << "Setting File Format";
|
|
||||||
disconnect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFileFormat(int)));
|
|
||||||
|
|
||||||
int ret = (int)myDet->setFileFormat((slsDetectorDefs::fileFormat)comboFileFormat->currentIndex());
|
void qTabDataOutput::GetFileOverwrite() {
|
||||||
if (ret != comboFileFormat->currentIndex()) {
|
|
||||||
qDefs::Message(qDefs::WARNING, "Could not set file format.", "qTabDataOutput::SetFileFormat");
|
|
||||||
comboFileFormat->setCurrentIndex((int)ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
connect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFileFormat(int)));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::UpdateFileOverwriteFromServer() {
|
|
||||||
FILE_LOG(logDEBUG) << "Getting File Over Write Enable";
|
FILE_LOG(logDEBUG) << "Getting File Over Write Enable";
|
||||||
disconnect(chkOverwriteEnable, SIGNAL(toggled(bool)), this, SLOT(SetOverwriteEnable(bool)));
|
disconnect(chkOverwriteEnable, SIGNAL(toggled(bool)), this, SLOT(SetOverwriteEnable(bool)));
|
||||||
|
|
||||||
@ -606,33 +478,34 @@ void qTabDataOutput::SetOverwriteEnable(bool enable) {
|
|||||||
|
|
||||||
connect(chkOverwriteEnable, SIGNAL(toggled(bool)), this, SLOT(SetOverwriteEnable(bool)));
|
connect(chkOverwriteEnable, SIGNAL(toggled(bool)), this, SLOT(SetOverwriteEnable(bool)));
|
||||||
|
|
||||||
UpdateFileOverwriteFromServer();
|
GetFileOverwrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::Refresh() {
|
void qTabDataOutput::Refresh() {
|
||||||
FILE_LOG(logDEBUG) << "**Updating DataOutput Tab";
|
FILE_LOG(logDEBUG) << "**Updating DataOutput Tab";
|
||||||
|
|
||||||
|
EnableBrowse();
|
||||||
if (!myDet->enableWriteToFile())
|
if (!myDet->enableWriteToFile())
|
||||||
boxFileWriteEnabled->setEnabled(false);
|
boxFileWriteEnabled->setEnabled(false);
|
||||||
else
|
else
|
||||||
boxFileWriteEnabled->setEnabled(true);
|
boxFileWriteEnabled->setEnabled(true);
|
||||||
|
|
||||||
// output dir
|
// output dir
|
||||||
PopulateDetectors();
|
GetOutputDir();
|
||||||
|
|
||||||
//overwrite
|
//overwrite
|
||||||
UpdateFileOverwriteFromServer();
|
GetFileOverwrite();
|
||||||
|
|
||||||
//file format
|
//file format
|
||||||
UpdateFileFormatFromServer();
|
GetFileFormat();
|
||||||
|
|
||||||
//file name
|
//file name
|
||||||
dispFileName->setText(QString(myDet->getFileName().c_str()));
|
dispFileName->setText(QString(myDet->getFileName().c_str()));
|
||||||
|
|
||||||
// rate correction
|
// rate correction
|
||||||
if (chkRate->isEnabled()) {
|
if (chkRate->isEnabled()) {
|
||||||
UpdateRateCorrectionFromServer();
|
GetRateCorrection();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (myDet->setReceiverOnline() == slsDetectorDefs::ONLINE_FLAG) {
|
if (myDet->setReceiverOnline() == slsDetectorDefs::ONLINE_FLAG) {
|
||||||
@ -647,15 +520,15 @@ void qTabDataOutput::Refresh() {
|
|||||||
|
|
||||||
// 10GbE
|
// 10GbE
|
||||||
if (chkTenGiga->isEnabled()) {
|
if (chkTenGiga->isEnabled()) {
|
||||||
EnableTenGigabitEthernet(-1, 1);
|
GetTenGigaEnable(-1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Eiger specific
|
//Eiger specific
|
||||||
if (widgetEiger->isVisible()) {
|
if (widgetEiger->isVisible()) {
|
||||||
//speed
|
//speed
|
||||||
UpdateSpeedFromServer();
|
GetSpeed();
|
||||||
//flags
|
//flags
|
||||||
UpdateFlagsFromServer();
|
GetFlags();
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE_LOG(logDEBUG) << "**Updated DataOutput Tab";
|
FILE_LOG(logDEBUG) << "**Updated DataOutput Tab";
|
||||||
|
@ -400,7 +400,7 @@ void qTabMeasurement::Enable(bool enable) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int qTabMeasurement::VerifyOutputDirectoryError() {
|
int qTabMeasurement::VerifyOutputDirectoryError() {
|
||||||
for (int i = 0; i < myDet->getNumberOfDetectors(); i++) {
|
for (int i = 0; i < myDet->getNumberOfDetectors(); i++) {xx
|
||||||
if (getModuleErrorMask(i) == FILE_PATH_DOES_NOT_EXIST) {
|
if (getModuleErrorMask(i) == FILE_PATH_DOES_NOT_EXIST) {
|
||||||
return slsDetectorDefs:: FAIL;
|
return slsDetectorDefs:: FAIL;
|
||||||
}
|
}
|
||||||
|
@ -1266,9 +1266,6 @@ int Feb_Control_SetReadoutSpeed(unsigned int readout_speed) { //0->full,1->half,
|
|||||||
} else if (readout_speed==2) {
|
} else if (readout_speed==2) {
|
||||||
Feb_Control_acquireNReadoutMode |= DAQ_CHIP_CONTROLLER_QUARTER_SPEED;
|
Feb_Control_acquireNReadoutMode |= DAQ_CHIP_CONTROLLER_QUARTER_SPEED;
|
||||||
FILE_LOG(logINFO, ("Speed set to quarter speed (25 MHz)\n"));
|
FILE_LOG(logINFO, ("Speed set to quarter speed (25 MHz)\n"));
|
||||||
} else if (readout_speed==3) {
|
|
||||||
Feb_Control_acquireNReadoutMode |= DAQ_CHIP_CONTROLLER_SUPER_SLOW_SPEED;
|
|
||||||
FILE_LOG(logINFO, ("Speed set to super slow speed (~0.200 MHz)\n"));
|
|
||||||
} else {
|
} else {
|
||||||
if (readout_speed) {
|
if (readout_speed) {
|
||||||
FILE_LOG(logERROR, ("readout speed %d unknown, defaulting to full speed.\n",readout_speed));
|
FILE_LOG(logERROR, ("readout speed %d unknown, defaulting to full speed.\n",readout_speed));
|
||||||
|
BIN
slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_gui
Executable file
BIN
slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_gui
Executable file
Binary file not shown.
@ -553,11 +553,6 @@ enum readOutFlags setReadOutFlags(enum readOutFlags val) {
|
|||||||
val=E_NON_PARALLEL;
|
val=E_NON_PARALLEL;
|
||||||
FILE_LOG(logDEBUG1, ("Setting Read out Flag: Non Parallel\n"));
|
FILE_LOG(logDEBUG1, ("Setting Read out Flag: Non Parallel\n"));
|
||||||
break;
|
break;
|
||||||
case SAFE:
|
|
||||||
val=E_SAFE;
|
|
||||||
FILE_LOG(logDEBUG1, ("Setting Read out Flag: Safe\n"));
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
FILE_LOG(logERROR, ("Cannot set unknown readout flag. 0x%x\n", val));
|
FILE_LOG(logERROR, ("Cannot set unknown readout flag. 0x%x\n", val));
|
||||||
return -1;
|
return -1;
|
||||||
@ -623,9 +618,6 @@ enum readOutFlags setReadOutFlags(enum readOutFlags val) {
|
|||||||
case E_NON_PARALLEL:
|
case E_NON_PARALLEL:
|
||||||
retval=NONPARALLEL;
|
retval=NONPARALLEL;
|
||||||
break;
|
break;
|
||||||
case E_SAFE:
|
|
||||||
retval=SAFE;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(eiger_overflow32) {
|
switch(eiger_overflow32) {
|
||||||
|
@ -1832,7 +1832,6 @@ int set_readout_flags(int file_des) {
|
|||||||
case CONTINOUS_RO:
|
case CONTINOUS_RO:
|
||||||
case PARALLEL:
|
case PARALLEL:
|
||||||
case NONPARALLEL:
|
case NONPARALLEL:
|
||||||
case SAFE:
|
|
||||||
case SHOW_OVERFLOW:
|
case SHOW_OVERFLOW:
|
||||||
case NOOVERFLOW:
|
case NOOVERFLOW:
|
||||||
#elif CHIPTESTBOARDD
|
#elif CHIPTESTBOARDD
|
||||||
|
@ -376,7 +376,7 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \page config
|
/*! \page config
|
||||||
- <b>flags [flag]</b> sets/gets the readout flags to mode. Options: none, storeinram, tot, continous, parallel, nonparallel, safe, digital, analog_digital, overflow, nooverflow, unknown. Used for EIGER only. \c Returns \c (string). put takes one string and \c returns concatenation of all active flags separated by spaces.
|
- <b>flags [flag]</b> sets/gets the readout flags to mode. Options: none, storeinram, tot, continous, parallel, nonparallel, digital, analog_digital, overflow, nooverflow, unknown. Used for EIGER only. \c Returns \c (string). put takes one string and \c returns concatenation of all active flags separated by spaces.
|
||||||
*/
|
*/
|
||||||
descrToFuncMap[i].m_pFuncName = "flags";
|
descrToFuncMap[i].m_pFuncName = "flags";
|
||||||
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdAdvanced;
|
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdAdvanced;
|
||||||
@ -4777,8 +4777,6 @@ std::string slsDetectorCommand::cmdAdvanced(int narg, const char * const args[],
|
|||||||
flag = PARALLEL;
|
flag = PARALLEL;
|
||||||
else if (sval == "nonparallel")
|
else if (sval == "nonparallel")
|
||||||
flag = NONPARALLEL;
|
flag = NONPARALLEL;
|
||||||
else if (sval == "safe")
|
|
||||||
flag = SAFE;
|
|
||||||
else if (sval == "digital")
|
else if (sval == "digital")
|
||||||
flag = DIGITAL_ONLY;
|
flag = DIGITAL_ONLY;
|
||||||
else if (sval == "analog_digital")
|
else if (sval == "analog_digital")
|
||||||
@ -4809,8 +4807,6 @@ std::string slsDetectorCommand::cmdAdvanced(int narg, const char * const args[],
|
|||||||
strcat(answer, "parallel ");
|
strcat(answer, "parallel ");
|
||||||
if (retval & NONPARALLEL)
|
if (retval & NONPARALLEL)
|
||||||
strcat(answer, "nonparallel ");
|
strcat(answer, "nonparallel ");
|
||||||
if (retval & SAFE)
|
|
||||||
strcat(answer, "safe ");
|
|
||||||
if (retval & DIGITAL_ONLY)
|
if (retval & DIGITAL_ONLY)
|
||||||
strcat(answer, "digital ");
|
strcat(answer, "digital ");
|
||||||
if (retval & ANALOG_AND_DIGITAL)
|
if (retval & ANALOG_AND_DIGITAL)
|
||||||
@ -4960,7 +4956,7 @@ std::string slsDetectorCommand::helpAdvanced(int action) {
|
|||||||
if (action == PUT_ACTION || action == HELP_ACTION) {
|
if (action == PUT_ACTION || action == HELP_ACTION) {
|
||||||
|
|
||||||
os << "extsig mode \t sets the mode of the external signal. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl;
|
os << "extsig mode \t sets the mode of the external signal. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl;
|
||||||
os << "flags mode \t sets the readout flags to mode. can be none, storeinram, tot, continous, parallel, nonparallel, safe, digital, analog_digital, overlow, nooverflow, unknown." << std::endl;
|
os << "flags mode \t sets the readout flags to mode. can be none, storeinram, tot, continous, parallel, nonparallel, digital, analog_digital, overlow, nooverflow, unknown." << std::endl;
|
||||||
|
|
||||||
os << "programfpga f \t programs the fpga with file f (with .pof extension)." << std::endl;
|
os << "programfpga f \t programs the fpga with file f (with .pof extension)." << std::endl;
|
||||||
os << "resetfpga f \t resets fpga, f can be any value" << std::endl;
|
os << "resetfpga f \t resets fpga, f can be any value" << std::endl;
|
||||||
@ -4976,7 +4972,7 @@ std::string slsDetectorCommand::helpAdvanced(int action) {
|
|||||||
|
|
||||||
os << "extsig \t gets the mode of the external signal. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl;
|
os << "extsig \t gets the mode of the external signal. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl;
|
||||||
|
|
||||||
os << "flags \t gets the readout flags. can be none, storeinram, tot, continous, parallel, nonparallel, safe, digital, analog_digital, overflow, nooverflow, unknown" << std::endl;
|
os << "flags \t gets the readout flags. can be none, storeinram, tot, continous, parallel, nonparallel, digital, analog_digital, overflow, nooverflow, unknown" << std::endl;
|
||||||
os << "led \t returns led status (0 off, 1 on)" << std::endl;
|
os << "led \t returns led status (0 off, 1 on)" << std::endl;
|
||||||
os << "powerchip \t gets if the chip has been powered on or off" << std::endl;
|
os << "powerchip \t gets if the chip has been powered on or off" << std::endl;
|
||||||
os << "auto_comp_disable \t Currently not implemented. gets if the automatic comparator diable mode is enabled/disabled" << std::endl;
|
os << "auto_comp_disable \t Currently not implemented. gets if the automatic comparator diable mode is enabled/disabled" << std::endl;
|
||||||
|
@ -516,7 +516,6 @@ format
|
|||||||
CONTINOUS_RO = 0x4000, /**< pump-probe mode */
|
CONTINOUS_RO = 0x4000, /**< pump-probe mode */
|
||||||
PARALLEL = 0x10000, /**< eiger parallel mode */
|
PARALLEL = 0x10000, /**< eiger parallel mode */
|
||||||
NONPARALLEL = 0x20000, /**< eiger serial mode */
|
NONPARALLEL = 0x20000, /**< eiger serial mode */
|
||||||
SAFE = 0x40000 /**< eiger safe mode */,
|
|
||||||
DIGITAL_ONLY = 0x80000, /** chiptest board read only digital bits (not
|
DIGITAL_ONLY = 0x80000, /** chiptest board read only digital bits (not
|
||||||
adc values)*/
|
adc values)*/
|
||||||
ANALOG_AND_DIGITAL = 0x100000, /** chiptest board read adc values and
|
ANALOG_AND_DIGITAL = 0x100000, /** chiptest board read adc values and
|
||||||
|
Loading…
x
Reference in New Issue
Block a user