Changeset 12599 for trunk/Cosy


Ignore:
Timestamp:
11/21/11 13:10:55 (13 years ago)
Author:
tbretz
Message:
Added a command to set the LED brightness in FACT; changed the units of the errors in FACT; make use of the 'real' MJD in the report; added the pdo3 status to the end of the report
Location:
trunk/Cosy/tcpip
Files:
2 edited

Legend:

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

    r9550 r12599  
    268268    if (fQueue)
    269269        fQueue->Proc(WM_STARGMODE, &on);
     270
     271    return true;
     272}
     273
     274bool MDriveCom::CommandLEDS(TString &str)
     275{
     276    gLog << all << "CC-COMMAND " << MTime(-1) << " LEDS " << str << endl;
     277
     278    str = str.Strip(TString::kBoth);
     279    if (str.IsNull())
     280    {
     281        gLog << err << "ERROR - LEDS command empty." << endl;
     282        return false;
     283    }
     284
     285    Int_t len;
     286    Long_t u[2];
     287    Int_t n=sscanf(str.Data(), "%ld %ld %n", &u[0], &u[1], &len);
     288    if (n!=2)
     289    {
     290        gLog << warn << "WARNING - Not enough argmuents (LEDS)." << endl;
     291        return kCONTINUE;
     292    }
     293
     294    str.Remove(0, len);
     295    str = str.Strip(TString::kBoth);
     296
     297    if (!str.IsNull())
     298    {
     299        gLog << err << "ERROR - Too many bytes in command LEDS" << endl;
     300        return false;
     301    }
     302
     303
     304    if (fQueue)
     305        fQueue->Proc(WM_LEDS, u);
    270306
    271307    return true;
     
    351387        return CommandSTGMD(str);
    352388
     389    if (cmd==(TString)"LEDS")
     390        return CommandLEDS(str);
     391
     392    if (cmd==(TString)"KEEP_ALIVE")
     393    {
     394        gLog << dbg << MTime(-1) << " KEEP_ALIVE" << endl;
     395        return true;
     396    }
     397
    353398    if (cmd.IsNull() && str.IsNull())
    354399    {
     
    371416}
    372417
    373 bool MDriveCom::SendReport(UInt_t stat, RaDec rd, double ha, ZdAz so, ZdAz is, ZdAz er, Bool_t armed, Int_t stargmd)
     418bool MDriveCom::SendReport(UInt_t stat, Double_t mjd, RaDec rd, double ha, ZdAz so, ZdAz is, ZdAz er, Bool_t armed, Int_t stargmd, UInt_t pdo3)
    374419{
    375420    // rd [rad]
     
    377422    // is [deg]
    378423    // er [rad]
    379     const MTime t(-1);
    380 
    381424    rd *= kRad2Deg;
    382425    so *= kRad2Deg;
     426#ifdef FACT
     427    er *= kRad2Deg*3600;
     428#else
    383429    er *= kRad2Deg;
     430#endif
    384431
    385432    rd.Ra(rd.Ra()/15);
     
    399446    Print(str, rd.Dec());   // Dec
    400447    Print(str, ha);         // HA
    401     str += MString::Format("%12.6f ", t.GetMjd()); // mjd
     448    //str += MString::Format("%12.6f ", mjd==0 ? MTime(-1).GetMjd() : mjd); // mjd
     449    str += MString::Format("%12.6f ", mjd); // mjd
    402450    Print(str, so.Zd());
    403451    Print(str, so.Az());
     
    408456    str += armed ? "1 " : "0 ";
    409457    str += MString::Format("%d ", stargmd);           // Starguider mode: 0=none, 1=starguider, 2=starguider off
     458    str += MString::Format("%x ", pdo3);             
    410459
    411460    return SendRep("DRIVE-REPORT", str.Data(), kFALSE);
  • trunk/Cosy/tcpip/MDriveCom.h

    r9550 r12599  
    3636    bool CommandTPOINT(TString &str);
    3737    bool CommandSTGMD(TString &str);
     38    bool CommandLEDS(TString &str);
    3839
    3940public:
     
    5556
    5657
    57     bool SendReport(UInt_t stat, RaDec rd, double ha, ZdAz so, ZdAz is, ZdAz er, Bool_t armed, Int_t stargmd);
     58    bool SendReport(UInt_t stat, Double_t mjd, RaDec rd, double ha, ZdAz so, ZdAz is, ZdAz er, Bool_t armed, Int_t stargmd, UInt_t pdo3);
    5859    bool SendStargReport(UInt_t stat, ZdAz miss, ZdAz nompos, Ring center, Int_t num, Int_t n, Double_t bright, Double_t mjd, Int_t numleds, Int_t numrings);
    5960    bool SendTPoint(bool stat, char type, Float_t mag, const char *name, const AltAz &za0, const ZdAz &za1,
Note: See TracChangeset for help on using the changeset viewer.