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

Last change on this file since 2615 was 2615, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 1.3 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 MARS_MTime
13#include "MTime.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 MTime 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; // [deg] celsius
35 Float_t fWindSpeed; // [km/h]
36 Float_t fSolarRadiation; // [W/m^2] IR-Radiation
37
38 virtual bool InterpreteCmd(TString cmd, TString str);
39
40 bool InterpreteReport(TString &str);
41 bool InterpreteStr(TString str);
42
43public:
44 MCeCoCom::MCeCoCom(const char *cmd, MLog &out=gLog)
45 : MTcpIpIO(out), fCommand(cmd), fStatus(0), fComStat(kNoCmdReceived)
46 {
47 }
48
49 bool Send(const char *str);
50 void SetStatus(Byte_t s) { fStatus=s; }
51
52 Float_t GetHumidity() const { return fHumidity; }
53 Float_t GetTemperature() const { return fTemperature; }
54};
55
56#endif
Note: See TracBrowser for help on using the repository browser.