00001 // $Id: QFitSlotWidget.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 "QFitSlotWidget.h" 00015 00016 #include "TClass.h" 00017 #include "QFitItem.h" 00018 #include "QGo4LineEdit.h" 00019 #include "TGo4FitSlot.h" 00020 #include "TGo4FitPanel.h" 00021 00022 QFitSlotWidget::QFitSlotWidget(QWidget *parent, const char* name) 00023 : QFitNamedWidget(parent, name) 00024 { 00025 setupUi(this); 00026 } 00027 00028 TGo4FitSlot* QFitSlotWidget::GetSlot() 00029 { 00030 return dynamic_cast<TGo4FitSlot*> (GetObject()); 00031 } 00032 00033 void QFitSlotWidget::FillSpecificData() 00034 { 00035 QFitNamedWidget::FillSpecificData(); 00036 TGo4FitSlot* slot = GetSlot(); 00037 if (slot) { 00038 NameEdt->setReadOnly(true); 00039 NameEdt->setDisabled(true); 00040 00041 InfoLbl->setText(QString("Slot of: ")+slot->GetOwner()->GetName() + 00042 ", dedicated for:" + slot->GetClass()->GetName() + " class"); 00043 InfoLbl->adjustSize(); 00044 00045 if (slot->GetObject()) { 00046 ObjectLbl->setText(QString("Object: ")+slot->GetObjectName() + 00047 ", of class: " + slot->GetObject()->ClassName()); 00048 if(slot->GetOwned()) OwnershipLbl->setText("Object owned by slot"); 00049 else OwnershipLbl->setText("Object not owned by slot"); 00050 } else { 00051 ObjectLbl->setText("No object in slot"); 00052 OwnershipLbl->setText(""); 00053 } 00054 ObjectLbl->adjustSize(); 00055 OwnershipLbl->adjustSize(); 00056 00057 RequirementChk->setChecked(slot->GetNeeded()); 00058 SaveCmb->setCurrentIndex(slot->GetSaveFlag()); 00059 00060 if (fxPanel!=0) { 00061 SourceLbl->setText(QString("Source: ") + fxPanel->Wiz_GetSlotSourceInfo(slot)); 00062 SourceLbl->adjustSize(); 00063 } 00064 } 00065 } 00066 00067 void QFitSlotWidget::RequirementChk_toggled( bool req) 00068 { 00069 if(!fbFillWidget && GetSlot()) 00070 GetSlot()->SetNeeded(req); 00071 } 00072 00073 00074 void QFitSlotWidget::SaveCmb_activated( int typ ) 00075 { 00076 if(!fbFillWidget && GetSlot()) 00077 GetSlot()->SetSaveFlag(typ); 00078 }