mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 13:27:14 +02:00
WIP
This commit is contained in:
@ -442,11 +442,6 @@ Disabled if receiver pc is not same as client pc.
|
|||||||
<string>Binary</string>
|
<string>Binary</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>ASCII</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>HDF5</string>
|
<string>HDF5</string>
|
||||||
|
@ -244,6 +244,28 @@ class qDefs : public QWidget {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// executing multiSlsDetector funtion and using return value to set QWidget function
|
||||||
|
// (handling -1 for comboboxes)
|
||||||
|
template <class W, typename WRT, typename RT, typename... CT>
|
||||||
|
static void IgnoreNonCriticalExceptionsandMinus1(multiSlsDetector* det,
|
||||||
|
const std::string message, const std::string source,
|
||||||
|
W* wid, void (W::*someQfunc)(WRT),
|
||||||
|
RT (multiSlsDetector::*somefunc)(CT...),
|
||||||
|
typename NonDeduced<CT>::type... Args) {
|
||||||
|
try {
|
||||||
|
int val = static_cast<int>((det->*somefunc)(Args...));
|
||||||
|
if (val == -1) {
|
||||||
|
Message(qDefs::WARNING, message + std::string(" is inconsistent for all detectors\n"), source);
|
||||||
|
} else {
|
||||||
|
(wid->*someQfunc)(val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// catch them here as they are not critical
|
||||||
|
catch (const sls::NonCriticalError &e) {
|
||||||
|
ExceptionMessage(message, e.what(), source);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// executing multiSlsDetector funtion and returning its value (integers, where value cannot be -1)
|
// executing multiSlsDetector funtion and returning its value (integers, where value cannot be -1)
|
||||||
/* can easily get out of hand
|
/* can easily get out of hand
|
||||||
|
@ -159,7 +159,7 @@ void qTabAdvanced::GetControlPort() {
|
|||||||
|
|
||||||
qDefs::IgnoreNonCriticalExceptions<QSpinBox>(
|
qDefs::IgnoreNonCriticalExceptions<QSpinBox>(
|
||||||
myDet,
|
myDet,
|
||||||
"Could not get detector control port."
|
"Could not get detector control port.",
|
||||||
"qTabAdvanced::GetControlPort",
|
"qTabAdvanced::GetControlPort",
|
||||||
spinControlPort,
|
spinControlPort,
|
||||||
&QSpinBox::setValue,
|
&QSpinBox::setValue,
|
||||||
@ -174,7 +174,7 @@ void qTabAdvanced::GetStopPort() {
|
|||||||
|
|
||||||
qDefs::IgnoreNonCriticalExceptions<QSpinBox>(
|
qDefs::IgnoreNonCriticalExceptions<QSpinBox>(
|
||||||
myDet,
|
myDet,
|
||||||
"Could not get detector stop port."
|
"Could not get detector stop port.",
|
||||||
"qTabAdvanced::GetStopPort",
|
"qTabAdvanced::GetStopPort",
|
||||||
spinStopPort,
|
spinStopPort,
|
||||||
&QSpinBox::setValue,
|
&QSpinBox::setValue,
|
||||||
@ -189,7 +189,7 @@ void qTabAdvanced::GetDetectorUDPIP() {
|
|||||||
|
|
||||||
qDefs::IgnoreNonCriticalExceptions<QLineEdit>(
|
qDefs::IgnoreNonCriticalExceptions<QLineEdit>(
|
||||||
myDet,
|
myDet,
|
||||||
"Could not get detector UDP IP."
|
"Could not get detector UDP IP.",
|
||||||
"qTabAdvanced::GetDetectorUDPIP",
|
"qTabAdvanced::GetDetectorUDPIP",
|
||||||
dispDetectorUDPIP,
|
dispDetectorUDPIP,
|
||||||
&QLineEdit::setText,
|
&QLineEdit::setText,
|
||||||
@ -204,7 +204,7 @@ void qTabAdvanced::GetDetectorUDPMAC() {
|
|||||||
|
|
||||||
qDefs::IgnoreNonCriticalExceptions<QLineEdit>(
|
qDefs::IgnoreNonCriticalExceptions<QLineEdit>(
|
||||||
myDet,
|
myDet,
|
||||||
"Could not get detector UDP MAC."
|
"Could not get detector UDP MAC.",
|
||||||
"qTabAdvanced::GetDetectorUDPMAC",
|
"qTabAdvanced::GetDetectorUDPMAC",
|
||||||
dispDetectorUDPMAC,
|
dispDetectorUDPMAC,
|
||||||
&QLineEdit::setText,
|
&QLineEdit::setText,
|
||||||
@ -219,7 +219,7 @@ void qTabAdvanced::GetCltZMQPort() {
|
|||||||
|
|
||||||
qDefs::IgnoreNonCriticalExceptions<QSpinBox>(
|
qDefs::IgnoreNonCriticalExceptions<QSpinBox>(
|
||||||
myDet,
|
myDet,
|
||||||
"Could not get client zmq port."
|
"Could not get client zmq port.",
|
||||||
"qTabAdvanced::GetCltZMQPort",
|
"qTabAdvanced::GetCltZMQPort",
|
||||||
spinZMQPort,
|
spinZMQPort,
|
||||||
&QSpinBox::setValue,
|
&QSpinBox::setValue,
|
||||||
@ -234,7 +234,7 @@ void qTabAdvanced::GetCltZMQIP() {
|
|||||||
|
|
||||||
qDefs::IgnoreNonCriticalExceptions<QLineEdit>(
|
qDefs::IgnoreNonCriticalExceptions<QLineEdit>(
|
||||||
myDet,
|
myDet,
|
||||||
"Could not get client zmq ip."
|
"Could not get client zmq ip.",
|
||||||
"qTabAdvanced::GetCltZMQIP",
|
"qTabAdvanced::GetCltZMQIP",
|
||||||
dispZMQIP,
|
dispZMQIP,
|
||||||
&QLineEdit::setText,
|
&QLineEdit::setText,
|
||||||
@ -249,7 +249,7 @@ void qTabAdvanced::GetRxrHostname() {
|
|||||||
|
|
||||||
qDefs::IgnoreNonCriticalExceptions<QLineEdit>(
|
qDefs::IgnoreNonCriticalExceptions<QLineEdit>(
|
||||||
myDet,
|
myDet,
|
||||||
"Could not get receiver hostname."
|
"Could not get receiver hostname.",
|
||||||
"qTabAdvanced::GetRxrHostname",
|
"qTabAdvanced::GetRxrHostname",
|
||||||
dispRxrHostname,
|
dispRxrHostname,
|
||||||
&QLineEdit::setText,
|
&QLineEdit::setText,
|
||||||
@ -300,7 +300,7 @@ void qTabAdvanced::GetRxrTCPPort() {
|
|||||||
|
|
||||||
qDefs::IgnoreNonCriticalExceptions<QSpinBox>(
|
qDefs::IgnoreNonCriticalExceptions<QSpinBox>(
|
||||||
myDet,
|
myDet,
|
||||||
"Could not get receiver tcp port."
|
"Could not get receiver tcp port.",
|
||||||
"qTabAdvanced::GetRxrTCPPort",
|
"qTabAdvanced::GetRxrTCPPort",
|
||||||
spinRxrTCPPort,
|
spinRxrTCPPort,
|
||||||
&QSpinBox::setValue,
|
&QSpinBox::setValue,
|
||||||
@ -315,7 +315,7 @@ void qTabAdvanced::GetRxrUDPPort() {
|
|||||||
|
|
||||||
qDefs::IgnoreNonCriticalExceptions<QSpinBox>(
|
qDefs::IgnoreNonCriticalExceptions<QSpinBox>(
|
||||||
myDet,
|
myDet,
|
||||||
"Could not get receiver udp port."
|
"Could not get receiver udp port.",
|
||||||
"qTabAdvanced::GetRxrUDPPort",
|
"qTabAdvanced::GetRxrUDPPort",
|
||||||
spinRxrUDPPort,
|
spinRxrUDPPort,
|
||||||
&QSpinBox::setValue,
|
&QSpinBox::setValue,
|
||||||
@ -330,7 +330,7 @@ void qTabAdvanced::GetRxrUDPIP() {
|
|||||||
|
|
||||||
qDefs::IgnoreNonCriticalExceptions<QLineEdit>(
|
qDefs::IgnoreNonCriticalExceptions<QLineEdit>(
|
||||||
myDet,
|
myDet,
|
||||||
"Could not get receiver udp ip."
|
"Could not get receiver udp ip.",
|
||||||
"qTabAdvanced::GetRxrUDPIP",
|
"qTabAdvanced::GetRxrUDPIP",
|
||||||
dispRxrUDPIP,
|
dispRxrUDPIP,
|
||||||
&QLineEdit::setText,
|
&QLineEdit::setText,
|
||||||
@ -345,7 +345,7 @@ void qTabAdvanced::GetRxrUDPMAC() {
|
|||||||
|
|
||||||
qDefs::IgnoreNonCriticalExceptions<QLineEdit>(
|
qDefs::IgnoreNonCriticalExceptions<QLineEdit>(
|
||||||
myDet,
|
myDet,
|
||||||
"Could not get receiver udp mac."
|
"Could not get receiver udp mac.",
|
||||||
"qTabAdvanced::GetRxrUDPMAC",
|
"qTabAdvanced::GetRxrUDPMAC",
|
||||||
dispRxrUDPMAC,
|
dispRxrUDPMAC,
|
||||||
&QLineEdit::setText,
|
&QLineEdit::setText,
|
||||||
@ -360,7 +360,7 @@ void qTabAdvanced::GetRxrZMQPort() {
|
|||||||
|
|
||||||
qDefs::IgnoreNonCriticalExceptions<QSpinBox>(
|
qDefs::IgnoreNonCriticalExceptions<QSpinBox>(
|
||||||
myDet,
|
myDet,
|
||||||
"Could not get receiver zmq port."
|
"Could not get receiver zmq port.",
|
||||||
"qTabAdvanced::GetRxrZMQPort",
|
"qTabAdvanced::GetRxrZMQPort",
|
||||||
spinRxrZMQPort,
|
spinRxrZMQPort,
|
||||||
&QSpinBox::setValue,
|
&QSpinBox::setValue,
|
||||||
@ -375,7 +375,7 @@ void qTabAdvanced::GetRxrZMQIP() {
|
|||||||
|
|
||||||
qDefs::IgnoreNonCriticalExceptions<QLineEdit>(
|
qDefs::IgnoreNonCriticalExceptions<QLineEdit>(
|
||||||
myDet,
|
myDet,
|
||||||
"Could not get receiver zmq ip."
|
"Could not get receiver zmq ip.",
|
||||||
"qTabAdvanced::GetRxrZMQIP",
|
"qTabAdvanced::GetRxrZMQIP",
|
||||||
dispRxrZMQIP,
|
dispRxrZMQIP,
|
||||||
&QLineEdit::setText,
|
&QLineEdit::setText,
|
||||||
@ -710,7 +710,7 @@ void qTabAdvanced::SetROI() {
|
|||||||
FILE_LOG(logINFO) << "Setting ROI:" << nroi;
|
FILE_LOG(logINFO) << "Setting ROI:" << nroi;
|
||||||
qDefs::IgnoreNonCriticalExceptions(
|
qDefs::IgnoreNonCriticalExceptions(
|
||||||
myDet,
|
myDet,
|
||||||
"Could not set these ROIs."
|
"Could not set these ROIs.",
|
||||||
"qTabAdvanced::SetROI",
|
"qTabAdvanced::SetROI",
|
||||||
&multiSlsDetector::setROI, nroi, roi, -1);
|
&multiSlsDetector::setROI, nroi, roi, -1);
|
||||||
|
|
||||||
@ -724,7 +724,7 @@ void qTabAdvanced::GetAllTrimbits() {
|
|||||||
|
|
||||||
qDefs::IgnoreNonCriticalExceptions<QSpinBox>(
|
qDefs::IgnoreNonCriticalExceptions<QSpinBox>(
|
||||||
myDet,
|
myDet,
|
||||||
"Could not get all trimbits value."
|
"Could not get all trimbits value.",
|
||||||
"qTabAdvanced::GetAllTrimbits",
|
"qTabAdvanced::GetAllTrimbits",
|
||||||
spinSetAllTrimbits,
|
spinSetAllTrimbits,
|
||||||
&QSpinBox::setValue,
|
&QSpinBox::setValue,
|
||||||
@ -736,8 +736,9 @@ void qTabAdvanced::GetAllTrimbits() {
|
|||||||
void qTabAdvanced::SetAllTrimbits() {
|
void qTabAdvanced::SetAllTrimbits() {
|
||||||
int value = spinSetAllTrimbits->value();
|
int value = spinSetAllTrimbits->value();
|
||||||
FILE_LOG(logINFO) << "Setting all trimbits:" << value;
|
FILE_LOG(logINFO) << "Setting all trimbits:" << value;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
myDet->setAllTrimbits(value, -1);
|
myDet->setAllTrimbits(value);
|
||||||
} catch (const sls::NonCriticalError &e) {
|
} catch (const sls::NonCriticalError &e) {
|
||||||
qDefs::ExceptionMessage("Could not set all trimbits.", e.what(), "qTabAdvanced::SetAllTrimbits");
|
qDefs::ExceptionMessage("Could not set all trimbits.", e.what(), "qTabAdvanced::SetAllTrimbits");
|
||||||
GetAllTrimbits();
|
GetAllTrimbits();
|
||||||
@ -750,7 +751,7 @@ void qTabAdvanced::GetNumStoragecells() {
|
|||||||
|
|
||||||
qDefs::IgnoreNonCriticalExceptions<QSpinBox>(
|
qDefs::IgnoreNonCriticalExceptions<QSpinBox>(
|
||||||
myDet,
|
myDet,
|
||||||
"Could not get number of additional storage cells."
|
"Could not get number of additional storage cells.",
|
||||||
"qTabAdvanced::GetNumStoragecells",
|
"qTabAdvanced::GetNumStoragecells",
|
||||||
spinNumStoragecells,
|
spinNumStoragecells,
|
||||||
&QSpinBox::setValue,
|
&QSpinBox::setValue,
|
||||||
@ -775,11 +776,17 @@ void qTabAdvanced::GetSubExposureTime() {
|
|||||||
disconnect(comboSubExpTimeUnit,SIGNAL(currentIndexChanged(int)),this, SLOT(SetSubExposureTime()));
|
disconnect(comboSubExpTimeUnit,SIGNAL(currentIndexChanged(int)),this, SLOT(SetSubExposureTime()));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
double value = (double)(myDet->setTimer(slsDetectorDefs::SUBFRAME_ACQUISITION_TIME,-1) * (1E-9));
|
int64_t retval = myDet->setTimer(slsDetectorDefs::SUBFRAME_ACQUISITION_TIME);
|
||||||
qDefs::timeUnit unit;
|
if (retval == -1) {
|
||||||
double time = qDefs::getCorrectTime(unit, value);
|
qDefs::Message(qDefs::WARNING, "Subexptime is inconsistent for all detectors.", "qTabAdvanced::GetSubExposureTime");
|
||||||
spinSubExpTime->setValue(time);
|
spinSubExpTime->setValue(-1);
|
||||||
comboSubExpTimeUnit->setCurrentIndex((int)unit);
|
} else {
|
||||||
|
double value = (double)( retval * (1E-9));
|
||||||
|
qDefs::timeUnit unit;
|
||||||
|
double time = qDefs::getCorrectTime(unit, value);
|
||||||
|
spinSubExpTime->setValue(time);
|
||||||
|
comboSubExpTimeUnit->setCurrentIndex((int)unit);
|
||||||
|
}
|
||||||
} catch (const sls::NonCriticalError &e) {
|
} catch (const sls::NonCriticalError &e) {
|
||||||
qDefs::ExceptionMessage("Could not get sub exposure time.", e.what(), "qTabSettings::GetSubExposureTime");
|
qDefs::ExceptionMessage("Could not get sub exposure time.", e.what(), "qTabSettings::GetSubExposureTime");
|
||||||
}
|
}
|
||||||
@ -806,11 +813,17 @@ void qTabAdvanced::GetSubDeadTime() {
|
|||||||
disconnect(comboSubDeadTimeUnit,SIGNAL(currentIndexChanged(int)),this, SLOT(SetSubDeadTime()));
|
disconnect(comboSubDeadTimeUnit,SIGNAL(currentIndexChanged(int)),this, SLOT(SetSubDeadTime()));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
double value = (double)(myDet->setTimer(slsDetectorDefs::SUBFRAME_DEADTIME,-1) * (1E-9));
|
int64_t retval = myDet->setTimer(slsDetectorDefs::SUBFRAME_DEADTIME);
|
||||||
qDefs::timeUnit unit;
|
if (retval == -1) {
|
||||||
double time = qDefs::getCorrectTime(unit, value);
|
qDefs::Message(qDefs::WARNING, "Sub dead time is inconsistent for all detectors.", "qTabAdvanced::GetSubDeadTime");
|
||||||
spinSubDeadTime->setValue(time);
|
spinSubDeadTime->setValue(-1);
|
||||||
comboSubDeadTimeUnit->setCurrentIndex((int)unit);
|
} else {
|
||||||
|
double value = (double)(retval * (1E-9));
|
||||||
|
qDefs::timeUnit unit;
|
||||||
|
double time = qDefs::getCorrectTime(unit, value);
|
||||||
|
spinSubDeadTime->setValue(time);
|
||||||
|
comboSubDeadTimeUnit->setCurrentIndex((int)unit);
|
||||||
|
}
|
||||||
} catch (const sls::NonCriticalError &e) {
|
} catch (const sls::NonCriticalError &e) {
|
||||||
qDefs::ExceptionMessage("Could not get sub dead time.", e.what(), "qTabSettings::GetSubDeadTime");
|
qDefs::ExceptionMessage("Could not get sub dead time.", e.what(), "qTabSettings::GetSubDeadTime");
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ void qTabDataOutput::EnableBrowse() {
|
|||||||
btnOutputBrowse->setEnabled(true);
|
btnOutputBrowse->setEnabled(true);
|
||||||
} else {
|
} else {
|
||||||
std::string hostname;
|
std::string hostname;
|
||||||
size_t len = 15;
|
const size_t len = 15;
|
||||||
char host[len]{};
|
char host[len]{};
|
||||||
if (gethostname(host, len) == 0) {
|
if (gethostname(host, len) == 0) {
|
||||||
hostname.assign(host);
|
hostname.assign(host);
|
||||||
@ -117,17 +117,16 @@ void qTabDataOutput::EnableBrowse() {
|
|||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::GetOutputDir() {
|
void qTabDataOutput::GetOutputDir() {
|
||||||
FILE_LOG(logDEBUG) << "Getting output directory";
|
FILE_LOG(logDEBUG) << "Getting file path";
|
||||||
|
|
||||||
disconnect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(SetOutputDir()));
|
disconnect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(SetOutputDir()));
|
||||||
|
|
||||||
qDefs::IgnoreNonCriticalExceptions<QLineEdit>(
|
try {
|
||||||
myDet,
|
std::string path = myDet->getFilePath(comboDetector->currentIndex() - 1);
|
||||||
"Could not get output file path."
|
dispOutputDir->setText(QString(path.c_str()));
|
||||||
"qTabDataOutput::GetOutputDir",
|
} catch (const sls::NonCriticalError &e) {
|
||||||
dispOutputDir,
|
qDefs::ExceptionMessage("Could not get file path.", e.what(), "qTabDataOutput::GetOutputDir");
|
||||||
&QLineEdit::setText,
|
}
|
||||||
&multiSlsDetector::getFilePath, comboDetector->currentIndex() - 1);
|
|
||||||
|
|
||||||
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(SetOutputDir()));
|
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(SetOutputDir()));
|
||||||
}
|
}
|
||||||
@ -140,9 +139,9 @@ void qTabDataOutput::BrowseOutputDir() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void qTabDataOutput::SetOutputDir() {
|
void qTabDataOutput::SetOutputDir() {
|
||||||
FILE_LOG(logDEBUG) << "Setting output directory";
|
|
||||||
|
|
||||||
QString path = dispOutputDir->text();
|
QString path = dispOutputDir->text();
|
||||||
|
FILE_LOG(logDEBUG) << "Setting output directory to " << path.toAscii().constData();
|
||||||
|
|
||||||
// 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");
|
||||||
@ -169,10 +168,10 @@ void qTabDataOutput::GetFileFormat() {
|
|||||||
FILE_LOG(logDEBUG) << "Getting File Format";
|
FILE_LOG(logDEBUG) << "Getting File Format";
|
||||||
disconnect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFileFormat(int)));
|
disconnect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFileFormat(int)));
|
||||||
|
|
||||||
qDefs::IgnoreNonCriticalExceptions<QComboBox>(
|
qDefs::IgnoreNonCriticalExceptionsandMinus1<QComboBox>(
|
||||||
myDet,
|
myDet,
|
||||||
"Could not get file format."
|
"Could not get file format.",
|
||||||
"qTabAdvanced::GetFileFormat",
|
"qTabDataOutput::GetFileFormat",
|
||||||
comboFileFormat,
|
comboFileFormat,
|
||||||
&QComboBox::setCurrentIndex,
|
&QComboBox::setCurrentIndex,
|
||||||
&multiSlsDetector::getFileFormat, -1);
|
&multiSlsDetector::getFileFormat, -1);
|
||||||
@ -181,7 +180,7 @@ void qTabDataOutput::GetFileFormat() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void qTabDataOutput::SetFileFormat(int format) {
|
void qTabDataOutput::SetFileFormat(int format) {
|
||||||
FILE_LOG(logINFO) << "Setting File Format";
|
FILE_LOG(logINFO) << "Setting File Format to " << slsDetectorDefs::getFileFormatType((slsDetectorDefs::fileFormat)format);
|
||||||
try {
|
try {
|
||||||
myDet->setFileFormat((slsDetectorDefs::fileFormat)comboFileFormat->currentIndex());
|
myDet->setFileFormat((slsDetectorDefs::fileFormat)comboFileFormat->currentIndex());
|
||||||
} catch (const sls::NonCriticalError &e) {
|
} catch (const sls::NonCriticalError &e) {
|
||||||
@ -190,6 +189,65 @@ void qTabDataOutput::SetFileFormat(int format) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabDataOutput::GetFileOverwrite() {
|
||||||
|
FILE_LOG(logDEBUG) << "Getting File Over Write Enable";
|
||||||
|
disconnect(chkOverwriteEnable, SIGNAL(toggled(bool)), this, SLOT(SetOverwriteEnable(bool)));
|
||||||
|
|
||||||
|
try {
|
||||||
|
int retval = myDet->getFileOverWrite();
|
||||||
|
if (retval == -1) {
|
||||||
|
qDefs::Message(qDefs::WARNING, "File over write is inconsistent for all detectors.", "qTabDataOutput::GetFileOverwrite");
|
||||||
|
} else {
|
||||||
|
chkOverwriteEnable->setChecked(retval == 0 ? false : true);
|
||||||
|
}
|
||||||
|
} catch (const sls::NonCriticalError &e) {
|
||||||
|
qDefs::ExceptionMessage("Could not get file over write enable.", e.what(), "qTabDataOutput::GetFileOverwrite");
|
||||||
|
}
|
||||||
|
|
||||||
|
connect(chkOverwriteEnable, SIGNAL(toggled(bool)), this, SLOT(SetOverwriteEnable(bool)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabDataOutput::SetOverwriteEnable(bool enable) {
|
||||||
|
FILE_LOG(logINFO) << "Setting File Over Write Enable to " << enable;
|
||||||
|
|
||||||
|
try {
|
||||||
|
myDet->setFileOverWrite(enable);
|
||||||
|
} catch (const sls::NonCriticalError &e) {
|
||||||
|
qDefs::ExceptionMessage("Could not set file over write enable.", e.what(), "qTabDataOutput::SetOverwriteEnable");
|
||||||
|
GetFileOverwrite();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabDataOutput::GetTenGigaEnable() {
|
||||||
|
FILE_LOG(logDEBUG) << "Getting 10GbE enable";
|
||||||
|
disconnect(chkTenGiga, SIGNAL(toggled(bool)), this, SLOT(SetTenGigaEnable(bool)));
|
||||||
|
|
||||||
|
try {
|
||||||
|
int retval = myDet->enableTenGigabitEthernet();
|
||||||
|
if (retval == -1) {
|
||||||
|
qDefs::Message(qDefs::WARNING, "10GbE enable is inconsistent for all detectors.", "qTabDataOutput::GetTenGigaEnable");
|
||||||
|
} else {
|
||||||
|
chkTenGiga->setChecked(retval == 0 ? false : true);
|
||||||
|
}
|
||||||
|
} catch (const sls::NonCriticalError &e) {
|
||||||
|
qDefs::ExceptionMessage("Could not get 10GbE enable.", e.what(), "qTabDataOutput::GetTenGigaEnable");
|
||||||
|
}
|
||||||
|
|
||||||
|
connect(chkTenGiga, SIGNAL(toggled(bool)), this, SLOT(SetTenGigaEnable(bool)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabDataOutput::SetTenGigaEnable(bool enable) {
|
||||||
|
FILE_LOG(logINFO) << "Setting 10GbE to " << enable;
|
||||||
|
|
||||||
|
try {
|
||||||
|
myDet->enableTenGigabitEthernet(enable);
|
||||||
|
} catch (const sls::NonCriticalError &e) {
|
||||||
|
qDefs::ExceptionMessage("Could not set 10GbE enable.", e.what(), "qTabDataOutput::SetTenGigaEnable");
|
||||||
|
GetTenGigaEnable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -313,26 +371,7 @@ void qTabDataOutput::GetRateCorrection() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::GetTenGigaEnable(bool enable, int get) {
|
|
||||||
if (get || enable == -1) {
|
|
||||||
FILE_LOG(logDEBUG) << "Getting 10Gbe enable";
|
|
||||||
} else {
|
|
||||||
FILE_LOG(logINFO) << (enable == 0 ? "Disabling" : "Enabling") << "10GbE";
|
|
||||||
}
|
|
||||||
disconnect(chkTenGiga, SIGNAL(toggled(bool)), this, SLOT(GetTenGigaEnable(bool)));
|
|
||||||
int ret;
|
|
||||||
if (get)
|
|
||||||
ret = myDet->GetTenGigaEnable(-1);
|
|
||||||
else
|
|
||||||
ret = myDet->GetTenGigaEnable(enable);
|
|
||||||
if (ret > 0)
|
|
||||||
chkTenGiga->setChecked(true);
|
|
||||||
else
|
|
||||||
chkTenGiga->setChecked(false);
|
|
||||||
connect(chkTenGiga, SIGNAL(toggled(bool)), this, SLOT(GetTenGigaEnable(bool)));
|
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet, "qTabDataOutput::GetTenGigaEnable");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::GetSpeed() {
|
void qTabDataOutput::GetSpeed() {
|
||||||
@ -458,28 +497,6 @@ void qTabDataOutput::SetFlags() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::GetFileOverwrite() {
|
|
||||||
FILE_LOG(logDEBUG) << "Getting File Over Write Enable";
|
|
||||||
disconnect(chkOverwriteEnable, SIGNAL(toggled(bool)), this, SLOT(SetOverwriteEnable(bool)));
|
|
||||||
|
|
||||||
chkOverwriteEnable->setChecked(myDet->overwriteFile());
|
|
||||||
|
|
||||||
connect(chkOverwriteEnable, SIGNAL(toggled(bool)), this, SLOT(SetOverwriteEnable(bool)));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::SetOverwriteEnable(bool enable) {
|
|
||||||
FILE_LOG(logINFO) << "Setting File Over Write Enable";
|
|
||||||
disconnect(chkOverwriteEnable, SIGNAL(toggled(bool)), this, SLOT(SetOverwriteEnable(bool)));
|
|
||||||
|
|
||||||
int valid = (enable ? 1 : 0);
|
|
||||||
if (myDet->overwriteFile(enable) != valid)
|
|
||||||
qDefs::Message(qDefs::WARNING, "Could not over write enable.", "qTabDataOutput::SetOverwriteEnable");
|
|
||||||
|
|
||||||
connect(chkOverwriteEnable, SIGNAL(toggled(bool)), this, SLOT(SetOverwriteEnable(bool)));
|
|
||||||
|
|
||||||
GetFileOverwrite();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::Refresh() {
|
void qTabDataOutput::Refresh() {
|
||||||
|
@ -514,8 +514,6 @@ int slsReceiverImplementation::setReadOutFlags(const readOutFlags f) {
|
|||||||
flag.append("parallel ");
|
flag.append("parallel ");
|
||||||
if (f & NONPARALLEL)
|
if (f & NONPARALLEL)
|
||||||
flag.append("nonparallel ");
|
flag.append("nonparallel ");
|
||||||
if (f & SAFE)
|
|
||||||
flag.append("safe ");
|
|
||||||
if (f & DIGITAL_ONLY)
|
if (f & DIGITAL_ONLY)
|
||||||
flag.append("digital ");
|
flag.append("digital ");
|
||||||
if (f & ANALOG_AND_DIGITAL)
|
if (f & ANALOG_AND_DIGITAL)
|
||||||
|
@ -645,8 +645,8 @@ format
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** returns string from file format index
|
/** returns string from file format index
|
||||||
\param s can be BINARY, ASCII, HDF5
|
\param s can be BINARY, HDF5
|
||||||
\returns string binary, ascii, hdf5
|
\returns string binary, hdf5
|
||||||
*/
|
*/
|
||||||
static std::string getFileFormatType(fileFormat f) {
|
static std::string getFileFormatType(fileFormat f) {
|
||||||
switch (f) {
|
switch (f) {
|
||||||
|
Reference in New Issue
Block a user