00001 // $Id: QFitterWidget.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 "QFitterWidget.h" 00015 00016 #include "QFitItem.h" 00017 #include "TGo4Fitter.h" 00018 #include "TGo4FitData.h" 00019 #include "TGo4FitModel.h" 00020 00021 00022 QFitterWidget::QFitterWidget(QWidget *parent, const char* name) 00023 : QFitNamedWidget(parent, name) 00024 { 00025 setupUi(this); 00026 } 00027 00028 TGo4Fitter * QFitterWidget::GetFitter() 00029 { 00030 return dynamic_cast<TGo4Fitter*> (GetObject()); 00031 } 00032 00033 void QFitterWidget::FillSpecificData() 00034 { 00035 QFitNamedWidget::FillSpecificData(); 00036 if (GetFitter()) { 00037 int typ = GetFitter()->GetFitFunctionType(); 00038 if (typ==TGo4Fitter::ff_user) typ = TGo4Fitter::ff_least_squares; 00039 FitFunctionTypeCmb->setCurrentIndex(typ); 00040 00041 const char strend[3] = { 13, 10 , 0 }; 00042 QString info("Associations:"); 00043 info+=strend; 00044 for (Int_t ndata=0;ndata<GetFitter()->GetNumData();ndata++) { 00045 TGo4FitData* data = GetFitter()->GetData(ndata); 00046 info += data->GetName(); 00047 info += ":"; 00048 for(Int_t nmodel=0;nmodel<GetFitter()->GetNumModel();nmodel++) { 00049 TGo4FitModel* model = GetFitter()->GetModel(nmodel); 00050 if (model->IsAssignTo(data->GetName())) { 00051 info+=" "; 00052 info+=model->GetName(); 00053 } 00054 } 00055 info+=strend; 00056 } 00057 InfoLbl->setText(info); 00058 InfoLbl->adjustSize(); 00059 } 00060 } 00061 00062 void QFitterWidget::FitFunctionTypeCmb_activated( int typ ) 00063 { 00064 if (!fbFillWidget && GetFitter()) 00065 GetFitter()->SetFitFunctionType(typ); 00066 } 00067