00001 // $Id: QFitModelFunctionWidget.cpp 1134 2014-01-22 14:53:40Z 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 "QFitModelFunctionWidget.h" 00015 00016 #include "TGo4FitModelFunction.h" 00017 #include "TGo4FitGuiTypes.h" 00018 00019 00020 QFitModelFunctionWidget::QFitModelFunctionWidget(QWidget *parent, const char* name) 00021 : QFitModelWidget(parent, name) 00022 { 00023 setupUi(this); 00024 } 00025 00026 TGo4FitModelFunction * QFitModelFunctionWidget::GetFunction() { 00027 return dynamic_cast<TGo4FitModelFunction*> (GetObject()); 00028 } 00029 00030 void QFitModelFunctionWidget::FillSpecificData() { 00031 QFitNamedWidget::FillSpecificData(); 00032 if (GetFunction()) { 00033 LibNameEdt->setText(GetFunction()->GetLibraryName()); 00034 FuncNameEdt->setText(GetFunction()->GetFunctionName()); 00035 NumParSpin->setValue(GetFunction()->GetNumberOfFuncPar()); 00036 } 00037 } 00038 00039 void QFitModelFunctionWidget::LibNameEdt_textChanged( const QString & name) 00040 { 00041 if(!fbFillWidget && GetFunction()) 00042 GetFunction()->SetLibraryName(name.toLatin1().constData()); 00043 } 00044 00045 void QFitModelFunctionWidget::FuncNameEdt_textChanged( const QString & name) 00046 { 00047 if(!fbFillWidget && GetFunction()) 00048 GetFunction()->SetFunctionName(name.toLatin1().constData()); 00049 } 00050 00051 void QFitModelFunctionWidget::NumParSpin_valueChanged( int num) 00052 { 00053 if(!fbFillWidget && GetFunction()) 00054 if(GetFunction()->SetNumberOfFuncPar(num)) 00055 UpdateItemsOfType(FitGui::ot_parslist, false); 00056 }