Ignore:
Timestamp:
02/21/08 22:03:06 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r8847 r8869  
    6161
    6262    //cout << "MDriveCom - TRACK... start." << endl;
    63     fQueue->PostMsg(WM_TRACK, &rd, sizeof(rd));
     63    if (fQueue)
     64        fQueue->PostMsg(WM_TRACK, &rd, sizeof(rd));
    6465    //cout << "MDriveCom - TRACK... done." << endl;
    6566    return true;
     
    8788
    8889    //cout << "MDriveCom - TRACK... start." << endl;
    89     fQueue->PostMsg(WM_GRB, &rd, sizeof(rd));
     90    if (fQueue)
     91        fQueue->PostMsg(WM_GRB, &rd, sizeof(rd));
    9092    //cout << "MDriveCom - TRACK... done." << endl;
    9193    return true;
     
    112114
    113115    //cout << "MDriveCom - POSITION... start." << endl;
    114     fQueue->PostMsg(WM_POSITION, &za, sizeof(za));
     116    if (fQueue)
     117        fQueue->PostMsg(WM_POSITION, &za, sizeof(za));
    115118    //cout << "MDriveCom - POSITION... done." << endl;
    116119    return true;
     
    136139
    137140    //cout << "MDriveCom - TRACK... start." << endl;
    138     fQueue->PostMsg(WM_PREPS, (void*)str.Data(), str.Length()+1);
     141    if (fQueue)
     142        fQueue->PostMsg(WM_PREPS, (void*)str.Data(), str.Length()+1);
    139143    //cout << "MDriveCom - TRACK... done." << endl;
     144    return true;
     145}
     146
     147bool MDriveCom::CommandTPOINT(TString &str)
     148{
     149    cout << "CC-COMMAND " << MTime(-1) << " TPOIN " << str << endl;
    140150    return true;
    141151}
     
    166176    bool lock = str=="lock";
    167177
    168     fQueue->PostMsg(WM_ARM, &lock, sizeof(lock));
     178    if (fQueue)
     179        fQueue->PostMsg(WM_ARM, &lock, sizeof(lock));
    169180    return true;
    170181}
     
    176187        //cout << "MDriveCom - WAIT... start." << endl;
    177188        cout << "CC-COMMAND " << MTime(-1) << " WAIT" << endl;
    178         fQueue->PostMsg(WM_WAIT);
     189        if (fQueue)
     190            fQueue->PostMsg(WM_WAIT);
    179191        //cout << "MDriveCom - WAIT... done." << endl;
    180192        return true;
     
    185197        //cout << "MDriveCom - STOP!... start." << endl;
    186198        cout << "CC-COMMAND " << MTime(-1) << " STOP!" << endl;
    187         fQueue->PostMsg(WM_STOP);
     199        if (fQueue)
     200            fQueue->PostMsg(WM_STOP);
    188201        //cout << "MDriveCom - STOP!... done." << endl;
    189202        return true;
     
    202215        return CommandPREPS(str);
    203216
     217    if (cmd==(TString)"TPOIN")
     218        return CommandTPOINT(str);
     219
     220    if (cmd==(TString)"ARM")
     221        return CommandARM(str);
     222
    204223    if (cmd.IsNull() && str.IsNull())
    205224    {
     
    223242}
    224243
    225 bool MDriveCom::SendReport(UInt_t stat, RaDec rd, ZdAz so, ZdAz is, ZdAz er)
     244bool MDriveCom::SendReport(UInt_t stat, RaDec rd, ZdAz so, ZdAz is, ZdAz er, Bool_t armed)
    226245{
    227246    // rd [rad]
     
    259278    Print(str, is.Az());
    260279    str += txt.Print("%08.3f ", er.Zd());
    261     str += txt.Print("%08.3f", er.Az());
     280    str += txt.Print("%08.3f ", er.Az());
     281    str += armed ? "1 " : "0 ";
    262282
    263283    return SendRep("DRIVE-REPORT", str, kFALSE);
     
    303323    return SendRep("STARG-REPORT", str, kTRUE);
    304324}
     325
     326bool MDriveCom::SendTPoint(UInt_t stat)
     327{
     328    /*
     329    // miss   [deg]
     330    // nompos [deg]
     331    const MTime t(-1);
     332
     333    miss *= 60;        // [arcmin]
     334
     335    // Set status flag
     336    if (stat&kError)
     337        SetStatus(0);
     338    if (stat&kStandby)
     339        SetStatus(2);
     340    if (stat&kMonitoring)
     341        SetStatus(4);
     342   
     343    MString txt;
     344
     345    TString str;
     346    str += txt.Print("%05.3f ", miss.Zd());       //[arcmin]
     347    str += txt.Print("%05.3f ", miss.Az());       //[arcmin]
     348    Print(str, nompos.Zd());                      //[deg]
     349    Print(str, nompos.Az());                      //[deg]
     350    str += txt.Print("%05.1f ",   center.GetX()); //number
     351    str += txt.Print("%05.1f ",   center.GetY()); //number
     352    str += txt.Print("%04d ",   n);               //number of correleated stars
     353    str += txt.Print("%03.1f ",  bright);
     354    str += txt.Print("%12.6f ", t.GetMjd());      // mjd
     355    str += txt.Print("%.1f ", x);
     356    str += txt.Print("%.1f ", y);
     357    str += txt.Print("%04d ", num);               //number of detected stars
     358    */
     359
     360    return SendRep("TPOINT-REPORT", "", kTRUE);
     361}
Note: See TracChangeset for help on using the changeset viewer.