mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 00:58:01 +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:
@ -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
|
||||
|
Reference in New Issue
Block a user