Changeset 4076 for trunk/MagicSoft/Cosy/tcpip/MDriveCom.cc
- Timestamp:
- 05/15/04 16:46:27 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/tcpip/MDriveCom.cc
r2618 r4076 6 6 #include "MAstro.h" 7 7 #include "MCosy.h" 8 #include "MString.h" 8 9 9 10 using namespace std; … … 53 54 } 54 55 55 lout << "CC-COMMAND: Track " << ra << "h " << dec << "deg '" << str 56 << "'" << endl; 56 cout << "CC-COMMAND " << MTime(-1) << " RADEC " << ra << "h " << dec << "d '" << str << "'" << endl; 57 57 58 58 ra *= 15; // h -> deg … … 60 60 RaDec rd[2] = { RaDec(ra, dec), RaDec(ra, dec) }; 61 61 62 cout << "MDriveCom - TRACK... start." << endl;62 //cout << "MDriveCom - TRACK... start." << endl; 63 63 fQueue->PostMsg(WM_TRACK, &rd, sizeof(rd)); 64 cout << "MDriveCom - TRACK... done." << endl;64 //cout << "MDriveCom - TRACK... done." << endl; 65 65 return true; 66 66 } … … 81 81 } 82 82 83 lout << "CC-COMMAND: Move" << zd << "deg " << az << "deg" << endl;83 cout << "CC-COMMAND " << MTime(-1) << " ZDAZ " << zd << "deg " << az << "deg" << endl; 84 84 85 85 ZdAz za(zd, az); 86 86 87 cout << "MDriveCom - POSITION... start." << endl;87 //cout << "MDriveCom - POSITION... start." << endl; 88 88 fQueue->PostMsg(WM_POSITION, &za, sizeof(za)); 89 cout << "MDriveCom - POSITION... done." << endl;89 //cout << "MDriveCom - POSITION... done." << endl; 90 90 return true; 91 91 } … … 95 95 if (cmd==(TString)"WAIT" && str.IsNull()) 96 96 { 97 cout << "MDriveCom - WAIT... start." << endl; 97 //cout << "MDriveCom - WAIT... start." << endl; 98 cout << "CC-COMMAND " << MTime(-1) << " WAIT" << endl; 98 99 fQueue->PostMsg(WM_WAIT); 99 cout << "MDriveCom - WAIT... done." << endl;100 //cout << "MDriveCom - WAIT... done." << endl; 100 101 return true; 101 102 } … … 103 104 if (cmd==(TString)"STOP!" && str.IsNull()) 104 105 { 105 cout << "MDriveCom - STOP!... start." << endl;106 lout << "CC-COMMAND: STOP!" << endl;106 //cout << "MDriveCom - STOP!... start." << endl; 107 cout << "CC-COMMAND " << MTime(-1) << " STOP!" << endl; 107 108 fQueue->PostMsg(WM_STOP); 108 cout << "MDriveCom - STOP!... done." << endl;109 //cout << "MDriveCom - STOP!... done." << endl; 109 110 return true; 110 111 } … … 124 125 if (cmd.IsNull() && str.IsNull()) 125 126 { 126 cout << " Empty command (single '\\n') received." << endl;127 cout << "CC-COMMAND " << MTime(-1) << " Empty command (single '\\n') received." << endl; 127 128 return false; 128 129 } 129 130 130 cout << " Unknown Command: '" << cmd << "':'" << str << "'" << endl;131 cout << "CC-COMMAND " << MTime(-1) << " Syntax error: '" << cmd << "':'" << str << "'" << endl; 131 132 return false; 132 133 } … … 139 140 MAstro::Deg2Dms(deg, sgn, d, m, s); 140 141 141 str += Form("%c %03d %02d %03d ", sgn, d, m, s); 142 MString txt; 143 str += txt.Print("%c %03d %02d %03d ", sgn, d, m, s); 142 144 } 143 145 … … 148 150 // is [deg] 149 151 // er [rad] 152 const MTime t(-1); 150 153 151 154 rd *= kRad2Deg; … … 165 168 SetStatus(4); 166 169 167 MTime t; 168 t.Now(); 170 MString txt; 169 171 170 172 TString str; … … 172 174 Print(str, rd.Dec()); // Dec 173 175 Print(str, 0); // HA 174 str += Form("%12.6f ", t.GetMjd()); // mjd176 str += txt.Print("%12.6f ", t.GetMjd()); // mjd 175 177 Print(str, so.Zd()); 176 178 Print(str, so.Az()); 177 179 Print(str, is.Zd()); 178 180 Print(str, is.Az()); 179 str += Form("%08.3f ", er.Zd());180 str += Form("%08.3f", er.Az());181 str += txt.Print("%08.3f ", er.Zd()); 182 str += txt.Print("%08.3f", er.Az()); 181 183 182 return Send( str);184 return Send("DRIVE-REPORT", str); 183 185 } 186 187 bool MDriveCom::SendStatus(const char *stat) 188 { 189 return Send("DRIVE-STATUS", stat); 190 }
Note:
See TracChangeset
for help on using the changeset viewer.