GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
QFitterWidget.cpp
Go to the documentation of this file.
1 // $Id$
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 "QFitterWidget.h"
15 
16 #include "TGo4Fitter.h"
17 #include "TGo4FitData.h"
18 #include "TGo4FitModel.h"
19 
20 QFitterWidget::QFitterWidget(QWidget *parent, const char *name)
21  : QFitNamedWidget(parent, name)
22 {
23  setupUi(this);
24  QObject::connect(FitFunctionTypeCmb, QOverload<int>::of(&QComboBox::activated), this, &QFitterWidget::FitFunctionTypeCmb_activated);
25 }
26 
28 {
29  return dynamic_cast<TGo4Fitter*> (GetObject());
30 }
31 
33 {
35  if (GetFitter()) {
36  int typ = GetFitter()->GetFitFunctionType();
38  FitFunctionTypeCmb->setCurrentIndex(typ);
39 
40  const char strend[3] = { 13, 10, 0 };
41  QString info("Associations:");
42  info+=strend;
43  for (Int_t ndata = 0; ndata < GetFitter()->GetNumData(); ndata++) {
44  TGo4FitData *data = GetFitter()->GetData(ndata);
45  info += data->GetName();
46  info += ":";
47  for (Int_t nmodel = 0; nmodel < GetFitter()->GetNumModel(); nmodel++) {
48  TGo4FitModel *model = GetFitter()->GetModel(nmodel);
49  if (model->IsAssignTo(data->GetName())) {
50  info+=" ";
51  info+=model->GetName();
52  }
53  }
54  info += strend;
55  }
56  InfoLbl->setText(info);
57  InfoLbl->adjustSize();
58  }
59 }
60 
62 {
63  if (!fbFillWidget && GetFitter())
65 }
66 
Int_t GetNumData() const
Definition: TGo4Fitter.h:123
void SetFitFunctionType(Int_t iFitFunctionType)
Definition: TGo4Fitter.h:80
bool fbFillWidget
Definition: QFitWidget.h:63
Bool_t IsAssignTo(const char *DataName) const
Definition: TGo4FitModel.h:141
TGo4Fitter * GetFitter() override
void FillSpecificData() override
virtual void FitFunctionTypeCmb_activated(int typ)
TGo4FitModel * GetModel(Int_t n)
Definition: TGo4Fitter.cxx:200
void FillSpecificData() override
Int_t GetNumModel() const
Definition: TGo4Fitter.h:178
TGo4FitData * GetData(Int_t n)
Definition: TGo4Fitter.cxx:104
virtual TObject * GetObject()
Definition: QFitWidget.cpp:50
Int_t GetFitFunctionType() const
Definition: TGo4Fitter.h:85
QFitterWidget(QWidget *parent=nullptr, const char *name=nullptr)