Changeset 9432 for trunk/MagicSoft
- Timestamp:
- 04/22/09 10:46:59 (16 years ago)
- Location:
- trunk/MagicSoft/Cosy
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/Changelog
r9418 r9432 1 1 -*-*- END -*-*- 2 3 2009/04/22 Thomas Bretz (La Palma) 4 5 * .cosyrc_magic2, prepos_magic2.txt, leds_magic2.txt: 6 - added 7 8 * devdrv/dkc.cc: 9 - added some initialisation in the constructor 10 - added Warning E256 11 12 * devdrv/shaftencoder.cc: 13 - removed fTurn 14 - removed fDirChangedPos 15 - removed inter-connection with macs/dkc 16 - added a sanity check for fLabel 17 - removed obsolete functions 18 19 * tcpip/MCeCoCom.[h,cc]: 20 - added telescope number to reports 21 22 * tcpip/MTcpIpIO.[h,cc]: 23 - reopen send socket if invalid 24 - added some debug output 25 - make the timeout a variable 26 27 2 28 3 29 2009/04/01 Thomas Bretz … … 19 45 20 46 21 47 22 48 2009/01/14 Thomas Bretz 23 49 24 50 * slalib/dat.c: 25 51 - added leap second 26 27 28 52 53 54 29 55 2008/08/26 Thomas Bretz (La Palma) 30 56 -
trunk/MagicSoft/Cosy/tcpip/MCeCoCom.cc
r8998 r9432 133 133 134 134 const TString msg = 135 MString::Format("%s "135 MString::Format("%s M%d " 136 136 "%02d %04d %02d %02d %02d %02d %02d %03d " 137 137 "%02d %04d %02d %02d %02d %02d %02d %03d " 138 "%s\n", cmd, 138 "%s\n", cmd, fTelescope, 139 139 fStatus, y1, mon1, d1, h1, m1, s1, ms1, 140 140 fComStat, y2, mon2, d2, h2, m2, s2, ms2, -
trunk/MagicSoft/Cosy/tcpip/MCeCoCom.h
r8869 r9432 33 33 int fCCStatus; // global status of CC 34 34 35 Byte_t fTelescope; 36 35 37 ComStatus_t fComStat; // communication status 36 38 … … 49 51 public: 50 52 MCeCoCom(const char *addr, const int tx=7304, const int rx=7404, MLog *out=NULL) 51 : MTcpIpIO(addr, tx, rx), fOut(out), fStatus(0), fComStat(kNoCmdReceived), 53 : MTcpIpIO(addr, tx, rx), fOut(out), fStatus(0), 54 fTelescope(1), fComStat(kNoCmdReceived), 52 55 fHumidity(0), fTemperature(0), fWindSpeed(0), fSolarRadiation(-1), 53 56 fAlarmCounter(0) … … 60 63 bool SendRep(const char *cmd, const char *str, bool force); 61 64 void SetStatus(Byte_t s) { fStatus=s; } 65 66 void SetTelescope(Byte_t tel) { fTelescope = tel; } 62 67 63 68 Float_t GetHumidity() const { return fHumidity; } -
trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.cc
r8869 r9432 15 15 16 16 #undef DEBUG 17 //#define DEBUG 17 18 18 19 using namespace std; … … 40 41 */ 41 42 42 MTcpIpO::MTcpIpO(const char *addr, Int_t tx) 43 { 43 MTcpIpO::MTcpIpO(const char *addr, Int_t tx) : fPortTx(tx) 44 { 45 gLog << inf2 << "- Open send socket to " << addr << ":" << tx << endl; 44 46 fTxSocket = new TSocket(addr, tx); 45 47 } … … 147 149 bool MTcpIpO::Send(const char *msg, Int_t len) 148 150 { 151 if (!fTxSocket->IsValid()) 152 { 153 const TInetAddress &a = fTxSocket->GetInetAddress(); 154 if (!a.IsValid()) 155 return false; 156 #ifdef DEBUG 157 cout << "- Reopen send socket to " << a.GetHostAddress() << ":" << fPortTx << endl; 158 #endif 159 delete fTxSocket; 160 fTxSocket = new TSocket(a.GetHostAddress(), fPortTx); 161 } 162 149 163 return SendFrame(*fTxSocket, msg, len); 150 164 } … … 206 220 fConnectionEstablished = kTRUE; 207 221 208 MTimeout timeout ;222 MTimeout timeout(fTimeout); 209 223 210 224 // Get connection on port fPortRx and redirected … … 228 242 if (timeout.HasTimedOut()) 229 243 { 230 gLog << warn << MTime(-1) << " WARNING - Connection to " << MTcpIpO::GetSocketAddress(sock) << " timed out ." << endl;244 gLog << warn << MTime(-1) << " WARNING - Connection to " << MTcpIpO::GetSocketAddress(sock) << " timed out after " << fTimeout << "ms." << endl; 231 245 return kFALSE; 232 246 } … … 285 299 fConnectionEstablished = kFALSE; 286 300 301 #ifdef DEBUG 302 cout << "===> DEL SOCKET" << endl; 303 #endif 287 304 delete socket; 288 305 } … … 314 331 } 315 332 333 #ifdef DEBUG 334 cout << "===> DEL SERVER" << endl; 335 #endif 316 336 delete server; 317 337 -
trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.h
r8865 r9432 44 44 TSocket *fTxSocket; 45 45 46 Int_t fPortTx; 47 46 48 public: 47 49 MTcpIpO(const char *addr, Int_t tx);
Note:
See TracChangeset
for help on using the changeset viewer.