00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4ControllerRunnable.h"
00017
00018 #include "TGo4Log.h"
00019 #include "TGo4Thread.h"
00020 #include "TGo4ExampleServer.h"
00021 #include "TGo4ExampleController.h"
00022
00023 const UInt_t TGo4ControllerRunnable::fguCOMMANDINTERVAL=10000;
00024
00025 TGo4ControllerRunnable::TGo4ControllerRunnable(const char* name, TGo4ExampleServer* serv)
00026 : TGo4Runnable(name,serv)
00027 {
00028 TRACE((15,"TGo4ControllerRunnable::TGo4ControllerRunnable(Text_t*,TGo4ExampleServer*) constructor",__LINE__, __FILE__));
00029 fxController=serv->GetController();
00030 fxServer=serv;
00031 }
00032
00033 TGo4ControllerRunnable::~TGo4ControllerRunnable()
00034 {
00035 TRACE((15,"TGo4ControllerRunnable::~TGo4ControllerRunnable() destructor",__LINE__, __FILE__));
00036 }
00037
00038 Int_t TGo4ControllerRunnable::Run(void*)
00039 {
00040 TRACE((12,"TGo4ControllerRunnable::Run()",__LINE__, __FILE__));
00041
00042
00043 TGo4TaskHandler* currenttask=fxServer->GetCurrentTaskHandler();
00044 if(currenttask==0)
00045 {
00046 TRACE((11,"TGo4ControllerRunnable::Run()-- no current client existing",__LINE__, __FILE__));
00047 TGo4Thread::Sleep(fguCOMMANDINTERVAL);
00048
00049 }
00050 else
00051 {
00052 TRACE((11,"TGo4ControllerRunnable::Run()-- working on client's taskhandler queues",__LINE__, __FILE__));
00053
00054 TGo4Thread::Sleep(fguCOMMANDINTERVAL);
00055
00056 TGo4Command* com=fxController->GetCommand();
00057 fxServer->SubmitCommand(com);
00058
00059 fxServer->SubmitCommand("EXAction2");
00060 TObject* data= fxServer->NextObject();
00061 fxController->DisplayData(data);
00062 }
00063 return 0;
00064
00065 }
00066
00067