mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-17 07:17:13 +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:
@ -59,7 +59,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
case 'f':
|
||||
fname = optarg;
|
||||
LOG(logDEBUG) << long_options[option_index].name << " " << optarg;
|
||||
LOG(sls::logDEBUG) << long_options[option_index].name << " " << optarg;
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
@ -72,7 +72,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
case 'v':
|
||||
tempval = APIGUI;
|
||||
LOG(logINFO) << "SLS Detector GUI " << GITBRANCH << " (0x"
|
||||
LOG(sls::logINFO) << "SLS Detector GUI " << GITBRANCH << " (0x"
|
||||
<< std::hex << tempval << ")";
|
||||
return 0;
|
||||
|
||||
@ -88,7 +88,7 @@ int main(int argc, char **argv) {
|
||||
"i. Default: 0. Required \n" +
|
||||
"\t only when more than one multi "
|
||||
"detector object is needed.\n\n";
|
||||
LOG(logERROR) << help_message;
|
||||
LOG(sls::logERROR) << help_message;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -96,16 +96,18 @@ int main(int argc, char **argv) {
|
||||
QApplication app(argc, argv);
|
||||
app.setStyle(new QPlastiqueStyle); // style is deleted by QApplication
|
||||
try {
|
||||
qDetectorMain det(multiId, fname, isDeveloper);
|
||||
sls::qDetectorMain det(multiId, fname, isDeveloper);
|
||||
det.show();
|
||||
app.exec();
|
||||
} catch (const std::exception &e) {
|
||||
qDefs::Message(qDefs::CRITICAL,
|
||||
sls::qDefs::Message(sls::qDefs::CRITICAL,
|
||||
std::string(e.what()) + "\nExiting Gui :'( ", "main");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
namespace sls {
|
||||
|
||||
qDetectorMain::qDetectorMain(int multiId, const std::string &fname,
|
||||
bool isDevel)
|
||||
: QMainWindow(nullptr), detType(slsDetectorDefs::GENERIC),
|
||||
@ -212,7 +214,7 @@ void qDetectorMain::SetUpWidgetWindow() {
|
||||
void qDetectorMain::SetUpDetector(const std::string &config_file, int multiID) {
|
||||
|
||||
// instantiate detector and set window title
|
||||
det = sls::make_unique<sls::Detector>(multiID);
|
||||
det = make_unique<Detector>(multiID);
|
||||
|
||||
// create messages tab to capture config file loading logs
|
||||
tabMessages = new qTabMessages(this);
|
||||
@ -238,15 +240,15 @@ void qDetectorMain::SetUpDetector(const std::string &config_file, int multiID) {
|
||||
default:
|
||||
std::ostringstream os;
|
||||
os << det->getHostname() << " has "
|
||||
<< sls::ToString(det->getDetectorType().squash())
|
||||
<< ToString(det->getDetectorType().squash())
|
||||
<< " detector type (" << std::to_string(detType)
|
||||
<< "). Exiting GUI.";
|
||||
std::string errorMess = os.str();
|
||||
throw sls::RuntimeError(errorMess.c_str());
|
||||
throw RuntimeError(errorMess.c_str());
|
||||
}
|
||||
std::ostringstream os;
|
||||
os << "SLS Detector GUI : "
|
||||
<< sls::ToString(det->getDetectorType().squash()) << " - "
|
||||
<< ToString(det->getDetectorType().squash()) << " - "
|
||||
<< det->getHostname();
|
||||
std::string title = os.str();
|
||||
LOG(logINFO) << title;
|
||||
@ -441,10 +443,10 @@ void qDetectorMain::ExecuteHelp(QAction *action) {
|
||||
LOG(logINFO) << "About Common GUI for Jungfrau, Eiger, Mythen3, "
|
||||
"Gotthard, Gotthard2 and Moench detectors";
|
||||
|
||||
std::string guiVersion = sls::ToStringHex(APIGUI);
|
||||
std::string guiVersion = ToStringHex(APIGUI);
|
||||
std::string clientVersion = "unknown";
|
||||
try {
|
||||
clientVersion = sls::ToStringHex(det->getClientVersion());
|
||||
clientVersion = ToStringHex(det->getClientVersion());
|
||||
}
|
||||
CATCH_DISPLAY("Could not get client version.",
|
||||
"qDetectorMain::ExecuteHelp")
|
||||
@ -609,3 +611,5 @@ void qDetectorMain::SetZoomToolTip(bool disable) {
|
||||
else
|
||||
dockWidgetPlot->setToolTip(zoomToolTip);
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
Reference in New Issue
Block a user