Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4FitGUI/QFitRangeWidget.ui.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 /****************************************************************************
00017 ** ui.h extension file, included from the uic-generated form implementation.
00018 **
00019 ** If you wish to add, delete or rename slots use Qt Designer which will
00020 ** update this file, preserving your code. Create an init() slot in place of
00021 ** a constructor, and a destroy() slot in place of a destructor.
00022 *****************************************************************************/
00023 
00024 TGo4FitComponent* QFitRangeWidget::GetComp() {
00025    return dynamic_cast<TGo4FitComponent*> (GetObject());
00026 }
00027 
00028 int QFitRangeWidget::GetNumRange() {
00029    return GetItem()->Tag();
00030 }
00031 
00032 void QFitRangeWidget::FillSpecificData() {
00033    int num = GetNumRange();
00034    if ((num<0) || (GetComp()==0)) return;
00035 
00036    Int_t typ, naxis;
00037    Double_t left, right;
00038    GetComp()->GetRangeCondition(num,typ,naxis,left,right);
00039 
00040    RangeTypCmb->setCurrentItem(typ);
00041    AxisNumSpin->setValue(naxis);
00042 
00043    if (typ!=3) LeftEdt->setText(QString::number(left));
00044    if (typ!=2) RightEdt->setText(QString::number(right));
00045 
00046 
00047    EnableEditsForRangeType(typ);
00048 }
00049 
00050 void QFitRangeWidget::EnableEditsForRangeType( int num )
00051 {
00052   LeftEdt->setEnabled((num==0) || (num==1) || (num==2));
00053   RightEdt->setEnabled((num==0) || (num==1) || (num==3));
00054 }
00055 
00056 void QFitRangeWidget::GetRangeData() {
00057   if (fbFillWidget || (GetComp()==0)) return;
00058 
00059   int num = GetNumRange();
00060   if(num<0) return;
00061 
00062   Int_t typ = RangeTypCmb->currentItem();
00063   Int_t naxis = AxisNumSpin->value();
00064 
00065   Double_t left=0., right=0.;
00066   bool isok1 = TRUE, isok2 = TRUE;
00067 
00068   if (typ!=3) left = LeftEdt->text().toDouble(&isok1);
00069   if (typ!=2) right = RightEdt->text().toDouble(&isok2);
00070 
00071   if (isok1 && isok2) {
00072     GetComp()->SetRangeCondition(num,typ,naxis,left,right);
00073     fxSlots->SetItemText(GetItem(), TRUE);
00074   }
00075 }
00076 
00077 
00078 void QFitRangeWidget::AxisNumSpin_valueChanged( int )
00079 {
00080   GetRangeData();
00081 }
00082 
00083 void QFitRangeWidget::RangeTypCmb_activated( int num )
00084 {
00085   if (!fbFillWidget) {
00086     EnableEditsForRangeType(num);
00087     GetRangeData();
00088   }
00089 }
00090 
00091 
00092 void QFitRangeWidget::LeftEdt_textChanged( const QString & )
00093 {
00094   GetRangeData();
00095 }
00096 
00097 
00098 void QFitRangeWidget::RightEdt_textChanged( const QString & )
00099 {
00100   GetRangeData();
00101 }
00102 
00103 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:55:58 2005 for Go4-v2.10-5 by doxygen1.2.15