GSI Object Oriented Online Offline (Go4)  GO4-6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QFitModelGaussNWidget.cpp
Go to the documentation of this file.
1 // $Id: QFitModelGaussNWidget.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 "QFitModelGaussNWidget.h"
15 
16 #include "TGo4FitModelGaussN.h"
17 #include "TGo4FitGuiTypes.h"
18 
19 QFitModelGaussNWidget::QFitModelGaussNWidget(QWidget *parent, const char* name)
20  : QFitModelWidget(parent, name)
21 {
22  setupUi(this);
23  QObject::connect(AxisNumberSpin, SIGNAL(valueChanged(int)), this, SLOT(AxisNumberSpin_valueChanged(int)));
24  QObject::connect(AxisTable, SIGNAL(cellChanged(int,int)), this, SLOT(AxisTable_valueChanged(int,int)));
25 }
26 
28 {
29  return dynamic_cast<TGo4FitModelGaussN*> (GetObject());
30 }
31 
33 {
35  if (GetGaussN()) {
36  AxisNumberSpin->setValue(GetGaussN()->GetAxisNumbers());
37  SetAxisTable();
38  }
39 }
40 
42 {
43  if (GetGaussN()==0) return;
44  int num = GetGaussN()->GetAxisNumbers();
45  AxisTable->setRowCount(num);
46  for(int n=0;n<num;n++)
47  AxisTable->setItem(n,0,
48  new QTableWidgetItem(QString::number(GetGaussN()->GetAxisForIndex(n))));
49 }
50 
52 {
53  if(!fbFillWidget && GetGaussN())
54  if (GetGaussN()->SetAxisNumbers(num)) {
55  SetAxisTable();
57  }
58 }
59 
61 {
62  if(!fbFillWidget && GetGaussN()) {
63  bool ok = false;
64  int value = AxisTable->item(nrow,ncol)->text().toInt(&ok);
65  if(ok) {
66  GetGaussN()->SetAxisForIndex(nrow,value);
67  if (GetGaussN()->ResortIndexes(nrow)) SetAxisTable();
68  }
69  }
70 }
QFitModelGaussNWidget(QWidget *parent=0, const char *name=0)
bool fbFillWidget
Definition: QFitWidget.h:63
void SetAxisForIndex(Int_t indx, Int_t axis)
virtual TGo4FitModelGaussN * GetGaussN()
virtual TObject * GetObject()
Definition: QFitWidget.cpp:51
virtual void AxisTable_valueChanged(int, int)
virtual void FillSpecificData()
virtual void AxisNumberSpin_valueChanged(int)
virtual void UpdateItemsOfType(int typ, bool allitems)
Definition: QFitWidget.cpp:101