Ignore:
Timestamp:
02/23/10 10:17:52 (15 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy/tcpip
Files:
2 edited

Legend:

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

    r9522 r9550  
    135135    }
    136136
    137     Int_t id, len; // Starguider switched on or not
    138     Float_t dra, ddec;
    139     Int_t n=sscanf(str.Data(), "%d %f %f %n", &id, &dra, &ddec, &len);
     137    Int_t id, len;
     138    Float_t offset, angle;
     139    Int_t n=sscanf(str.Data(), "%d %f %f %n", &id, &offset, &angle, &len);
    140140    if (n!=3)
    141141    {
     
    153153    }
    154154
    155     gLog << all << "CC-COMMAND " << MTime(-1) << " CELEST ID=" << id << " dRa=" << dra << "deg dDec=" << ddec << "deg" << endl;
     155    gLog << all << "CC-COMMAND " << MTime(-1) << " CELEST ID=" << id << " WobbleOffset=" << offset << "deg WobbleAngle=" << angle << "deg" << endl;
    156156
    157157    if (id==0)
     
    167167    }
    168168
    169     // Moon;
    170     id = 3;
    171 
    172     gLog << warn << "WARNING - Tracking the moon's center forced." << endl;
    173 
    174     //cout << "MDriveCom - POSITION... start." << endl;
    175     if (fQueue)
    176         fQueue->PostMsg(WM_PLANET, &id, sizeof(id));
    177     //cout << "MDriveCom - POSITION... done." << endl;
     169    Double_t data[3] = { id, offset, angle };
     170
     171    //cout << "MDriveCom - CELEST... start." << endl;
     172    if (fQueue)
     173        fQueue->PostMsg(WM_CELEST, data, sizeof(Double_t)*3);
     174    //cout << "MDriveCom - CELEST... done." << endl;
     175    return true;
     176}
     177
     178bool MDriveCom::CommandMOON(TString &str)
     179{
     180    str = str.Strip(TString::kBoth);
     181    if (str.IsNull())
     182    {
     183        gLog << err << "ERROR - MOON command empty." << endl;
     184        return false;
     185    }
     186
     187    Int_t len;
     188    Float_t wobble, offset;
     189    Int_t n=sscanf(str.Data(), "%f %f %n", &wobble, &offset, &len);
     190    if (n!=2)
     191    {
     192        gLog << warn << "WARNING - Not enough argmuents (MOON)." << endl;
     193        return kCONTINUE;
     194    }
     195
     196    str.Remove(0, len);
     197    str = str.Strip(TString::kBoth);
     198
     199    if (!str.IsNull())
     200    {
     201        gLog << err << "ERROR - Too many bytes in command MOON" << endl;
     202        return false;
     203    }
     204
     205    gLog << all << "CC-COMMAND " << MTime(-1) << " MOON WobbleOffset=" << wobble << "deg ShadowOffset=" << offset << "deg" << endl;
     206
     207    Double_t data[2] = { wobble, offset };
     208
     209    //cout << "MDriveCom - MOON... start." << endl;
     210    if (fQueue)
     211        fQueue->PostMsg(WM_MOON, data, sizeof(Double_t)*2);
     212    //cout << "MDriveCom - MOON... done." << endl;
    178213    return true;
    179214}
     
    300335    if (cmd==(TString)"CELEST")
    301336        return CommandCELEST(str);
     337
     338    if (cmd==(TString)"MOON")
     339        return CommandMOON(str);
    302340
    303341    if (cmd==(TString)"PREPS")
  • trunk/MagicSoft/Cosy/tcpip/MDriveCom.h

    r9516 r9550  
    3131    bool CommandZDAZ(TString &str);
    3232    bool CommandCELEST(TString &str);
     33    bool CommandMOON(TString &str);
    3334    bool CommandPREPS(TString &str);
    3435    bool CommandARM(TString &str);
Note: See TracChangeset for help on using the changeset viewer.