GSI Object Oriented Online Offline (Go4)  GO4-6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QFitModelGauss2Widget.cpp
Go to the documentation of this file.
1 // $Id: QFitModelGauss2Widget.cpp 3113 2021-03-30 06:27:16Z 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 "QFitModelGauss2Widget.h"
15 
16 #include "TGo4FitModelGauss2.h"
17 
18 
19 QFitModelGauss2Widget::QFitModelGauss2Widget(QWidget *parent, const char* name)
20  : QFitModelWidget(parent, name)
21 {
22  setupUi(this);
23  QObject::connect(Axis1Spin, SIGNAL(valueChanged(int)), this, SLOT(Axis1Spin_valueChanged(int)));
24  QObject::connect(Axis2Spin, SIGNAL(valueChanged(int)), this, SLOT(Axis2Spin_valueChanged(int)));
25 }
26 
28 {
29  return dynamic_cast<TGo4FitModelGauss2*> (GetObject());
30 }
31 
33 {
35  if (GetGauss2()) {
36  Axis1Spin->setValue(GetGauss2()->GetNumAxis1());
37  Axis2Spin->setValue(GetGauss2()->GetNumAxis2());
38  }
39 }
40 
42 {
43  if (!fbFillWidget && GetGauss2()) {
44  GetGauss2()->SetNumAxis1(num1);
45  int num2 = GetGauss2()->GetNumAxis2();
46  if (num2==num1) {
47  num2++;
48  GetGauss2()->SetNumAxis2(num2);
49  fbFillWidget = kTRUE;
50  Axis2Spin->setValue(num2);
51  fbFillWidget = kFALSE;
52  }
53  }
54 }
55 
57 {
58  if (!fbFillWidget && GetGauss2()) {
59  GetGauss2()->SetNumAxis2(num2);
60  int num1 = GetGauss2()->GetNumAxis1();
61  if (num2==num1) {
62  if (num1==0) num1 = 1; else num1--;
63  GetGauss2()->SetNumAxis1(num1);
64  fbFillWidget = kTRUE;
65  Axis1Spin->setValue(num1);
66  fbFillWidget = kFALSE;
67  }
68  }
69 }
virtual void Axis2Spin_valueChanged(int)
virtual void Axis1Spin_valueChanged(int)
Int_t SetNumAxis1(Int_t n)
virtual TGo4FitModelGauss2 * GetGauss2()
bool fbFillWidget
Definition: QFitWidget.h:63
QFitModelGauss2Widget(QWidget *parent=0, const char *name=0)
Int_t SetNumAxis2(Int_t n)
virtual TObject * GetObject()
Definition: QFitWidget.cpp:51
virtual void FillSpecificData()