Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

QFitRangeWidget.ui.h

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE 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 {
00026    return dynamic_cast<TGo4FitComponent*> (GetObject());
00027 }
00028 
00029 int QFitRangeWidget::GetNumRange()
00030 {
00031    return GetItem()->Tag();
00032 }
00033 
00034 void QFitRangeWidget::FillSpecificData() {
00035    int num = GetNumRange();
00036    if ((num<0) || (GetComp()==0)) return;
00037 
00038    Int_t typ, naxis;
00039    Double_t left, right;
00040    GetComp()->GetRangeCondition(num,typ,naxis,left,right);
00041 
00042    RangeTypCmb->setCurrentItem(typ);
00043    AxisNumSpin->setValue(naxis);
00044 
00045    if (typ!=3) LeftEdt->setText(QString::number(left));
00046    if (typ!=2) RightEdt->setText(QString::number(right));
00047 
00048    EnableEditsForRangeType(typ);
00049 }
00050 
00051 void QFitRangeWidget::EnableEditsForRangeType( int num )
00052 {
00053   LeftEdt->setEnabled((num==0) || (num==1) || (num==2));
00054   RightEdt->setEnabled((num==0) || (num==1) || (num==3));
00055 }
00056 
00057 void QFitRangeWidget::GetRangeData()
00058 {
00059   if (fbFillWidget || (GetComp()==0)) return;
00060 
00061   int num = GetNumRange();
00062   if(num<0) return;
00063 
00064   Int_t typ = RangeTypCmb->currentItem();
00065   Int_t naxis = AxisNumSpin->value();
00066 
00067   Double_t left=0., right=0.;
00068   bool isok1 = TRUE, isok2 = TRUE;
00069 
00070   if (typ!=3) left = LeftEdt->text().toDouble(&isok1);
00071   if (typ!=2) right = RightEdt->text().toDouble(&isok2);
00072 
00073   if (isok1 && isok2) {
00074      GetComp()->SetRangeCondition(num,typ,naxis,left,right);
00075      SetWidgetItemText(true);
00076   }
00077 }
00078 
00079 void QFitRangeWidget::AxisNumSpin_valueChanged( int )
00080 {
00081   GetRangeData();
00082 }
00083 
00084 void QFitRangeWidget::RangeTypCmb_activated( int num )
00085 {
00086   if (!fbFillWidget) {
00087     EnableEditsForRangeType(num);
00088     GetRangeData();
00089   }
00090 }
00091 
00092 void QFitRangeWidget::LeftEdt_textChanged( const QString & )
00093 {
00094   GetRangeData();
00095 }
00096 
00097 void QFitRangeWidget::RightEdt_textChanged( const QString & )
00098 {
00099   GetRangeData();
00100 }
00101 
00102 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:14 2008 for Go4-v3.04-1 by  doxygen 1.4.2