00001 #ifndef CONFIGUREFEECOM
00002 #define CONFIGUREFEECOM
00003
00004 #include "SendWithoutCoCo.hpp"
00005 #include "FedCommand.hpp"
00006 #include "FeeIclAck.hpp"
00007 #include "AnswerStruct.hpp"
00008 #include <boost/scoped_ptr.hpp>
00009 #include "ace/Synch.h"
00010 #include "WatchDog.hpp"
00011
00015 #define CONFIGUREFEECOM_STRUCTURE "I:1;I:1;F:1;C:256"
00016
00019 #define CFC_WATCH_DOG_TIMEOUT 10000L
00020
00023 #define SET_FEESERVER_NAMES 0x0001
00024
00027 #define SET_FEESERVICE_NAMES 0x0002
00028
00031 #define SET_LOG_LEVEL 0x0003
00032
00035 #define GET_LOG_LEVEL 0x0004
00036
00039 #define SET_UPDATE_RATE 0x0005
00040
00043 #define GET_UPDATE_RATE 0x0006
00044
00047 #define SET_TIME_OUT 0x0007
00048
00051 #define GET_TIME_OUT 0x0008
00052
00055 #define SET_DEAD_BAND 0x0009
00056
00059 #define GET_DEAD_BAND 0x000A
00060
00064 #define FEESERVER_SET_DEADBAND_FLAG 0x0080 // dec 128
00065
00070 #define FEESERVER_GET_DEADBAND_FLAG 0x0100 // dec 256
00071
00075 #define FEESERVER_SET_ISSUE_TIMEOUT_FLAG 0x0200 // dec 512
00076
00080 #define FEESERVER_GET_ISSUE_TIMEOUT_FLAG 0x0400 // dec 1024
00081
00085 #define FEESERVER_SET_UPDATERATE_FLAG 0x0800 // dec 2048
00086
00090 #define FEESERVER_GET_UPDATERATE_FLAG 0x1000 // dec 4096
00091
00095 #define FEESERVER_SET_LOGLEVEL_FLAG 0x2000 // dec 8192
00096
00100 #define FEESERVER_GET_LOGLEVEL_FLAG 0x4000 // dec 16384
00101
00105 typedef struct ContConfigureFeeCom {
00107 int commandID;
00109 int iTag;
00111 float fTag;
00113 char target[256];
00114
00120 ContConfigureFeeCom& operator=(const ContConfigureFeeCom& rhs){
00121 if(this==&rhs){
00122 return *this;
00123 }
00124 commandID=rhs.commandID;
00125 iTag=rhs.iTag;
00126 fTag=rhs.fTag;
00127 memcpy(target,rhs.target,256);
00128
00129 return *this;
00130
00131 }
00132 }ContConfigureFeeCom;
00133
00134 namespace ztt { namespace dcs{
00135
00146 class ConfigureFeeCom:public FedCommand{
00147
00148 public:
00155 ConfigureFeeCom(char* name,DimCommandHandler* handler):FedCommand(name,CONFIGUREFEECOM_STRUCTURE,handler),keyWatchDog(0),
00156 mutex(),cond(mutex),iclAck(FeeIclAck::createInstance()),mWatchDog("ConfigureFeeCom",&mAnswerStruct,&busy),busy(false){
00157
00158 mWatchDog.activate(THR_DETACHED|THR_NEW_LWP,5,1);
00159
00160 mb = new ACE_Message_Block((char*)&keyWatchDog);
00161 };
00165
00166
00167
00168
00169
00170
00174
00175
00176
00177
00178
00179
00180
00184
00189
00193
00199
00203
00204
00205
00209
00213
00217
00221
00225
00229
00230
00234
00239
00240
00244
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261