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

/Go4GUI/TGo4EventInfo.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 void TGo4EventInfo::init()
00025 {
00026     TGo4LockGuard glob;
00027     setAcceptDrops( TRUE );
00028     fbRefreshMode=false;
00029     fxTGo4GUIRegistry = TGo4GUIRegistry::Instance();
00030     char SlotName[256];
00031     char Caption[256];
00032     snprintf(SlotName,255,"%s%s",name(),"_Slots" );
00033     fxTGo4EventInfoSlots = (TGo4EventInfoSlots *) fxTGo4GUIRegistry->GetSlotClass(SlotName);
00034     if(fxTGo4EventInfoSlots  !=0) {
00035       fxTGo4EventInfoSlots->SetGUI(this);
00036     }else{
00037       fxTGo4EventInfoSlots = new TGo4EventInfoSlots (SlotName, "Slots Class for Qt GUI", this);
00038     }
00039    fxTGo4EventInfoStatus= dynamic_cast <TGo4EventInfoStatus *> (fxTGo4EventInfoSlots->GetStatus());
00040    SetMbsMode(true);
00041    RefreshInfo();
00042    adjustSize();
00043    update();
00044 }
00045 
00046 void TGo4EventInfo::destroy()
00047 {
00048     TGo4LockGuard glob;
00049     fxTGo4GUIRegistry->UnRegisterClass(fxTGo4EventInfoSlots,fxTGo4EventInfoStatus);
00050     delete  fxTGo4EventInfoSlots;
00051 }
00052 
00053 void TGo4EventInfo::closeEvent( QCloseEvent *ce )
00054 {
00055     TGo4LockGuard glob;
00056     ce->accept();
00057     fxTGo4EventInfoSlots->SetGUI(0);
00058     delete this;
00059 }
00060 
00061 
00062 void TGo4EventInfo::RefreshClicked()
00063 {
00064    fxTGo4EventInfoSlots->SendGetCurrentEventCommand();
00065 }
00066 
00067 void TGo4EventInfo::PrintEventClicked()
00068 {
00069     fxTGo4EventInfoSlots->SendSetPrintEventCommand();
00070 }
00071 
00072 
00073 void TGo4EventInfo::dropEvent( QDropEvent * e )
00074 {
00075   TGo4LockGuard glob;
00076   bool remotedrop=false;
00077   QListView *dragsource=dynamic_cast <QListView *> (e->source());
00078    if(dragsource==0) return;
00079    TGo4QItem *dragitem= dynamic_cast <TGo4QItem *>(dragsource->currentItem());
00080     if(dragitem==0) return; // only accept histogram items here
00081     if(strcmp(e->source()->name(),"ListViewRemote")==0)
00082       remotedrop=true;
00083     else
00084       remotedrop=false;
00085    QString name;
00086     QCString plain = "plain";
00087     bool decoded = QTextDrag::decode(e, name, plain);
00088     // otherwise we'll accept any kind of text (like text/uri-list)
00089     if (! decoded) decoded = QTextDrag::decode(e, name);
00090     if(remotedrop)
00091         {
00092             EventStepName->setText(name);
00093             //EventTextDisplay->clear();
00094             RefreshClicked();
00095         }
00096    else
00097         {
00098 
00099         }
00100    dragsource->clearSelection();                                // cleanup selection in case of fast drags
00101    dragsource->setSelected(dragitem,true); // due to changed startdrag in listviews JA
00102    e->acceptAction();
00103 }
00104 
00105 
00106 void TGo4EventInfo::dragEnterEvent( QDragEnterEvent * e )
00107 {
00108   if ( QTextDrag::canDecode( e ))
00109         e->accept();
00110 }
00111 
00112 
00113 bool TGo4EventInfo::IsMbsMode()
00114 {
00115     return fbMbsMode;
00116 }
00117 
00118 
00119 void TGo4EventInfo::SetMbsMode( bool on )
00120 {
00121    if(fbRefreshMode) return; // avoid signal feedback
00122    fbMbsMode=on;
00123    if(on)
00124       EventStepName->setText("MbsEvent-10-1");
00125    else
00126       EventStepName->clear();
00127 }
00128 
00129 
00130 void TGo4EventInfo::SetEventNum( int num )
00131 {
00132    if(fbRefreshMode) return; // avoid signal feedback
00133    fxTGo4EventInfoStatus->SetEventNum(num);
00134 }
00135 
00136 
00137 void TGo4EventInfo::SetMbsSid( int sid )
00138 {
00139    if(fbRefreshMode) return; // avoid signal feedback
00140    fxTGo4EventInfoStatus->SetSubId(sid);
00141 }
00142 
00143 
00144 void TGo4EventInfo::SetMbsLong( bool on )
00145 {
00146    if(fbRefreshMode) return; // avoid signal feedback
00147    fxTGo4EventInfoStatus->SetLong(on);
00148 }
00149 
00150 
00151 void TGo4EventInfo::SetMbsHex( bool on )
00152 {
00153    if(fbRefreshMode) return; // avoid signal feedback
00154    fxTGo4EventInfoStatus->SetHex(on);
00155    fxTGo4EventInfoStatus->SetData(!on);
00156 }
00157 
00158 
00159 void TGo4EventInfo::PrintLogClicked()
00160 {
00161    fxTGo4EventInfoSlots->PrintToLog();
00162 }
00163 
00164 void TGo4EventInfo::RefreshInfo()
00165 {
00166    fbRefreshMode=true; // avoid signal feedback while updating widgets
00167    MbsButton->setChecked(IsMbsMode());
00168    MbsPrintBox->setEnabled(IsMbsMode());
00169    //MbsPrintBox->setShown(IsMbsMode());
00170    MbsPrintBox->setEnabled(IsMbsMode());
00171    //EventTextDisplay->setText(fxTGo4EventInfoStatus->GetEventPrintout());
00172    RemoteButton->setChecked(fxTGo4EventInfoStatus->IsRemoteMode());
00173    TreeButton->setChecked(fxTGo4EventInfoStatus->IsTreeMode());
00174    PrintEventNum->setValue( fxTGo4EventInfoStatus->GetEventNum());
00175    PrintEventSid->setValue( fxTGo4EventInfoStatus->GetSubId());
00176    LongBox->setChecked(fxTGo4EventInfoStatus->IsLong());
00177    HexBox->setChecked(fxTGo4EventInfoStatus->IsHex());
00178    polish();
00179    update();
00180    show();
00181    //adjustSize();
00182    fbRefreshMode=false;
00183 }
00184 
00185 
00186 void TGo4EventInfo::SetEventName( const QString & name )
00187 {
00188    if(fbRefreshMode) return; // avoid signal feedback
00189    QString nomen=name.stripWhiteSpace();
00190    fxTGo4EventInfoStatus->SetEventName(nomen);
00191    // check from name if mbs mode or not:
00192    fbMbsMode=nomen.contains("MbsEvent-10-1");
00193    RefreshInfo();
00194 }
00195 
00196 
00197 void TGo4EventInfo::SetRemoteMode( bool on )
00198 {
00199    fxTGo4EventInfoStatus->SetRemoteMode(on);
00200 }
00201 
00202 
00203 void TGo4EventInfo::SetTreeMode( bool on )
00204 {
00205    fxTGo4EventInfoStatus->SetTreeMode(on);
00206 }
00207 
00208 //----------------------------END OF GO4 SOURCE FILE ---------------------

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