Changeset 8840 for trunk/MagicSoft/Cosy
- Timestamp:
- 01/30/08 15:41:38 (17 years ago)
- Location:
- trunk/MagicSoft/Cosy/tcpip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/tcpip/MCeCoCom.cc
r8378 r8840 2 2 3 3 #include <iostream> 4 5 #include "MLog.h" 4 6 5 7 #include "MString.h" … … 7 9 using namespace std; 8 10 11 /* 12 // THIS COULD NEVER WORK BECAUSE IT IGNORES WHETHER 13 // WE SEND STARGUIDER OR DRIVE REPORTS! 14 bool MCeCoCom::SendMsg(const char *msg, bool force=kFALSE) 15 { 16 const MTime t(-1); 17 18 if ((double)t-(double)fTime<0.001*fSendInterval && !force) 19 return true; 20 21 if (lout.Lock("MTcpIpIO::Send")) 22 { 23 //const Int_t rc = lout.IsOutputDeviceEnabled(MLog::eGui); 24 //lout.DisableOutputDevice(MLog::eGui); 25 lout << msg << flush; 26 lout.UnLock("MTcpIpIO::Send"); 27 //if (rc) 28 // lout.EnableOutputDevice(MLog::eGui); 29 } 30 31 fTime = t; 32 33 return Send(msg, strlen(msg)); 34 } 35 */ 9 36 bool MCeCoCom::InterpreteCmd(TString cmd, TString str) 10 37 { … … 114 141 str); 115 142 116 const bool rc = MTcpIpIO::Send(msg, force); 143 // Send report to CC 144 const bool rc = Send(msg, strlen(msg)); 117 145 fComStat = rc ? kNoCmdReceived : kComProblem; 146 147 // Write report to stream 148 if (fOut) 149 if (fOut->Lock("MTcpIpIO::Send")) 150 { 151 *fOut << msg << flush; 152 fOut->UnLock("MTcpIpIO::Send"); 153 } 154 118 155 return rc; 119 156 } -
trunk/MagicSoft/Cosy/tcpip/MCeCoCom.h
r8378 r8840 24 24 }; 25 25 26 //TString fCommand; // report string of the current system 26 MLog *fOut; // Stream to which reports are written in addition 27 28 // Int_t fSendInterval; // [ms] 29 // MTime fTime; 30 27 31 MTime fT; // time of last report received 28 32 char fStatus; // current status of this system … … 44 48 45 49 public: 46 MCeCoCom::MCeCoCom(const char *cmd, MLog &out=gLog) 47 : MTcpIpIO(out), /*fCommand(cmd),*/ fStatus(0), fComStat(kNoCmdReceived), fSolarRadiation(-1) 50 MCeCoCom(MLog *out) 51 : MTcpIpIO(7304, 7404), fOut(out), fStatus(0), fComStat(kNoCmdReceived), 52 fHumidity(0), fTemperature(0), fWindSpeed(0), fSolarRadiation(-1), 53 fAlarmCounter(0) 48 54 { 49 55 } 56 //virtual bool SendMsg(const char *msg, bool force); 50 57 51 58 bool SendRep(const char *cmd, const char *str, bool force);
Note:
See TracChangeset
for help on using the changeset viewer.