mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-20 02:40:03 +02:00
changed the start and stop receiver error messages to be displayed to the client and not jsus recever
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@213 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
parent
16b8bb967c
commit
9cdbd74471
@ -183,7 +183,7 @@ static const int64_t GUI_VERSION=0x20121213;
|
|||||||
* @param myDet is the multidetector object
|
* @param myDet is the multidetector object
|
||||||
/returns error message else an empty string
|
/returns error message else an empty string
|
||||||
* */
|
* */
|
||||||
static string checkErrorMessage(multiSlsDetector*& myDet){
|
static string checkErrorMessage(multiSlsDetector*& myDet, string title = "Main"){
|
||||||
|
|
||||||
|
|
||||||
int errorLevel= (int)WARNING;
|
int errorLevel= (int)WARNING;
|
||||||
@ -206,7 +206,7 @@ static const int64_t GUI_VERSION=0x20121213;
|
|||||||
retval.append("</font></nobr>");
|
retval.append("</font></nobr>");
|
||||||
|
|
||||||
//display message
|
//display message
|
||||||
qDefs::Message((MessageIndex)errorLevel,retval,"Main");
|
qDefs::Message((MessageIndex)errorLevel,retval,title);
|
||||||
}
|
}
|
||||||
|
|
||||||
myDet->clearAllErrorMask();
|
myDet->clearAllErrorMask();
|
||||||
@ -221,7 +221,7 @@ static const int64_t GUI_VERSION=0x20121213;
|
|||||||
* @param show to display the error message
|
* @param show to display the error message
|
||||||
/returns error message else an empty string
|
/returns error message else an empty string
|
||||||
* */
|
* */
|
||||||
static string checkErrorMessage(slsDetector*& myDet,bool show = true){
|
static string checkErrorMessage(slsDetector*& myDet, string title = "Main", bool show = true){
|
||||||
|
|
||||||
|
|
||||||
int errorLevel= (int)WARNING;
|
int errorLevel= (int)WARNING;
|
||||||
@ -246,7 +246,7 @@ static const int64_t GUI_VERSION=0x20121213;
|
|||||||
|
|
||||||
//display message
|
//display message
|
||||||
if(show)
|
if(show)
|
||||||
qDefs::Message((MessageIndex)errorLevel,retval,"Main");
|
qDefs::Message((MessageIndex)errorLevel,retval,title);
|
||||||
}
|
}
|
||||||
|
|
||||||
myDet->clearErrorMask();
|
myDet->clearErrorMask();
|
||||||
|
@ -84,19 +84,19 @@ void qActionsWidget::SetMode(int mode){
|
|||||||
if(!fName.isEmpty()){
|
if(!fName.isEmpty()){
|
||||||
//check if mode didnt get set
|
//check if mode didnt get set
|
||||||
if(mode!=myDet->getActionMode(id)){
|
if(mode!=myDet->getActionMode(id)){
|
||||||
qDefs::Message(qDefs::WARNING,"The mode could not be changed.","ActionsWidget");
|
qDefs::Message(qDefs::WARNING,"The mode could not be changed.","qActionsWidget::SetMode");
|
||||||
comboScript->setCurrentIndex(myDet->getActionMode(id));
|
comboScript->setCurrentIndex(myDet->getActionMode(id));
|
||||||
}//if mode got set and its custom script
|
}//if mode got set and its custom script
|
||||||
else if(mode){
|
else if(mode){
|
||||||
//when the file name did not get set correctly
|
//when the file name did not get set correctly
|
||||||
if(fName.compare(QString(myDet->getActionScript(id).c_str()))){
|
if(fName.compare(QString(myDet->getActionScript(id).c_str()))){
|
||||||
qDefs::Message(qDefs::WARNING,"The file path could not be set.","ActionsWidget");
|
qDefs::Message(qDefs::WARNING,"The file path could not be set.","qActionsWidget::SetMode");
|
||||||
dispScript->setText(QString(myDet->getActionScript(id).c_str()));
|
dispScript->setText(QString(myDet->getActionScript(id).c_str()));
|
||||||
SetScriptFile();
|
SetScriptFile();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qActionsWidget::SetMode");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -139,12 +139,12 @@ void qActionsWidget::SetScriptFile(){
|
|||||||
else{
|
else{
|
||||||
//path doesnt exist
|
//path doesnt exist
|
||||||
if(stat(fName.toAscii().constData(),&st_buf)){
|
if(stat(fName.toAscii().constData(),&st_buf)){
|
||||||
qDefs::Message(qDefs::WARNING,"The script file entered does not exist","ActionsWidget");
|
qDefs::Message(qDefs::WARNING,"The script file entered does not exist","qActionsWidget::SetScriptFile");
|
||||||
dispScript->setText(QString(myDet->getActionScript(id).c_str()));
|
dispScript->setText(QString(myDet->getActionScript(id).c_str()));
|
||||||
}
|
}
|
||||||
//if its not a file
|
//if its not a file
|
||||||
else if (!S_ISREG (st_buf.st_mode)) {
|
else if (!S_ISREG (st_buf.st_mode)) {
|
||||||
qDefs::Message(qDefs::WARNING,"The script file path entered is not a file","ActionsWidget");
|
qDefs::Message(qDefs::WARNING,"The script file path entered is not a file","qActionsWidget::SetScriptFile");
|
||||||
dispScript->setText(QString(myDet->getActionScript(id).c_str()));
|
dispScript->setText(QString(myDet->getActionScript(id).c_str()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -159,7 +159,7 @@ void qActionsWidget::SetScriptFile(){
|
|||||||
if(fName.compare(QString(myDet->getActionScript(id).c_str()))){
|
if(fName.compare(QString(myDet->getActionScript(id).c_str()))){
|
||||||
//did not get set, write what is was before
|
//did not get set, write what is was before
|
||||||
if(!fName.isEmpty())
|
if(!fName.isEmpty())
|
||||||
qDefs::Message(qDefs::WARNING,"The script file could not be set. Reverting to previous file.","ActionsWidget");
|
qDefs::Message(qDefs::WARNING,"The script file could not be set. Reverting to previous file.","qActionsWidget::SetScriptFile");
|
||||||
dispScript->setText(QString(myDet->getActionScript(id).c_str()));
|
dispScript->setText(QString(myDet->getActionScript(id).c_str()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -167,7 +167,7 @@ void qActionsWidget::SetScriptFile(){
|
|||||||
//dont display if theres a none
|
//dont display if theres a none
|
||||||
if(!dispScript->text().compare("none")) dispScript->setText("");
|
if(!dispScript->text().compare("none")) dispScript->setText("");
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qActionsWidget::SetScriptFile");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,7 +184,7 @@ void qActionsWidget::SetParameter(){
|
|||||||
//dont display if theres a none
|
//dont display if theres a none
|
||||||
if(!dispParameter->text().compare("none")) dispParameter->setText("");
|
if(!dispParameter->text().compare("none")) dispParameter->setText("");
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qActionsWidget::SetParameter");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ void qActionsWidget::Refresh(){
|
|||||||
"parameter:" << parameter << "\t***" << endl;
|
"parameter:" << parameter << "\t***" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qActionsWidget::Refresh");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -232,10 +232,10 @@ void qCloneWidget::SavePlot(){
|
|||||||
fName = QFileDialog::getSaveFileName(this,tr("Save Snapshot "),fName,tr("PNG Files (*.png);;XPM Files(*.xpm);;JPEG Files(*.jpg)"),0,QFileDialog::ShowDirsOnly);
|
fName = QFileDialog::getSaveFileName(this,tr("Save Snapshot "),fName,tr("PNG Files (*.png);;XPM Files(*.xpm);;JPEG Files(*.jpg)"),0,QFileDialog::ShowDirsOnly);
|
||||||
if (!fName.isEmpty())
|
if (!fName.isEmpty())
|
||||||
if((img.save(fName)))
|
if((img.save(fName)))
|
||||||
qDefs::Message(qDefs::INFORMATION,"The SnapShot has been successfully saved","Snapshot");
|
qDefs::Message(qDefs::INFORMATION,"The SnapShot has been successfully saved","qCloneWidget::SavePlot");
|
||||||
else
|
else
|
||||||
qDefs::Message(qDefs::WARNING,"Attempt to save snapshot failed.\n"
|
qDefs::Message(qDefs::WARNING,"Attempt to save snapshot failed.\n"
|
||||||
"Formats: .png, .jpg, .xpm.","Snapshot");
|
"Formats: .png, .jpg, .xpm.","qCloneWidget::SavePlot");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -201,30 +201,30 @@ void qDetectorMain::SetUpDetector(const string fName){
|
|||||||
|
|
||||||
//gets the hostname if it worked
|
//gets the hostname if it worked
|
||||||
string host = myDet->getHostname();
|
string host = myDet->getHostname();
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::SetUpDetector");
|
||||||
|
|
||||||
//if hostname doesnt exist even in shared memory
|
//if hostname doesnt exist even in shared memory
|
||||||
if(!host.length()){
|
if(!host.length()){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << endl << "No Detector Connected." << endl;
|
cout << endl << "No Detector Connected." << endl;
|
||||||
#endif
|
#endif
|
||||||
qDefs::Message(qDefs::CRITICAL,"No Detectors Connected. ","Main");
|
qDefs::Message(qDefs::CRITICAL,"No Detectors Connected. ","qDetectorMain::SetUpDetector");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//check if the detector is not even connected
|
//check if the detector is not even connected
|
||||||
string offline = myDet->checkOnline();
|
string offline = myDet->checkOnline();
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::SetUpDetector");
|
||||||
|
|
||||||
if(!offline.empty()){
|
if(!offline.empty()){
|
||||||
qDefs::Message(qDefs::CRITICAL,string("<nobr>The detector(s) <b>")+offline+string(" </b> is/are not connected. Exiting GUI.</nobr>"),"Main");
|
qDefs::Message(qDefs::CRITICAL,string("<nobr>The detector(s) <b>")+offline+string(" </b> is/are not connected. Exiting GUI.</nobr>"),"qDetectorMain::SetUpDetector");
|
||||||
cout << "The detector(s) " << host << " is/are not connected. Exiting GUI." << endl;
|
cout << "The detector(s) " << host << " is/are not connected. Exiting GUI." << endl;
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if type valid. If not, exit
|
// Check if type valid. If not, exit
|
||||||
slsDetectorDefs::detectorType detType = myDet->getDetectorsType();
|
slsDetectorDefs::detectorType detType = myDet->getDetectorsType();
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::SetUpDetector");
|
||||||
|
|
||||||
switch(detType){
|
switch(detType){
|
||||||
case slsDetectorDefs::MYTHEN: break;
|
case slsDetectorDefs::MYTHEN: break;
|
||||||
@ -234,10 +234,10 @@ void qDetectorMain::SetUpDetector(const string fName){
|
|||||||
case slsDetectorDefs::MOENCH: actionLoadTrimbits->setText("Load Settings"); actionSaveTrimbits->setText("Save Settings"); break;
|
case slsDetectorDefs::MOENCH: actionLoadTrimbits->setText("Load Settings"); actionSaveTrimbits->setText("Save Settings"); break;
|
||||||
default:
|
default:
|
||||||
string detName = myDet->slsDetectorBase::getDetectorType(detType);
|
string detName = myDet->slsDetectorBase::getDetectorType(detType);
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::SetUpDetector");
|
||||||
string errorMess = host+string(" has unknown detector type \"")+
|
string errorMess = host+string(" has unknown detector type \"")+
|
||||||
detName+string("\". Exiting GUI.");
|
detName+string("\". Exiting GUI.");
|
||||||
qDefs::Message(qDefs::CRITICAL,errorMess,"Main");
|
qDefs::Message(qDefs::CRITICAL,errorMess,"qDetectorMain::SetUpDetector");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
setWindowTitle("SLS Detector GUI : "+
|
setWindowTitle("SLS Detector GUI : "+
|
||||||
@ -246,7 +246,7 @@ void qDetectorMain::SetUpDetector(const string fName){
|
|||||||
cout << endl << "Type : " << slsDetectorBase::getDetectorType(detType) << "\nDetector : " << host << endl;
|
cout << endl << "Type : " << slsDetectorBase::getDetectorType(detType) << "\nDetector : " << host << endl;
|
||||||
//#endif
|
//#endif
|
||||||
myDet->setOnline(slsDetectorDefs::ONLINE_FLAG);
|
myDet->setOnline(slsDetectorDefs::ONLINE_FLAG);
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::SetUpDetector");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -309,21 +309,21 @@ void qDetectorMain::LoadConfigFile(const string fName){
|
|||||||
|
|
||||||
//path doesnt exist
|
//path doesnt exist
|
||||||
if(stat(fName.c_str(),&st_buf))
|
if(stat(fName.c_str(),&st_buf))
|
||||||
qDefs::Message(qDefs::WARNING,string("<nobr>Start up configuration failed to load. The following file does not exist:</nobr><br><nobr>")+fName,"Main");
|
qDefs::Message(qDefs::WARNING,string("<nobr>Start up configuration failed to load. The following file does not exist:</nobr><br><nobr>")+fName,"qDetectorMain::LoadConfigFile");
|
||||||
|
|
||||||
//not a file
|
//not a file
|
||||||
else if (!S_ISREG (st_buf.st_mode))
|
else if (!S_ISREG (st_buf.st_mode))
|
||||||
qDefs::Message(qDefs::WARNING,string("<nobr>Start up configuration failed to load. The following file is not a recognized file format:</nobr><br><nobr>")+fName,"Main");
|
qDefs::Message(qDefs::WARNING,string("<nobr>Start up configuration failed to load. The following file is not a recognized file format:</nobr><br><nobr>")+fName,"qDetectorMain::LoadConfigFile");
|
||||||
|
|
||||||
else{
|
else{
|
||||||
//could not load config file
|
//could not load config file
|
||||||
if(myDet->readConfigurationFile(fName)==slsDetectorDefs::FAIL)
|
if(myDet->readConfigurationFile(fName)==slsDetectorDefs::FAIL)
|
||||||
qDefs::Message(qDefs::WARNING,string("Could not load all the Configuration Parameters from file:\n")+fName,"Main");
|
qDefs::Message(qDefs::WARNING,string("Could not load all the Configuration Parameters from file:\n")+fName,"qDetectorMain::LoadConfigFile");
|
||||||
//successful
|
//successful
|
||||||
else
|
else
|
||||||
qDefs::Message(qDefs::INFORMATION,"<nobr>The Configuration Parameters have been loaded successfully at start up.</nobr>","Main");
|
qDefs::Message(qDefs::INFORMATION,"<nobr>The Configuration Parameters have been loaded successfully at start up.</nobr>","qDetectorMain::LoadConfigFile");
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::LoadConfigFile");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -395,17 +395,17 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
|
|||||||
cout << "Loading Setup" << endl;
|
cout << "Loading Setup" << endl;
|
||||||
#endif
|
#endif
|
||||||
QString fName = QString(myDet->getFilePath().c_str());
|
QString fName = QString(myDet->getFilePath().c_str());
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||||
fName = QFileDialog::getOpenFileName(this,
|
fName = QFileDialog::getOpenFileName(this,
|
||||||
tr("Load Detector Setup"),fName,
|
tr("Load Detector Setup"),fName,
|
||||||
tr("Detector Setup files (*.det)"));
|
tr("Detector Setup files (*.det)"));
|
||||||
// Gets called when cancelled as well
|
// Gets called when cancelled as well
|
||||||
if (!fName.isEmpty()){
|
if (!fName.isEmpty()){
|
||||||
if(myDet->retrieveDetectorSetup(string(fName.toAscii().constData()))!=slsDetectorDefs::FAIL){
|
if(myDet->retrieveDetectorSetup(string(fName.toAscii().constData()))!=slsDetectorDefs::FAIL){
|
||||||
qDefs::Message(qDefs::INFORMATION,"The Setup Parameters have been loaded successfully.","Main");
|
qDefs::Message(qDefs::INFORMATION,"The Setup Parameters have been loaded successfully.","qDetectorMain::ExecuteUtilities");
|
||||||
refreshTabs=true;
|
refreshTabs=true;
|
||||||
}else qDefs::Message(qDefs::WARNING,string("Could not load the Setup Parameters from file:\n")+fName.toAscii().constData(),"Main");
|
}else qDefs::Message(qDefs::WARNING,string("Could not load the Setup Parameters from file:\n")+fName.toAscii().constData(),"qDetectorMain::ExecuteUtilities");
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(action==actionSaveSetup){
|
else if(action==actionSaveSetup){
|
||||||
@ -413,16 +413,16 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
|
|||||||
cout << "Saving Setup" << endl;
|
cout << "Saving Setup" << endl;
|
||||||
#endif
|
#endif
|
||||||
QString fName = QString(myDet->getFilePath().c_str());
|
QString fName = QString(myDet->getFilePath().c_str());
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||||
fName = QFileDialog::getSaveFileName(this,
|
fName = QFileDialog::getSaveFileName(this,
|
||||||
tr("Save Current Detector Setup"),fName,
|
tr("Save Current Detector Setup"),fName,
|
||||||
tr("Detector Setup files (*.det) "));
|
tr("Detector Setup files (*.det) "));
|
||||||
// Gets called when cancelled as well
|
// Gets called when cancelled as well
|
||||||
if (!fName.isEmpty()){
|
if (!fName.isEmpty()){
|
||||||
if(myDet->dumpDetectorSetup(string(fName.toAscii().constData()))!=slsDetectorDefs::FAIL)
|
if(myDet->dumpDetectorSetup(string(fName.toAscii().constData()))!=slsDetectorDefs::FAIL)
|
||||||
qDefs::Message(qDefs::INFORMATION,"The Setup Parameters have been saved successfully.","Main");
|
qDefs::Message(qDefs::INFORMATION,"The Setup Parameters have been saved successfully.","qDetectorMain::ExecuteUtilities");
|
||||||
else qDefs::Message(qDefs::WARNING,string("Could not save the Setup Parameters from file:\n")+fName.toAscii().constData(),"Main");
|
else qDefs::Message(qDefs::WARNING,string("Could not save the Setup Parameters from file:\n")+fName.toAscii().constData(),"qDetectorMain::ExecuteUtilities");
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(action==actionOpenConfiguration){
|
else if(action==actionOpenConfiguration){
|
||||||
@ -430,17 +430,17 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
|
|||||||
cout << "Loading Configuration" << endl;
|
cout << "Loading Configuration" << endl;
|
||||||
#endif
|
#endif
|
||||||
QString fName = QString(myDet->getFilePath().c_str());
|
QString fName = QString(myDet->getFilePath().c_str());
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||||
fName = QFileDialog::getOpenFileName(this,
|
fName = QFileDialog::getOpenFileName(this,
|
||||||
tr("Load Detector Configuration"),fName,
|
tr("Load Detector Configuration"),fName,
|
||||||
tr("Configuration files (*.config)"));
|
tr("Configuration files (*.config)"));
|
||||||
// Gets called when cancelled as well
|
// Gets called when cancelled as well
|
||||||
if (!fName.isEmpty()){
|
if (!fName.isEmpty()){
|
||||||
if(myDet->readConfigurationFile(string(fName.toAscii().constData()))!=slsDetectorDefs::FAIL){
|
if(myDet->readConfigurationFile(string(fName.toAscii().constData()))!=slsDetectorDefs::FAIL){
|
||||||
qDefs::Message(qDefs::INFORMATION,"The Configuration Parameters have been configured successfully.","Main");
|
qDefs::Message(qDefs::INFORMATION,"The Configuration Parameters have been configured successfully.","qDetectorMain::ExecuteUtilities");
|
||||||
refreshTabs=true;
|
refreshTabs=true;
|
||||||
}else qDefs::Message(qDefs::WARNING,string("Could not load all the Configuration Parameters from file:\n")+fName.toAscii().constData(),"Main");
|
}else qDefs::Message(qDefs::WARNING,string("Could not load all the Configuration Parameters from file:\n")+fName.toAscii().constData(),"qDetectorMain::ExecuteUtilities");
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(action==actionSaveConfiguration){
|
else if(action==actionSaveConfiguration){
|
||||||
@ -448,21 +448,21 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
|
|||||||
cout << "Saving Configuration" << endl;
|
cout << "Saving Configuration" << endl;
|
||||||
#endif
|
#endif
|
||||||
QString fName = QString(myDet->getFilePath().c_str());
|
QString fName = QString(myDet->getFilePath().c_str());
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||||
fName = QFileDialog::getSaveFileName(this,
|
fName = QFileDialog::getSaveFileName(this,
|
||||||
tr("Save Current Detector Configuration"),fName,
|
tr("Save Current Detector Configuration"),fName,
|
||||||
tr("Configuration files (*.config) "));
|
tr("Configuration files (*.config) "));
|
||||||
// Gets called when cancelled as well
|
// Gets called when cancelled as well
|
||||||
if (!fName.isEmpty()){
|
if (!fName.isEmpty()){
|
||||||
if(myDet->writeConfigurationFile(string(fName.toAscii().constData()))!=slsDetectorDefs::FAIL)
|
if(myDet->writeConfigurationFile(string(fName.toAscii().constData()))!=slsDetectorDefs::FAIL)
|
||||||
qDefs::Message(qDefs::INFORMATION,"The Configuration Parameters have been saved successfully.","Main");
|
qDefs::Message(qDefs::INFORMATION,"The Configuration Parameters have been saved successfully.","qDetectorMain::ExecuteUtilities");
|
||||||
else qDefs::Message(qDefs::WARNING,string("Could not save the Configuration Parameters from file:\n")+fName.toAscii().constData(),"Main");
|
else qDefs::Message(qDefs::WARNING,string("Could not save the Configuration Parameters from file:\n")+fName.toAscii().constData(),"qDetectorMain::ExecuteUtilities");
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(action==actionLoadTrimbits){
|
else if(action==actionLoadTrimbits){
|
||||||
QString fName = QString(myDet->getSettingsDir());
|
QString fName = QString(myDet->getSettingsDir());
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||||
//gotthard
|
//gotthard
|
||||||
if(actionLoadTrimbits->text().contains("Settings")){
|
if(actionLoadTrimbits->text().contains("Settings")){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
@ -474,9 +474,9 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
|
|||||||
// Gets called when cancelled as well
|
// Gets called when cancelled as well
|
||||||
if (!fName.isEmpty()){
|
if (!fName.isEmpty()){
|
||||||
if(myDet->loadSettingsFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL)
|
if(myDet->loadSettingsFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL)
|
||||||
qDefs::Message(qDefs::INFORMATION,"The Settings have been loaded successfully.","Main");
|
qDefs::Message(qDefs::INFORMATION,"The Settings have been loaded successfully.","qDetectorMain::ExecuteUtilities");
|
||||||
else qDefs::Message(qDefs::WARNING,string("Could not load the Settings from file:\n")+fName.toAscii().constData(),"Main");
|
else qDefs::Message(qDefs::WARNING,string("Could not load the Settings from file:\n")+fName.toAscii().constData(),"qDetectorMain::ExecuteUtilities");
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||||
}
|
}
|
||||||
|
|
||||||
}//mythen and eiger
|
}//mythen and eiger
|
||||||
@ -491,9 +491,9 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
|
|||||||
// Gets called when cancelled as well
|
// Gets called when cancelled as well
|
||||||
if (!fName.isEmpty()){
|
if (!fName.isEmpty()){
|
||||||
if(myDet->loadSettingsFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL)
|
if(myDet->loadSettingsFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL)
|
||||||
qDefs::Message(qDefs::INFORMATION,"The Trimbits have been loaded successfully.","Main");
|
qDefs::Message(qDefs::INFORMATION,"The Trimbits have been loaded successfully.","qDetectorMain::ExecuteUtilities");
|
||||||
else qDefs::Message(qDefs::WARNING,string("Could not load the Trimbits from file:\n")+fName.toAscii().constData(),"Main");
|
else qDefs::Message(qDefs::WARNING,string("Could not load the Trimbits from file:\n")+fName.toAscii().constData(),"qDetectorMain::ExecuteUtilities");
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -505,16 +505,16 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
|
|||||||
#endif
|
#endif
|
||||||
//different output directory so as not to overwrite
|
//different output directory so as not to overwrite
|
||||||
QString fName = QString(myDet->getSettingsDir());
|
QString fName = QString(myDet->getSettingsDir());
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||||
fName = QFileDialog::getSaveFileName(this,
|
fName = QFileDialog::getSaveFileName(this,
|
||||||
tr("Save Current Detector Settings"),fName,
|
tr("Save Current Detector Settings"),fName,
|
||||||
tr("Settings files (*.settings settings.sn*) "));
|
tr("Settings files (*.settings settings.sn*) "));
|
||||||
// Gets called when cancelled as well
|
// Gets called when cancelled as well
|
||||||
if (!fName.isEmpty()){
|
if (!fName.isEmpty()){
|
||||||
if(myDet->saveSettingsFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL)
|
if(myDet->saveSettingsFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL)
|
||||||
qDefs::Message(qDefs::INFORMATION,"The Settings have been saved successfully.","Main");
|
qDefs::Message(qDefs::INFORMATION,"The Settings have been saved successfully.","qDetectorMain::ExecuteUtilities");
|
||||||
else qDefs::Message(qDefs::WARNING,string("Could not save the Settings to file:\n")+fName.toAscii().constData(),"Main");
|
else qDefs::Message(qDefs::WARNING,string("Could not save the Settings to file:\n")+fName.toAscii().constData(),"qDetectorMain::ExecuteUtilities");
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||||
}
|
}
|
||||||
}//mythen and eiger
|
}//mythen and eiger
|
||||||
else{
|
else{
|
||||||
@ -522,16 +522,16 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
|
|||||||
cout << "Saving Trimbits" << endl;
|
cout << "Saving Trimbits" << endl;
|
||||||
#endif//different output directory so as not to overwrite
|
#endif//different output directory so as not to overwrite
|
||||||
QString fName = QString(myDet->getSettingsDir());
|
QString fName = QString(myDet->getSettingsDir());
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||||
fName = QFileDialog::getSaveFileName(this,
|
fName = QFileDialog::getSaveFileName(this,
|
||||||
tr("Save Current Detector Trimbits"),fName,
|
tr("Save Current Detector Trimbits"),fName,
|
||||||
tr("Trimbit files (*.trim noise.sn*) "));
|
tr("Trimbit files (*.trim noise.sn*) "));
|
||||||
// Gets called when cancelled as well
|
// Gets called when cancelled as well
|
||||||
if (!fName.isEmpty()){
|
if (!fName.isEmpty()){
|
||||||
if(myDet->saveSettingsFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL)
|
if(myDet->saveSettingsFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL)
|
||||||
qDefs::Message(qDefs::INFORMATION,"The Trimbits have been saved successfully.","Main");
|
qDefs::Message(qDefs::INFORMATION,"The Trimbits have been saved successfully.","qDetectorMain::ExecuteUtilities");
|
||||||
else qDefs::Message(qDefs::WARNING,string("Could not save the Trimbits to file:\n")+fName.toAscii().constData(),"Main");
|
else qDefs::Message(qDefs::WARNING,string("Could not save the Trimbits to file:\n")+fName.toAscii().constData(),"qDetectorMain::ExecuteUtilities");
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -547,9 +547,9 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
|
|||||||
// Gets called when cancelled as well
|
// Gets called when cancelled as well
|
||||||
if (!fName.isEmpty()){
|
if (!fName.isEmpty()){
|
||||||
if(myDet->loadCalibrationFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL)
|
if(myDet->loadCalibrationFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL)
|
||||||
qDefs::Message(qDefs::INFORMATION,"The Calibration Data have been loaded successfully.","Main");
|
qDefs::Message(qDefs::INFORMATION,"The Calibration Data have been loaded successfully.","qDetectorMain::ExecuteUtilities");
|
||||||
else qDefs::Message(qDefs::WARNING,string("Could not load the Calibration data from file:\n")+ fName.toAscii().constData(),"Main");
|
else qDefs::Message(qDefs::WARNING,string("Could not load the Calibration data from file:\n")+ fName.toAscii().constData(),"qDetectorMain::ExecuteUtilities");
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(action==actionSaveCalibration){
|
else if(action==actionSaveCalibration){
|
||||||
@ -564,9 +564,9 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
|
|||||||
// Gets called when cancelled as well
|
// Gets called when cancelled as well
|
||||||
if (!fName.isEmpty()){
|
if (!fName.isEmpty()){
|
||||||
if(myDet->saveCalibrationFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL)
|
if(myDet->saveCalibrationFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL)
|
||||||
qDefs::Message(qDefs::INFORMATION,"The Calibration Data have been saved successfully.","Main");
|
qDefs::Message(qDefs::INFORMATION,"The Calibration Data have been saved successfully.","qDetectorMain::ExecuteUtilities");
|
||||||
else qDefs::Message(qDefs::WARNING,string("Could not save the Calibration data to file:\n")+fName.toAscii().constData(),"Main");
|
else qDefs::Message(qDefs::WARNING,string("Could not save the Calibration data to file:\n")+fName.toAscii().constData(),"qDetectorMain::ExecuteUtilities");
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -601,7 +601,7 @@ void qDetectorMain::ExecuteHelp(QAction *action){
|
|||||||
string thisGUIVersion = string(version);
|
string thisGUIVersion = string(version);
|
||||||
|
|
||||||
sprintf(version,"%llx",myDet->getId(slsDetectorDefs::THIS_SOFTWARE_VERSION));
|
sprintf(version,"%llx",myDet->getId(slsDetectorDefs::THIS_SOFTWARE_VERSION));
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteHelp");
|
||||||
string thisClientVersion = string(version);
|
string thisClientVersion = string(version);
|
||||||
|
|
||||||
//<h1 style="font-family:verdana;">A heading</h1>
|
//<h1 style="font-family:verdana;">A heading</h1>
|
||||||
@ -613,7 +613,7 @@ void qDetectorMain::ExecuteHelp(QAction *action){
|
|||||||
"It can be operated in parallel with the command line interface:<br>"
|
"It can be operated in parallel with the command line interface:<br>"
|
||||||
"sls_detector_put,<br>sls_detector_get,<br>sls_detector_acquire and<br>sls_detector_help.<br><br>"
|
"sls_detector_put,<br>sls_detector_get,<br>sls_detector_acquire and<br>sls_detector_help.<br><br>"
|
||||||
"The GUI Software is still in progress. "
|
"The GUI Software is still in progress. "
|
||||||
"Please report bugs to dhanya.maliakal@psi.ch or anna.bergamaschi@psi.ch.<\\p>","About SLS Detector GUI");
|
"Please report bugs to dhanya.maliakal@psi.ch or anna.bergamaschi@psi.ch.<\\p>","qDetectorMain::ExecuteHelp");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -275,7 +275,7 @@ void qDrawPlot::SetupWidgetWindow(){
|
|||||||
//Setting the callback function to get progress from detector class(using receivers)
|
//Setting the callback function to get progress from detector class(using receivers)
|
||||||
myDet->registerProgressCallback(&(GetProgressCallBack),this);
|
myDet->registerProgressCallback(&(GetProgressCallBack),this);
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDrawPlot::SetupWidgetWindow");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -369,7 +369,7 @@ void qDrawPlot::StartStopDaqToggle(bool stop_if_running){
|
|||||||
StartDaq(true);
|
StartDaq(true);
|
||||||
running=!running;
|
running=!running;
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDrawPlot::StartStopDaqToggle");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** if this is set during client initation */
|
/** if this is set during client initation */
|
||||||
@ -521,7 +521,7 @@ void qDrawPlot::SetScanArgument(int scanArg){
|
|||||||
|
|
||||||
UnlockLastImageArray();
|
UnlockLastImageArray();
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDrawPlot::SetScanArgument");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1027,7 +1027,7 @@ void qDrawPlot::ShowAcquisitionErrorMessage(QString status){
|
|||||||
alreadyDisplayed = true;
|
alreadyDisplayed = true;
|
||||||
qDefs::Message(qDefs::WARNING,string("<nobr>The acquisiton has ended abruptly. "
|
qDefs::Message(qDefs::WARNING,string("<nobr>The acquisiton has ended abruptly. "
|
||||||
"Current Detector Status: ")+status.toAscii().constData()+
|
"Current Detector Status: ")+status.toAscii().constData()+
|
||||||
string(".</nobr>"),"Dock");
|
string(".</nobr>"),"qDrawPlot::ShowAcquisitionErrorMessage");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1241,7 +1241,7 @@ void qDrawPlot::ClonePlot(){
|
|||||||
if(running) sFilePath = filePath.toAscii().constData();
|
if(running) sFilePath = filePath.toAscii().constData();
|
||||||
else {
|
else {
|
||||||
sFilePath = myDet->getFilePath();
|
sFilePath = myDet->getFilePath();
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDrawPlot::ClonePlot");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1339,7 +1339,7 @@ void qDrawPlot::SaveClones(){
|
|||||||
if(success)
|
if(success)
|
||||||
qDefs::Message(qDefs::INFORMATION,"The Snapshots have all been saved successfully in .png.","Dock");
|
qDefs::Message(qDefs::INFORMATION,"The Snapshots have all been saved successfully in .png.","Dock");
|
||||||
else
|
else
|
||||||
qDefs::Message(qDefs::WARNING,errMessage + string("were not saved."),"Dock");
|
qDefs::Message(qDefs::WARNING,errMessage + string("were not saved."),"qDrawPlot::SaveClones");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1378,7 +1378,7 @@ void qDrawPlot::SavePlot(){
|
|||||||
if(running) fName = filePath;
|
if(running) fName = filePath;
|
||||||
else {
|
else {
|
||||||
fName = QString(myDet->getFilePath().c_str());
|
fName = QString(myDet->getFilePath().c_str());
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDrawPlot::SavePlot");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(boxPlot->title().contains('.')){
|
if(boxPlot->title().contains('.')){
|
||||||
@ -1391,10 +1391,10 @@ void qDrawPlot::SavePlot(){
|
|||||||
|
|
||||||
if (!fName.isEmpty())
|
if (!fName.isEmpty())
|
||||||
if(savedImage.save(fName))
|
if(savedImage.save(fName))
|
||||||
qDefs::Message(qDefs::INFORMATION,"The Image has been successfully saved","Dock");
|
qDefs::Message(qDefs::INFORMATION,"The Image has been successfully saved","qDrawPlot::SavePlot");
|
||||||
else
|
else
|
||||||
qDefs::Message(qDefs::WARNING,"Attempt to save image failed.\n"
|
qDefs::Message(qDefs::WARNING,"Attempt to save image failed.\n"
|
||||||
"Formats: .png, .jpg, .xpm.","Dock");
|
"Formats: .png, .jpg, .xpm.","qDrawPlot::SavePlot");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1409,7 +1409,7 @@ void qDrawPlot::SavePlotAutomatic(){
|
|||||||
if(running) qFilePath = filePath;
|
if(running) qFilePath = filePath;
|
||||||
else {
|
else {
|
||||||
qFilePath = QString(myDet->getFilePath().c_str());
|
qFilePath = QString(myDet->getFilePath().c_str());
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDrawPlot::SavePlotAutomatic");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1447,7 +1447,7 @@ void qDrawPlot::SavePlotAutomatic(){
|
|||||||
|
|
||||||
void qDrawPlot::ShowSaveErrorMessage(QString fileName){
|
void qDrawPlot::ShowSaveErrorMessage(QString fileName){
|
||||||
qDefs::Message(qDefs::WARNING,string("Automatic Saving: Could not save the first file:\n")+
|
qDefs::Message(qDefs::WARNING,string("Automatic Saving: Could not save the first file:\n")+
|
||||||
string(fileName.toAscii().constData()) + string("\n\nNote: Will not show future file save errors for this acquisition."),"Dock");
|
string(fileName.toAscii().constData()) + string("\n\nNote: Will not show future file save errors for this acquisition."),"qDrawPlot::ShowSaveErrorMessage");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1507,14 +1507,14 @@ int qDrawPlot::UpdateTrimbitPlot(bool fromDetector,bool Histogram){
|
|||||||
if(histTrimbits) delete [] histTrimbits; histTrimbits = new double[actualPixelsX];
|
if(histTrimbits) delete [] histTrimbits; histTrimbits = new double[actualPixelsX];
|
||||||
ret = myDet->getChanRegs(histTrimbits,fromDetector);
|
ret = myDet->getChanRegs(histTrimbits,fromDetector);
|
||||||
if(!ret){
|
if(!ret){
|
||||||
qDefs::Message(qDefs::WARNING,"No Trimbit data found in shared memory.","Dock");
|
qDefs::Message(qDefs::WARNING,"No Trimbit data found in shared memory.","qDrawPlot::UpdateTrimbitPlot");
|
||||||
return qDefs::FAIL;
|
return qDefs::FAIL;
|
||||||
}
|
}
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Got Trimbits" << endl;
|
cout << "Got Trimbits" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qDrawPlot::UpdateTrimbitPlot");
|
||||||
|
|
||||||
//defining axes
|
//defining axes
|
||||||
if(Histogram) nPixelsX = TRIM_HISTOGRAM_XMAX+1;
|
if(Histogram) nPixelsX = TRIM_HISTOGRAM_XMAX+1;
|
||||||
@ -1599,7 +1599,7 @@ int qDrawPlot::UpdateTrimbitPlot(bool fromDetector,bool Histogram){
|
|||||||
//get trimbits
|
//get trimbits
|
||||||
ret = 1;/*myDet->getChanRegs(lastImageArray,fromDetector);*/
|
ret = 1;/*myDet->getChanRegs(lastImageArray,fromDetector);*/
|
||||||
if(!ret){
|
if(!ret){
|
||||||
qDefs::Message(qDefs::WARNING,"No Trimbit data found in shared memory.","Dock");
|
qDefs::Message(qDefs::WARNING,"No Trimbit data found in shared memory.","qDrawPlot::UpdateTrimbitPlot");
|
||||||
return qDefs::FAIL;
|
return qDefs::FAIL;
|
||||||
}
|
}
|
||||||
//clear/select plot and set titles
|
//clear/select plot and set titles
|
||||||
|
@ -296,7 +296,7 @@ void qScanWidget::EnableSizeWidgets(){
|
|||||||
char cId[5];sprintf(cId,"%d",id);
|
char cId[5];sprintf(cId,"%d",id);
|
||||||
qDefs::Message(qDefs::INFORMATION,string("<nobr><font color=\"blue\">Scan Level ")+string(cId)+
|
qDefs::Message(qDefs::INFORMATION,string("<nobr><font color=\"blue\">Scan Level ")+string(cId)+
|
||||||
string(": Specific Values</font></nobr><br><br><nobr>Number of positions added: ")+
|
string(": Specific Values</font></nobr><br><br><nobr>Number of positions added: ")+
|
||||||
string(cNum)+string("</nobr>"),"ScanWidget");
|
string(cNum)+string("</nobr>"),"qScanWidget::EnableSizeWidgets");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -404,7 +404,7 @@ int qScanWidget::SetScan(int mode){
|
|||||||
return qDefs::OK;
|
return qDefs::OK;
|
||||||
}else{//mode NOT set
|
}else{//mode NOT set
|
||||||
if((mode!=actualMode)&&(actualNumSteps)){
|
if((mode!=actualMode)&&(actualNumSteps)){
|
||||||
qDefs::Message(qDefs::WARNING,"The mode could not be changed for an unknown reason.","ScanWidget");
|
qDefs::Message(qDefs::WARNING,"The mode could not be changed for an unknown reason.","qScanWidget::SetScan");
|
||||||
comboScript->setCurrentIndex(actualMode);
|
comboScript->setCurrentIndex(actualMode);
|
||||||
return qDefs::FAIL;
|
return qDefs::FAIL;
|
||||||
}
|
}
|
||||||
@ -412,7 +412,7 @@ int qScanWidget::SetScan(int mode){
|
|||||||
|
|
||||||
emit EnableScanBox();
|
emit EnableScanBox();
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qScanWidget::SetScan");
|
||||||
|
|
||||||
return qDefs::OK;
|
return qDefs::OK;
|
||||||
}
|
}
|
||||||
@ -471,12 +471,12 @@ void qScanWidget::SetScriptFile(){
|
|||||||
if(!set){
|
if(!set){
|
||||||
//path doesnt exist
|
//path doesnt exist
|
||||||
if(stat(fName.toAscii().constData(),&st_buf)){
|
if(stat(fName.toAscii().constData(),&st_buf)){
|
||||||
qDefs::Message(qDefs::WARNING,"The script file entered does not exist","ScanWidget");
|
qDefs::Message(qDefs::WARNING,"The script file entered does not exist","qScanWidget::SetScriptFile");
|
||||||
dispScript->setText(QString(myDet->getScanScript(id).c_str()));
|
dispScript->setText(QString(myDet->getScanScript(id).c_str()));
|
||||||
}
|
}
|
||||||
//if its not a file
|
//if its not a file
|
||||||
else if (!S_ISREG (st_buf.st_mode)) {
|
else if (!S_ISREG (st_buf.st_mode)) {
|
||||||
qDefs::Message(qDefs::WARNING,"The script file path entered is not a file","ScanWidget");
|
qDefs::Message(qDefs::WARNING,"The script file path entered is not a file","qScanWidget::SetScriptFile");
|
||||||
dispScript->setText(QString(myDet->getScanScript(id).c_str()));
|
dispScript->setText(QString(myDet->getScanScript(id).c_str()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -489,7 +489,7 @@ void qScanWidget::SetScriptFile(){
|
|||||||
if(fName.compare(QString(myDet->getScanScript(id).c_str()))){
|
if(fName.compare(QString(myDet->getScanScript(id).c_str()))){
|
||||||
//did not get set, write what is was before
|
//did not get set, write what is was before
|
||||||
if(!fName.isEmpty())
|
if(!fName.isEmpty())
|
||||||
qDefs::Message(qDefs::WARNING,"The script file could not be set. Reverting to previous file.","ScanWidget");
|
qDefs::Message(qDefs::WARNING,"The script file could not be set. Reverting to previous file.","qScanWidget::SetScriptFile");
|
||||||
dispScript->setText(QString(myDet->getScanScript(id).c_str()));
|
dispScript->setText(QString(myDet->getScanScript(id).c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -504,7 +504,7 @@ void qScanWidget::SetScriptFile(){
|
|||||||
if(!fName.compare(QString(modeNames[i].c_str())))
|
if(!fName.compare(QString(modeNames[i].c_str())))
|
||||||
dispScript->setText("");
|
dispScript->setText("");
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qScanWidget::SetScriptFile");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -530,7 +530,7 @@ void qScanWidget::SetParameter(){
|
|||||||
if(!parameter.compare(QString(modeNames[i].c_str())))
|
if(!parameter.compare(QString(modeNames[i].c_str())))
|
||||||
dispParameter->setText("");
|
dispParameter->setText("");
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qScanWidget::SetParameter");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -546,9 +546,9 @@ void qScanWidget::SetPrecision(int value){
|
|||||||
#endif
|
#endif
|
||||||
myDet->setScanPrecision(id,value);
|
myDet->setScanPrecision(id,value);
|
||||||
if(myDet->getScanPrecision(id)!=value)
|
if(myDet->getScanPrecision(id)!=value)
|
||||||
qDefs::Message(qDefs::WARNING,"The precision was not set for an unknown reason.","ScanWidget");;
|
qDefs::Message(qDefs::WARNING,"The precision was not set for an unknown reason.","qScanWidget::SetPrecision");;
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qScanWidget::SetPrecision");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -661,7 +661,7 @@ void qScanWidget::RangeFromChanged(){
|
|||||||
//check size validity
|
//check size validity
|
||||||
else if(RangeCheckNumValid(numSteps)==qDefs::FAIL)
|
else if(RangeCheckNumValid(numSteps)==qDefs::FAIL)
|
||||||
qDefs::Message(qDefs::WARNING,"<nobr><b>Number of Steps</b> = 1 + (<b> To </b> - <b> From </b>) / <b>Size</b>.</nobr><br>"
|
qDefs::Message(qDefs::WARNING,"<nobr><b>Number of Steps</b> = 1 + (<b> To </b> - <b> From </b>) / <b>Size</b>.</nobr><br>"
|
||||||
"<b>Number of Steps</b> must be >= 2. Changing <b>From</b> back to previous value.</nobr>","Scan");
|
"<b>Number of Steps</b> must be >= 2. Changing <b>From</b> back to previous value.</nobr>","qScanWidget::RangeFromChanged");
|
||||||
else change = true;
|
else change = true;
|
||||||
|
|
||||||
//change it back from = to - size*num + size
|
//change it back from = to - size*num + size
|
||||||
@ -708,11 +708,11 @@ void qScanWidget::RangeToChanged(){
|
|||||||
|
|
||||||
//check size validity
|
//check size validity
|
||||||
if(RangeCheckSizeZero()==qDefs::FAIL)
|
if(RangeCheckSizeZero()==qDefs::FAIL)
|
||||||
qDefs::Message(qDefs::WARNING,"<nobr><b>From</b> cannot be equal to <b>To</b>. Changing <b>To</b> back to previous value.</nobr>","Scan");
|
qDefs::Message(qDefs::WARNING,"<nobr><b>From</b> cannot be equal to <b>To</b>. Changing <b>To</b> back to previous value.</nobr>","qScanWidget::RangeToChanged");
|
||||||
//check size validity
|
//check size validity
|
||||||
else if(RangeCheckNumValid(numSteps)==qDefs::FAIL)
|
else if(RangeCheckNumValid(numSteps)==qDefs::FAIL)
|
||||||
qDefs::Message(qDefs::WARNING,"<nobr><b>Number of Steps</b> = 1 + (<b> To </b> - <b> From </b>) / <b>Size</b>.</nobr><br>"
|
qDefs::Message(qDefs::WARNING,"<nobr><b>Number of Steps</b> = 1 + (<b> To </b> - <b> From </b>) / <b>Size</b>.</nobr><br>"
|
||||||
"<b>Number of Steps</b> must be >= 2. Changing <b>To</b> back to previous value.</nobr>","Scan");
|
"<b>Number of Steps</b> must be >= 2. Changing <b>To</b> back to previous value.</nobr>","qScanWidget::RangeToChanged");
|
||||||
else change = true;
|
else change = true;
|
||||||
|
|
||||||
//change it back to = size*num - size + from
|
//change it back to = size*num - size + from
|
||||||
@ -760,11 +760,11 @@ void qScanWidget::RangeSizeChanged(){
|
|||||||
|
|
||||||
//check size validity
|
//check size validity
|
||||||
if(!spinSize->value())
|
if(!spinSize->value())
|
||||||
qDefs::Message(qDefs::WARNING,"<nobr><b>Size</b> cannot be 0. Changing <b>Size</b> back to previous value.</nobr>","Scan");
|
qDefs::Message(qDefs::WARNING,"<nobr><b>Size</b> cannot be 0. Changing <b>Size</b> back to previous value.</nobr>","qScanWidget::RangeSizeChanged");
|
||||||
//check size validity
|
//check size validity
|
||||||
else if(RangeCheckNumValid(numSteps)==qDefs::FAIL)
|
else if(RangeCheckNumValid(numSteps)==qDefs::FAIL)
|
||||||
qDefs::Message(qDefs::WARNING,"<nobr><b>Number of Steps</b> = 1 + (<b> To </b> - <b> From </b>) / <b>Size</b>.</nobr><br>"
|
qDefs::Message(qDefs::WARNING,"<nobr><b>Number of Steps</b> = 1 + (<b> To </b> - <b> From </b>) / <b>Size</b>.</nobr><br>"
|
||||||
"<b>Number of Steps</b> must be >= 2. Changing <b>Size</b> back to previous value.</nobr>","Scan");
|
"<b>Number of Steps</b> must be >= 2. Changing <b>Size</b> back to previous value.</nobr>","qScanWidget::RangeSizeChanged");
|
||||||
else change = true;
|
else change = true;
|
||||||
|
|
||||||
//change it back size = (to-from)/(num-1)
|
//change it back size = (to-from)/(num-1)
|
||||||
@ -833,13 +833,13 @@ void qScanWidget::SetRangeSteps(){
|
|||||||
if((comboScript->currentIndex()==CustomScript)&&((script=="")||(script=="none"))){
|
if((comboScript->currentIndex()==CustomScript)&&((script=="")||(script=="none"))){
|
||||||
qDefs::Message(qDefs::INFORMATION,string("<nobr><font color=\"blue\">Scan Level ")+string(cId)+
|
qDefs::Message(qDefs::INFORMATION,string("<nobr><font color=\"blue\">Scan Level ")+string(cId)+
|
||||||
string(": Constant Step Size</font></nobr><br><br>"
|
string(": Constant Step Size</font></nobr><br><br>"
|
||||||
"<nobr>Positions could not be loaded as the script file path is empty.</nobr>"),"ScanWidget");
|
"<nobr>Positions could not be loaded as the script file path is empty.</nobr>"),"qScanWidget::SetRangeSteps");
|
||||||
}else{
|
}else{
|
||||||
//error loading positions
|
//error loading positions
|
||||||
if(myDet->getScanSteps(id)!=actualNumSteps){
|
if(myDet->getScanSteps(id)!=actualNumSteps){
|
||||||
qDefs::Message(qDefs::WARNING,string("<nobr><font color=\"blue\">Scan Level ")+string(cId)+
|
qDefs::Message(qDefs::WARNING,string("<nobr><font color=\"blue\">Scan Level ")+string(cId)+
|
||||||
string(": Values From File</font></nobr><br><br>"
|
string(": Values From File</font></nobr><br><br>"
|
||||||
"<nobr>The positions list was not set for an unknown reason.</nobr>"),"ScanWidget");
|
"<nobr>The positions list was not set for an unknown reason.</nobr>"),"qScanWidget::SetRangeSteps");
|
||||||
/*LoadPositions();
|
/*LoadPositions();
|
||||||
comboScript->setCurrentIndex(myDet->getScanMode(id))*/
|
comboScript->setCurrentIndex(myDet->getScanMode(id))*/
|
||||||
}
|
}
|
||||||
@ -848,13 +848,13 @@ void qScanWidget::SetRangeSteps(){
|
|||||||
char cNum[200];sprintf(cNum,"%d",actualNumSteps);
|
char cNum[200];sprintf(cNum,"%d",actualNumSteps);
|
||||||
qDefs::Message(qDefs::INFORMATION,string("<nobr><font color=\"blue\">Scan Level ")+string(cId)+
|
qDefs::Message(qDefs::INFORMATION,string("<nobr><font color=\"blue\">Scan Level ")+string(cId)+
|
||||||
string(": Constant Step Size</font></nobr><br><br><nobr>Number of positions added: ")+
|
string(": Constant Step Size</font></nobr><br><br><nobr>Number of positions added: ")+
|
||||||
string(cNum)+string("</nobr>"),"ScanWidget");
|
string(cNum)+string("</nobr>"),"qScanWidget::SetRangeSteps");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qScanWidget::SetRangeSteps");
|
||||||
}
|
}
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -914,14 +914,14 @@ int qScanWidget::SetCustomSteps(){
|
|||||||
if((comboScript->currentIndex()==CustomScript)&&((script=="")||(script=="none"))){
|
if((comboScript->currentIndex()==CustomScript)&&((script=="")||(script=="none"))){
|
||||||
qDefs::Message(qDefs::INFORMATION,string("<nobr><font color=\"blue\">Scan Level ")+string(cId)+
|
qDefs::Message(qDefs::INFORMATION,string("<nobr><font color=\"blue\">Scan Level ")+string(cId)+
|
||||||
string(": Values From File</font></nobr><br><br>"
|
string(": Values From File</font></nobr><br><br>"
|
||||||
"<nobr>Positions could not be loaded as the script file path is empty.</nobr>"),"ScanWidget");
|
"<nobr>Positions could not be loaded as the script file path is empty.</nobr>"),"qScanWidget::SetCustomSteps");
|
||||||
return qDefs::FAIL;
|
return qDefs::FAIL;
|
||||||
}else{
|
}else{
|
||||||
if(myDet->getScanSteps(id)!=actualNumSteps){
|
if(myDet->getScanSteps(id)!=actualNumSteps){
|
||||||
qDefs::Message(qDefs::WARNING,"The positions list was not set for an unknown reason.","ScanWidget");
|
qDefs::Message(qDefs::WARNING,"The positions list was not set for an unknown reason.","qScanWidget::SetCustomSteps");
|
||||||
LoadPositions();
|
LoadPositions();
|
||||||
comboScript->setCurrentIndex(myDet->getScanMode(id));
|
comboScript->setCurrentIndex(myDet->getScanMode(id));
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qScanWidget::qScanWidget::SetCustomSteps");
|
||||||
return qDefs::FAIL;
|
return qDefs::FAIL;
|
||||||
}
|
}
|
||||||
//else success is checked in enabledsizewidgets , else it does this for every add, delete etc
|
//else success is checked in enabledsizewidgets , else it does this for every add, delete etc
|
||||||
@ -1079,20 +1079,20 @@ void qScanWidget::SetFileSteps(){
|
|||||||
if((comboScript->currentIndex()==CustomScript)&&((script=="")||(script=="none"))){
|
if((comboScript->currentIndex()==CustomScript)&&((script=="")||(script=="none"))){
|
||||||
qDefs::Message(qDefs::INFORMATION,string("<nobr><font color=\"blue\">Scan Level ")+string(cId)+
|
qDefs::Message(qDefs::INFORMATION,string("<nobr><font color=\"blue\">Scan Level ")+string(cId)+
|
||||||
string(": Values From File</font></nobr><br><br>"
|
string(": Values From File</font></nobr><br><br>"
|
||||||
"<nobr>Positions could not be loaded as the script file path is empty.</nobr>"),"ScanWidget");
|
"<nobr>Positions could not be loaded as the script file path is empty.</nobr>"),"qScanWidget::SetFileSteps");
|
||||||
}else{
|
}else{
|
||||||
//error loading positions
|
//error loading positions
|
||||||
if(myDet->getScanSteps(id)!=actualNumSteps){
|
if(myDet->getScanSteps(id)!=actualNumSteps){
|
||||||
qDefs::Message(qDefs::WARNING,string("<nobr><font color=\"blue\">Scan Level ")+string(cId)+
|
qDefs::Message(qDefs::WARNING,string("<nobr><font color=\"blue\">Scan Level ")+string(cId)+
|
||||||
string(": Values From File</font></nobr><br><br>"
|
string(": Values From File</font></nobr><br><br>"
|
||||||
"<nobr>The positions list was not set for an unknown reason.</nobr>"),"ScanWidget");
|
"<nobr>The positions list was not set for an unknown reason.</nobr>"),"qScanWidget::SetFileSteps");
|
||||||
}
|
}
|
||||||
#ifdef VERYVERBOSE
|
#ifdef VERYVERBOSE
|
||||||
else{//SUCCESS
|
else{//SUCCESS
|
||||||
char cNum[200];sprintf(cNum,"%d",actualNumSteps);
|
char cNum[200];sprintf(cNum,"%d",actualNumSteps);
|
||||||
qDefs::Message(qDefs::INFORMATION,string("<nobr><font color=\"blue\">Scan Level ")+string(cId)+
|
qDefs::Message(qDefs::INFORMATION,string("<nobr><font color=\"blue\">Scan Level ")+string(cId)+
|
||||||
string(": Values From File</font></nobr><br><br><nobr>Number of positions added: ")+
|
string(": Values From File</font></nobr><br><br><nobr>Number of positions added: ")+
|
||||||
string(cNum)+string("</nobr>"),"ScanWidget");
|
string(cNum)+string("</nobr>"),"qScanWidget::SetFileSteps");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -1108,7 +1108,7 @@ void qScanWidget::SetFileSteps(){
|
|||||||
connect(spinSteps, SIGNAL(valueChanged(int)), this, SLOT(SetNSteps()));
|
connect(spinSteps, SIGNAL(valueChanged(int)), this, SLOT(SetNSteps()));
|
||||||
}
|
}
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qScanWidget::SetFileSteps");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1198,7 +1198,7 @@ void qScanWidget::LoadPositions(){
|
|||||||
connect(spinSteps, SIGNAL(valueChanged(int)), this, SLOT(SetNSteps()));
|
connect(spinSteps, SIGNAL(valueChanged(int)), this, SLOT(SetNSteps()));
|
||||||
connect(btnGroup, SIGNAL(buttonClicked(QAbstractButton*)),this,SLOT(EnableSizeWidgets()));
|
connect(btnGroup, SIGNAL(buttonClicked(QAbstractButton*)),this,SLOT(EnableSizeWidgets()));
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qScanWidget::LoadPositions");
|
||||||
//do not set the range variables because if the stepsize is by any chance 0..
|
//do not set the range variables because if the stepsize is by any chance 0..
|
||||||
//then the number of steps should change to 1. so only set custom steps
|
//then the number of steps should change to 1. so only set custom steps
|
||||||
}
|
}
|
||||||
@ -1240,7 +1240,7 @@ void qScanWidget::Refresh(){
|
|||||||
"precision:" << precision << "\t***" << endl;
|
"precision:" << precision << "\t***" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qScanWidget::Refresh");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ int qServer::StartStopServer(int start){
|
|||||||
checkStarted=1;
|
checkStarted=1;
|
||||||
if (pthread_create(&gui_server_thread, NULL,StartServerThread, (void*) this)){
|
if (pthread_create(&gui_server_thread, NULL,StartServerThread, (void*) this)){
|
||||||
gui_server_thread_running=0;
|
gui_server_thread_running=0;
|
||||||
qDefs::Message(qDefs::WARNING,"Can't create gui server thread", "Server");
|
qDefs::Message(qDefs::WARNING,"Can't create gui server thread", "qServer::StartStopServer");
|
||||||
cout << "ERROR: Can't create gui server thread" << endl;
|
cout << "ERROR: Can't create gui server thread" << endl;
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
@ -168,7 +168,7 @@ int qServer::StartStopServer(int start){
|
|||||||
checkStopStarted=1;
|
checkStopStarted=1;
|
||||||
if (pthread_create(&gui_stop_server_thread, NULL,StopServerThread, (void*) this)){
|
if (pthread_create(&gui_stop_server_thread, NULL,StopServerThread, (void*) this)){
|
||||||
gui_server_thread_running=0;
|
gui_server_thread_running=0;
|
||||||
qDefs::Message(qDefs::WARNING,"Can't create gui stop server thread", "Server");
|
qDefs::Message(qDefs::WARNING,"Can't create gui stop server thread", "qServer::StartStopServer");
|
||||||
cout << "ERROR: Can't create gui stop server thread" << endl;
|
cout << "ERROR: Can't create gui stop server thread" << endl;
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
@ -238,7 +238,7 @@ int qServer::StopServer(){
|
|||||||
myStopSocket = new MySocketTCP(port_no+1);
|
myStopSocket = new MySocketTCP(port_no+1);
|
||||||
if (myStopSocket->getErrorStatus()){
|
if (myStopSocket->getErrorStatus()){
|
||||||
gui_server_thread_running = 0;
|
gui_server_thread_running = 0;
|
||||||
qDefs::Message(qDefs::WARNING,"Could not start gui stop server socket","Server");
|
qDefs::Message(qDefs::WARNING,"Could not start gui stop server socket","qServer::StopServer");
|
||||||
}
|
}
|
||||||
checkStopStarted = 0;
|
checkStopStarted = 0;
|
||||||
|
|
||||||
@ -303,7 +303,7 @@ int qServer::StartServer(){
|
|||||||
mySocket = new MySocketTCP(port_no);
|
mySocket = new MySocketTCP(port_no);
|
||||||
if (mySocket->getErrorStatus()){
|
if (mySocket->getErrorStatus()){
|
||||||
gui_server_thread_running = 0;
|
gui_server_thread_running = 0;
|
||||||
qDefs::Message(qDefs::WARNING,"Could not start gui server socket","Server");
|
qDefs::Message(qDefs::WARNING,"Could not start gui server socket","qServer::StartServer");
|
||||||
}
|
}
|
||||||
checkStarted = 0;
|
checkStarted = 0;
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ void qTabActions::SetupWidgetWindow(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabActions::SetupWidgetWindow");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -364,7 +364,7 @@ void qTabActions::Expand(QAbstractButton *button ){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabActions::Expand");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -411,10 +411,10 @@ void qTabActions::SetPosition(){
|
|||||||
positions[i] = comboPos->itemText(i).toDouble();
|
positions[i] = comboPos->itemText(i).toDouble();
|
||||||
//setting the list and catching error
|
//setting the list and catching error
|
||||||
if(myDet->setPositions(comboPos->count(),positions)!=comboPos->count())
|
if(myDet->setPositions(comboPos->count(),positions)!=comboPos->count())
|
||||||
qDefs::Message(qDefs::WARNING,"The positions list was not set for some reason.","Actions");
|
qDefs::Message(qDefs::WARNING,"The positions list was not set for some reason.","qTabActions::SetPosition");
|
||||||
|
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabActions::SetPosition");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -466,7 +466,7 @@ void qTabActions::EnablePositions(bool enable){
|
|||||||
btnExpand[NumPositions]->setEnabled(false);
|
btnExpand[NumPositions]->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabActions::EnablePositions");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -524,7 +524,7 @@ void qTabActions::Refresh(){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "**Updated all action widgets: " << endl << endl;
|
cout << "**Updated all action widgets: " << endl << endl;
|
||||||
#endif
|
#endif
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabActions::Refresh");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ void qTabAdvanced::SetupWidgetWindow(){
|
|||||||
comboDetector->setCurrentIndex(0);
|
comboDetector->setCurrentIndex(0);
|
||||||
det = myDet->getSlsDetector(comboDetector->currentIndex());
|
det = myDet->getSlsDetector(comboDetector->currentIndex());
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabAdvanced::SetupWidgetWindow");
|
||||||
|
|
||||||
spinControlPort->setValue(det->getControlPort());
|
spinControlPort->setValue(det->getControlPort());
|
||||||
spinStopPort->setValue(det->getStopPort());
|
spinStopPort->setValue(det->getStopPort());
|
||||||
@ -166,7 +166,7 @@ void qTabAdvanced::SetupWidgetWindow(){
|
|||||||
|
|
||||||
Initialization();
|
Initialization();
|
||||||
|
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabAdvanced::SetupWidgetWindow");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,11 +262,11 @@ void qTabAdvanced::SetLogs(){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Could not set/reset Log." << endl;
|
cout << "Could not set/reset Log." << endl;
|
||||||
#endif
|
#endif
|
||||||
qDefs::Message(qDefs::WARNING,"Could not set/reset Log.","Advanced");
|
qDefs::Message(qDefs::WARNING,"Could not set/reset Log.","qTabAdvanced::SetLogs");
|
||||||
checkedBox->setChecked(!enable);
|
checkedBox->setChecked(!enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabAdvanced::SetLogs");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -281,7 +281,7 @@ void qTabAdvanced::SetExposureTime(){
|
|||||||
#endif
|
#endif
|
||||||
myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,(int64_t)exptimeNS);
|
myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,(int64_t)exptimeNS);
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabAdvanced::SetExposureTime");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -293,7 +293,7 @@ void qTabAdvanced::SetThreshold(){
|
|||||||
cout << "Setting Threshold DACu:" << spinThreshold->value() << endl;
|
cout << "Setting Threshold DACu:" << spinThreshold->value() << endl;
|
||||||
#endif
|
#endif
|
||||||
spinThreshold->setValue((double)myDet->setDAC((dacs_t)spinThreshold->value(),slsDetectorDefs::THRESHOLD));
|
spinThreshold->setValue((double)myDet->setDAC((dacs_t)spinThreshold->value(),slsDetectorDefs::THRESHOLD));
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabAdvanced::SetThreshold");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -329,7 +329,7 @@ void qTabAdvanced::SetOutputFile(){
|
|||||||
if(!dirPath.compare(trimdir)){
|
if(!dirPath.compare(trimdir)){
|
||||||
int ret = qDefs::Message(qDefs::QUESTION,string("<nobr>This will possibly overwrite your original trimbits.</nobr><br>"
|
int ret = qDefs::Message(qDefs::QUESTION,string("<nobr>This will possibly overwrite your original trimbits.</nobr><br>"
|
||||||
"<nobr>Proposed file path:") + string(dirPath.toAscii().constData())+
|
"<nobr>Proposed file path:") + string(dirPath.toAscii().constData())+
|
||||||
string("</nobr><br><nobr>Do you still want to continue?</nobr>"),"Advanced");
|
string("</nobr><br><nobr>Do you still want to continue?</nobr>"),"qTabAdvanced::SetOutputFile");
|
||||||
if(ret==qDefs::FAIL){
|
if(ret==qDefs::FAIL){
|
||||||
dispFile->setText("");
|
dispFile->setText("");
|
||||||
dispFile->setToolTip(outputDirTip + errOutputTip);
|
dispFile->setToolTip(outputDirTip + errOutputTip);
|
||||||
@ -350,7 +350,7 @@ void qTabAdvanced::SetOutputFile(){
|
|||||||
btnStart->setEnabled(false);
|
btnStart->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabAdvanced::SetOutputFile");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -480,17 +480,17 @@ void qTabAdvanced::StartTrimming(){
|
|||||||
int ret = myDet->executeTrimming(trimmingMode,parameter1,parameter2,-1);
|
int ret = myDet->executeTrimming(trimmingMode,parameter1,parameter2,-1);
|
||||||
if((ret!=slsDetectorDefs::FAIL)&&(ret!=-1));
|
if((ret!=slsDetectorDefs::FAIL)&&(ret!=-1));
|
||||||
else
|
else
|
||||||
qDefs::Message(qDefs::WARNING,"Atleast 1 channel could not be trimmed.","Advanced");
|
qDefs::Message(qDefs::WARNING,"Atleast 1 channel could not be trimmed.","qTabAdvanced::StartTrimming");
|
||||||
//save trim file
|
//save trim file
|
||||||
ret = myDet->saveSettingsFile(string(dispFile->text().toAscii().constData()),-1);
|
ret = myDet->saveSettingsFile(string(dispFile->text().toAscii().constData()),-1);
|
||||||
if((ret!=slsDetectorDefs::FAIL)&&(ret!=-1)){
|
if((ret!=slsDetectorDefs::FAIL)&&(ret!=-1)){
|
||||||
qDefs::Message(qDefs::INFORMATION,"The Trimbits have been saved successfully.","Advanced");
|
qDefs::Message(qDefs::INFORMATION,"The Trimbits have been saved successfully.","qTabAdvanced::StartTrimming");
|
||||||
//updates plots
|
//updates plots
|
||||||
myPlot->UpdateTrimbitPlot(false,radioHistogram->isChecked());
|
myPlot->UpdateTrimbitPlot(false,radioHistogram->isChecked());
|
||||||
}
|
}
|
||||||
else qDefs::Message(qDefs::WARNING,string("Could not Save the Trimbits to file:\n")+dispFile->text().toAscii().constData(),"Advanced");
|
else qDefs::Message(qDefs::WARNING,string("Could not Save the Trimbits to file:\n")+dispFile->text().toAscii().constData(),"qTabAdvanced::StartTrimming");
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabAdvanced::StartTrimming");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -516,7 +516,7 @@ void qTabAdvanced::SetControlPort(int port){
|
|||||||
#endif
|
#endif
|
||||||
disconnect(spinControlPort, SIGNAL(valueChanged(int)), this, SLOT(SetControlPort(int)));
|
disconnect(spinControlPort, SIGNAL(valueChanged(int)), this, SLOT(SetControlPort(int)));
|
||||||
spinControlPort->setValue(det->setPort(slsDetectorDefs::CONTROL_PORT,port));
|
spinControlPort->setValue(det->setPort(slsDetectorDefs::CONTROL_PORT,port));
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabAdvanced::SetControlPort");
|
||||||
connect(spinControlPort, SIGNAL(valueChanged(int)), this, SLOT(SetControlPort(int)));
|
connect(spinControlPort, SIGNAL(valueChanged(int)), this, SLOT(SetControlPort(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -530,7 +530,7 @@ void qTabAdvanced::SetStopPort(int port){
|
|||||||
#endif
|
#endif
|
||||||
disconnect(spinStopPort, SIGNAL(valueChanged(int)), this, SLOT(SetStopPort(int)));
|
disconnect(spinStopPort, SIGNAL(valueChanged(int)), this, SLOT(SetStopPort(int)));
|
||||||
spinStopPort->setValue(det->setPort(slsDetectorDefs::STOP_PORT,port));
|
spinStopPort->setValue(det->setPort(slsDetectorDefs::STOP_PORT,port));
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabAdvanced::SetStopPort");
|
||||||
connect(spinStopPort, SIGNAL(valueChanged(int)), this, SLOT(SetStopPort(int)));
|
connect(spinStopPort, SIGNAL(valueChanged(int)), this, SLOT(SetStopPort(int)));
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -545,7 +545,7 @@ void qTabAdvanced::SetRxrTCPPort(int port){
|
|||||||
#endif
|
#endif
|
||||||
disconnect(spinTCPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrTCPPort(int)));
|
disconnect(spinTCPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrTCPPort(int)));
|
||||||
spinTCPPort->setValue(det->setPort(slsDetectorDefs::DATA_PORT,port));
|
spinTCPPort->setValue(det->setPort(slsDetectorDefs::DATA_PORT,port));
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabAdvanced::SetRxrTCPPort");
|
||||||
connect(spinTCPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrTCPPort(int)));
|
connect(spinTCPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrTCPPort(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -560,7 +560,7 @@ void qTabAdvanced::SetRxrUDPPort(int port){
|
|||||||
|
|
||||||
disconnect(spinUDPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrUDPPort(int)));
|
disconnect(spinUDPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrUDPPort(int)));
|
||||||
spinUDPPort->setValue(det->setReceiverUDPPort(port));
|
spinUDPPort->setValue(det->setReceiverUDPPort(port));
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabAdvanced::SetRxrUDPPort");
|
||||||
connect(spinUDPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrUDPPort(int)));
|
connect(spinUDPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrUDPPort(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -577,7 +577,7 @@ void qTabAdvanced::SetReceiverOnline(int index){
|
|||||||
SetReceiver();
|
SetReceiver();
|
||||||
else
|
else
|
||||||
comboRxrOnline->setCurrentIndex(det->setReceiverOnline(index));
|
comboRxrOnline->setCurrentIndex(det->setReceiverOnline(index));
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabAdvanced::SetReceiverOnline");
|
||||||
connect(comboRxrOnline, SIGNAL(currentIndexChanged(int)), this, SLOT(SetReceiverOnline(int)));
|
connect(comboRxrOnline, SIGNAL(currentIndexChanged(int)), this, SLOT(SetReceiverOnline(int)));
|
||||||
//highlight in red if offline
|
//highlight in red if offline
|
||||||
if(!comboRxrOnline->currentIndex()){
|
if(!comboRxrOnline->currentIndex()){
|
||||||
@ -603,7 +603,7 @@ void qTabAdvanced::SetOnline(int index){
|
|||||||
#endif
|
#endif
|
||||||
disconnect(comboOnline, SIGNAL(currentIndexChanged(int)), this, SLOT(SetOnline(int)));
|
disconnect(comboOnline, SIGNAL(currentIndexChanged(int)), this, SLOT(SetOnline(int)));
|
||||||
comboOnline->setCurrentIndex(det->setOnline(index));
|
comboOnline->setCurrentIndex(det->setOnline(index));
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabAdvanced::SetOnline");
|
||||||
connect(comboOnline, SIGNAL(currentIndexChanged(int)), this, SLOT(SetOnline(int)));
|
connect(comboOnline, SIGNAL(currentIndexChanged(int)), this, SLOT(SetOnline(int)));
|
||||||
//highlight in red if offline
|
//highlight in red if offline
|
||||||
if(!comboOnline->currentIndex()){
|
if(!comboOnline->currentIndex()){
|
||||||
@ -637,7 +637,7 @@ void qTabAdvanced::SetNetworkParameters(){
|
|||||||
dispMAC->setText(QString(det->setDetectorMAC(dispMAC->text().toAscii().constData())));
|
dispMAC->setText(QString(det->setDetectorMAC(dispMAC->text().toAscii().constData())));
|
||||||
dispUDPIP->setText(QString(det->setReceiverUDPIP(dispUDPIP->text().toAscii().constData())));
|
dispUDPIP->setText(QString(det->setReceiverUDPIP(dispUDPIP->text().toAscii().constData())));
|
||||||
dispUDPMAC->setText(QString(det->setReceiverUDPMAC(dispUDPMAC->text().toAscii().constData())));
|
dispUDPMAC->setText(QString(det->setReceiverUDPMAC(dispUDPMAC->text().toAscii().constData())));
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabAdvanced::SetNetworkParameters");
|
||||||
|
|
||||||
connect(dispIP, SIGNAL(editingFinished()), this, SLOT(SetNetworkParameters()));
|
connect(dispIP, SIGNAL(editingFinished()), this, SLOT(SetNetworkParameters()));
|
||||||
connect(dispMAC, SIGNAL(editingFinished()), this, SLOT(SetNetworkParameters()));
|
connect(dispMAC, SIGNAL(editingFinished()), this, SLOT(SetNetworkParameters()));
|
||||||
@ -655,9 +655,9 @@ void qTabAdvanced::SetReceiver(){
|
|||||||
#endif
|
#endif
|
||||||
string outdir = myDet->getFilePath();
|
string outdir = myDet->getFilePath();
|
||||||
dispRxrHostname->setText(QString(det->setReceiver(dispRxrHostname->text().toAscii().constData())));
|
dispRxrHostname->setText(QString(det->setReceiver(dispRxrHostname->text().toAscii().constData())));
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabAdvanced::SetReceiver");
|
||||||
det->setFilePath(outdir);
|
det->setFilePath(outdir);
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabAdvanced::SetReceiver");
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -674,7 +674,7 @@ void qTabAdvanced::updateROIList(){
|
|||||||
|
|
||||||
int n,i;
|
int n,i;
|
||||||
slsDetectorDefs::ROI* temp = myDet->getROI(n);
|
slsDetectorDefs::ROI* temp = myDet->getROI(n);
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabAdvanced::updateROIList");
|
||||||
|
|
||||||
if((temp!=NULL)&&(n>0)){
|
if((temp!=NULL)&&(n>0)){
|
||||||
//assign into array, else it loses values cuz of memory
|
//assign into array, else it loses values cuz of memory
|
||||||
@ -800,7 +800,7 @@ void qTabAdvanced::AddROIInput(int num){
|
|||||||
cout<<"ROI Inputs added " << num << endl;
|
cout<<"ROI Inputs added " << num << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabAdvanced::AddROIInput");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -869,7 +869,7 @@ void qTabAdvanced::setROI(){
|
|||||||
//configuremac
|
//configuremac
|
||||||
myDet->configureMAC();
|
myDet->configureMAC();
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabAdvanced::setROI");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -949,7 +949,7 @@ void qTabAdvanced::SetDetector(int index){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabAdvanced::SetDetector");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1028,7 +1028,7 @@ void qTabAdvanced::Refresh(){
|
|||||||
//network
|
//network
|
||||||
det = myDet->getSlsDetector(comboDetector->currentIndex());
|
det = myDet->getSlsDetector(comboDetector->currentIndex());
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabAdvanced::Refresh");
|
||||||
|
|
||||||
//disconnect
|
//disconnect
|
||||||
disconnect(spinControlPort, SIGNAL(valueChanged(int)), this, SLOT(SetControlPort(int)));
|
disconnect(spinControlPort, SIGNAL(valueChanged(int)), this, SLOT(SetControlPort(int)));
|
||||||
@ -1121,7 +1121,7 @@ void qTabAdvanced::Refresh(){
|
|||||||
cout << "**Updated Advanced Tab" << endl << endl;
|
cout << "**Updated Advanced Tab" << endl << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabAdvanced::Refresh");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ void qTabDataOutput::SetupWidgetWindow(){
|
|||||||
cout << "done" << endl;
|
cout << "done" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDataOutput::SetupWidgetWindow");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -155,90 +155,8 @@ void qTabDataOutput::Initialization(){
|
|||||||
connect(chkDiscardBad, SIGNAL(toggled(bool)), this, SLOT(DiscardBadChannels()));
|
connect(chkDiscardBad, SIGNAL(toggled(bool)), this, SLOT(DiscardBadChannels()));
|
||||||
|
|
||||||
}
|
}
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
/*
|
|
||||||
void qTabDataOutput::setOutputDir(){
|
|
||||||
disconnect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(setOutputDir()));
|
|
||||||
|
|
||||||
QString path = dispOutputDir->text();
|
|
||||||
|
|
||||||
string oldPath = myDet->getFilePath();
|
|
||||||
bool error=false;
|
|
||||||
|
|
||||||
//gets rid of the end '/'s
|
|
||||||
while(path.endsWith('/')) path.chop(1);
|
|
||||||
dispOutputDir->setText(path);
|
|
||||||
|
|
||||||
if(myDet->setReceiverOnline()==slsDetectorDefs::ONLINE_FLAG){
|
|
||||||
for(int i=0;i<myDet->getNumberOfDetectors();i++){
|
|
||||||
slsDetector *det = myDet->getSlsDetector(i);
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
|
||||||
oldPath = det->getFilePath();
|
|
||||||
det->setFilePath(string(path.toAscii().constData()));
|
|
||||||
qDefs::checkErrorMessage(det);
|
|
||||||
if(det->getFilePath()!=(string(path.toAscii().constData()))){
|
|
||||||
error=true;
|
|
||||||
qDefs::checkErrorMessage(det);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(error){
|
|
||||||
//set it back for the ones which got set
|
|
||||||
for(int i=0;i<myDet->getNumberOfDetectors();i++){
|
|
||||||
slsDetector *det = myDet->getSlsDetector(i);
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
|
||||||
det->setFilePath(oldPath);
|
|
||||||
qDefs::checkErrorMessage(det);
|
|
||||||
}
|
|
||||||
}//set it in multi as well if it worked so that they reflect the same
|
|
||||||
else
|
|
||||||
myDet->setFilePath(string(path.toAscii().constData()));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
for(int i=0;i<myDet->getNumberOfDetectors();i++){
|
|
||||||
slsDetector *det = myDet->getSlsDetector(i);
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
|
||||||
det->setFilePath(string(path.toAscii().constData()));
|
|
||||||
qDefs::checkErrorMessage(det);
|
|
||||||
if(det->getFilePath()!=(string(path.toAscii().constData()))){
|
|
||||||
error=true;
|
|
||||||
qDefs::checkErrorMessage(det);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!error){
|
|
||||||
//if(QFile::exists(path)){
|
|
||||||
lblOutputDir->setText("Output Directory: ");
|
|
||||||
lblOutputDir->setPalette(chkRate->palette());
|
|
||||||
lblOutputDir->setToolTip(outDirTip);
|
|
||||||
dispOutputDir->setToolTip(outDirTip);
|
|
||||||
btnOutputBrowse->setToolTip(outDirTip);
|
|
||||||
|
|
||||||
myDet->setFilePath(string(path.toAscii().constData()));
|
|
||||||
#ifdef VERBOSE
|
|
||||||
cout << "Output Directory changed to :"<<myDet->getFilePath() << endl;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
lblOutputDir->setText("Output Directory:*");
|
|
||||||
lblOutputDir->setPalette(red);
|
|
||||||
QString errTip = outDirTip +
|
|
||||||
QString("<nobr><font color=\"red\">"
|
|
||||||
"Enter a valid path to change <b>Output Directory</b>.</font></nobr>");
|
|
||||||
lblOutputDir->setToolTip(errTip);
|
|
||||||
dispOutputDir->setToolTip(errTip);
|
|
||||||
btnOutputBrowse->setToolTip(errTip);
|
|
||||||
}
|
|
||||||
|
|
||||||
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(setOutputDir()));
|
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@ -290,7 +208,7 @@ void qTabDataOutput::SetFlatField(){
|
|||||||
string sDir = dir.toAscii().constData(),sFile = file.toAscii().constData();
|
string sDir = dir.toAscii().constData(),sFile = file.toAscii().constData();
|
||||||
if(sDir.length()<1) {sDir = string(QDir::current().absolutePath().toAscii().constData()); /*"/home/";*/}
|
if(sDir.length()<1) {sDir = string(QDir::current().absolutePath().toAscii().constData()); /*"/home/";*/}
|
||||||
qDefs::Message(qDefs::WARNING,"Invalid Flat Field file: "+sDir+"/"+sFile+
|
qDefs::Message(qDefs::WARNING,"Invalid Flat Field file: "+sDir+"/"+sFile+
|
||||||
".\nUnsetting Flat Field.","Data Output");
|
".\nUnsetting Flat Field.","qTabDataOutput::SetFlatField");
|
||||||
|
|
||||||
//Unsetting flat field
|
//Unsetting flat field
|
||||||
myDet->setFlatFieldCorrectionFile("");
|
myDet->setFlatFieldCorrectionFile("");
|
||||||
@ -324,7 +242,7 @@ void qTabDataOutput::SetFlatField(){
|
|||||||
|
|
||||||
connect(dispFlatField,SIGNAL(editingFinished()),this,SLOT(SetFlatField()));
|
connect(dispFlatField,SIGNAL(editingFinished()),this,SLOT(SetFlatField()));
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDataOutput::SetFlatField");
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -354,7 +272,7 @@ void qTabDataOutput::UpdateFlatFieldFromServer(){
|
|||||||
|
|
||||||
connect(dispFlatField, SIGNAL(editingFinished()), this, SLOT(SetFlatField()));
|
connect(dispFlatField, SIGNAL(editingFinished()), this, SLOT(SetFlatField()));
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDataOutput::UpdateFlatFieldFromServer");
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -371,7 +289,8 @@ void qTabDataOutput::BrowseFlatFieldPath(){
|
|||||||
SetFlatField();
|
SetFlatField();
|
||||||
}
|
}
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDataOutput::BrowseFlatFieldPath");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -424,7 +343,7 @@ void qTabDataOutput::SetRateCorrection(){
|
|||||||
connect(radioDeadTime, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection()));
|
connect(radioDeadTime, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection()));
|
||||||
connect(spinDeadTime, SIGNAL(valueChanged(double)), this, SLOT(SetRateCorrection()));
|
connect(spinDeadTime, SIGNAL(valueChanged(double)), this, SLOT(SetRateCorrection()));
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDataOutput::SetRateCorrection");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -439,7 +358,7 @@ void qTabDataOutput::UpdateRateCorrectionFromServer(){
|
|||||||
|
|
||||||
double rate;
|
double rate;
|
||||||
rate = (double)myDet->getRateCorrectionTau();
|
rate = (double)myDet->getRateCorrectionTau();
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDataOutput::UpdateRateCorrectionFromServer");
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Getting rate correction from server:" << rate << " : ";
|
cout << "Getting rate correction from server:" << rate << " : ";
|
||||||
#endif
|
#endif
|
||||||
@ -495,7 +414,7 @@ void qTabDataOutput::SetAngularCorrection(){
|
|||||||
cout << "Setting angular conversion to default" << endl;
|
cout << "Setting angular conversion to default" << endl;
|
||||||
#endif
|
#endif
|
||||||
}else{
|
}else{
|
||||||
qDefs::Message(qDefs::WARNING,"Angular Conversion could not be set. Please set the default file name using the command line, if you haven't already.","Data Output");
|
qDefs::Message(qDefs::WARNING,"Angular Conversion could not be set. Please set the default file name using the command line, if you haven't already.","qTabDataOutput::SetAngularCorrection");
|
||||||
chkAngular->setChecked(false);
|
chkAngular->setChecked(false);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
@ -507,7 +426,7 @@ void qTabDataOutput::SetAngularCorrection(){
|
|||||||
|
|
||||||
emit AngularConversionSignal(chkAngular->isChecked());
|
emit AngularConversionSignal(chkAngular->isChecked());
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDataOutput::SetAngularCorrection");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -515,9 +434,9 @@ void qTabDataOutput::SetAngularCorrection(){
|
|||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::DiscardBadChannels(){
|
void qTabDataOutput::DiscardBadChannels(){
|
||||||
//#ifdef VERYVERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Entering Discard bad channels function" << endl;
|
cout << "Entering Discard bad channels function" << endl;
|
||||||
//#endif
|
#endif
|
||||||
if(chkDiscardBad->isChecked()){
|
if(chkDiscardBad->isChecked()){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Setting bad channel correction to default" << endl;
|
cout << "Setting bad channel correction to default" << endl;
|
||||||
@ -530,7 +449,7 @@ void qTabDataOutput::DiscardBadChannels(){
|
|||||||
myDet->setBadChannelCorrection("");
|
myDet->setBadChannelCorrection("");
|
||||||
}
|
}
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDataOutput::DiscardBadChannels");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -607,7 +526,7 @@ void qTabDataOutput::Refresh(){
|
|||||||
cout << "**Updated DataOutput Tab" << endl << endl;
|
cout << "**Updated DataOutput Tab" << endl << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDataOutput::Refresh");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -646,7 +565,7 @@ void qTabDataOutput::GetOutputDir(){
|
|||||||
dispReadOutputDir->setText(QString(myDet->getFilePath().c_str()));
|
dispReadOutputDir->setText(QString(myDet->getFilePath().c_str()));
|
||||||
}else{
|
}else{
|
||||||
slsDetector *det = myDet->getSlsDetector(comboDetector->currentIndex());
|
slsDetector *det = myDet->getSlsDetector(comboDetector->currentIndex());
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDataOutput::GetOutputDir");
|
||||||
dispReadOutputDir->setText(QString(det->getFilePath().c_str()));
|
dispReadOutputDir->setText(QString(det->getFilePath().c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -678,7 +597,7 @@ int qTabDataOutput::VerifyOutputDirectory(){
|
|||||||
//for each detector
|
//for each detector
|
||||||
for(int i=0;i<myDet->getNumberOfDetectors();i++){
|
for(int i=0;i<myDet->getNumberOfDetectors();i++){
|
||||||
slsDetector *det = myDet->getSlsDetector(i);
|
slsDetector *det = myDet->getSlsDetector(i);
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDataOutput::VerifyOutputDirectory");
|
||||||
if(receiver){
|
if(receiver){
|
||||||
detName = string("\n - ") + string(comboDetector->itemText(i).toAscii().constData()) ;
|
detName = string("\n - ") + string(comboDetector->itemText(i).toAscii().constData()) ;
|
||||||
path = det->getFilePath();
|
path = det->getFilePath();
|
||||||
@ -687,7 +606,7 @@ int qTabDataOutput::VerifyOutputDirectory(){
|
|||||||
if(det->setFilePath(path).empty()){
|
if(det->setFilePath(path).empty()){
|
||||||
mess. append(detName);
|
mess. append(detName);
|
||||||
error = true;
|
error = true;
|
||||||
}else if(!qDefs::checkErrorMessage(det,false).empty()){
|
}else if(!qDefs::checkErrorMessage(det,"qTabDataOutput::VerifyOutputDirectory",false).empty()){
|
||||||
mess. append(detName);
|
mess. append(detName);
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
@ -714,7 +633,7 @@ int qTabDataOutput::VerifyOutputDirectory(){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "The output path doesnt exist anymore" << endl;
|
cout << "The output path doesnt exist anymore" << endl;
|
||||||
#endif
|
#endif
|
||||||
qDefs::Message(qDefs::WARNING,string("Invalid Output Directory ")+ mess ,"Data Output");
|
qDefs::Message(qDefs::WARNING,string("Invalid Output Directory ")+ mess ,"qTabDataOutput::SetAngularCorrection");
|
||||||
dispReadOutputDir->setPalette(*red1);
|
dispReadOutputDir->setPalette(*red1);
|
||||||
boxOutDir->setPalette(red);
|
boxOutDir->setPalette(red);
|
||||||
|
|
||||||
@ -784,9 +703,9 @@ void qTabDataOutput::SetOutputDir(){
|
|||||||
|
|
||||||
if(receiver){
|
if(receiver){
|
||||||
slsDetector *det = myDet->getSlsDetector(comboDetector->currentIndex());
|
slsDetector *det = myDet->getSlsDetector(comboDetector->currentIndex());
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDataOutput::SetOutputDir");
|
||||||
det->setFilePath(string(dispOutputDir->text().toAscii().constData()));
|
det->setFilePath(string(dispOutputDir->text().toAscii().constData()));
|
||||||
if(!qDefs::checkErrorMessage(det).empty()){
|
if(!qDefs::checkErrorMessage(det,"qTabDataOutput::SetOutputDir").empty()){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "The output path could not be set" << endl;
|
cout << "The output path could not be set" << endl;
|
||||||
#endif
|
#endif
|
||||||
@ -802,10 +721,10 @@ void qTabDataOutput::SetOutputDir(){
|
|||||||
//for each detector
|
//for each detector
|
||||||
for(int i=0;i<myDet->getNumberOfDetectors();i++){
|
for(int i=0;i<myDet->getNumberOfDetectors();i++){
|
||||||
slsDetector *det = myDet->getSlsDetector(i);
|
slsDetector *det = myDet->getSlsDetector(i);
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDataOutput::SetOutputDir");
|
||||||
if(det->setFilePath(string(path.toAscii().constData())).empty()){
|
if(det->setFilePath(string(path.toAscii().constData())).empty()){
|
||||||
error = true;
|
error = true;
|
||||||
}else if(!qDefs::checkErrorMessage(det,false).empty()){
|
}else if(!qDefs::checkErrorMessage(det,"qTabDataOutput::SetOutputDir",false).empty()){
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
myDet->setFilePath(det->getFilePath());
|
myDet->setFilePath(det->getFilePath());
|
||||||
@ -813,10 +732,10 @@ void qTabDataOutput::SetOutputDir(){
|
|||||||
|
|
||||||
|
|
||||||
if(error){
|
if(error){
|
||||||
qDefs::Message(qDefs::WARNING,string("Invalid output directory "),"Data Output set");
|
qDefs::Message(qDefs::WARNING,string("Invalid output directory "),"qTabDataOutput::SetOutputDir");
|
||||||
for(int i=0;i<myDet->getNumberOfDetectors();i++){
|
for(int i=0;i<myDet->getNumberOfDetectors();i++){
|
||||||
slsDetector *det = myDet->getSlsDetector(i);
|
slsDetector *det = myDet->getSlsDetector(i);
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDataOutput::SetOutputDir");
|
||||||
det->setFilePath(string(dispReadOutputDir->text().toAscii().constData()));
|
det->setFilePath(string(dispReadOutputDir->text().toAscii().constData()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ void qTabDebugging::SetupWidgetWindow(){
|
|||||||
if(detType==slsDetectorDefs::MYTHEN) UpdateModuleList();
|
if(detType==slsDetectorDefs::MYTHEN) UpdateModuleList();
|
||||||
UpdateStatus();
|
UpdateStatus();
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDebugging::SetupWidgetWindow");
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -140,7 +140,7 @@ void qTabDebugging::UpdateModuleList(){
|
|||||||
cout << "Getting Module List" << endl;
|
cout << "Getting Module List" << endl;
|
||||||
#endif
|
#endif
|
||||||
det = myDet->getSlsDetector(comboDetector->currentIndex());
|
det = myDet->getSlsDetector(comboDetector->currentIndex());
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDebugging::UpdateModuleList");
|
||||||
//deletes all modules except "all modules"
|
//deletes all modules except "all modules"
|
||||||
for(int i=0;i<comboModule->count()-1;i++)
|
for(int i=0;i<comboModule->count()-1;i++)
|
||||||
comboModule->removeItem(i);
|
comboModule->removeItem(i);
|
||||||
@ -148,7 +148,7 @@ void qTabDebugging::UpdateModuleList(){
|
|||||||
comboModule->addItem(QString("Module %1").arg(i));
|
comboModule->addItem(QString("Module %1").arg(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabDebugging::UpdateModuleList");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -160,12 +160,12 @@ void qTabDebugging::UpdateStatus(){
|
|||||||
cout << "Getting Status" << endl;
|
cout << "Getting Status" << endl;
|
||||||
#endif
|
#endif
|
||||||
det = myDet->getSlsDetector(comboDetector->currentIndex());
|
det = myDet->getSlsDetector(comboDetector->currentIndex());
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDebugging::UpdateStatus");
|
||||||
int detStatus = (int)det->getRunStatus();
|
int detStatus = (int)det->getRunStatus();
|
||||||
string status = slsDetectorBase::runStatusType(slsDetectorDefs::runStatus(detStatus));
|
string status = slsDetectorBase::runStatusType(slsDetectorDefs::runStatus(detStatus));
|
||||||
lblStatus->setText(QString(status.c_str()).toUpper());
|
lblStatus->setText(QString(status.c_str()).toUpper());
|
||||||
|
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabDebugging::UpdateStatus");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -232,11 +232,11 @@ void qTabDebugging::GetInfo(){
|
|||||||
for (int i=0;i<comboDetector->count();i++){
|
for (int i=0;i<comboDetector->count();i++){
|
||||||
QList<QTreeWidgetItem *> childItems;
|
QList<QTreeWidgetItem *> childItems;
|
||||||
det = myDet->getSlsDetector(i);
|
det = myDet->getSlsDetector(i);
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDebugging::GetInfo");
|
||||||
for(int j=0;j<det->getNMods();j++)
|
for(int j=0;j<det->getNMods();j++)
|
||||||
childItems.append(new QTreeWidgetItem((QTreeWidget*)0, QStringList(QString("Module %1").arg(j))));
|
childItems.append(new QTreeWidgetItem((QTreeWidget*)0, QStringList(QString("Module %1").arg(j))));
|
||||||
treeDet->topLevelItem(i)->insertChildren(0,childItems);
|
treeDet->topLevelItem(i)->insertChildren(0,childItems);
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabDebugging::GetInfo");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -357,7 +357,7 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
det = myDet->getSlsDetector(i);
|
det = myDet->getSlsDetector(i);
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDebugging::SetParameters");
|
||||||
lblDetectorId->setText(comboDetector->itemText(i));
|
lblDetectorId->setText(comboDetector->itemText(i));
|
||||||
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER));
|
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER));
|
||||||
lblDetectorSerial->setText(QString(value));
|
lblDetectorSerial->setText(QString(value));
|
||||||
@ -365,7 +365,7 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){
|
|||||||
lblDetectorFirmware ->setText(QString(value));
|
lblDetectorFirmware ->setText(QString(value));
|
||||||
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION));
|
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION));
|
||||||
lblDetectorSoftware->setText(QString(value));
|
lblDetectorSoftware->setText(QString(value));
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabDebugging::SetParameters");
|
||||||
|
|
||||||
lblModuleId->setText("");
|
lblModuleId->setText("");
|
||||||
lblModuleSerial->setText("");
|
lblModuleSerial->setText("");
|
||||||
@ -378,7 +378,7 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){
|
|||||||
int im = item->parent()->indexOfChild(item);
|
int im = item->parent()->indexOfChild(item);
|
||||||
|
|
||||||
det = myDet->getSlsDetector(i);
|
det = myDet->getSlsDetector(i);
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDebugging::SetParameters");
|
||||||
lblDetectorId->setText(comboDetector->itemText(i));
|
lblDetectorId->setText(comboDetector->itemText(i));
|
||||||
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER));
|
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER));
|
||||||
lblDetectorSerial->setText(QString(value));
|
lblDetectorSerial->setText(QString(value));
|
||||||
@ -393,7 +393,7 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){
|
|||||||
sprintf(value,"%llx",det->getId(slsDetectorDefs::MODULE_FIRMWARE_VERSION,im));
|
sprintf(value,"%llx",det->getId(slsDetectorDefs::MODULE_FIRMWARE_VERSION,im));
|
||||||
lblModuleFirmware->setText(QString(value));
|
lblModuleFirmware->setText(QString(value));
|
||||||
|
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabDebugging::SetParameters");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -410,7 +410,7 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
det = myDet->getSlsDetector(i);
|
det = myDet->getSlsDetector(i);
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDebugging::SetParameters");
|
||||||
lblDetectorId->setText(comboDetector->itemText(i));
|
lblDetectorId->setText(comboDetector->itemText(i));
|
||||||
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER));
|
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER));
|
||||||
lblDetectorSerial->setText(QString(value));
|
lblDetectorSerial->setText(QString(value));
|
||||||
@ -419,7 +419,7 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){
|
|||||||
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION));
|
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION));
|
||||||
lblDetectorSoftware->setText(QString(value));
|
lblDetectorSoftware->setText(QString(value));
|
||||||
|
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabDebugging::SetParameters");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -434,7 +434,7 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
det = myDet->getSlsDetector(i);
|
det = myDet->getSlsDetector(i);
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDebugging::SetParameters");
|
||||||
lblDetectorId->setText(comboDetector->itemText(i));
|
lblDetectorId->setText(comboDetector->itemText(i));
|
||||||
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER));
|
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER));
|
||||||
lblDetectorSerial->setText(QString(value));
|
lblDetectorSerial->setText(QString(value));
|
||||||
@ -443,7 +443,7 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){
|
|||||||
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION));
|
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION));
|
||||||
lblDetectorSoftware->setText(QString(value));
|
lblDetectorSoftware->setText(QString(value));
|
||||||
|
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabDebugging::SetParameters");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
@ -485,7 +485,7 @@ void qTabDebugging::TestDetector(){
|
|||||||
|
|
||||||
//get sls det object
|
//get sls det object
|
||||||
det = myDet->getSlsDetector(comboDetector->currentIndex());
|
det = myDet->getSlsDetector(comboDetector->currentIndex());
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDebugging::TestDetector");
|
||||||
|
|
||||||
//detector firmware
|
//detector firmware
|
||||||
if(chkDetectorFirmware->isChecked()){
|
if(chkDetectorFirmware->isChecked()){
|
||||||
@ -542,9 +542,9 @@ void qTabDebugging::TestDetector(){
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
//display message
|
//display message
|
||||||
qDefs::Message(qDefs::INFORMATION,message.toAscii().constData(),"Debugging");
|
qDefs::Message(qDefs::INFORMATION,message.toAscii().constData(),"qTabDebugging::TestDetector");
|
||||||
|
|
||||||
qDefs::checkErrorMessage(det);
|
qDefs::checkErrorMessage(det,"qTabDebugging::TestDetector");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ void qTabDeveloper::SetupWidgetWindow(){
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qDefs::Message(qDefs::CRITICAL,string("Unknown detector type:")+myDet->slsDetectorBase::getDetectorType(detType),"Developer");
|
qDefs::Message(qDefs::CRITICAL,string("Unknown detector type:")+myDet->slsDetectorBase::getDetectorType(detType),"qTabDeveloper::SetupWidgetWindow");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -175,7 +175,7 @@ void qTabDeveloper::SetupWidgetWindow(){
|
|||||||
adcTimer = new QTimer(this);
|
adcTimer = new QTimer(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDeveloper::SetupWidgetWindow");
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -244,7 +244,7 @@ void qTabDeveloper::SetDacValues(int id){
|
|||||||
#endif
|
#endif
|
||||||
spinDacs[id]->setValue((double)myDet->setDAC((dacs_t)spinDacs[id]->value(),getSLSIndex(id)));
|
spinDacs[id]->setValue((double)myDet->setDAC((dacs_t)spinDacs[id]->value(),getSLSIndex(id)));
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDeveloper::SetDacValues");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -257,10 +257,10 @@ void qTabDeveloper::SetHighVoltage(){
|
|||||||
#endif
|
#endif
|
||||||
int highvoltage = comboHV->currentText().toInt();
|
int highvoltage = comboHV->currentText().toInt();
|
||||||
int ret = myDet->setDAC(highvoltage,slsDetectorDefs::HV_POT);
|
int ret = myDet->setDAC(highvoltage,slsDetectorDefs::HV_POT);
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDeveloper::SetHighVoltage");
|
||||||
//error
|
//error
|
||||||
if(ret != highvoltage){
|
if(ret != highvoltage){
|
||||||
qDefs::Message(qDefs::CRITICAL,"High Voltage could not be set to this value.","Developer");
|
qDefs::Message(qDefs::CRITICAL,"High Voltage could not be set to this value.","qTabDeveloper::SetHighVoltage");
|
||||||
lblHV->setPalette(red);
|
lblHV->setPalette(red);
|
||||||
lblHV->setText("High Voltage:*");
|
lblHV->setText("High Voltage:*");
|
||||||
QString errTip = tipHV+QString("<br><br><font color=\"red\"><nobr>High Voltage could not be set. The return value is ")+
|
QString errTip = tipHV+QString("<br><br><font color=\"red\"><nobr>High Voltage could not be set. The return value is ")+
|
||||||
@ -290,7 +290,7 @@ slsDetectorDefs::dacIndex qTabDeveloper::getSLSIndex(int index){
|
|||||||
case 4: return slsDetectorDefs::CALIBRATION_PULSE;
|
case 4: return slsDetectorDefs::CALIBRATION_PULSE;
|
||||||
case 5: return slsDetectorDefs::PREAMP;
|
case 5: return slsDetectorDefs::PREAMP;
|
||||||
default:
|
default:
|
||||||
qDefs::Message(qDefs::CRITICAL,"Unknown DAC/ADC Index. Weird Error","Developer");
|
qDefs::Message(qDefs::CRITICAL,"Unknown DAC/ADC Index. Weird Error","qTabDeveloper::getSLSIndex");
|
||||||
Refresh();
|
Refresh();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -313,14 +313,14 @@ slsDetectorDefs::dacIndex qTabDeveloper::getSLSIndex(int index){
|
|||||||
case 8: return slsDetectorDefs::TEMPERATURE_ADC;
|
case 8: return slsDetectorDefs::TEMPERATURE_ADC;
|
||||||
case 9:return slsDetectorDefs::TEMPERATURE_FPGA;
|
case 9:return slsDetectorDefs::TEMPERATURE_FPGA;
|
||||||
default:
|
default:
|
||||||
qDefs::Message(qDefs::CRITICAL,"Unknown DAC/ADC Index. Weird Error","Developer");
|
qDefs::Message(qDefs::CRITICAL,"Unknown DAC/ADC Index. Weird Error","qTabDeveloper::getSLSIndex");
|
||||||
Refresh();
|
Refresh();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qDefs::Message(qDefs::CRITICAL,string("Unknown detector type:")+myDet->slsDetectorBase::getDetectorType(detType),"Developer");
|
qDefs::Message(qDefs::CRITICAL,string("Unknown detector type:")+myDet->slsDetectorBase::getDetectorType(detType),"qTabDeveloper::getSLSIndex");
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDeveloper::getSLSIndex");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -339,7 +339,7 @@ void qTabDeveloper::RefreshAdcs(){
|
|||||||
for(int i=0;i<NUM_ADC_WIDGETS;i++)
|
for(int i=0;i<NUM_ADC_WIDGETS;i++)
|
||||||
spinAdcs[i]->setValue((double)myDet->getADC(getSLSIndex(i+NUM_DAC_WIDGETS)));
|
spinAdcs[i]->setValue((double)myDet->getADC(getSLSIndex(i+NUM_DAC_WIDGETS)));
|
||||||
adcTimer->start(ADC_TIMEOUT);
|
adcTimer->start(ADC_TIMEOUT);
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDeveloper::RefreshAdcs");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -396,7 +396,7 @@ void qTabDeveloper::Refresh(){
|
|||||||
cout << "**Updated Developer Tab" << endl << endl;
|
cout << "**Updated Developer Tab" << endl << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabDeveloper::Refresh");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ void qTabMeasurement::SetupWidgetWindow(){
|
|||||||
iconStart = new QIcon(":/icons/images/start.png");
|
iconStart = new QIcon(":/icons/images/start.png");
|
||||||
iconStop = new QIcon(":/icons/images/stop.png");
|
iconStop = new QIcon(":/icons/images/stop.png");
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::SetupWidgetWindow");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ void qTabMeasurement::SetExpertMode(bool enable){
|
|||||||
cout << "Getting number of probes : " << val << endl;
|
cout << "Getting number of probes : " << val << endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::SetExpertMode");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ void qTabMeasurement::SetupTimingMode(){
|
|||||||
item[(int)Trigger_Window]->setEnabled(false);
|
item[(int)Trigger_Window]->setEnabled(false);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qDefs::Message(qDefs::CRITICAL,"Unknown detector type.","Measurement");
|
qDefs::Message(qDefs::CRITICAL,"Unknown detector type.","qTabMeasurement::SetupTimingMode");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -184,7 +184,7 @@ void qTabMeasurement::SetupTimingMode(){
|
|||||||
else{
|
else{
|
||||||
//check if the detector is not even connected
|
//check if the detector is not even connected
|
||||||
string offline = myDet->checkOnline();
|
string offline = myDet->checkOnline();
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::SetupTimingMode");
|
||||||
|
|
||||||
if(!offline.empty()){
|
if(!offline.empty()){
|
||||||
qDefs::Message(qDefs::CRITICAL,string("<nobr>The detector(s) <b>")+offline+string(" </b> is/are not connected. Exiting GUI.</nobr>"),"Main");
|
qDefs::Message(qDefs::CRITICAL,string("<nobr>The detector(s) <b>")+offline+string(" </b> is/are not connected. Exiting GUI.</nobr>"),"Main");
|
||||||
@ -194,12 +194,12 @@ void qTabMeasurement::SetupTimingMode(){
|
|||||||
|
|
||||||
qDefs::Message(qDefs::WARNING,"Unknown Timing Mode detected from detector."
|
qDefs::Message(qDefs::WARNING,"Unknown Timing Mode detected from detector."
|
||||||
"\n\nSetting the following defaults:\nTiming Mode \t: None\n"
|
"\n\nSetting the following defaults:\nTiming Mode \t: None\n"
|
||||||
"Number of Frames \t: 1\nNumber of Triggers \t: 1","Measurement");
|
"Number of Frames \t: 1\nNumber of Triggers \t: 1","qTabMeasurement::SetupTimingMode");
|
||||||
comboTimingMode->setCurrentIndex((int)None);
|
comboTimingMode->setCurrentIndex((int)None);
|
||||||
SetTimingMode((int)None);
|
SetTimingMode((int)None);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::SetupTimingMode");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -291,7 +291,7 @@ void qTabMeasurement::setFileName(const QString& fName){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Setting File name to " << myDet->getFileName() << endl;
|
cout << "Setting File name to " << myDet->getFileName() << endl;
|
||||||
#endif
|
#endif
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::setFileName");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ void qTabMeasurement::setRunIndex(int index){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Setting File Index to " << myDet->getFileIndex() << endl;
|
cout << "Setting File Index to " << myDet->getFileIndex() << endl;
|
||||||
#endif
|
#endif
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::setRunIndex");
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -310,11 +310,10 @@ void qTabMeasurement::setRunIndex(int index){
|
|||||||
|
|
||||||
void qTabMeasurement::startStopAcquisition(){
|
void qTabMeasurement::startStopAcquisition(){
|
||||||
if(btnStartStop->isChecked()){
|
if(btnStartStop->isChecked()){
|
||||||
|
|
||||||
if(thisParent->DoesOutputDirExist() == slsDetectorDefs::FAIL){
|
if(thisParent->DoesOutputDirExist() == slsDetectorDefs::FAIL){
|
||||||
if(qDefs::Message(qDefs::QUESTION,
|
if(qDefs::Message(qDefs::QUESTION,
|
||||||
"Your data will not be saved. Proceed with acquisition anyway?",
|
"Your data will not be saved. Proceed with acquisition anyway?",
|
||||||
"Measurement") == slsDetectorDefs::FAIL){
|
"qTabMeasurement::startStopAcquisition") == slsDetectorDefs::FAIL){
|
||||||
disconnect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
|
disconnect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
|
||||||
btnStartStop->click();
|
btnStartStop->click();
|
||||||
connect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
|
connect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
|
||||||
@ -361,7 +360,7 @@ void qTabMeasurement::startStopAcquisition(){
|
|||||||
btnStartStop->setChecked(false);
|
btnStartStop->setChecked(false);
|
||||||
Enable(1);*/
|
Enable(1);*/
|
||||||
}
|
}
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::startStopAcquisition");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -386,7 +385,7 @@ void qTabMeasurement::UpdateFinished(){
|
|||||||
|
|
||||||
|
|
||||||
//}
|
//}
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::UpdateFinished");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -417,7 +416,7 @@ void qTabMeasurement::setNumMeasurements(int val){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Setting Number of Measurements to " << (int)myDet->setTimer(slsDetectorDefs::MEASUREMENTS_NUMBER,-1) << endl;
|
cout << "Setting Number of Measurements to " << (int)myDet->setTimer(slsDetectorDefs::MEASUREMENTS_NUMBER,-1) << endl;
|
||||||
#endif
|
#endif
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::setNumMeasurements");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -429,7 +428,7 @@ void qTabMeasurement::setNumFrames(int val){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Setting number of frames to " << (int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,-1) << endl;
|
cout << "Setting number of frames to " << (int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,-1) << endl;
|
||||||
#endif
|
#endif
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::setNumFrames");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -461,7 +460,7 @@ void qTabMeasurement::setExposureTime(){
|
|||||||
lblPeriod->setText("Acquisition Period:");
|
lblPeriod->setText("Acquisition Period:");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::setExposureTime");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -492,7 +491,7 @@ void qTabMeasurement::setAcquisitionPeriod(){
|
|||||||
lblPeriod->setText("Acquisition Period:");
|
lblPeriod->setText("Acquisition Period:");
|
||||||
}
|
}
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::setAcquisitionPeriod");
|
||||||
//Check if the interval between plots is ok
|
//Check if the interval between plots is ok
|
||||||
emit CheckPlotIntervalSignal();
|
emit CheckPlotIntervalSignal();
|
||||||
}
|
}
|
||||||
@ -506,7 +505,7 @@ void qTabMeasurement::setNumTriggers(int val){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Setting number of triggers to " << (int)myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,-1) << endl;
|
cout << "Setting number of triggers to " << (int)myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,-1) << endl;
|
||||||
#endif
|
#endif
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::setNumTriggers");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -521,7 +520,7 @@ void qTabMeasurement::setDelay(){
|
|||||||
cout << "Setting delay after trigger to " << exptimeNS << " clocks" << "/" << spinDelay->value() << qDefs::getUnitString((qDefs::timeUnit)comboDelayUnit->currentIndex()) << endl;
|
cout << "Setting delay after trigger to " << exptimeNS << " clocks" << "/" << spinDelay->value() << qDefs::getUnitString((qDefs::timeUnit)comboDelayUnit->currentIndex()) << endl;
|
||||||
#endif
|
#endif
|
||||||
myDet->setTimer(slsDetectorDefs::DELAY_AFTER_TRIGGER,(int64_t)exptimeNS);
|
myDet->setTimer(slsDetectorDefs::DELAY_AFTER_TRIGGER,(int64_t)exptimeNS);
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::setDelay");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -533,7 +532,7 @@ void qTabMeasurement::setNumGates(int val){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Setting number of gates to " << (int)myDet->setTimer(slsDetectorDefs::GATES_NUMBER,-1) << endl;
|
cout << "Setting number of gates to " << (int)myDet->setTimer(slsDetectorDefs::GATES_NUMBER,-1) << endl;
|
||||||
#endif
|
#endif
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::setNumGates");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -545,7 +544,7 @@ void qTabMeasurement::setNumProbes(int val){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Setting number of frames to " << (int)myDet->setTimer(slsDetectorDefs::PROBES_NUMBER,-1) << endl;
|
cout << "Setting number of frames to " << (int)myDet->setTimer(slsDetectorDefs::PROBES_NUMBER,-1) << endl;
|
||||||
#endif
|
#endif
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::setNumProbes");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -631,16 +630,16 @@ void qTabMeasurement::SetTimingMode(int mode){
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//This should never happen
|
//This should never happen
|
||||||
qDefs::Message(qDefs::CRITICAL,"Timing mode unknown to GUI","Measurement");
|
qDefs::Message(qDefs::CRITICAL,"Timing mode unknown to GUI","qTabMeasurement::SetTimingMode");
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::SetTimingMode");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::SetTimingMode");
|
||||||
if(!success){
|
if(!success){
|
||||||
qDefs::Message(qDefs::WARNING,"The detector timing mode could not be set.\n"
|
qDefs::Message(qDefs::WARNING,"The detector timing mode could not be set.\n"
|
||||||
"Please check the external flags."
|
"Please check the external flags."
|
||||||
"\n\nSetting the following defaults:\nTiming Mode \t: None\n"
|
"\n\nSetting the following defaults:\nTiming Mode \t: None\n"
|
||||||
"Number of Frames \t: 1\nNumber of Triggers \t: 1","Measurement");
|
"Number of Frames \t: 1\nNumber of Triggers \t: 1","qTabMeasurement::SetTimingMode");
|
||||||
comboTimingMode->setCurrentIndex((int)None);
|
comboTimingMode->setCurrentIndex((int)None);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -756,7 +755,7 @@ void qTabMeasurement::SetTimingMode(int mode){
|
|||||||
myPlot->setFrameEnabled(lblNumFrames->isEnabled());
|
myPlot->setFrameEnabled(lblNumFrames->isEnabled());
|
||||||
myPlot->setTriggerEnabled(lblNumTriggers->isEnabled());
|
myPlot->setTriggerEnabled(lblNumTriggers->isEnabled());
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::SetTimingMode");
|
||||||
|
|
||||||
emit CheckPlotIntervalSignal();
|
emit CheckPlotIntervalSignal();
|
||||||
|
|
||||||
@ -775,7 +774,7 @@ void qTabMeasurement::EnableFileWrite(bool enable){
|
|||||||
dispFileName->setEnabled(enable);
|
dispFileName->setEnabled(enable);
|
||||||
if(enable) setFileName(dispFileName->text());
|
if(enable) setFileName(dispFileName->text());
|
||||||
myPlot->SetEnableFileWrite(enable);
|
myPlot->SetEnableFileWrite(enable);
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::EnableFileWrite");
|
||||||
};
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -820,7 +819,7 @@ void qTabMeasurement::Refresh(){
|
|||||||
myPlot->setFrameEnabled(lblNumFrames->isEnabled());
|
myPlot->setFrameEnabled(lblNumFrames->isEnabled());
|
||||||
myPlot->setTriggerEnabled(lblNumTriggers->isEnabled());
|
myPlot->setTriggerEnabled(lblNumTriggers->isEnabled());
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabMeasurement::Refresh");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
|
@ -103,9 +103,9 @@ void qTabMessages::SaveLog() {
|
|||||||
QTextStream out(&outfile);
|
QTextStream out(&outfile);
|
||||||
out<<dispLog->toPlainText() << endl;
|
out<<dispLog->toPlainText() << endl;
|
||||||
qDefs::Message(qDefs::INFORMATION,string("The Log has been successfully saved to "
|
qDefs::Message(qDefs::INFORMATION,string("The Log has been successfully saved to "
|
||||||
"")+fName.toAscii().constData(),"Messages");
|
"")+fName.toAscii().constData(),"qTabMessages::SaveLog");
|
||||||
}
|
}
|
||||||
else qDefs::Message(qDefs::WARNING,"Attempt to save log file failed.","Messages");
|
else qDefs::Message(qDefs::WARNING,"Attempt to save log file failed.","qTabMessages::SaveLog");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ void qTabPlot::SetupWidgetWindow(){
|
|||||||
//to check if this should be enabled
|
//to check if this should be enabled
|
||||||
EnableScanBox();
|
EnableScanBox();
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabPlot::SetupWidgetWindow");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -564,7 +564,7 @@ void qTabPlot::SetFrequency(){
|
|||||||
if(acqPeriodMS==0){
|
if(acqPeriodMS==0){
|
||||||
qDefs::Message(qDefs::WARNING,"<nobr>Interval between Plots:</nobr><br><nobr>"
|
qDefs::Message(qDefs::WARNING,"<nobr>Interval between Plots:</nobr><br><nobr>"
|
||||||
"<b>Every Nth Image</b>: Period betwen Frames and Exposure Time cannot both be 0 ms.</nobr><br><nobr>"
|
"<b>Every Nth Image</b>: Period betwen Frames and Exposure Time cannot both be 0 ms.</nobr><br><nobr>"
|
||||||
"Resetting to minimum plotting time interval","Plot");
|
"Resetting to minimum plotting time interval","qTabPlot::SetFrequency");
|
||||||
comboFrequency->setCurrentIndex(0);
|
comboFrequency->setCurrentIndex(0);
|
||||||
stackedLayout->setCurrentIndex(comboFrequency->currentIndex());
|
stackedLayout->setCurrentIndex(comboFrequency->currentIndex());
|
||||||
spinTimeGap->setValue(minPlotTimer);
|
spinTimeGap->setValue(minPlotTimer);
|
||||||
@ -579,7 +579,7 @@ void qTabPlot::SetFrequency(){
|
|||||||
connect(spinTimeGap, SIGNAL(editingFinished()), this, SLOT(SetFrequency()));
|
connect(spinTimeGap, SIGNAL(editingFinished()), this, SLOT(SetFrequency()));
|
||||||
connect(spinNthFrame, SIGNAL(editingFinished()), this, SLOT(SetFrequency()));
|
connect(spinNthFrame, SIGNAL(editingFinished()), this, SLOT(SetFrequency()));
|
||||||
connect(comboFrequency, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFrequency()));
|
connect(comboFrequency, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFrequency()));
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabPlot::SetFrequency");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -593,7 +593,7 @@ void qTabPlot::SetFrequency(){
|
|||||||
|
|
||||||
if((int)timeMS==0){
|
if((int)timeMS==0){
|
||||||
qDefs::Message(qDefs::WARNING,"<nobr>Interval between Plots:</nobr><br><nobr>"
|
qDefs::Message(qDefs::WARNING,"<nobr>Interval between Plots:</nobr><br><nobr>"
|
||||||
"Time Interval must be atleast >= 1 ms. Resetting to minimum plotting time interval.","Plot");
|
"Time Interval must be atleast >= 1 ms. Resetting to minimum plotting time interval.","qTabPlot::SetFrequency");
|
||||||
spinTimeGap->setValue(minPlotTimer);
|
spinTimeGap->setValue(minPlotTimer);
|
||||||
comboTimeGapUnit->setCurrentIndex(qDefs::MILLISECONDS);
|
comboTimeGapUnit->setCurrentIndex(qDefs::MILLISECONDS);
|
||||||
timeMS=minPlotTimer;
|
timeMS=minPlotTimer;
|
||||||
@ -676,7 +676,7 @@ void qTabPlot::SetFrequency(){
|
|||||||
connect(spinNthFrame, SIGNAL(editingFinished()), this, SLOT(SetFrequency()));
|
connect(spinNthFrame, SIGNAL(editingFinished()), this, SLOT(SetFrequency()));
|
||||||
connect(comboFrequency, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFrequency()));
|
connect(comboFrequency, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFrequency()));
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabPlot::SetFrequency");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -697,7 +697,7 @@ void qTabPlot::EnableScanBox(){
|
|||||||
//none of these scan plotting options make sense if positions exists
|
//none of these scan plotting options make sense if positions exists
|
||||||
bool positionsExist = myDet->getAngularConversion(ang);//myDet->getPositions();
|
bool positionsExist = myDet->getAngularConversion(ang);//myDet->getPositions();
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabPlot::EnableScanBox");
|
||||||
|
|
||||||
//only now enable/disable
|
//only now enable/disable
|
||||||
boxScan->setEnabled((mode0||mode1)&&(!positionsExist));
|
boxScan->setEnabled((mode0||mode1)&&(!positionsExist));
|
||||||
@ -789,7 +789,7 @@ void qTabPlot::EnablingNthFrameFunction(bool enable){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
/** What happens for 2d????*/
|
|
||||||
void qTabPlot::SetScanArgument(){
|
void qTabPlot::SetScanArgument(){
|
||||||
bool histogram = radioHistogram->isChecked();
|
bool histogram = radioHistogram->isChecked();
|
||||||
|
|
||||||
@ -886,7 +886,7 @@ void qTabPlot::SetScanArgument(){
|
|||||||
}else //done here so that it isnt set by default each time
|
}else //done here so that it isnt set by default each time
|
||||||
myPlot->SetScanArgument(qDefs::None);
|
myPlot->SetScanArgument(qDefs::None);
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabPlot::SetScanArgument");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ void qTabSettings::SetupWidgetWindow(){
|
|||||||
default: comboDynamicRange->setCurrentIndex(0); break;
|
default: comboDynamicRange->setCurrentIndex(0); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabSettings::SetupWidgetWindow");
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -74,7 +74,7 @@ void qTabSettings::SetupWidgetWindow(){
|
|||||||
void qTabSettings::SetupDetectorSettings(){
|
void qTabSettings::SetupDetectorSettings(){
|
||||||
// Get detector settings from detector
|
// Get detector settings from detector
|
||||||
slsDetectorDefs::detectorSettings sett = myDet->getSettings();
|
slsDetectorDefs::detectorSettings sett = myDet->getSettings();
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabSettings::SetupDetectorSettings");
|
||||||
if(sett==-1) sett = slsDetectorDefs::UNDEFINED;
|
if(sett==-1) sett = slsDetectorDefs::UNDEFINED;
|
||||||
// To be able to index items on a combo box
|
// To be able to index items on a combo box
|
||||||
model = qobject_cast<QStandardItemModel*>(comboSettings->model());
|
model = qobject_cast<QStandardItemModel*>(comboSettings->model());
|
||||||
@ -114,7 +114,7 @@ void qTabSettings::SetupDetectorSettings(){
|
|||||||
item[(int)VeryHighGain]->setEnabled(true);
|
item[(int)VeryHighGain]->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qDefs::Message(qDefs::CRITICAL,"Unknown detector type. Exiting GUI.","Settings");
|
qDefs::Message(qDefs::CRITICAL,"Unknown detector type. Exiting GUI.","qTabSettings::SetupDetectorSettings");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -122,7 +122,7 @@ void qTabSettings::SetupDetectorSettings(){
|
|||||||
// This should not happen -only if the server and gui has a mismatch
|
// This should not happen -only if the server and gui has a mismatch
|
||||||
// on which all modes are allowed in detectors
|
// on which all modes are allowed in detectors
|
||||||
if(!(item[(int)sett]->isEnabled())){
|
if(!(item[(int)sett]->isEnabled())){
|
||||||
qDefs::Message(qDefs::CRITICAL,"Unknown Detector Settings retrieved from detector. Exiting GUI.","Settings");
|
qDefs::Message(qDefs::CRITICAL,"Unknown Detector Settings retrieved from detector. Exiting GUI.","qTabSettings::SetupDetectorSettings");
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "ERROR: Unknown Detector Settings retrieved from detector." << endl;
|
cout << "ERROR: Unknown Detector Settings retrieved from detector." << endl;
|
||||||
#endif
|
#endif
|
||||||
@ -151,7 +151,7 @@ void qTabSettings::Initialization(){
|
|||||||
void qTabSettings::setSettings(int index){
|
void qTabSettings::setSettings(int index){
|
||||||
//dont set it if settings is set to undefined or uninitialized
|
//dont set it if settings is set to undefined or uninitialized
|
||||||
if((index==Undefined)||(index==Uninitialized)){
|
if((index==Undefined)||(index==Uninitialized)){
|
||||||
qDefs::Message(qDefs::WARNING,"Cannot change settings to Undefined or Uninitialized.","Settings");
|
qDefs::Message(qDefs::WARNING,"Cannot change settings to Undefined or Uninitialized.","qTabSettings::setSettings");
|
||||||
disconnect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setSettings(int)));
|
disconnect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setSettings(int)));
|
||||||
int sett = (int)myDet->getSettings();
|
int sett = (int)myDet->getSettings();
|
||||||
if(sett==-1) sett = slsDetectorDefs::UNDEFINED;
|
if(sett==-1) sett = slsDetectorDefs::UNDEFINED;
|
||||||
@ -175,7 +175,7 @@ void qTabSettings::setSettings(int index){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabSettings::setSettings");
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -186,13 +186,13 @@ void qTabSettings::SetNumberOfModules(int index){
|
|||||||
#endif
|
#endif
|
||||||
int i = myDet->setNumberOfModules(index);
|
int i = myDet->setNumberOfModules(index);
|
||||||
if(index!=i)
|
if(index!=i)
|
||||||
qDefs::Message(qDefs::WARNING,"Number of modules cannot be set for this value.","Settings");
|
qDefs::Message(qDefs::WARNING,"Number of modules cannot be set for this value.","qTabSettings::SetNumberOfModules");
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "ERROR: Setting number of modules to "<< i << endl;
|
cout << "ERROR: Setting number of modules to "<< i << endl;
|
||||||
#endif
|
#endif
|
||||||
spinNumModules->setValue(i);
|
spinNumModules->setValue(i);
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabSettings::SetNumberOfModules");
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -213,7 +213,7 @@ void qTabSettings::SetDynamicRange(int index){
|
|||||||
cout << "Setting dynamic range to "<< dr << endl;
|
cout << "Setting dynamic range to "<< dr << endl;
|
||||||
#endif
|
#endif
|
||||||
if(ret!=dr){
|
if(ret!=dr){
|
||||||
qDefs::Message(qDefs::WARNING,"Dynamic Range cannot be set to this value.","Settings");
|
qDefs::Message(qDefs::WARNING,"Dynamic Range cannot be set to this value.","qTabSettings::SetDynamicRange");
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "ERROR: Setting dynamic range to "<< ret << endl;
|
cout << "ERROR: Setting dynamic range to "<< ret << endl;
|
||||||
#endif
|
#endif
|
||||||
@ -227,7 +227,7 @@ void qTabSettings::SetDynamicRange(int index){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabSettings::SetDynamicRange");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -242,13 +242,13 @@ void qTabSettings::SetEnergy(){
|
|||||||
myDet->setThresholdEnergy(index);
|
myDet->setThresholdEnergy(index);
|
||||||
int ret = (int)myDet->getThresholdEnergy();
|
int ret = (int)myDet->getThresholdEnergy();
|
||||||
if((ret-index)>200){
|
if((ret-index)>200){
|
||||||
qDefs::Message(qDefs::WARNING,"Threshold energy could not be set. The difference is greater than 200.","Settings");
|
qDefs::Message(qDefs::WARNING,"Threshold energy could not be set. The difference is greater than 200.","qTabSettings::SetEnergy");
|
||||||
}
|
}
|
||||||
disconnect(spinThreshold, SIGNAL(valueChanged(int)), this, SLOT(SetEnergy()));
|
disconnect(spinThreshold, SIGNAL(valueChanged(int)), this, SLOT(SetEnergy()));
|
||||||
spinThreshold->setValue(ret);
|
spinThreshold->setValue(ret);
|
||||||
connect(spinThreshold, SIGNAL(valueChanged(int)), this, SLOT(SetEnergy()));
|
connect(spinThreshold, SIGNAL(valueChanged(int)), this, SLOT(SetEnergy()));
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabSettings::SetEnergy");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -314,7 +314,7 @@ void qTabSettings::Refresh(){
|
|||||||
cout << "**Updated Settings Tab" << endl << endl;
|
cout << "**Updated Settings Tab" << endl << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet);
|
qDefs::checkErrorMessage(myDet,"qTabSettings::Refresh");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user