mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-18 07:47:12 +02:00
rxr sls namespace (#457)
* rxr src files and classes (detectordata, ZmqSocket) added to sls namespace * moving defines inside namespace * moving defines inside namespace, added helpdacs to namespace * added namespace to gui * gui also updated * removed unnecessary sls:: when already in sls namespace for slsDetectoSoftware, receverSoftware, slsDetectorGui and slsSupportlib
This commit is contained in:
@ -6,7 +6,9 @@
|
||||
#include "sls/bit_utils.h"
|
||||
#include <QStandardItemModel>
|
||||
|
||||
qTabSettings::qTabSettings(QWidget *parent, sls::Detector *detector)
|
||||
namespace sls {
|
||||
|
||||
qTabSettings::qTabSettings(QWidget *parent, Detector *detector)
|
||||
: QWidget(parent), det(detector) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
@ -215,7 +217,7 @@ void qTabSettings::GetSettings() {
|
||||
break;
|
||||
default:
|
||||
if ((int)retval < -1 || (int)retval >= comboSettings->count()) {
|
||||
throw sls::RuntimeError(std::string("Unknown settings: ") +
|
||||
throw RuntimeError(std::string("Unknown settings: ") +
|
||||
std::to_string(retval));
|
||||
}
|
||||
comboSettings->setCurrentIndex(retval);
|
||||
@ -231,7 +233,7 @@ void qTabSettings::SetSettings(int index) {
|
||||
// settings
|
||||
auto val = static_cast<slsDetectorDefs::detectorSettings>(index);
|
||||
try {
|
||||
LOG(logINFO) << "Setting Settings to " << sls::ToString(val);
|
||||
LOG(logINFO) << "Setting Settings to " << ToString(val);
|
||||
det->setSettings(val);
|
||||
}
|
||||
CATCH_HANDLE("Could not set settings.", "qTabSettings::SetSettings", this,
|
||||
@ -250,7 +252,7 @@ void qTabSettings::GetGainMode() {
|
||||
auto retval = det->getGainMode().tsquash(
|
||||
"Inconsistent gain mode for all detectors.");
|
||||
if ((int)retval < 0 || (int)retval >= comboGainMode->count()) {
|
||||
throw sls::RuntimeError(std::string("Unknown gain mode: ") +
|
||||
throw RuntimeError(std::string("Unknown gain mode: ") +
|
||||
std::to_string(retval));
|
||||
}
|
||||
// warning when using fix_g0 and not in export mode
|
||||
@ -321,7 +323,7 @@ void qTabSettings::GetDynamicRange() {
|
||||
comboDynamicRange->setCurrentIndex(DYNAMICRANGE_4);
|
||||
break;
|
||||
default:
|
||||
throw sls::RuntimeError(std::string("Unknown dynamic range: ") +
|
||||
throw RuntimeError(std::string("Unknown dynamic range: ") +
|
||||
std::to_string(retval));
|
||||
}
|
||||
}
|
||||
@ -352,7 +354,7 @@ void qTabSettings::SetDynamicRange(int index) {
|
||||
det->setDynamicRange(4);
|
||||
break;
|
||||
default:
|
||||
throw sls::RuntimeError(std::string("Unknown dynamic range: ") +
|
||||
throw RuntimeError(std::string("Unknown dynamic range: ") +
|
||||
std::to_string(index));
|
||||
}
|
||||
}
|
||||
@ -399,7 +401,7 @@ void qTabSettings::SetThresholdEnergies() {
|
||||
slsDetectorDefs::detectorSettings sett =
|
||||
static_cast<slsDetectorDefs::detectorSettings>(
|
||||
comboSettings->currentIndex());
|
||||
LOG(logINFO) << "Setting Threshold Energies to " << sls::ToString(eV)
|
||||
LOG(logINFO) << "Setting Threshold Energies to " << ToString(eV)
|
||||
<< " (eV)";
|
||||
try {
|
||||
det->setThresholdEnergy(eV, sett);
|
||||
@ -430,7 +432,7 @@ void qTabSettings::GetCounterMask() {
|
||||
disconnect(chkCounter3, SIGNAL(toggled(bool)), this,
|
||||
SLOT(SetCounterMask()));
|
||||
try {
|
||||
auto retval = sls::getSetBits(det->getCounterMask().tsquash(
|
||||
auto retval = getSetBits(det->getCounterMask().tsquash(
|
||||
"Counter mask is inconsistent for all detectors."));
|
||||
// default to unchecked
|
||||
for (auto p : counters) {
|
||||
@ -439,7 +441,7 @@ void qTabSettings::GetCounterMask() {
|
||||
// if retval[i] = 2, chkCounter2 is checked
|
||||
for (auto i : retval) {
|
||||
if (i > 3) {
|
||||
throw sls::RuntimeError(
|
||||
throw RuntimeError(
|
||||
std::string("Unknown counter index : ") +
|
||||
std::to_string(static_cast<int>(i)));
|
||||
}
|
||||
@ -496,3 +498,5 @@ void qTabSettings::Refresh() {
|
||||
|
||||
LOG(logDEBUG) << "**Updated Settings Tab";
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
Reference in New Issue
Block a user