source: trunk/MagicSoft/Cosy/tcpip/MCeCoCom.h@ 2514

Last change on this file since 2514 was 2514, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 1.1 KB
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
16class MCeCoCom : public MTcpIpIO
17{
18private:
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 Float_t fHumidity; // [%]
34 Float_t fTemperature; // degrees celsius
35
36 virtual bool InterpreteCmd(TString cmd, TString str);
37
38 bool InterpreteStr(TString str);
39
40public:
41 MCeCoCom::MCeCoCom(const char *cmd, MLog &out=gLog)
42 : MTcpIpIO(out), fCommand(cmd), fStatus(0), fComStat(kNoCmdReceived)
43 {
44 }
45
46 bool Send(const char *str);
47 void SetStatus(Byte_t s) { fStatus=s; }
48
49 Float_t GetHumidity() const { return fHumidity; }
50 Float_t GetTemperature() const { return fTemperature; }
51};
52
53#endif
Note: See TracBrowser for help on using the repository browser.