Ignore:
Timestamp:
03/17/05 11:02:59 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r4865 r6841  
    77#include "MCosy.h"
    88#include "MString.h"
     9#include "Ring.h"
    910
    1011using namespace std;
     
    6263    //cout << "MDriveCom - TRACK... start." << endl;
    6364    fQueue->PostMsg(WM_TRACK, &rd, sizeof(rd));
     65    //cout << "MDriveCom - TRACK... done." << endl;
     66    return true;
     67}
     68
     69bool MDriveCom::CommandGRB(TString &str)
     70{
     71    Double_t ra, dec;
     72    if (!ReadPosition(str, ra, dec))
     73    {
     74        cout << "ERROR - Reading position from GRB" << endl;
     75        return false;
     76    }
     77    if (!str.IsNull())
     78    {
     79        cout << "ERROR - Too many bytes in command GRB" << endl;
     80        return false;
     81    }
     82
     83    cout << "CC-COMMAND " << MTime(-1) << " GRB " << ra << "h " << dec << "d '" << str << "'" << endl;
     84
     85    ra *= 15; // h -> deg
     86
     87    RaDec rd[2] = { RaDec(ra, dec), RaDec(ra, dec) };
     88
     89    //cout << "MDriveCom - TRACK... start." << endl;
     90    fQueue->PostMsg(WM_GRB, &rd, sizeof(rd));
    6491    //cout << "MDriveCom - TRACK... done." << endl;
    6592    return true;
     
    113140    if (cmd==(TString)"RADEC")
    114141        return CommandRADEC(str);
     142
     143    if (cmd==(TString)"GRB")
     144        return CommandGRB(str);
    115145
    116146    if (cmd==(TString)"ZDAZ")
     
    190220}
    191221
    192 bool MDriveCom::SendStargReport(UInt_t stat, ZdAz miss)
    193 {
    194    
    195     // miss [rad]
     222bool MDriveCom::SendStargReport(UInt_t stat, ZdAz miss, ZdAz nompos, Ring center, Int_t n, Double_t bright, Double_t mjd)
     223{
     224    // miss   [deg]
     225    // nompos [rad]
    196226    const MTime t(-1);
    197227
    198     miss *= kRad2Deg;
     228    miss   *= 60;        // [arcmin]
     229    nompos *= kRad2Deg;  // [deg]
    199230
    200231    // Set status flag
     
    211242
    212243    TString str;
    213     str += txt.Print("%05.3f ", miss.Zd());
    214     str += txt.Print("%05.3f", miss.Az());
     244    str += txt.Print("%05.3f ", miss.Zd());       //[arcmin]
     245    str += txt.Print("%05.3f ", miss.Az());       //[arcmin]
     246    Print(str, nompos.Zd());                      //[deg]
     247    Print(str, nompos.Az());                      //[deg]
     248    str += txt.Print("%05.1f ",   center.GetX()); //number
     249    str += txt.Print("%05.1f ",   center.GetY()); //number
     250    str += txt.Print("%04d ",   n);               //number
     251    str += txt.Print("%03.1f",  bright);
     252    str += txt.Print("%12.6f ", t.GetMjd());      // mjd
    215253   
    216254    return Send("STARG-REPORT", str, kTRUE);
Note: See TracChangeset for help on using the changeset viewer.