Changeset 9550 for trunk/MagicSoft/Cosy/tcpip
- Timestamp:
- 02/23/10 10:17:52 (15 years ago)
- Location:
- trunk/MagicSoft/Cosy/tcpip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/tcpip/MDriveCom.cc
r9522 r9550 135 135 } 136 136 137 Int_t id, len; // Starguider switched on or not138 Float_t dra, ddec;139 Int_t n=sscanf(str.Data(), "%d %f %f %n", &id, & dra, &ddec, &len);137 Int_t id, len; 138 Float_t offset, angle; 139 Int_t n=sscanf(str.Data(), "%d %f %f %n", &id, &offset, &angle, &len); 140 140 if (n!=3) 141 141 { … … 153 153 } 154 154 155 gLog << all << "CC-COMMAND " << MTime(-1) << " CELEST ID=" << id << " dRa=" << dra << "deg dDec=" << ddec<< "deg" << endl;155 gLog << all << "CC-COMMAND " << MTime(-1) << " CELEST ID=" << id << " WobbleOffset=" << offset << "deg WobbleAngle=" << angle << "deg" << endl; 156 156 157 157 if (id==0) … … 167 167 } 168 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)); 177 //cout << "MDriveCom - POSITION... done." << endl; 169 Double_t data[3] = { id, offset, angle }; 170 171 //cout << "MDriveCom - CELEST... start." << endl; 172 if (fQueue) 173 fQueue->PostMsg(WM_CELEST, data, sizeof(Double_t)*3); 174 //cout << "MDriveCom - CELEST... done." << endl; 175 return true; 176 } 177 178 bool MDriveCom::CommandMOON(TString &str) 179 { 180 str = str.Strip(TString::kBoth); 181 if (str.IsNull()) 182 { 183 gLog << err << "ERROR - MOON command empty." << endl; 184 return false; 185 } 186 187 Int_t len; 188 Float_t wobble, offset; 189 Int_t n=sscanf(str.Data(), "%f %f %n", &wobble, &offset, &len); 190 if (n!=2) 191 { 192 gLog << warn << "WARNING - Not enough argmuents (MOON)." << endl; 193 return kCONTINUE; 194 } 195 196 str.Remove(0, len); 197 str = str.Strip(TString::kBoth); 198 199 if (!str.IsNull()) 200 { 201 gLog << err << "ERROR - Too many bytes in command MOON" << endl; 202 return false; 203 } 204 205 gLog << all << "CC-COMMAND " << MTime(-1) << " MOON WobbleOffset=" << wobble << "deg ShadowOffset=" << offset << "deg" << endl; 206 207 Double_t data[2] = { wobble, offset }; 208 209 //cout << "MDriveCom - MOON... start." << endl; 210 if (fQueue) 211 fQueue->PostMsg(WM_MOON, data, sizeof(Double_t)*2); 212 //cout << "MDriveCom - MOON... done." << endl; 178 213 return true; 179 214 } … … 300 335 if (cmd==(TString)"CELEST") 301 336 return CommandCELEST(str); 337 338 if (cmd==(TString)"MOON") 339 return CommandMOON(str); 302 340 303 341 if (cmd==(TString)"PREPS") -
trunk/MagicSoft/Cosy/tcpip/MDriveCom.h
r9516 r9550 31 31 bool CommandZDAZ(TString &str); 32 32 bool CommandCELEST(TString &str); 33 bool CommandMOON(TString &str); 33 34 bool CommandPREPS(TString &str); 34 35 bool CommandARM(TString &str);
Note:
See TracChangeset
for help on using the changeset viewer.