GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
QFitModelGauss2Widget.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
15
16#include "TGo4FitModelGauss2.h"
17
18
19QFitModelGauss2Widget::QFitModelGauss2Widget(QWidget *parent, const char *name)
20 : QFitModelWidget(parent, name)
21{
22 setupUi(this);
23 QObject::connect(Axis1Spin, QOverload<int>::of(&QSpinBox::valueChanged), this, &QFitModelGauss2Widget::Axis1Spin_valueChanged);
24 QObject::connect(Axis2Spin, QOverload<int>::of(&QSpinBox::valueChanged), this, &QFitModelGauss2Widget::Axis2Spin_valueChanged);
25}
26
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 TGo4FitModelGauss2 * GetGauss2()
virtual void Axis2Spin_valueChanged(int)
virtual void Axis1Spin_valueChanged(int)
QFitModelGauss2Widget(QWidget *parent=nullptr, const char *name=nullptr)
QFitModelWidget(QWidget *parent=nullptr, const char *name=nullptr)
void FillSpecificData() override
virtual TObject * GetObject()
bool fbFillWidget
Definition QFitWidget.h:63
Two dimensional gaussian peak.
Int_t GetNumAxis2() const
Return number of second selected axis.
Int_t SetNumAxis2(Int_t n)
Sets number of second selected axis.
Int_t GetNumAxis1() const
Return number of first selected axis.
Int_t SetNumAxis1(Int_t n)
Sets number of first selected axis.