GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QFitParWidget.cpp
Go to the documentation of this file.
1 // $Id: QFitParWidget.cpp 490 2009-11-04 12:30:14Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "QFitParWidget.h"
15 
16 #include "QFitItem.h"
17 #include "TGo4FitParameter.h"
18 #include "TGo4FitParsList.h"
19 
20 
21 QFitParWidget::QFitParWidget(QWidget *parent, const char* name)
22  : QFitNamedWidget(parent, name)
23 {
24  setupUi(this);
25 }
26 
28  return dynamic_cast<TGo4FitParameter*> (GetObject());
29 }
30 
33  TGo4FitParameter* fxParameter = GetPar();
34  if (fxParameter==0) return;
35 
36  ValueEdt->setText(QString::number(fxParameter->GetValue()));
37  ErrorEdt->setText(QString::number(fxParameter->GetError()));
38  FixedChk->setChecked(fxParameter->GetFixed());
39 
40  Double_t min, max;
41 
42  bool b = fxParameter->GetRange(min,max);
43 
44  RangeChk->setChecked(b);
45  RangeMinEdt->setEnabled(b);
46  RangeMaxEdt->setEnabled(b);
47 
48  RangeMinEdt->setText(QString::number(min));
49  RangeMaxEdt->setText(QString::number(max));
50 
51  Double_t eps;
52  b = fxParameter->GetEpsilon(eps);
53  EpsilonChk->setChecked(b);
54  EpsilonEdt->setEnabled(b);
55  EpsilonEdt->setText(QString::number(eps));
56 }
57 
58 void QFitParWidget::ValueEdt_textChanged( const QString & value)
59 {
60  if(!fbFillWidget && (GetPar()!=0)) {
61  bool ok;
62  double zn = value.toDouble(&ok);
63  if(ok) {
64  GetPar()->SetValue(zn);
65  SetWidgetItemText(true);
66  }
67  }
68 }
69 
70 void QFitParWidget::ErrorEdt_textChanged( const QString & value)
71 {
72  if(!fbFillWidget && (GetPar()!=0)) {
73  bool ok;
74  double zn = value.toDouble(&ok);
75  if(ok) GetPar()->SetError(zn);
76  }
77 }
78 
79 void QFitParWidget::RangeMinEdt_textChanged( const QString & value)
80 {
81  if(!fbFillWidget && (GetPar()!=0)) {
82  bool ok;
83  double zn = value.toDouble(&ok);
84  if(ok) GetPar()->ChangeRangeMin(zn);
85  }
86 }
87 
88 
89 void QFitParWidget::RangeMaxEdt_textChanged( const QString & value)
90 {
91  if(!fbFillWidget && (GetPar()!=0)) {
92  bool ok;
93  double zn = value.toDouble(&ok);
94  if(ok) GetPar()->ChangeRangeMax(zn);
95  }
96 }
97 
98 
99 void QFitParWidget::EpsilonEdt_textChanged( const QString & value)
100 {
101  if(!fbFillWidget && (GetPar()!=0)) {
102  bool ok;
103  double zn = value.toDouble(&ok);
104  if(ok) GetPar()->ChangeEpsilon(zn);
105  }
106 
107 }
108 
109 
111 {
112  if(!fbFillWidget && (GetPar()!=0))
113  GetPar()->SetFixed(zn);
114 }
115 
116 
118 {
119  if(!fbFillWidget && (GetPar()!=0)) {
120  RangeMinEdt->setEnabled(zn);
121  RangeMaxEdt->setEnabled(zn);
122  GetPar()->SetRangeUse(zn);
123  }
124 }
125 
127 {
128  if(!fbFillWidget && (GetPar()!=0)) {
129  EpsilonEdt->setEnabled(zn);
130  GetPar()->SetEpsilonUse(zn);
131  }
132 }
void SetRangeUse(Bool_t use)
Bool_t GetFixed() const
void ChangeRangeMin(Double_t iRangeMin)
virtual void EpsilonEdt_textChanged(const QString &value)
void SetEpsilonUse(Bool_t use)
QFitParWidget(QWidget *parent=0, const char *name=0)
virtual void ValueEdt_textChanged(const QString &value)
void ChangeRangeMax(Double_t iRangeMax)
Bool_t GetRange(Double_t &min, Double_t &max) const
virtual void EpsilonChk_toggled(bool zn)
bool fbFillWidget
Definition: QFitWidget.h:64
virtual void RangeMinEdt_textChanged(const QString &value)
virtual void SetWidgetItemText(bool trace)
Definition: QFitWidget.cpp:97
Double_t GetError() const
Bool_t GetEpsilon(Double_t &eps) const
virtual void FillSpecificData()
virtual TObject * GetObject()
Definition: QFitWidget.cpp:53
void SetValue(Double_t iValue)
Double_t GetValue() const
virtual void RangeChk_toggled(bool zn)
virtual void FillSpecificData()
void SetFixed(Bool_t iFixed)
virtual void FixedChk_toggled(bool zn)
virtual void RangeMaxEdt_textChanged(const QString &value)
virtual TGo4FitParameter * GetPar()
virtual void ErrorEdt_textChanged(const QString &value)
void SetError(Double_t iError)
void ChangeEpsilon(Double_t iEpsilon)