00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4TaskHandlerStatus.h"
00017
00018 #include "Riostream.h"
00019
00020 #include "TGo4Log.h"
00021
00022 TGo4TaskHandlerStatus::TGo4TaskHandlerStatus() :
00023 TGo4Status(),
00024 fxComName(),
00025 fxStatName(),
00026 fxDatName(),
00027 fxHostName(),
00028 fuNegPort(0),
00029 fiComPort(0),
00030 fiStatPort(0),
00031 fiDatPort(0),
00032 fbIsAborting(kFALSE)
00033 {
00034 }
00035
00036 TGo4TaskHandlerStatus::TGo4TaskHandlerStatus(const char* name) :
00037 TGo4Status(name),
00038 fxComName(),
00039 fxStatName(),
00040 fxDatName(),
00041 fxHostName(),
00042 fuNegPort(0),
00043 fiComPort(0),
00044 fiStatPort(0),
00045 fiDatPort(0),
00046 fbIsAborting(kFALSE)
00047
00048 {
00049 }
00050
00051 TGo4TaskHandlerStatus::~TGo4TaskHandlerStatus()
00052 {
00053 }
00054
00055 Int_t TGo4TaskHandlerStatus::PrintStatus(Text_t* buffer, Int_t buflen)
00056 {
00057 if(buflen<=0 && buffer!=0)
00058 return 0;
00059 Int_t locallen=4096;
00060 Text_t localbuf[4096];
00061 Text_t* current=localbuf;
00062 Int_t restlen=locallen;
00063 Int_t size=0;
00064 current=PrintBuffer(current,restlen, "G-OOOO-> TaskHandler Status Class %s Printout: <-OOOO-G\n",GetName());
00065 current=PrintBuffer(current,restlen, "G-OOOO-> --------------------------------------------------------------------- <-OOOO-G\n");
00066 current=PrintBuffer(current,restlen, "G-OOOO-> Remote Server: %s\n",GetHostName());
00067 current=PrintBuffer(current,restlen, "G-OOOO-> Negotiation Port: %d\n",fuNegPort);
00068 current=PrintBuffer(current,restlen, "G-OOOO-> Command Thread: %s\n",GetComName());
00069 current=PrintBuffer(current,restlen, "G-OOOO-> Command Port: %d\n",fiComPort);
00070 current=PrintBuffer(current,restlen, "G-OOOO-> Data Thread: %s\n",GetDatName());
00071 current=PrintBuffer(current,restlen, "G-OOOO-> Data Port: %d\n",fiDatPort);
00072 current=PrintBuffer(current,restlen, "G-OOOO-> Status Thread: %s\n",GetStatName());
00073 current=PrintBuffer(current,restlen, "G-OOOO-> Status Port: %d\n",fiStatPort);
00074 if(fbIsAborting)
00075 {
00076 current=PrintBuffer(current,restlen, "G-OOOO-> Aborting State: TRUE\n");
00077 }
00078 else
00079 {
00080 current=PrintBuffer(current,restlen, "G-OOOO-> Aborting State: FALSE\n");
00081 }
00082 current=PrintBuffer(current,restlen, "G-OOOO-> END TaskHandler Status Class Printout END <-OOOO-G\n");
00083 if(buffer==0)
00084 {
00085 cout << localbuf << endl;
00086 }
00087 else
00088 {
00089 size=locallen-restlen;
00090 if(size>buflen-1)
00091 size=buflen-1;
00092 strncpy(buffer,localbuf,size);
00093 }
00094 return size;
00095 }
00096
00097 void TGo4TaskHandlerStatus::SetFlags(Bool_t isaborting)
00098 {
00099 fbIsAborting=isaborting;
00100 }
00101
00102 void TGo4TaskHandlerStatus::SetPorts(UInt_t neg, Int_t com, Int_t stat, Int_t dat)
00103 {
00104 fuNegPort=neg;
00105 fiComPort=com;
00106 fiStatPort=stat;
00107 fiDatPort=dat;
00108 }
00109
00110 void TGo4TaskHandlerStatus::SetNames(const char* com, const char* stat, const char* dat, const char* host)
00111 {
00112 fxComName = com;
00113 fxStatName = stat;
00114 fxDatName = dat;
00115 fxHostName = host;
00116 }
00117
00118