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

TGo4EventInfo.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 const char* defMbsEventName = "MbsEvent-10-1";
00017 
00018 
00019 void TGo4EventInfo::init()
00020 {
00021    setCaption("Event info");
00022    ResetWidget();
00023 }
00024 
00025 bool TGo4EventInfo::IsAcceptDrag(const char* itemname, TClass* cl, int kind)
00026 {
00027    return (kind==TGo4Access::kndEventElement);
00028 }
00029 
00030 void TGo4EventInfo::DropItem(const char* itemname, TClass* cl, int kind)
00031 {
00032    if (kind==TGo4Access::kndEventElement)
00033      WorkWithEvent(itemname);
00034 }
00035 
00036 void TGo4EventInfo::WorkWithEvent(const char* itemname)
00037 {
00038    EventLbl->setText(itemname);
00039 
00040    bool ismbs = strstr(itemname,defMbsEventName)!=0;
00041 
00042    MbsPrintBox->setEnabled(ismbs);
00043    TString mbsitem = Browser()->FindItemInAnalysis(defMbsEventName);
00044    MbsButton->setEnabled(!ismbs && (mbsitem.Length()>0));
00045    setFocus();
00046 }
00047 
00048 void TGo4EventInfo::ResetWidget()
00049 {
00050    QGo4Widget::ResetWidget();
00051    EventLbl->setText("");
00052    MbsButton->setEnabled(true);
00053 //   if (Browser()!=0) {
00054 //     TString mbsitem = Browser()->FindItemInAnalysis(defMbsEventName);
00055 //     MbsButton->setEnabled(mbsitem.Length()>0);
00056 //   } else
00057 //     MbsButton->setEnabled(false);
00058    MbsPrintBox->setEnabled(FALSE);
00059 }
00060 
00061 void TGo4EventInfo::linkedObjectUpdated(const char* linkname, TObject* obj)
00062 {
00063    TTree* tr = dynamic_cast<TTree*>(obj);
00064    if (tr!=0) {
00065       tr->Show(0);
00066       return;
00067    }
00068 
00069    if (obj!=0) {
00070       obj->Print();
00071       return;
00072    }
00073 }
00074 
00075 void TGo4EventInfo::linkedObjectRemoved(const char* linkname)
00076 {
00077 }
00078 
00079 
00080 void TGo4EventInfo::RefreshClicked()
00081 {
00082    RemoveAllLinks();
00083 
00084    if (EventLbl->text().length()==0) return;
00085    QString evname = EventLbl->text();
00086    bool isremote = RemoteButton->isChecked();
00087    bool istree = TreeButton->isChecked();
00088 
00089    TGo4Slot* tgtslot = 0;
00090    if (!isremote)
00091      tgtslot = AddSlot("Event");
00092 
00093    TGo4BrowserProxy* br = Browser();
00094    if (br!=0)
00095       br->RequestEventStatus(evname.latin1(), istree, tgtslot);
00096 }
00097 
00098 void TGo4EventInfo::PrintEventClicked()
00099 {
00100    if (EventLbl->text().length()==0) return;
00101 
00102    TString folder, name;
00103    TGo4Slot::ProduceFolderAndName(EventLbl->text().latin1(), folder, name);
00104 
00105    TGo4AnalysisProxy* anal  = GetAnalysis(EventLbl->text().latin1());
00106 
00107    if (anal!=0)
00108      anal->RemotePrintEvent(name.Data(),
00109                             PrintEventNum->value(),
00110                             PrintEventSid->value(),
00111                             HexBox->isChecked(),
00112                             LongBox->isChecked());
00113 }
00114 
00115 void TGo4EventInfo::MbsButton_clicked()
00116 {
00117    TString itemname = Browser()->FindItemInAnalysis(defMbsEventName);
00118    if (itemname.Length()>0)
00119      WorkWithEvent(itemname.Data());
00120 }
00121 
00122 //----------------------------END OF GO4 SOURCE FILE ---------------------

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