mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 03:10:02 +02:00
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:
parent
7701531ff3
commit
e153c6fd58
@ -506,7 +506,7 @@ void ContourSignal(bool);
|
||||
void LogzSignal(bool);
|
||||
void LogySignal(bool);
|
||||
void SetZRangeSignal(double,double);
|
||||
void EnableZRangeSignal(bool);
|
||||
void ResetZMinZMaxSignal(bool,bool,double,double);
|
||||
void SetCurrentMeasurementSignal(int);
|
||||
void saveErrorSignal(QString);
|
||||
void AcquisitionErrorSignal(QString);
|
||||
|
@ -151,7 +151,7 @@ private slots:
|
||||
signals:
|
||||
void DisableZoomSignal(bool);
|
||||
void SetZRangeSignal(double,double);
|
||||
void EnableZRangeSignal(bool);
|
||||
void ResetZMinZMaxSignal(bool,bool,double,double);
|
||||
|
||||
};
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
* 19.06.2012 All modifications with the Ian flag has been made since
|
||||
* z_range_ne and the buttons are defined in another class.
|
||||
* Logz button and z_range_ne have wrappers to connect them
|
||||
* 05.05.2013 Added ResetZMinZMax
|
||||
*/
|
||||
|
||||
|
||||
@ -67,6 +68,8 @@ void ResetRange();
|
||||
#ifndef IAN
|
||||
void SetZRange(double,double);
|
||||
void EnableZRange(bool enable);
|
||||
void ResetZMinZMax(bool zmin, bool zmax, double min, double max);
|
||||
|
||||
#endif
|
||||
|
||||
signals:
|
||||
|
@ -99,12 +99,12 @@ void SlsQt2DPlotLayout::ConnectSignalsAndSlots(){
|
||||
void SlsQt2DPlotLayout::UpdateNKeepSetRangeIfSet(){
|
||||
#ifdef IAN
|
||||
if(z_range_ne->CheckBoxState()){
|
||||
#else
|
||||
if(zRangeChecked){
|
||||
#endif
|
||||
//just reset histogram range before update
|
||||
the_plot->SetZMinMax(z_range_ne->GetValue(0),z_range_ne->GetValue(1));
|
||||
#ifdef IAN
|
||||
}
|
||||
#endif
|
||||
the_plot->Update();
|
||||
}
|
||||
|
||||
@ -131,6 +131,37 @@ void SlsQt2DPlotLayout::ResetRange(){
|
||||
}
|
||||
|
||||
|
||||
void SlsQt2DPlotLayout::ResetZMinZMax(bool zmin, bool zmax, double min, double max){
|
||||
z_range_ne->SetNumber(min,0);
|
||||
z_range_ne->SetNumber(max,1);
|
||||
|
||||
//refind z limits
|
||||
the_plot->SetZMinMax();
|
||||
if(btnLogz->isChecked()) the_plot->SetZMinimumToFirstGreaterThanZero();
|
||||
|
||||
//first time check validity
|
||||
if(zmax) z_range_ne->SetValue(max,0);
|
||||
else z_range_ne->SetValue(the_plot->GetZMaximum(),1);
|
||||
|
||||
if(zmin) z_range_ne->SetValue(min,0);
|
||||
else z_range_ne->SetValue(the_plot->GetZMinimum(),0);
|
||||
|
||||
if(zmin && zmax){
|
||||
bool same = (z_range_ne->GetValue(0)==z_range_ne->GetValue(1)) ? 1:0;
|
||||
if(!z_range_ne->IsValueOk(0)||same) z_range_ne->SetValue(the_plot->GetZMinimum(),0);
|
||||
if(!z_range_ne->IsValueOk(1)||same) z_range_ne->SetValue(the_plot->GetZMaximum(),1);
|
||||
}
|
||||
|
||||
z_range_ne->SetRange(the_plot->GetZMinimum(),z_range_ne->GetValue(1),0);
|
||||
z_range_ne->SetRange(z_range_ne->GetValue(0),the_plot->GetZMaximum(),1);
|
||||
|
||||
//set histogram range
|
||||
the_plot->SetZMinMax(z_range_ne->GetValue(0),z_range_ne->GetValue(1));
|
||||
|
||||
the_plot->Update();
|
||||
}
|
||||
|
||||
|
||||
void SlsQt2DPlotLayout::SetZScaleToLog(bool yes){
|
||||
#ifndef IAN
|
||||
#ifdef VERBOSE
|
||||
@ -190,5 +221,6 @@ void SlsQt2DPlotLayout::EnableZRange(bool enable){
|
||||
#endif
|
||||
zRangeChecked = enable;
|
||||
ResetRange();
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -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)));
|
||||
|
||||
|
@ -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());
|
||||
|
@ -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){
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user