| Line | |
|---|
| 1 | #ifndef COSY_MCeCoCom
|
|---|
| 2 | #define COSY_MCeCoCom
|
|---|
| 3 |
|
|---|
| 4 | #ifndef ROOT_TString
|
|---|
| 5 | #include <TString.h>
|
|---|
| 6 | #endif
|
|---|
| 7 |
|
|---|
| 8 | #ifndef COSY_MTcpIpIO
|
|---|
| 9 | #include "MTcpIpIO.h"
|
|---|
| 10 | #endif
|
|---|
| 11 |
|
|---|
| 12 | #ifndef COSY_Timer
|
|---|
| 13 | #include "timer.h"
|
|---|
| 14 | #endif
|
|---|
| 15 |
|
|---|
| 16 | class MCeCoCom : public MTcpIpIO
|
|---|
| 17 | {
|
|---|
| 18 | private:
|
|---|
| 19 | enum ComStatus_t
|
|---|
| 20 | {
|
|---|
| 21 | kCmdReceived,
|
|---|
| 22 | kNoCmdReceived,
|
|---|
| 23 | kComProblem
|
|---|
| 24 | };
|
|---|
| 25 |
|
|---|
| 26 | TString fCommand; // report string of the current system
|
|---|
| 27 | Timer fT; // time of last report received
|
|---|
| 28 | char fStatus; // current status of this system
|
|---|
| 29 | int fCCStatus; // global status of CC
|
|---|
| 30 |
|
|---|
| 31 | ComStatus_t fComStat; // communication status
|
|---|
| 32 |
|
|---|
| 33 | virtual bool InterpreteCmd(TString cmd, TString str);
|
|---|
| 34 |
|
|---|
| 35 | bool InterpreteStr(TString str);
|
|---|
| 36 |
|
|---|
| 37 | public:
|
|---|
| 38 | MCeCoCom::MCeCoCom(const char *cmd, MLog &out=gLog)
|
|---|
| 39 | : MTcpIpIO(out), fCommand(cmd), fStatus(0), fComStat(kNoCmdReceived)
|
|---|
| 40 | {
|
|---|
| 41 | }
|
|---|
| 42 |
|
|---|
| 43 | bool Send(const char *str);
|
|---|
| 44 | void SetStatus(Byte_t s) { fStatus=s; }
|
|---|
| 45 | };
|
|---|
| 46 |
|
|---|
| 47 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.