check error message in between implemented in gui

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@166 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d
2013-03-13 15:53:24 +00:00
parent b0534f194a
commit ebd6a9131b
4 changed files with 61 additions and 4 deletions

View File

@ -96,7 +96,7 @@ void qActionsWidget::SetMode(int mode){
} }
} }
} }
qDefs::checkErrorMessage(myDet);
} }
@ -167,6 +167,8 @@ 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);
} }
@ -181,6 +183,8 @@ void qActionsWidget::SetParameter(){
myDet->setActionParameter(id,parameter.toAscii().constData()); myDet->setActionParameter(id,parameter.toAscii().constData());
//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);
} }
@ -207,6 +211,8 @@ void qActionsWidget::Refresh(){
"script:" << script << "\t" "script:" << script << "\t"
"parameter:" << parameter << "\t***" << endl; "parameter:" << parameter << "\t***" << endl;
#endif #endif
qDefs::checkErrorMessage(myDet);
} }

View File

@ -110,6 +110,7 @@ void qTabDataOutput::SetupWidgetWindow(){
if(myDet->getBadChannelCorrection()) chkDiscardBad->setChecked(true); if(myDet->getBadChannelCorrection()) chkDiscardBad->setChecked(true);
qDefs::checkErrorMessage(myDet);
} }
@ -152,9 +153,12 @@ void qTabDataOutput::setOutputDir(){
if(myDet->setReceiverOnline()==slsDetectorDefs::ONLINE_FLAG){ if(myDet->setReceiverOnline()==slsDetectorDefs::ONLINE_FLAG){
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);
det->setFilePath(string(path.toAscii().constData())); det->setFilePath(string(path.toAscii().constData()));
qDefs::checkErrorMessage(det);
if(det->getFilePath()!=(string(path.toAscii().constData()))){ if(det->getFilePath()!=(string(path.toAscii().constData()))){
error=true; error=true;
qDefs::checkErrorMessage(det);
break; break;
} }
} }
@ -162,7 +166,9 @@ void qTabDataOutput::setOutputDir(){
//set it back for the ones which got set //set it back for the ones which got set
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);
det->setFilePath(oldPath); det->setFilePath(oldPath);
qDefs::checkErrorMessage(det);
} }
}//set it in multi as well if it worked so that they reflect the same }//set it in multi as well if it worked so that they reflect the same
else else
@ -199,6 +205,8 @@ void qTabDataOutput::setOutputDir(){
} }
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(setOutputDir())); connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(setOutputDir()));
qDefs::checkErrorMessage(myDet);
} }
@ -286,6 +294,8 @@ void qTabDataOutput::SetFlatField(){
} }
connect(dispFlatField,SIGNAL(editingFinished()),this,SLOT(SetFlatField())); connect(dispFlatField,SIGNAL(editingFinished()),this,SLOT(SetFlatField()));
qDefs::checkErrorMessage(myDet);
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
@ -314,12 +324,13 @@ void qTabDataOutput::UpdateFlatFieldFromServer(){
chkFlatField->setText("Flat Field File:"); chkFlatField->setText("Flat Field File:");
connect(dispFlatField, SIGNAL(editingFinished()), this, SLOT(SetFlatField())); connect(dispFlatField, SIGNAL(editingFinished()), this, SLOT(SetFlatField()));
qDefs::checkErrorMessage(myDet);
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabDataOutput::BrowseFlatFieldPath() void qTabDataOutput::BrowseFlatFieldPath(){
{
QString fName = dispFlatField->text(); QString fName = dispFlatField->text();
QString dir = fName.section('/',0,-2,QString::SectionIncludeLeadingSep); QString dir = fName.section('/',0,-2,QString::SectionIncludeLeadingSep);
if(dir.isEmpty()) dir = QString(myDet->getFlatFieldCorrectionDir().c_str());/*"/home/";*/ if(dir.isEmpty()) dir = QString(myDet->getFlatFieldCorrectionDir().c_str());/*"/home/";*/
@ -330,6 +341,8 @@ void qTabDataOutput::BrowseFlatFieldPath()
dispFlatField->setText(fName); dispFlatField->setText(fName);
SetFlatField(); SetFlatField();
} }
qDefs::checkErrorMessage(myDet);
} }
@ -381,6 +394,8 @@ void qTabDataOutput::SetRateCorrection(){
connect(radioAuto, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection())); connect(radioAuto, SIGNAL(toggled(bool)), this, SLOT(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);
} }
@ -395,6 +410,7 @@ void qTabDataOutput::UpdateRateCorrectionFromServer(){
double rate; double rate;
rate = (double)myDet->getRateCorrectionTau(); rate = (double)myDet->getRateCorrectionTau();
qDefs::checkErrorMessage(myDet);
#ifdef VERBOSE #ifdef VERBOSE
cout << "Getting rate correction from server:" << rate << " : "; cout << "Getting rate correction from server:" << rate << " : ";
#endif #endif
@ -461,6 +477,8 @@ void qTabDataOutput::SetAngularCorrection(){
} }
emit AngularConversionSignal(chkAngular->isChecked()); emit AngularConversionSignal(chkAngular->isChecked());
qDefs::checkErrorMessage(myDet);
} }
@ -482,6 +500,8 @@ void qTabDataOutput::DiscardBadChannels(){
cout << "Unsetting bad channel correction" << endl; cout << "Unsetting bad channel correction" << endl;
#endif #endif
} }
qDefs::checkErrorMessage(myDet);
} }
@ -552,6 +572,8 @@ void qTabDataOutput::Refresh(){
#ifdef VERBOSE #ifdef VERBOSE
cout << "**Updated DataOutput Tab" << endl << endl; cout << "**Updated DataOutput Tab" << endl << endl;
#endif #endif
qDefs::checkErrorMessage(myDet);
} }

View File

@ -91,6 +91,7 @@ void qTabDebugging::SetupWidgetWindow(){
if(detType==slsDetectorDefs::MYTHEN) UpdateModuleList(); if(detType==slsDetectorDefs::MYTHEN) UpdateModuleList();
UpdateStatus(); UpdateStatus();
qDefs::checkErrorMessage(myDet);
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
@ -115,6 +116,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);
//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);
@ -122,6 +124,7 @@ void qTabDebugging::UpdateModuleList(){
comboModule->addItem(QString("Module %1").arg(i)); comboModule->addItem(QString("Module %1").arg(i));
} }
qDefs::checkErrorMessage(det);
} }
@ -133,11 +136,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);
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);
} }
@ -204,9 +208,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);
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);
} }
break; break;
@ -305,6 +311,7 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){
break; break;
det = myDet->getSlsDetector(i); det = myDet->getSlsDetector(i);
qDefs::checkErrorMessage(myDet);
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));
@ -312,6 +319,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);
lblModuleId->setText(""); lblModuleId->setText("");
lblModuleSerial->setText(""); lblModuleSerial->setText("");
@ -324,6 +332,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);
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));
@ -337,6 +346,8 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){
lblModuleSerial->setText(QString(value)); lblModuleSerial->setText(QString(value));
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);
} }
break; break;
} }
@ -353,6 +364,7 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){
break; break;
det = myDet->getSlsDetector(i); det = myDet->getSlsDetector(i);
qDefs::checkErrorMessage(myDet);
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));
@ -360,6 +372,8 @@ 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);
} }
break; break;
} }
@ -374,6 +388,7 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){
break; break;
det = myDet->getSlsDetector(i); det = myDet->getSlsDetector(i);
qDefs::checkErrorMessage(myDet);
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));
@ -381,6 +396,8 @@ 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);
break; break;
} }
@ -421,6 +438,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);
//detector firmware //detector firmware
if(chkDetectorFirmware->isChecked()){ if(chkDetectorFirmware->isChecked()){
@ -478,6 +496,8 @@ void qTabDebugging::TestDetector(){
} }
//display message //display message
qDefs::Message(qDefs::INFORMATION,message.toAscii().constData(),"Debugging"); qDefs::Message(qDefs::INFORMATION,message.toAscii().constData(),"Debugging");
qDefs::checkErrorMessage(det);
} }

View File

@ -153,6 +153,7 @@ void qTabPlot::SetupWidgetWindow(){
btnResetPedestal->setEnabled(false); btnResetPedestal->setEnabled(false);
} }
qDefs::checkErrorMessage(myDet);
} }
@ -482,6 +483,7 @@ void qTabPlot::SetFrequency(){
//if period is 0, check exptime, if that is also 0, give warning and set to min timer //if period is 0, check exptime, if that is also 0, give warning and set to min timer
if(acqPeriodMS==0){ if(acqPeriodMS==0){
acqPeriodMS = (myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,-1)*(1E-6)); acqPeriodMS = (myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,-1)*(1E-6));
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>"
@ -500,6 +502,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);
return; return;
} }
} }
@ -594,6 +597,8 @@ 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);
} }
@ -614,6 +619,8 @@ 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);
//only now enable/disable //only now enable/disable
boxScan->setEnabled((mode0||mode1)&&(!positionsExist)); boxScan->setEnabled((mode0||mode1)&&(!positionsExist));
@ -801,6 +808,8 @@ 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(0); myPlot->SetScanArgument(0);
qDefs::checkErrorMessage(myDet);
} }