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

/Go4GUI/TGo4LogInfoSlots.cxx

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 #include "TGo4LogInfoSlots.h"
00017 
00018 #include "qstring.h"
00019 #include "qdatetime.h"
00020 
00021 #include "Go4GUIRegistry/TGo4GUIRegistry.h"
00022 #include "TGo4LogInfo.h"
00023 #include "TGo4LogInfoObject.h"
00024 #include "TGo4LogInfoStatus.h"
00025 
00026 TGo4LogInfoSlots::TGo4LogInfoSlots(const char * name, const char * title, TGo4LogInfo * p)
00027    : TGo4SlotsBaseClass(name, title), fxTGo4LogInfo(p)
00028 {
00029    // TGo4LockGuard Global;
00030    fxTGo4GUIRegistry = TGo4GUIRegistry::Instance();
00031    fxTGo4LogInfoStatus = new TGo4LogInfoStatus("TGo4LogInfoStatus", "Log Info Status");
00032    fxTGo4GUIRegistry->RegisterSlotClass(this, fxTGo4LogInfoStatus, p);
00033    fxTGo4GUIRegistry->SetLogInfo(this);
00034 }
00035 
00036 TGo4LogInfoSlots::~TGo4LogInfoSlots()
00037 {
00038    delete fxTGo4LogInfoStatus;
00039 }
00040 
00041 void TGo4LogInfoSlots::SetGUI(TGo4LogInfo * GUI)
00042 {
00043    // TGo4LockGuard Global;
00044    fxTGo4LogInfo=GUI;
00045    fxTGo4GUIRegistry->GuiIsChanged(this, GUI);
00046 }
00047 
00048 
00049 void TGo4LogInfoSlots::StatusChanged(TGo4Status * Status)
00050 {
00051    // TGo4LockGuard Global;
00052    QDateTime dt= QDateTime::currentDateTime();
00053    QString Name = Status->GetName();
00054    QString date = dt.toString("dd.MM.yy  ");
00055    QString time = dt.toString("hh.mm.ss  ");
00056 
00057    fxTGo4LogInfoStatus->AddLogInfo(new TGo4LogInfoObject(Status->GetName(),Status->GetTitle(),time.data(),date.data()));
00058    if(fxTGo4LogInfo!=0)
00059      fxTGo4LogInfo->NewText(Name, date, time);
00060    delete Status;
00061 }
00062 
00063 void TGo4LogInfoSlots::DisplayLogInfo(const char* Name, const char* Date, const char* Time)
00064 {
00065    if(fxTGo4LogInfo!=0)
00066      fxTGo4LogInfo->NewText(Name, Date, Time);
00067 }
00068 
00069 void TGo4LogInfoSlots::RestoreInfo()
00070 {
00071    // TGo4LockGuard Global;
00072 
00073    TObject *entry = 0;
00074    TIter iter(fxTGo4LogInfoStatus->GetLogInfo());
00075    while((entry = iter()) !=0) {
00076        TGo4LogInfoObject* fxTGo4LogInfoObject = dynamic_cast<TGo4LogInfoObject *> (entry);
00077        if (fxTGo4LogInfoObject==0) continue;
00078        QString Name = fxTGo4LogInfoObject->GetName();
00079        QString Date = fxTGo4LogInfoObject->GetLogDate();
00080        QString Time = fxTGo4LogInfoObject->GetLogTime();
00081        if(fxTGo4LogInfo!=0)
00082          fxTGo4LogInfo->NewText(Name, Date, Time);
00083    }
00084 }
00085 
00086 void TGo4LogInfoSlots::ClearLogInfo()
00087 {
00088    fxTGo4LogInfo->ClearText();
00089 }
00090 
00091 void TGo4LogInfoSlots::SaveToFile(const char *filename)
00092 {
00093 }
00094 
00095 TGo4LogInfoStatus * TGo4LogInfoSlots::GetStatus()
00096 {
00097    // TGo4LockGuard Global;
00098    return fxTGo4LogInfoStatus;
00099 }
00100 
00101 //----------------------------END OF GO4 SOURCE FILE ---------------------

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