00001 // $Id: QFitModelGauss2Widget.cpp 490 2009-11-04 12:30:14Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #include "QFitModelGauss2Widget.h" 00015 00016 #include "TGo4FitModelGauss2.h" 00017 00018 00019 QFitModelGauss2Widget::QFitModelGauss2Widget(QWidget *parent, const char* name) 00020 : QFitModelWidget(parent, name) 00021 { 00022 setupUi(this); 00023 } 00024 00025 TGo4FitModelGauss2 * QFitModelGauss2Widget::GetGauss2() 00026 { 00027 return dynamic_cast<TGo4FitModelGauss2*> (GetObject()); 00028 } 00029 00030 void QFitModelGauss2Widget::FillSpecificData() 00031 { 00032 QFitNamedWidget::FillSpecificData(); 00033 if (GetGauss2()) { 00034 Axis1Spin->setValue(GetGauss2()->GetNumAxis1()); 00035 Axis2Spin->setValue(GetGauss2()->GetNumAxis2()); 00036 } 00037 } 00038 00039 void QFitModelGauss2Widget::Axis1Spin_valueChanged(int num1) 00040 { 00041 if (!fbFillWidget && GetGauss2()) { 00042 GetGauss2()->SetNumAxis1(num1); 00043 int num2 = GetGauss2()->GetNumAxis2(); 00044 if (num2==num1) { 00045 num2++; 00046 GetGauss2()->SetNumAxis2(num2); 00047 fbFillWidget = kTRUE; 00048 Axis2Spin->setValue(num2); 00049 fbFillWidget = kFALSE; 00050 } 00051 } 00052 } 00053 00054 void QFitModelGauss2Widget::Axis2Spin_valueChanged(int num2) 00055 { 00056 if (!fbFillWidget && GetGauss2()) { 00057 GetGauss2()->SetNumAxis2(num2); 00058 int num1 = GetGauss2()->GetNumAxis1(); 00059 if (num2==num1) { 00060 if (num1==0) num1 = 1; else num1--; 00061 GetGauss2()->SetNumAxis1(num1); 00062 fbFillWidget = kTRUE; 00063 Axis1Spin->setValue(num1); 00064 fbFillWidget = kFALSE; 00065 } 00066 } 00067 }