Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

QFitParCfgWidget.ui.h

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 /****************************************************************************
00017 ** ui.h extension file, included from the uic-generated form implementation.
00018 **
00019 ** If you wish to add, delete or rename slots use Qt Designer which will
00020 ** update this file, preserving your code. Create an init() slot in place of
00021 ** a constructor, and a destroy() slot in place of a destructor.
00022 *****************************************************************************/
00023 
00024 
00025 TGo4FitParameter * QFitParCfgWidget::GetPar()
00026 {
00027    return dynamic_cast<TGo4FitParameter*> (GetObject());
00028 }
00029 
00030 void QFitParCfgWidget::FillSpecificData()
00031 {
00032   if (GetPar()) {
00033      ParNameEdit->setText(GetPar()->GetName());
00034      ParFixedChk->setChecked(GetPar()->GetFixed());
00035      Double_t min,max;
00036      if (GetPar()->GetRange(min,max)) {
00037         RangeMinEdit->setText(QString::number(min));
00038         RangeMaxEdit->setText(QString::number(max));
00039      } else {
00040         RangeMinEdit->setText("");
00041         RangeMaxEdit->setText("");
00042      }
00043      Double_t eps;
00044      if (GetPar()->GetEpsilon(eps)) EpsilonEdit->setText(QString::number(eps));
00045                                else EpsilonEdit->setText("");
00046   }
00047 }
00048 
00049 void QFitParCfgWidget::AnalyzeRangeValues()
00050 {
00051   if  ((RangeMinEdit->text().length()==0) && (RangeMaxEdit->text().length()==0))
00052     { GetPar()->SetRangeUse(kFALSE); return; }
00053   double min,max;
00054   bool okmin = FALSE, okmax = FALSE;
00055 
00056   min = RangeMinEdit->text().toDouble(&okmin);
00057   max = RangeMaxEdit->text().toDouble(&okmax);
00058 
00059   if (RangeMinEdit->text().length()==0) { min = max; okmin = okmax; }
00060   if (RangeMaxEdit->text().length()==0) { max = min; okmax = okmin; }
00061 
00062   if (okmin && okmax)
00063     GetPar()->SetRange(min,max);
00064 }
00065 
00066 
00067 void QFitParCfgWidget::ParNameEdit_textChanged( const QString & name)
00068 {
00069   if(!fbFillWidget && GetPar() && (name.length()>0)) {
00070       TGo4FitParsList* pars = dynamic_cast<TGo4FitParsList*> (GetItem()->Parent()->Object());
00071       if (pars==0) return;
00072       if (pars->FindPar(name)) return;
00073       GetPar()->SetName(name);
00074       GetItem()->setText(0,name);
00075   }
00076 }
00077 
00078 
00079 void QFitParCfgWidget::ParFixedChk_toggled( bool chk)
00080 {
00081   if(!fbFillWidget && GetPar())
00082     GetPar()->SetFixed(chk);
00083 }
00084 
00085 
00086 void QFitParCfgWidget::RangeMinEdit_textChanged( const QString &)
00087 {
00088   if(!fbFillWidget && GetPar())
00089     AnalyzeRangeValues();
00090 }
00091 
00092 
00093 void QFitParCfgWidget::RangeMaxEdit_textChanged( const QString &)
00094 {
00095   if(!fbFillWidget && GetPar())
00096     AnalyzeRangeValues();
00097 }
00098 
00099 void QFitParCfgWidget::EpsilonEdit_textChanged( const QString & value)
00100 {
00101     if(!fbFillWidget && GetPar())
00102       if (value.length()==0) GetPar()->SetEpsilonUse(kFALSE); else {
00103           bool res = FALSE;
00104           double zn = value.toDouble(&res);
00105           if(res) GetPar()->SetEpsilon(zn);
00106       }
00107 }
00108 
00109 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:14 2008 for Go4-v3.04-1 by  doxygen 1.4.2