Changeset 8811 for trunk/MagicSoft


Ignore:
Timestamp:
01/16/08 10:05:44 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/Changelog

    r8810 r8811  
    1515
    1616   * videodev/CaosFilter.h, videodev/FilterLed.h, videodev/PixClient.h,
    17      videodev/PixGetter.h, videodev/Writer.h:
     17     videodev/PixGetter.h, videodev/Writer.h, candrv/sdolist.h:
    1818     - added virtual destructor as suggested by gcc 4
     19
     20   * devdrv/macs.[h,cc], devdrv/shaftencoder.[h,cc]:
     21     - replaced timeval_t* by a const reference in all arguments of
     22       member functions
     23
     24   * gui/MGEmbeddedCanvas.cc:
     25     - replaced C-style includes (iostream.h) with C++ style (iostream)
     26
     27   * videodev/FilterLed.cc:
     28     - initialized fImg as suggested by valgrind
    1929
    2030
  • trunk/MagicSoft/Cosy/devdrv/macs.cc

    r8376 r8811  
    4343}
    4444
    45 void Macs::HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, timeval_t *tv)
     45void Macs::HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, const timeval_t &tv)
    4646{
    4747  // cout << "SdoRx: Idx=0x"<< hex << idx << "/" << (int)subidx;
     
    8686//        lout << "Actual Position: " << dec << (signed long)val << endl;
    8787        fPos = (LWORDS_t)val;
    88         fPosTime.Set(*tv);
     88        fPosTime.Set(tv);
    8989        return;
    9090/*
     
    136136}
    137137
    138 void Macs::HandleSDOOK(WORD_t idx, BYTE_t subidx, LWORD_t data, timeval_t *tv)
     138void Macs::HandleSDOOK(WORD_t idx, BYTE_t subidx, LWORD_t data, const timeval_t &tv)
    139139{
    140140    //    cout << "Node #" << dec << (int)GetId() << ": Sdo=" << hex << idx  << "/" << (int)subidx << " set." << endl;
     
    556556}
    557557
    558 void Macs::HandlePDO1(BYTE_t *data, timeval_t *tv)
     558void Macs::HandlePDO1(const BYTE_t *data, const timeval_t &tv)
    559559{
    560560    // FIXME!!!! Only 0x4000 should do this to be
     
    575575    fStatus = data[3];
    576576
    577     fPdoTime.Set(*tv);
    578 }
    579 
    580 void Macs::HandlePDO2(BYTE_t *data, timeval_t *tv)
     577    fPdoTime.Set(tv);
     578}
     579
     580void Macs::HandlePDO2(const BYTE_t *data, const timeval_t &tv)
    581581{
    582582    LWORDS_t errnum = (data[0]<<24) | (data[1]<<16) | (data[2]<<8) | data[3];
     
    727727}
    728728
    729 void Macs::HandlePDO3(BYTE_t *data, timeval_t *tv)
     729void Macs::HandlePDO3(const BYTE_t *data, const timeval_t &tv)
    730730{
    731731    // 3    5    7    9
  • trunk/MagicSoft/Cosy/devdrv/macs.h

    r4104 r8811  
    3838    void StopDevice();
    3939
    40     void HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, timeval_t *tv);
    41     void HandleSDOOK(WORD_t idx, BYTE_t subidx, LWORD_t data, timeval_t *tv);
     40    void HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, const timeval_t &tv);
     41    void HandleSDOOK(WORD_t idx, BYTE_t subidx, LWORD_t data, const timeval_t &tv);
    4242    //void HandleSDOError(LWORD_t data) { NodeDrv::HandleSDOError(data); }
    4343
    44     void HandlePDO1(BYTE_t *data, timeval_t *tv);
    45     void HandlePDO2(BYTE_t *data, timeval_t *tv);
    46     void HandlePDO3(BYTE_t *data, timeval_t *tv);
     44    void HandlePDO1(const BYTE_t *data, const timeval_t &tv);
     45    void HandlePDO2(const BYTE_t *data, const timeval_t &tv);
     46    void HandlePDO3(const BYTE_t *data, const timeval_t &tv);
    4747    //void HandleNodeguard(timeval_t *tv);
    4848
  • trunk/MagicSoft/Cosy/devdrv/shaftencoder.cc

    r7300 r8811  
    1717    : NodeDrv(nodeid, name, out), fPos(0), fVel(0), fAcc(0),
    1818    fTurn(0), fDirection(kUndefined), fHysteresisPos(0), fHysteresisNeg(0),
    19     fLabel(NULL), fPosHasChanged(false), fDirHasChanged(false),
     19    fLabel(NULL), fUpdPos(0), fPosHasChanged(false), fDirHasChanged(false),
    2020    fReport(NULL),
    2121    /*fTwin(0), fIsUpdated(kFALSE),*/
     
    3535}
    3636*/
    37 void ShaftEncoder::HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, timeval_t *tv)
     37void ShaftEncoder::HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, const timeval_t &tv)
    3838{
    3939    switch (idx)
     
    125125}
    126126
    127 void ShaftEncoder::HandleSDOOK(WORD_t idx, BYTE_t subidx, LWORD_t data, timeval_t *tv)
     127void ShaftEncoder::HandleSDOOK(WORD_t idx, BYTE_t subidx, LWORD_t data, const timeval_t &tv)
    128128{
    129129    switch (idx)
     
    195195}
    196196
    197 void ShaftEncoder::HandlePDOType0(BYTE_t *data, timeval_t *tv)
     197void ShaftEncoder::HandlePDOType0(const BYTE_t *data, const timeval_t &tv)
    198198{
    199199    //
     
    216216
    217217    fPos = pos;
    218     fTime.Set(*tv);
     218    fTime.Set(tv);
    219219    fPosHasChanged = true;
    220220
     
    230230}
    231231
    232 void ShaftEncoder::HandlePDOType1(BYTE_t *data, timeval_t *tv)
     232void ShaftEncoder::HandlePDOType1(const BYTE_t *data, const timeval_t &tv)
    233233{
    234234    //
     
    253253    //CheckTwin(fPos-pos);
    254254    fPos=pos;
    255     fTime.Set(*tv);
     255    fTime.Set(tv);
    256256    fPosHasChanged=true;
    257257    //fIsUpdated=kTRUE;
     
    271271//ofstream fout("log/shaftencoder.log");
    272272
    273 void ShaftEncoder::HandlePDOType2(BYTE_t *data, timeval_t *tv)
     273void ShaftEncoder::HandlePDOType2(const BYTE_t *data, const timeval_t &tv)
    274274{
    275275    //
     
    322322    fTurn = turn;
    323323
    324     fTime.Set(*tv);
     324    fTime.Set(tv);
    325325    fPosHasChanged=true;
    326326    //fIsUpdated=kTRUE;
  • trunk/MagicSoft/Cosy/devdrv/shaftencoder.h

    r7299 r8811  
    4545
    4646
    47     void HandlePDOType0(BYTE_t *data, timeval_t *tv);
    48     void HandlePDOType1(BYTE_t *data, timeval_t *tv);
    49     void HandlePDOType2(BYTE_t *data, timeval_t *tv);
     47    void HandlePDOType0(const BYTE_t *data, const timeval_t &tv);
     48    void HandlePDOType1(const BYTE_t *data, const timeval_t &tv);
     49    void HandlePDOType2(const BYTE_t *data, const timeval_t &tv);
    5050
    5151    void ReqPos();
     
    6464    //void SetTwin(ShaftEncoder *se) { fTwin = se; }
    6565
    66     void HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, timeval_t *tv);
    67     void HandleSDOOK(WORD_t idx, BYTE_t subidx, LWORD_t data, timeval_t *tv);
     66    void HandleSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, const timeval_t &tv);
     67    void HandleSDOOK(WORD_t idx, BYTE_t subidx, LWORD_t data, const timeval_t &tv);
    6868    /*
    6969     void HandleSDOOK(WORD_t idx, BYTE_t subidx, timeval_t *tv) { NodeDrv::HandleSDOOK(idx, subidx, tv); }
    7070     void HandleSDOError(LWORD_t data)           { NodeDrv::HandleSDOError(data); }
    7171     */
    72     void HandlePDO1(BYTE_t *data, timeval_t *tv) { HandlePDOType2(data, tv); }
    73     void HandlePDO2(BYTE_t *data, timeval_t *tv) { HandlePDOType2(data, tv); }
     72    void HandlePDO1(const BYTE_t *data, const timeval_t &tv) { HandlePDOType2(data, tv); }
     73    void HandlePDO2(const BYTE_t *data, const timeval_t &tv) { HandlePDOType2(data, tv); }
    7474
    7575    LWORDS_t GetPos() const       { return IsZombieNode() ? 0 : fPos+fTurn*fTicks; } // FIXME? 0?
  • trunk/MagicSoft/Cosy/gui/MGEmbeddedCanvas.cc

    r2278 r8811  
    77#include "MGEmbeddedCanvas.h"
    88
    9 #include <iostream.h>
     9#include <iostream>
    1010
    1111#include <TList.h>
     
    1515
    1616ClassImp(MGEmbeddedCanvas);
     17
     18using namespace std;
    1719
    1820MGEmbeddedCanvas::MGEmbeddedCanvas(const char *name, const TGWindow* p,
  • trunk/MagicSoft/Cosy/videodev/FilterLed.cc

    r8377 r8811  
    7575
    7676public:
    77     ClusterFinder(byte *img, UInt_t w, UInt_t h) : fLimitingSize(999)
     77    ClusterFinder(byte *img, UInt_t w, UInt_t h) : fImg(0), fLimitingSize(999)
    7878    {
    7979        fW = w;
Note: See TracChangeset for help on using the changeset viewer.