Changeset 12599
- Timestamp:
- 11/21/11 13:10:55 (13 years ago)
- Location:
- trunk/Cosy/tcpip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosy/tcpip/MDriveCom.cc
r9550 r12599 268 268 if (fQueue) 269 269 fQueue->Proc(WM_STARGMODE, &on); 270 271 return true; 272 } 273 274 bool MDriveCom::CommandLEDS(TString &str) 275 { 276 gLog << all << "CC-COMMAND " << MTime(-1) << " LEDS " << str << endl; 277 278 str = str.Strip(TString::kBoth); 279 if (str.IsNull()) 280 { 281 gLog << err << "ERROR - LEDS command empty." << endl; 282 return false; 283 } 284 285 Int_t len; 286 Long_t u[2]; 287 Int_t n=sscanf(str.Data(), "%ld %ld %n", &u[0], &u[1], &len); 288 if (n!=2) 289 { 290 gLog << warn << "WARNING - Not enough argmuents (LEDS)." << endl; 291 return kCONTINUE; 292 } 293 294 str.Remove(0, len); 295 str = str.Strip(TString::kBoth); 296 297 if (!str.IsNull()) 298 { 299 gLog << err << "ERROR - Too many bytes in command LEDS" << endl; 300 return false; 301 } 302 303 304 if (fQueue) 305 fQueue->Proc(WM_LEDS, u); 270 306 271 307 return true; … … 351 387 return CommandSTGMD(str); 352 388 389 if (cmd==(TString)"LEDS") 390 return CommandLEDS(str); 391 392 if (cmd==(TString)"KEEP_ALIVE") 393 { 394 gLog << dbg << MTime(-1) << " KEEP_ALIVE" << endl; 395 return true; 396 } 397 353 398 if (cmd.IsNull() && str.IsNull()) 354 399 { … … 371 416 } 372 417 373 bool MDriveCom::SendReport(UInt_t stat, RaDec rd, double ha, ZdAz so, ZdAz is, ZdAz er, Bool_t armed, Int_t stargmd)418 bool MDriveCom::SendReport(UInt_t stat, Double_t mjd, RaDec rd, double ha, ZdAz so, ZdAz is, ZdAz er, Bool_t armed, Int_t stargmd, UInt_t pdo3) 374 419 { 375 420 // rd [rad] … … 377 422 // is [deg] 378 423 // er [rad] 379 const MTime t(-1);380 381 424 rd *= kRad2Deg; 382 425 so *= kRad2Deg; 426 #ifdef FACT 427 er *= kRad2Deg*3600; 428 #else 383 429 er *= kRad2Deg; 430 #endif 384 431 385 432 rd.Ra(rd.Ra()/15); … … 399 446 Print(str, rd.Dec()); // Dec 400 447 Print(str, ha); // HA 401 str += MString::Format("%12.6f ", t.GetMjd()); // mjd 448 //str += MString::Format("%12.6f ", mjd==0 ? MTime(-1).GetMjd() : mjd); // mjd 449 str += MString::Format("%12.6f ", mjd); // mjd 402 450 Print(str, so.Zd()); 403 451 Print(str, so.Az()); … … 408 456 str += armed ? "1 " : "0 "; 409 457 str += MString::Format("%d ", stargmd); // Starguider mode: 0=none, 1=starguider, 2=starguider off 458 str += MString::Format("%x ", pdo3); 410 459 411 460 return SendRep("DRIVE-REPORT", str.Data(), kFALSE); -
trunk/Cosy/tcpip/MDriveCom.h
r9550 r12599 36 36 bool CommandTPOINT(TString &str); 37 37 bool CommandSTGMD(TString &str); 38 bool CommandLEDS(TString &str); 38 39 39 40 public: … … 55 56 56 57 57 bool SendReport(UInt_t stat, RaDec rd, double ha, ZdAz so, ZdAz is, ZdAz er, Bool_t armed, Int_t stargmd);58 bool SendReport(UInt_t stat, Double_t mjd, RaDec rd, double ha, ZdAz so, ZdAz is, ZdAz er, Bool_t armed, Int_t stargmd, UInt_t pdo3); 58 59 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); 59 60 bool SendTPoint(bool stat, char type, Float_t mag, const char *name, const AltAz &za0, const ZdAz &za1,
Note:
See TracChangeset
for help on using the changeset viewer.