GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QFitDataWidget.cpp
Go to the documentation of this file.
1 // $Id: QFitDataWidget.cpp 3106 2021-03-29 17:35:56Z 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 fuer 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 QFitDataWidget::QFitDataWidget(QWidget *parent, const char* name)
22  : QFitNamedWidget(parent, name)
23 {
24  setupUi(this);
25 
26  QObject::connect(NumCalibrSpin, SIGNAL(valueChanged(int)), this, SLOT(NumCalibrSpin_valueChanged(int)));
27  QObject::connect(UseBinsChk, SIGNAL(toggled(bool)), this, SLOT(UseBinsChk_toggled(bool)));
28  QObject::connect(SigmaCmb, SIGNAL(activated(int)), this, SLOT(SigmaCmb_activated(int)));
29  QObject::connect(SigmaEdt, SIGNAL(textChanged(QString)), this, SLOT(SigmaEdt_textChanged(QString)));
30  QObject::connect(BinsLimitEdt, SIGNAL(textChanged(QString)), this, SLOT(BinsLimitEdt_textChanged(QString)));
31  QObject::connect(AmplChk, SIGNAL(toggled(bool)), this, SLOT(AmplChk_toggled(bool)));
32  QObject::connect(UseBuffersChk, SIGNAL(toggled(bool)), this, SLOT(UseBuffersChk_toggled(bool)));
33 }
34 
36 {
37  return dynamic_cast<TGo4FitData*> (GetObject());
38 }
39 
41 {
43 
44  if(GetData()) {
45  if(GetData()->GetDataType()==TGo4FitData::dtHistogram) DataInfoLbl->setText("Data type: histogramic");
46  else DataInfoLbl->setText("Data type: set of points");
47  DataInfoLbl->adjustSize();
48 
49  AmplChk->setChecked(GetData()->GetAmplPar()!=0);
50  AmplChk->setEnabled(GetData()->CanAmplTouch());
51 
52  NumCalibrSpin->setValue(GetData()->GetNumberOfTransSlots());
53  UseBinsChk->setChecked(GetData()->GetUseBinScale());
54  SigmaCmb->setCurrentIndex(GetData()->GetSigmaSource());
55  SigmaEdt->setEnabled(GetData()->GetSigmaSource()==2);
56  SigmaEdt->setText(QString::number(GetData()->GetSigmaValue()));
57  BinsLimitEdt->setText(QString::number(GetData()->GetExcludeLessThen()));
58  UseBuffersChk->setChecked(GetData()->GetUseBuffers());
59 
60  QString info("Models:");
61 
62  TGo4Fitter* fitter = dynamic_cast<TGo4Fitter*> (GetItem()->Parent()->Object());
63  if (fitter)
64  for(Int_t nmodel=0;nmodel<fitter->GetNumModel();nmodel++) {
65  TGo4FitModel* model = fitter->GetModel(nmodel);
66  if (model->IsAssignTo(GetData()->GetName())) {
67  info+=" "; info+=model->GetName();
68  }
69  }
70  ModelsLbl->setText(info);
71  ModelsLbl->adjustSize();
72  }
73 }
74 
76 {
77  if (!fbFillWidget && GetData())
78  if (GetData()->SetNumberOfTransSlots(num)) {
79  if (GetFitter())
81  UpdateWidgetItem(true);
83  }
84 }
85 
87 {
88  if (!fbFillWidget && GetData())
89  GetData()->SetUseBinScale(zn);
90 }
91 
93 {
94  if (!fbFillWidget && GetData()) {
95  GetData()->SetSigmaSource(zn, -1.);
96  SigmaEdt->setEnabled(zn == 2);
97  }
98 }
99 
100 void QFitDataWidget::SigmaEdt_textChanged( const QString & value)
101 {
102  if(!fbFillWidget && GetData()) {
103  bool ok = true;
104  double zn = value.toDouble(&ok);
105  if(ok) GetData()->SetSigmaValue(zn);
106  }
107 }
108 
109 void QFitDataWidget::BinsLimitEdt_textChanged( const QString & value)
110 {
111  if (!fbFillWidget && GetData()) {
112  bool ok = true;
113  double zn = value.toDouble(&ok);
114  if (ok)
116  }
117 }
118 
120 {
121  if (!fbFillWidget && GetData() && GetData()->CanAmplTouch()) {
122  bool res = false;
123  if (chk)
124  res = GetData()->MakeAmpl();
125  else
126  res = GetData()->RemoveAmpl();
127  if (res)
129  }
130 }
131 
133 {
134  if (!fbFillWidget && GetData())
135  GetData()->SetUseBuffers(zn);
136 }
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:63
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:191
QFitItem * Parent() const
Definition: QFitItem.h:35
virtual void AmplChk_toggled(bool chk)
virtual TObject * GetObject()
Definition: QFitWidget.cpp:51
virtual QFitItem * GetItem()
Definition: QFitWidget.cpp:46
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:57
virtual void UpdateItemsOfType(int typ, bool allitems)
Definition: QFitWidget.cpp:101
QFitDataWidget(QWidget *parent=0, const char *name=0)
virtual void UpdateWidgetItem(bool trace)
Definition: QFitWidget.cpp:89