Changeset 9443 for trunk


Ignore:
Timestamp:
05/11/09 21:49:57 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy
Files:
5 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/Changelog

    r9439 r9443  
    11                                                                  -*-*- END -*-*-
     2
     3 2009/05/11 Thomas Bretz (La Palma)
     4
     5   * cosy.cc:
     6     - made compatible with newer MARS version
     7     - added a connection check to the sps
     8     - made ports settable by rc-file
     9
     10   * telesto.cc:
     11     - made compatible with newer MARS version
     12
     13   * devdrv/dkc.[h,cc]:
     14     - disarm when network is shut down
     15     - changed acces to armed
     16     - set default status to 0xff
     17     - added IsRpmActive
     18
     19   * main/MTracking.cc:
     20     - leave tracking loop when sps stopped tracking (e.g.
     21       disarmed)
     22
     23   * tcpip/MTcpIpIO.cc:
     24     - set debug level to get proper outout when MTcpIpO
     25       creates a socket
     26
     27
    228
    329 2009/05/09 Thomas Bretz (La Palma)
  • trunk/MagicSoft/Cosy/cosy.cc

    r9439 r9443  
    115115    // Evaluate arguments
    116116    //
    117     MArgs arg(argc, argv, kTRUE);
     117    MArgs arg(argc, argv);
    118118    gLog.Setup(arg);
    119119
     
    131131    const Bool_t  kDebugMem     = arg.HasOnlyAndRemove("--debug-mem");
    132132    const Bool_t  kDebugThreads = arg.HasOnlyAndRemove("--debug-threads");
    133     const Int_t   ceco_tx       = arg.GetIntAndRemove("--cc-tx=", 7314);//7304);
    134     const Int_t   ceco_rx       = arg.GetIntAndRemove("--cc-rx=", 7414);//7404);
    135133    const TString kConfig       = arg.GetStringAndRemove("--config=", ".cosyrc"); // ceco
    136134    Int_t  kDebugEnv = arg.HasOnlyAndRemove("--debug-env") ? 1 : 0;
     
    160158    const Int_t   channel     = env.GetValue("DefaultCameraChannel", 0);
    161159    const TString sps         = env.GetValue("IpAddressSPS", "sps");
    162     const TString ceco        = env.GetValue("IpAddressCentralControl", "161.72.130.60");
     160    const TString ceco        = env.GetValue("IpAddressCentralControl", "161.72.130.2");
     161    const Int_t   ceco_rx     = env.GetValue("PortCentralControlRX", 7404);
     162    const Int_t   ceco_tx     = env.GetValue("PortCentralControlTX", 7304);
    163163    const TString powerswitch = env.GetValue("IpAddressPowerSwitch", "");
    164164    const Int_t   telescope   = env.GetValue("Telescope", 1);
     
    214214    if (kDebugMem)
    215215        TObject::SetObjectStat(kTRUE);
     216
     217    // Check if a connection can be established
     218    const Int_t save = gDebug;
     219    gDebug = 1;
     220    TSocket test(sps, 5357);
     221    gDebug = save;
     222    test.Close();
    216223
    217224    //
  • trunk/MagicSoft/Cosy/devdrv/dkc.cc

    r9439 r9443  
    1515using namespace std;
    1616
    17 #define EXPERT
     17//#define EXPERT
    1818
    1919Dkc::Dkc(const BYTE_t nodeid, const char *name)
    2020    : NodeDrv(nodeid, name), fMacId(2*nodeid+1),
    2121    fPdoPos1(0), fPdoPos2(0), fPosActive(0), fRpmActive(0),
    22     fStatus(0), fStatusDKC(0), fStatusPdo3(0xff), fArmed(false),
     22    fStatus(0xff), fStatusDKC(0), fStatusPdo3(0xff), fArmed(false),
    2323    fReport(NULL),fLabel(NULL),fUpdPos(0)
    2424{
     
    367367    // FIXME: This isn't called if the initialization isn't done completely!
    368368    //
    369 
    370369    SetRpmMode(FALSE);
     370    Disarm();
    371371}
    372372
     
    515515void Dkc::HandlePDO3(const BYTE_t *data, const timeval_t &tv)
    516516{
    517     fArmed = data[2]&0x01;
    518 
    519517    if (fStatus!=data[3])
    520518    {
    521                   // data[3]&0x01; // motor not moving
     519        fArmed     = data[3]&0x01; // armed status
    522520        fPosActive = data[3]&0x02; // positioning active
    523521        fRpmActive = data[3]&0x04; // RPM mode switched on
  • trunk/MagicSoft/Cosy/devdrv/dkc.h

    r9439 r9443  
    120120
    121121    bool IsOperative() const { return fStatusPdo3==0xef; }
     122    bool IsRpmActive() const { return fRpmActive; }
    122123
    123124    void HandleError();
  • trunk/MagicSoft/Cosy/main/MTracking.cc

    r9439 r9443  
    363363        //
    364364        usleep(1000000); // 1s
     365
     366        //
     367        // If we would do it in the beginnign of the loop it can happen
     368        // that we check before we got the feedback through the pdo
     369        //
     370        if (!fCosy->fMac1->IsRpmActive() || !fCosy->fMac2->IsRpmActive())
     371            break;
    365372    }
    366373
  • trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.cc

    r9439 r9443  
    1515
    1616#undef DEBUG
    17 //#define DEBUG
    1817
    1918using namespace std;
     
    4645    gLog << all << "- Open send socket to " << addr << ":" << tx << endl;
    4746
     47    const Int_t save = gDebug;
     48    gDebug=1;
    4849    fTxSocket = new TSocket(addr, tx);
     50    gDebug=save;
    4951    fTxSocket->SetOption(kNoBlock, 1);
    5052
  • trunk/MagicSoft/Cosy/telesto.cc

    r8973 r9443  
    9292    // Evaluate arguments
    9393    //
    94     MArgs arg(argc, argv, kTRUE);
     94    MArgs arg(argc, argv);
    9595    gLog.Setup(arg);
    9696
Note: See TracChangeset for help on using the changeset viewer.