GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QFitDataWidget.cpp
Go to the documentation of this file.
1 // $Id: QFitDataWidget.cpp 1135 2014-01-22 15:40:12Z 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 "QFitDataWidget.h"
15 #include "QFitItem.h"
16 #include "TGo4FitData.h"
17 #include "TGo4FitModel.h"
18 #include "TGo4Fitter.h"
19 #include "TGo4FitGuiTypes.h"
20 
21 
22 QFitDataWidget::QFitDataWidget(QWidget *parent, const char* name)
23  : QFitNamedWidget(parent, name)
24 {
25  setupUi(this);
26 }
27 
29  return dynamic_cast<TGo4FitData*> (GetObject());
30 }
31 
34 
35  if(GetData()) {
36  if(GetData()->GetDataType()==TGo4FitData::dtHistogram) DataInfoLbl->setText("Data type: histogramic");
37  else DataInfoLbl->setText("Data type: set of points");
38  DataInfoLbl->adjustSize();
39 
40  AmplChk->setChecked(GetData()->GetAmplPar()!=0);
41  AmplChk->setEnabled(GetData()->CanAmplTouch());
42 
43  NumCalibrSpin->setValue(GetData()->GetNumberOfTransSlots());
44  UseBinsChk->setChecked(GetData()->GetUseBinScale());
45  SigmaCmb->setCurrentIndex(GetData()->GetSigmaSource());
46  SigmaEdt->setEnabled(GetData()->GetSigmaSource()==2);
47  SigmaEdt->setText(QString::number(GetData()->GetSigmaValue()));
48  BinsLimitEdt->setText(QString::number(GetData()->GetExcludeLessThen()));
49  UseBuffersChk->setChecked(GetData()->GetUseBuffers());
50 
51  QString info("Models:");
52 
53  TGo4Fitter* fitter = dynamic_cast<TGo4Fitter*> (GetItem()->Parent()->Object());
54  if (fitter)
55  for(Int_t nmodel=0;nmodel<fitter->GetNumModel();nmodel++) {
56  TGo4FitModel* model = fitter->GetModel(nmodel);
57  if (model->IsAssignTo(GetData()->GetName())) {
58  info+=" "; info+=model->GetName();
59  }
60  }
61  ModelsLbl->setText(info);
62  ModelsLbl->adjustSize();
63  }
64 }
65 
67 {
68  if(!fbFillWidget && GetData())
69  if (GetData()->SetNumberOfTransSlots(num)) {
70  if (GetFitter())
72  UpdateWidgetItem(true);
74  }
75 }
76 
78 {
79  if(!fbFillWidget && GetData())
80  GetData()->SetUseBinScale(zn);
81 }
82 
84 {
85  if(!fbFillWidget && GetData()) {
86  GetData()->SetSigmaSource(zn, -1.);
87  SigmaEdt->setEnabled(zn==2);
88  }
89 }
90 
91 
92 void QFitDataWidget::SigmaEdt_textChanged( const QString & value)
93 {
94  if(!fbFillWidget && GetData()) {
95  bool ok = true;
96  double zn = value.toDouble(&ok);
97  if(ok) GetData()->SetSigmaValue(zn);
98  }
99 }
100 
101 void QFitDataWidget::BinsLimitEdt_textChanged( const QString & value)
102 {
103  if(!fbFillWidget && GetData()) {
104  bool ok = true;
105  double zn = value.toDouble(&ok);
106  if(ok) GetData()->SetExcludeLessThen(zn);
107  }
108 }
109 
111 {
112  if(!fbFillWidget && GetData() && GetData()->CanAmplTouch()) {
113  bool res = false;
114  if (chk) res = GetData()->MakeAmpl();
115  else res = GetData()->RemoveAmpl();
116  if (res) UpdateItemsOfType(FitGui::ot_parslist, false);
117  }
118 }
119 
120 
122 {
123  if(!fbFillWidget && GetData())
124  GetData()->SetUseBuffers(zn);
125 }
void SetUpdateSlotList()
void SetUseBuffers(Bool_t iUse)
virtual void FillSpecificData()
TObject * Object() const
Definition: QFitItem.h:27
void SetSigmaValue(Double_t SigmaValue)
Definition: TGo4FitData.h:102
virtual void NumCalibrSpin_valueChanged(int num)
void SetExcludeLessThen(Double_t limit=0.)
Definition: TGo4FitData.h:107
void SetSigmaSource(Int_t TakeFrom, Double_t SigmaValue=1.)
Definition: TGo4FitData.h:95
bool fbFillWidget
Definition: QFitWidget.h:64
virtual void BinsLimitEdt_textChanged(const QString &value)
virtual void SigmaEdt_textChanged(const QString &value)
virtual void UseBinsChk_toggled(bool zn)
TGo4FitModel * GetModel(Int_t n)
Definition: TGo4Fitter.cxx:193
QFitItem * Parent() const
Definition: QFitItem.h:35
virtual void AmplChk_toggled(bool chk)
virtual TObject * GetObject()
Definition: QFitWidget.cpp:53
virtual QFitItem * GetItem()
Definition: QFitWidget.cpp:48
Int_t GetNumModel() const
Definition: TGo4Fitter.h:178
void SetUseBinScale(Bool_t iUseBinScale)
Definition: TGo4FitData.h:67
Bool_t MakeAmpl(Bool_t isFixed=kFALSE)
virtual TGo4FitData * GetData()
virtual void SigmaCmb_activated(int zn)
virtual void FillSpecificData()
Bool_t IsAssignTo(const char *DataName) const
Definition: TGo4FitModel.h:141
virtual void UseBuffersChk_toggled(bool)
virtual TGo4Fitter * GetFitter()
Definition: QFitWidget.cpp:59
virtual void UpdateItemsOfType(int typ, bool allitems)
Definition: QFitWidget.cpp:103
QFitDataWidget(QWidget *parent=0, const char *name=0)
virtual void UpdateWidgetItem(bool trace)
Definition: QFitWidget.cpp:91