Changeset 9516 for trunk/MagicSoft/Cosy/tcpip
- Timestamp:
- 10/21/09 10:49:36 (15 years ago)
- Location:
- trunk/MagicSoft/Cosy/tcpip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/tcpip/MDriveCom.cc
r9515 r9516 64 64 ra *= 15; // h -> deg 65 65 66 RaDec rd [2] = { RaDec(ra, dec), RaDec(ra, dec) };66 RaDec rd(ra, dec); 67 67 68 68 //cout << "MDriveCom - TRACK... start." << endl; … … 122 122 if (fQueue) 123 123 fQueue->PostMsg(WM_POSITION, &za, sizeof(za)); 124 //cout << "MDriveCom - POSITION... done." << endl; 125 return true; 126 } 127 128 bool MDriveCom::CommandCELEST(TString &str) 129 { 130 str = str.Strip(TString::kBoth); 131 if (str.IsNull()) 132 { 133 gLog << err << "ERROR - CELEST command empty." << endl; 134 return false; 135 } 136 137 Int_t id, len; // Starguider switched on or not 138 Float_t dra, ddec; 139 Int_t n=sscanf(str.Data(), "%d %f %f %n", &id, &dra, &ddec, &len); 140 if (n!=1) 141 { 142 gLog << warn << "WARNING - Not enough argmuents (CELEST)." << endl; 143 return kCONTINUE; 144 } 145 146 str.Remove(0, len); 147 str = str.Strip(TString::kBoth); 148 149 if (!str.IsNull()) 150 { 151 gLog << err << "ERROR - Too many bytes in command CELEST" << endl; 152 return false; 153 } 154 155 gLog << all << "CC-COMMAND " << MTime(-1) << " CELEST ID=" << id << " dRa=" << dra << "deg dDec=" << ddec << "deg" << endl; 156 157 if (id==0) 158 { 159 gLog << err << "ERROR - Tracking the sun IS STRICLY FORBIDDEN - ignored." << endl; 160 return false; 161 } 162 163 if (id<0 || id>9) 164 { 165 gLog << err << "ERROR - Unknown id " << id << " (must be between 1 and 9)." << endl; 166 return false; 167 } 168 169 // Moon; 170 id = 3; 171 172 gLog << warn << "WARNING - Tracking the moon's center forced." << endl; 173 174 //cout << "MDriveCom - POSITION... start." << endl; 175 if (fQueue) 176 fQueue->PostMsg(WM_PLANET, &id, sizeof(id)); 124 177 //cout << "MDriveCom - POSITION... done." << endl; 125 178 return true; … … 245 298 return CommandZDAZ(str); 246 299 300 if (cmd==(TString)"CELEST") 301 return CommandCELEST(str); 302 247 303 if (cmd==(TString)"PREPS") 248 304 return CommandPREPS(str); … … 277 333 } 278 334 279 bool MDriveCom::SendReport(UInt_t stat, RaDec rd, ZdAz so, ZdAz is, ZdAz er, Bool_t armed, Int_t stargmd)335 bool MDriveCom::SendReport(UInt_t stat, RaDec rd, double ha, ZdAz so, ZdAz is, ZdAz er, Bool_t armed, Int_t stargmd) 280 336 { 281 337 // rd [rad] … … 304 360 Print(str, rd.Ra()); // Ra 305 361 Print(str, rd.Dec()); // Dec 306 Print(str, 0);// HA362 Print(str, ha); // HA 307 363 str += MString::Format("%12.6f ", t.GetMjd()); // mjd 308 364 Print(str, so.Zd()); -
trunk/MagicSoft/Cosy/tcpip/MDriveCom.h
r9439 r9516 30 30 bool CommandGRB(TString &str); 31 31 bool CommandZDAZ(TString &str); 32 bool CommandCELEST(TString &str); 32 33 bool CommandPREPS(TString &str); 33 34 bool CommandARM(TString &str); … … 53 54 54 55 55 bool SendReport(UInt_t stat, RaDec rd, ZdAz so, ZdAz is, ZdAz er, Bool_t armed, Int_t stargmd);56 bool SendReport(UInt_t stat, RaDec rd, double ha, ZdAz so, ZdAz is, ZdAz er, Bool_t armed, Int_t stargmd); 56 57 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); 57 // bool SendTPoint(char type);58 58 bool SendTPoint(bool stat, char type, Float_t mag, const char *name, const AltAz &za0, const ZdAz &za1, 59 59 const TVector2 &xy, Float_t dzd, Float_t daz, const MTime &t, 60 60 const Ring ¢er, const Led &star, Int_t numleds, Int_t numrings, 61 61 Int_t numstars=0, Int_t numcor=0, Float_t bright=0); 62 62 63 bool SendStatus(const char *stat); 63 64 };
Note:
See TracChangeset
for help on using the changeset viewer.