fixed zmin zmax bug, automatically online when refreshing advanced tab bug, outdir not checking properly

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@178 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d
2013-05-08 17:32:38 +00:00
parent 7701531ff3
commit e153c6fd58
8 changed files with 77 additions and 17 deletions

View File

@ -278,7 +278,7 @@ void qDrawPlot::Initialization(){
connect(this, SIGNAL(ContourSignal(bool)), plot2D, SIGNAL(ContourSignal(bool)));
connect(this, SIGNAL(LogzSignal(bool)), plot2D, SLOT(SetZScaleToLog(bool)));
connect(this, SIGNAL(LogySignal(bool)), plot1D, SLOT(SetLogY(bool)));
connect(this, SIGNAL(EnableZRangeSignal(bool)),plot2D, SLOT(EnableZRange(bool)));
connect(this, SIGNAL(ResetZMinZMaxSignal(bool,bool,double,double)),plot2D, SLOT(ResetZMinZMax(bool,bool,double,double)));
connect(this, SIGNAL(SetZRangeSignal(double,double)), plot2D, SLOT(SetZRange(double,double)));

View File

@ -140,8 +140,10 @@ void qTabAdvanced::SetupWidgetWindow(){
//check if its online and set it to red if offline
det->checkOnline();
det->checkReceiverOnline();
if(det->setOnline()==slsDetectorDefs::ONLINE_FLAG)
det->checkOnline();
if(det->setReceiverOnline()==slsDetectorDefs::ONLINE_FLAG)
det->checkReceiverOnline();
comboOnline->setCurrentIndex(det->setOnline());
comboRxrOnline->setCurrentIndex(det->setReceiverOnline());
if(!comboOnline->currentIndex()){
@ -571,7 +573,10 @@ void qTabAdvanced::SetReceiverOnline(int index){
cout << "Setting Reciever Online to :" << index << endl;
#endif
disconnect(comboRxrOnline, SIGNAL(currentIndexChanged(int)), this, SLOT(SetReceiverOnline(int)));
comboRxrOnline->setCurrentIndex(det->setReceiverOnline(index));
if(index)
SetReceiver();
else
comboRxrOnline->setCurrentIndex(det->setReceiverOnline(index));
qDefs::checkErrorMessage(det);
connect(comboRxrOnline, SIGNAL(currentIndexChanged(int)), this, SLOT(SetReceiverOnline(int)));
//highlight in red if offline
@ -648,8 +653,11 @@ void qTabAdvanced::SetReceiver(){
#ifdef VERBOSE
cout << "Setting Receiver" << endl;
#endif
string outdir = myDet->getFilePath();
dispRxrHostname->setText(QString(det->setReceiver(dispRxrHostname->text().toAscii().constData())));
qDefs::checkErrorMessage(det);
det->setFilePath(outdir);
qDefs::checkErrorMessage(det);
Refresh();
}
@ -909,8 +917,10 @@ void qTabAdvanced::SetDetector(int index){
//check if its online and set it to red if offline
det->checkOnline();
det->checkReceiverOnline();
if(det->setOnline()==slsDetectorDefs::ONLINE_FLAG)
det->checkOnline();
if(det->setReceiverOnline()==slsDetectorDefs::ONLINE_FLAG)
det->checkReceiverOnline();
comboOnline->setCurrentIndex(det->setOnline());
comboRxrOnline->setCurrentIndex(det->setReceiverOnline());
//highlight in red if detector or receiver is offline
@ -1026,7 +1036,8 @@ void qTabAdvanced::Refresh(){
disconnect(comboOnline, SIGNAL(currentIndexChanged(int)), this, SLOT(SetOnline(int)));
//so that updated status
det->checkOnline();
if(det->setOnline()==slsDetectorDefs::ONLINE_FLAG)
det->checkOnline();
comboOnline->setCurrentIndex(det->setOnline());
spinControlPort->setValue(det->getControlPort());
spinStopPort->setValue(det->getStopPort());
@ -1053,7 +1064,8 @@ void qTabAdvanced::Refresh(){
dispMAC->setText(det->getDetectorMAC());
//so that updated status
det->checkReceiverOnline();
if(det->setReceiverOnline()==slsDetectorDefs::ONLINE_FLAG)
det->checkReceiverOnline();
comboRxrOnline->setCurrentIndex(det->setReceiverOnline());
dispRxrHostname->setText(det->getReceiver());

View File

@ -166,6 +166,7 @@ void qTabDataOutput::setOutputDir(){
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()))){
@ -187,9 +188,20 @@ void qTabDataOutput::setOutputDir(){
myDet->setFilePath(string(path.toAscii().constData()));
}
else {
myDet->setFilePath(string(path.toAscii().constData()));
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;
}
}
/* myDet->setFilePath(string(path.toAscii().constData()));
if(myDet->getFilePath()!=(string(path.toAscii().constData())))
error=true;
error=true;*/
}
if(!error){

View File

@ -261,7 +261,7 @@ void qTabPlot::Initialization(){
connect(chkYMax, SIGNAL(toggled(bool)), this, SLOT(EnableRange()));
connect(chkZMin, SIGNAL(toggled(bool)), this, SLOT(EnableZRange()));
connect(chkZMax, SIGNAL(toggled(bool)), this, SLOT(EnableZRange()));
connect(this, SIGNAL(EnableZRangeSignal(bool)), myPlot, SIGNAL(EnableZRangeSignal(bool)));
connect(this, SIGNAL(ResetZMinZMaxSignal(bool,bool,double,double)), myPlot, SIGNAL(ResetZMinZMaxSignal(bool,bool,double,double)));
connect(dispXMin, SIGNAL(editingFinished()), this, SLOT(SetAxesRange()));
connect(dispXMax, SIGNAL(editingFinished()), this, SLOT(SetAxesRange()));
@ -418,7 +418,8 @@ void qTabPlot::SetAxesRange(){
void qTabPlot::SetZRange(){
emit SetZRangeSignal(dispZMin->text().toDouble(),dispZMax->text().toDouble());
// emit SetZRangeSignal(dispZMin->text().toDouble(),dispZMax->text().toDouble());
emit ResetZMinZMaxSignal(chkZMin->isChecked(),chkZMax->isChecked(),dispZMin->text().toDouble(),dispZMax->text().toDouble());
}
@ -428,7 +429,7 @@ void qTabPlot::SetZRange(){
void qTabPlot::EnableZRange(){
dispZMin->setEnabled(chkZMin->isChecked());
dispZMax->setEnabled(chkZMax->isChecked());
emit EnableZRangeSignal((chkZMin->isChecked())||(chkZMax->isChecked()));
emit ResetZMinZMaxSignal(chkZMin->isChecked(),chkZMax->isChecked(),dispZMin->text().toDouble(),dispZMax->text().toDouble());
}