Changeset 9435 for trunk/MagicSoft/Cosy/tcpip
- Timestamp:
- 04/29/09 13:05:42 (16 years ago)
- Location:
- trunk/MagicSoft/Cosy/tcpip
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/tcpip/MCeCoCom.cc
r9432 r9435 42 42 bool MCeCoCom::InterpreteReport(TString &str) 43 43 { 44 if (!str.EndsWith("OVER")) 45 { 46 cout << "Communication Problem: Termination (OVER) not found." << endl; 47 fComStat = kComProblem; 48 return false; 49 } 50 44 51 int y, m, d, h, min, s, ms, len; 45 52 … … 74 81 return false; 75 82 } 83 /* 76 84 str.Remove(0, len); 77 85 … … 82 90 return false; 83 91 } 92 */ 84 93 85 94 fHumidity = hum; … … 142 151 143 152 // Send report to CC 144 const bool rc = Send(msg , strlen(msg));153 const bool rc = Send(msg.Data(), msg.Length()); 145 154 fComStat = rc ? kNoCmdReceived : kComProblem; 146 155 -
trunk/MagicSoft/Cosy/tcpip/MDriveCom.cc
r8998 r9435 148 148 { 149 149 cout << "CC-COMMAND " << MTime(-1) << " TPOIN " << str << endl; 150 151 if (fQueue) 152 fQueue->PostMsg(WM_TPOINT);//, (void*)str.Data(), str.Length()+1); 153 154 return true; 155 } 156 157 bool MDriveCom::CommandSTGMD(TString &str) 158 { 159 cout << "CC-COMMAND " << MTime(-1) << "STGMD" << endl; 160 161 if (fQueue) 162 fQueue->PostMsg(WM_STARGMODE);//, (void*)str.Data(), str.Length()+1); 163 150 164 return true; 151 165 } … … 220 234 if (cmd==(TString)"ARM") 221 235 return CommandARM(str); 236 237 if (cmd==(TString)"STGMD") 238 return CommandSTGMD(str); 222 239 223 240 if (cmd.IsNull() && str.IsNull()) … … 278 295 str += armed ? "1 " : "0 "; 279 296 280 return SendRep("DRIVE-REPORT", str , kFALSE);297 return SendRep("DRIVE-REPORT", str.Data(), kFALSE); 281 298 } 282 299 … … 286 303 } 287 304 288 bool MDriveCom::SendStargReport(UInt_t stat, ZdAz miss, ZdAz nompos, Ring center, Int_t num, Int_t n, Double_t bright, Double_t mjd, Double_t x, Double_t y)305 bool MDriveCom::SendStargReport(UInt_t stat, ZdAz miss, ZdAz nompos, Ring center, Int_t num, Int_t n, Double_t bright, Double_t mjd, Int_t numleds, Int_t numrings) 289 306 { 290 307 // miss [deg] … … 305 322 str += MString::Format("%05.3f ", miss.Zd()); //[arcmin] 306 323 str += MString::Format("%05.3f ", miss.Az()); //[arcmin] 307 Print(str, nompos.Zd()); //[deg]308 Print(str, nompos.Az()); //[deg]309 str += MString::Format("%05.1f ", center.GetX()); // number310 str += MString::Format("%05.1f ", center.GetY()); // number311 str += MString::Format("%04d ", n); // number of correleated stars312 str += MString::Format("%03.1f ", bright); 324 Print(str, nompos.Zd()); //[deg] 325 Print(str, nompos.Az()); //[deg] 326 str += MString::Format("%05.1f ", center.GetX()); // 327 str += MString::Format("%05.1f ", center.GetY()); // 328 str += MString::Format("%04d ", n); // number of correleated stars 329 str += MString::Format("%03.1f ", bright); // arbitrary sky brightness 313 330 str += MString::Format("%12.6f ", t.GetMjd()); // mjd 314 str += MString::Format("% .1f ", x);315 str += MString::Format("% .1f ", y);316 str += MString::Format("%04d ", num); // number of detected stars331 str += MString::Format("%d ", numleds); // number of detected leds 332 str += MString::Format("%d ", numrings); // number of detected rings 333 str += MString::Format("%04d ", num); // number of detected stars 317 334 318 335 return SendRep("STARG-REPORT", str, kTRUE); … … 321 338 bool MDriveCom::SendTPoint(UInt_t stat) 322 339 { 340 //const MTime t(-1); 341 342 SetStatus(stat); 323 343 /* 324 // miss [deg] 325 // nompos [deg] 326 const MTime t(-1); 327 328 miss *= 60; // [arcmin] 329 330 // Set status flag 331 if (stat&kError) 332 SetStatus(0); 333 if (stat&kStandby) 334 SetStatus(2); 335 if (stat&kMonitoring) 336 SetStatus(4); 337 338 MString txt; 339 340 TString str; 341 str += txt.Print("%05.3f ", miss.Zd()); //[arcmin] 342 str += txt.Print("%05.3f ", miss.Az()); //[arcmin] 343 Print(str, nompos.Zd()); //[deg] 344 Print(str, nompos.Az()); //[deg] 345 str += txt.Print("%05.1f ", center.GetX()); //number 346 str += txt.Print("%05.1f ", center.GetY()); //number 347 str += txt.Print("%04d ", n); //number of correleated stars 348 str += txt.Print("%03.1f ", bright); 349 str += txt.Print("%12.6f ", t.GetMjd()); // mjd 350 str += txt.Print("%.1f ", x); 351 str += txt.Print("%.1f ", y); 352 str += txt.Print("%04d ", num); //number of detected stars 353 */ 354 344 TString str; 345 str += name; // star name 346 str += " "; 347 str += nominalaz; 348 str += nominalel; 349 str += realaz; 350 str += realel; 351 str += nomra; 352 str += nomdec; 353 str += diffaz; 354 str += diffel; 355 str += mjd; 356 str += numleds; 357 str += artmag; 358 */ 355 359 return SendRep("TPOINT-REPORT", "", kTRUE); 356 360 } -
trunk/MagicSoft/Cosy/tcpip/MDriveCom.h
r8869 r9435 29 29 bool CommandARM(TString &str); 30 30 bool CommandTPOINT(TString &str); 31 bool CommandSTGMD(TString &str); 31 32 32 33 public: … … 49 50 50 51 bool SendReport(UInt_t stat, RaDec rd, ZdAz so, ZdAz is, ZdAz er, Bool_t armed); 51 bool SendStargReport(UInt_t stat, ZdAz miss, ZdAz nompos, Ring center, Int_t num, Int_t n, Double_t bright, Double_t mjd, Double_t x, Double_t y);52 bool SendStargReport(UInt_t stat, ZdAz miss, ZdAz nompos, Ring center, Int_t num, Int_t n, Double_t bright, Double_t mjd, Int_t numleds, Int_t numrings); 52 53 bool SendTPoint(UInt_t stat); 53 54 bool SendStatus(const char *stat);
Note:
See TracChangeset
for help on using the changeset viewer.