#ifndef COSY_MDriveCom
#define COSY_MDriveCom

#ifndef COSY_MCeCoCom
#include "MCeCoCom.h"
#endif

class RaDec;
class ZdAz;
class MsgQueue;
class Ring;

class MDriveCom : public MCeCoCom
{
private:
    MsgQueue *fQueue;

    bool ReadAngle(TString &str, Double_t &d);
    bool ReadPosition(TString &str, Double_t &d1, Double_t &d2);

    bool InterpreteCmd(TString cmd, TString str);
    void Print(TString &str, Double_t deg) const;

    bool CommandRADEC(TString &str);
    bool CommandGRB(TString &str);
    bool CommandZDAZ(TString &str);
    bool CommandPREPS(TString &str);
    bool CommandARM(TString &str);

public:
    enum
    {
        kError      = 0x01,
        kMoving     = 0x02,
        kTracking   = 0x04,
        kStopping   = 0x08,
        kStopped    = 0x10,
	kStandby    = 0x20,
	kMonitoring = 0x40
    };
  
    MDriveCom(MsgQueue *q, MLog &out=gLog) : MCeCoCom("DRIVE-REPORT", out), fQueue(q) {}

    bool SendReport(UInt_t stat, RaDec rd, ZdAz so, ZdAz is, ZdAz er);
    bool SendStargReport(UInt_t stat, ZdAz miss, ZdAz nompos, Ring center, Int_t num, Int_t n, Double_t bright, Double_t mjd, Double_t x, Double_t y);
    bool SendStatus(const char *stat);
};

#endif
