GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QFitRangeWidget.cpp
Go to the documentation of this file.
1 // $Id: QFitRangeWidget.cpp 1134 2014-01-22 14:53:40Z 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 "QFitRangeWidget.h"
15 
16 #include "QFitItem.h"
17 #include "TGo4FitComponent.h"
18 
19 QFitRangeWidget::QFitRangeWidget(QWidget *parent, const char* name)
20  : QFitWidget(parent, name)
21 {
22  setupUi(this);
23 }
24 
26 {
27  return dynamic_cast<TGo4FitComponent*> (GetObject());
28 }
29 
31 {
32  return GetItem()->Tag();
33 }
34 
36  int num = GetNumRange();
37  if ((num<0) || (GetComp()==0)) return;
38 
39  Int_t typ, naxis;
40  Double_t left, right;
41  GetComp()->GetRangeCondition(num,typ,naxis,left,right);
42 
43  RangeTypCmb->setCurrentIndex(typ);
44  AxisNumSpin->setValue(naxis);
45 
46  if (typ!=3) LeftEdt->setText(QString::number(left));
47  if (typ!=2) RightEdt->setText(QString::number(right));
48 
50 }
51 
53 {
54  LeftEdt->setEnabled((num==0) || (num==1) || (num==2));
55  RightEdt->setEnabled((num==0) || (num==1) || (num==3));
56 }
57 
59 {
60  if (fbFillWidget || (GetComp()==0)) return;
61 
62  int num = GetNumRange();
63  if(num<0) return;
64 
65  Int_t typ = RangeTypCmb->currentIndex();
66  Int_t naxis = AxisNumSpin->value();
67 
68  Double_t left=0., right=0.;
69  bool isok1 = true, isok2 = true;
70 
71  if (typ!=3) left = LeftEdt->text().toDouble(&isok1);
72  if (typ!=2) right = RightEdt->text().toDouble(&isok2);
73 
74  if (isok1 && isok2) {
75  GetComp()->SetRangeCondition(num,typ,naxis,left,right);
76  SetWidgetItemText(true);
77  }
78 }
79 
81 {
82  GetRangeData();
83 }
84 
86 {
87  if (!fbFillWidget) {
89  GetRangeData();
90  }
91 }
92 
93 void QFitRangeWidget::LeftEdt_textChanged( const QString & )
94 {
95  GetRangeData();
96 }
97 
99 {
100  GetRangeData();
101 }
void SetRangeCondition(Int_t n, Int_t typ, Int_t naxis, Double_t left, Double_t right)
QFitRangeWidget(QWidget *parent=0, const char *name=0)
virtual void LeftEdt_textChanged(const QString &)
virtual void EnableEditsForRangeType(int)
bool fbFillWidget
Definition: QFitWidget.h:64
virtual void AxisNumSpin_valueChanged(int)
virtual void SetWidgetItemText(bool trace)
Definition: QFitWidget.cpp:97
virtual int GetNumRange()
virtual void RangeTypCmb_activated(int)
virtual TGo4FitComponent * GetComp()
virtual TObject * GetObject()
Definition: QFitWidget.cpp:53
void GetRangeCondition(Int_t n, Int_t &typ, Int_t &naxis, Double_t &left, Double_t &right) const
virtual void FillSpecificData()
virtual void GetRangeData()
virtual void RightEdt_textChanged(const QString &)
virtual QFitItem * GetItem()
Definition: QFitWidget.cpp:48
int Tag() const
Definition: QFitItem.h:33