Changeset 4865 for trunk/MagicSoft/Cosy/tcpip
- Timestamp:
- 09/05/04 18:56:47 (20 years ago)
- Location:
- trunk/MagicSoft/Cosy/tcpip
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/tcpip/MCeCoCom.cc
r4105 r4865 90 90 } 91 91 92 bool MCeCoCom::Send(const char *cmd, const char *str )92 bool MCeCoCom::Send(const char *cmd, const char *str, bool force=kFALSE) 93 93 { 94 94 MTime t; … … 113 113 str); 114 114 115 const bool rc = MTcpIpIO::Send(msg );115 const bool rc = MTcpIpIO::Send(msg, force); 116 116 fComStat = rc ? kNoCmdReceived : kComProblem; 117 117 return rc; -
trunk/MagicSoft/Cosy/tcpip/MCeCoCom.h
r4105 r4865 49 49 } 50 50 51 bool Send(const char *cmd, const char *str );51 bool Send(const char *cmd, const char *str, bool force); 52 52 void SetStatus(Byte_t s) { fStatus=s; } 53 53 -
trunk/MagicSoft/Cosy/tcpip/MDriveCom.cc
r4105 r4865 182 182 str += txt.Print("%08.3f", er.Az()); 183 183 184 return Send("DRIVE-REPORT", str );184 return Send("DRIVE-REPORT", str, kFALSE); 185 185 } 186 186 187 187 bool MDriveCom::SendStatus(const char *stat) 188 188 { 189 return Send("DRIVE-STATUS", stat); 190 } 189 return Send("DRIVE-STATUS", stat, kFALSE); 190 } 191 192 bool MDriveCom::SendStargReport(UInt_t stat, ZdAz miss) 193 { 194 195 // miss [rad] 196 const MTime t(-1); 197 198 miss *= kRad2Deg; 199 200 // Set status flag 201 if (stat&kError) 202 SetStatus(0); 203 if (stat&kStopped) 204 SetStatus(1); 205 if (stat&kStandby) 206 SetStatus(2); 207 if (stat&kMonitoring) 208 SetStatus(4); 209 210 MString txt; 211 212 TString str; 213 str += txt.Print("%05.3f ", miss.Zd()); 214 str += txt.Print("%05.3f", miss.Az()); 215 216 return Send("STARG-REPORT", str, kTRUE); 217 218 } 219 220 221 222 223 -
trunk/MagicSoft/Cosy/tcpip/MDriveCom.h
r4076 r4865 31 31 kTracking = 0x04, 32 32 kStopping = 0x08, 33 kStopped = 0x10 33 kStopped = 0x10, 34 kStandby = 0x20, 35 kMonitoring = 0x40 34 36 }; 35 37 36 38 MDriveCom(MsgQueue *q, MLog &out=gLog) : MCeCoCom("DRIVE-REPORT", out), fQueue(q) {} 37 39 38 40 bool SendReport(UInt_t stat, RaDec rd, ZdAz so, ZdAz is, ZdAz er); 41 bool SendStargReport(UInt_t stat, ZdAz miss); 39 42 bool SendStatus(const char *stat); 40 43 }; 41 44 42 45 #endif 46 47 48 49 50 51 52 53 54 55 56 -
trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.cc
r4256 r4865 67 67 } 68 68 69 bool MTcpIpIO::Send(const char *msg) 70 { 69 bool MTcpIpIO::Send(const char *msg, bool force=kFALSE) 70 { 71 71 72 const MTime t(-1); 72 73 73 if ((double)t-(double)fTime<0.001*fSendInterval) 74 return true; 74 if ((double)t-(double)fTime<0.001*fSendInterval && !force) 75 return true; 76 75 77 76 78 if (lout.Lock("MTcpIpIO::Send")) … … 103 105 cout << "Tx: " << msg << flush; 104 106 #endif 107 105 108 return true; 106 109 } -
trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.h
r4076 r4865 32 32 ~MTcpIpIO(); 33 33 34 virtual bool Send(const char *msg );34 virtual bool Send(const char *msg, bool force); 35 35 virtual bool InterpreteStr(TString str); 36 36
Note:
See TracChangeset
for help on using the changeset viewer.