Ignore:
Timestamp:
05/15/04 16:46:27 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/tcpip/MDriveCom.cc

    r2618 r4076  
    66#include "MAstro.h"
    77#include "MCosy.h"
     8#include "MString.h"
    89
    910using namespace std;
     
    5354    }
    5455
    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;
    5757
    5858    ra *= 15; // h -> deg
     
    6060    RaDec rd[2] = { RaDec(ra, dec), RaDec(ra, dec) };
    6161
    62     cout << "MDriveCom - TRACK... start." << endl;
     62    //cout << "MDriveCom - TRACK... start." << endl;
    6363    fQueue->PostMsg(WM_TRACK, &rd, sizeof(rd));
    64     cout << "MDriveCom - TRACK... done." << endl;
     64    //cout << "MDriveCom - TRACK... done." << endl;
    6565    return true;
    6666}
     
    8181    }
    8282
    83     lout << "CC-COMMAND: Move " << zd << "deg " << az << "deg" << endl;
     83    cout << "CC-COMMAND " << MTime(-1) << " ZDAZ " << zd << "deg " << az << "deg" << endl;
    8484
    8585    ZdAz za(zd, az);
    8686
    87     cout << "MDriveCom - POSITION... start." << endl;
     87    //cout << "MDriveCom - POSITION... start." << endl;
    8888    fQueue->PostMsg(WM_POSITION, &za, sizeof(za));
    89     cout << "MDriveCom - POSITION... done." << endl;
     89    //cout << "MDriveCom - POSITION... done." << endl;
    9090    return true;
    9191}
     
    9595    if (cmd==(TString)"WAIT" && str.IsNull())
    9696    {
    97         cout << "MDriveCom - WAIT... start." << endl;
     97        //cout << "MDriveCom - WAIT... start." << endl;
     98        cout << "CC-COMMAND " << MTime(-1) << " WAIT" << endl;
    9899        fQueue->PostMsg(WM_WAIT);
    99         cout << "MDriveCom - WAIT... done." << endl;
     100        //cout << "MDriveCom - WAIT... done." << endl;
    100101        return true;
    101102    }
     
    103104    if (cmd==(TString)"STOP!" && str.IsNull())
    104105    {
    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;
    107108        fQueue->PostMsg(WM_STOP);
    108         cout << "MDriveCom - STOP!... done." << endl;
     109        //cout << "MDriveCom - STOP!... done." << endl;
    109110        return true;
    110111    }
     
    124125    if (cmd.IsNull() && str.IsNull())
    125126    {
    126         cout << "Empty command (single '\\n') received." << endl;
     127        cout << "CC-COMMAND " << MTime(-1) << " Empty command (single '\\n') received." << endl;
    127128        return false;
    128129    }
    129130
    130     cout << "Unknown Command: '" << cmd << "':'" << str << "'" << endl;
     131    cout << "CC-COMMAND " << MTime(-1) << " Syntax error: '" << cmd << "':'" << str << "'" << endl;
    131132    return false;
    132133}
     
    139140    MAstro::Deg2Dms(deg, sgn, d, m, s);
    140141
    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);
    142144}
    143145
     
    148150    // is [deg]
    149151    // er [rad]
     152    const MTime t(-1);
    150153
    151154    rd *= kRad2Deg;
     
    165168        SetStatus(4);
    166169
    167     MTime t;
    168     t.Now();
     170    MString txt;
    169171
    170172    TString str;
     
    172174    Print(str, rd.Dec());   // Dec
    173175    Print(str, 0);          // HA
    174     str += Form("%12.6f ", t.GetMjd()); // mjd
     176    str += txt.Print("%12.6f ", t.GetMjd()); // mjd
    175177    Print(str, so.Zd());
    176178    Print(str, so.Az());
    177179    Print(str, is.Zd());
    178180    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());
    181183
    182     return Send(str);
     184    return Send("DRIVE-REPORT", str);
    183185}
     186
     187bool MDriveCom::SendStatus(const char *stat)
     188{
     189    return Send("DRIVE-STATUS", stat);
     190}
Note: See TracChangeset for help on using the changeset viewer.