diff --git a/slsDetectorGui/include/qDefs.h b/slsDetectorGui/include/qDefs.h index e66dc5757..a117438ac 100644 --- a/slsDetectorGui/include/qDefs.h +++ b/slsDetectorGui/include/qDefs.h @@ -19,6 +19,9 @@ public: /** Empty Constructor */ qDefs(){}; +//------------------------------------------------------------------------------------------------------------------------------------------------- + +#define GUI_VERSION 0.1 //------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/slsDetectorGui/include/qDetectorMain.h b/slsDetectorGui/include/qDetectorMain.h index cc595ac1f..b4ec2cdb6 100644 --- a/slsDetectorGui/include/qDetectorMain.h +++ b/slsDetectorGui/include/qDetectorMain.h @@ -117,8 +117,9 @@ private: void SetUpWidgetWindow(); /**Sets up detector + * @param fName file name of the config file at start up * */ - void SetUpDetector(); + void SetUpDetector(const string fName); /**Sets up the signals and the slots * */ diff --git a/slsDetectorGui/src/qDetectorMain.cpp b/slsDetectorGui/src/qDetectorMain.cpp index 130347adb..907ff9c14 100644 --- a/slsDetectorGui/src/qDetectorMain.cpp +++ b/slsDetectorGui/src/qDetectorMain.cpp @@ -64,11 +64,9 @@ qDetectorMain::qDetectorMain(int argc, char **argv, QApplication *app, QWidget * } setupUi(this); - SetUpDetector(); + SetUpDetector(configFName); SetUpWidgetWindow(); Initialization(); - if(!configFName.empty()) LoadConfigFile(configFName); - } @@ -172,11 +170,16 @@ void qDetectorMain::SetUpWidgetWindow(){ //------------------------------------------------------------------------------------------------------------------------------------------------- -void qDetectorMain::SetUpDetector(){ +void qDetectorMain::SetUpDetector(const string fName){ //instantiate detector and set window title myDet = new multiSlsDetector(detID); + + //loads the config file at startup + if(!fName.empty()) LoadConfigFile(fName); + + //gets the hostname if it worked string host = myDet->getHostname(); //if hostname doesnt exist even in shared memory @@ -271,9 +274,9 @@ void qDetectorMain::LoadConfigFile(const string fName){ QString file = QString(fName.c_str());//.section('/',-1); if((file.contains('.'))&&(QFile::exists(file))){ if(myDet->readConfigurationFile(fName)!=slsDetectorDefs::FAIL) - qDefs::Message(qDefs::INFORMATION,"The Configuration Parameters have been loaded successfully at start up.","Main"); - else qDefs::Message(qDefs::WARNING,string("Could not load the Configuration Parameters at start up from file:\n")+fName,"Main"); - }else qDefs::Message(qDefs::WARNING,string("Start up configuration failed to load. The following file does not exist:\n")+fName,"Main"); + qDefs::Message(qDefs::INFORMATION,"The Configuration Parameters have been loaded successfully at start up.","Main"); + else qDefs::Message(qDefs::WARNING,string("Could not load the Configuration Parameters at start up from file:
")+fName,"Main"); + }else qDefs::Message(qDefs::WARNING,string("Start up configuration failed to load. The following file does not exist:
")+fName,"Main"); } @@ -506,14 +509,14 @@ void qDetectorMain::ExecuteHelp(QAction *action){ string thisClientVersion = string(version); //

A heading

qDefs::Message(qDefs::INFORMATION,"

" - "SLS Detector GUI version: 1.0
" + "SLS Detector GUI version: " + string(QString("%1").arg(GUI_VERSION).toAscii().constData())+"
" "SLS Detector Client version: "+thisClientVersion+"

" "Common GUI to control the SLS Detectors: " "Mythen, Eiger, Gotthard and Agipd.

" "It can be operated in parallel with the command line interface:
" "sls_detector_put,
sls_detector_get,
sls_detector_acquire and
sls_detector_help.

" "The GUI Software is still in progress. " - "Please report bugs to dhanya.maliakal@psi.ch.<\\p>","About SLS Detector GUI"); + "Please report bugs to dhanya.maliakal@psi.ch or anna.bergamaschi@psi.ch.<\\p>","About SLS Detector GUI"); } }