GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QFitModelGaussNWidget.cpp
Go to the documentation of this file.
1 // $Id: QFitModelGaussNWidget.cpp 1134 2014-01-22 14:53:40Z 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 für 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 }
24 
26 {
27  return dynamic_cast<TGo4FitModelGaussN*> (GetObject());
28 }
29 
31 {
33  if (GetGaussN()) {
34  AxisNumberSpin->setValue(GetGaussN()->GetAxisNumbers());
35  SetAxisTable();
36  }
37 }
38 
40 {
41  if (GetGaussN()==0) return;
42  int num = GetGaussN()->GetAxisNumbers();
43  AxisTable->setRowCount(num);
44  for(int n=0;n<num;n++)
45  AxisTable->setItem(n,0,
46  new QTableWidgetItem(QString::number(GetGaussN()->GetAxisForIndex(n))));
47 }
48 
50 {
51  if(!fbFillWidget && GetGaussN())
52  if (GetGaussN()->SetAxisNumbers(num)) {
53  SetAxisTable();
55  }
56 }
57 
59 {
60  if(!fbFillWidget && GetGaussN()) {
61  bool ok = false;
62  int value = AxisTable->item(nrow,ncol)->text().toInt(&ok);
63  if(ok) {
64  GetGaussN()->SetAxisForIndex(nrow,value);
65  if (GetGaussN()->ResortIndexes(nrow)) SetAxisTable();
66  }
67  }
68 }
QFitModelGaussNWidget(QWidget *parent=0, const char *name=0)
bool fbFillWidget
Definition: QFitWidget.h:64
void SetAxisForIndex(Int_t indx, Int_t axis)
virtual TGo4FitModelGaussN * GetGaussN()
virtual TObject * GetObject()
Definition: QFitWidget.cpp:53
virtual void AxisTable_valueChanged(int, int)
virtual void FillSpecificData()
virtual void AxisNumberSpin_valueChanged(int)
virtual void UpdateItemsOfType(int typ, bool allitems)
Definition: QFitWidget.cpp:103