Changeset 1266


Ignore:
Timestamp:
04/04/02 13:17:33 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/Changelog

    r1141 r1266  
    11                                                                  -*-*- END -*-*-
     2
     3 2002/04/04 - Thomas Bretz:
     4 
     5   * cosy.cc:
     6     - redirected logging output also to screen
     7
     8   * base/msgqueue.cc:
     9     - qualified void-pointer in delete-statements
     10
     11   * candrv/canopen.cc, candrv/vmodican.cc, candrv/network.cc:
     12     - added some more output
     13
     14   * candrv/vmodican.cc:
     15     - added a more informative ouput in case of open fails and exit
     16
     17   * videodev/Camera.cc:
     18     - qualified return value of mmap
     19
     20
    221
    322 2001/12/21 - Thomas Bretz:
  • trunk/MagicSoft/Cosy/base/msgqueue.cc

    r909 r1266  
    33#include <iostream.h>
    44
     5#include <unistd.h>        // usleep
    56#include <sys/resource.h>  // PRIO_PROCESS
    67
     
    1415{
    1516    pthread_cancel(fThread);
    16     delete fMp;
     17    delete (unsigned char*)fMp;
    1718}
    1819
     
    8788    fMsg = msg;
    8889
    89     delete fMp;
     90    delete (unsigned char*)fMp;
    9091    fMp = new unsigned char[size];
    9192
  • trunk/MagicSoft/Cosy/candrv/canopen.cc

    r1140 r1266  
    5151            pthread_mutex_lock(&fPdoMux[i][j]);
    5252        }
     53
     54    lout << "- CanOpen initialized." << endl;
    5355}
    5456
  • trunk/MagicSoft/Cosy/candrv/network.cc

    r1140 r1266  
    7474    for (int i=0; i<32; i++)
    7575        fNodes[i] = NULL;
     76
     77    lout << "- Network initialized." << endl;
    7678}
    7779
     
    233235        if (fNodes[i])
    234236        {
    235             lout << "- Initializing Node #" << dec << i << endl;
     237            lout << "- Setting up Node #" << dec << i << endl;
    236238            fNodes[i]->InitDevice(this);
    237239            fNodeInitialized[i] = TRUE;
    238240        }
    239     lout << "- All Nodes initialized." << endl;
     241    lout << "- All Nodes setup." << endl;
    240242}
    241243
  • trunk/MagicSoft/Cosy/candrv/nodedrv.cc

    r1140 r1266  
    7373        fName += (int)nodeid;
    7474    }
     75
     76    lout << "- Node #" << nodeid << " (" << name << ") initialized." << endl;
    7577}
    7678
  • trunk/MagicSoft/Cosy/candrv/vmodican.cc

    r1140 r1266  
    3939#include <unistd.h>        // read
    4040#include <pthread.h>       // pthread_create
     41#include <sys/time.h>      // gettimeofday
    4142#include <sys/ioctl.h>     // ioctl
    4243#include <sys/resource.h>  // PRIO_PROCESS
     
    592593    {
    593594        lout << "Error: Opening device '" << devname << "' (rc=" << fd << ")" << endl;
     595        lout << strerror(errno) << endl;
    594596        return FALSE;
    595597    }
    596598
    597     lout << "- Device " << devname << " open." << endl;
     599    lout << "- Device " << devname << " #" << fd << " open." << endl;
    598600
    599601    return TRUE;
     
    921923    Detach();
    922924
    923     Open(dev);                         // open module
     925    if (!Open(dev))
     926    {
     927        cout << "Cannot open device '" << dev << "'... exit." << endl;
     928        cout << strerror(errno) << endl;
     929        exit(1);                       // open module
     930    }
    924931    Reset();
    925932    EnableFifo();                      // connect to host (in interrupt mode)
     
    931938     EnableFastCan(50, 50);
    932939     SetTermination(0);
    933     */
     940     */
     941
     942    lout << "- VmodIcan initialized." << endl;
     943
    934944}
    935945
  • trunk/MagicSoft/Cosy/cosy.cc

    r924 r1266  
    1212
    1313#define clog(txt) \
    14     lout << edev(MLog::eStdout) << txt << endl << ddev(MLog::eStdout)
     14    { \
     15    const Bool_t is = lout.IsOutputDeviceEnabled(MLog::eStdout); \
     16    lout << edev(MLog::eStdout) << txt << endl; \
     17    if (is) \
     18    lout.EnableOutputDevice(MLog::eStdout); \
     19    }
    1520
    1621int main(int argc, char **argv)
     
    2328    //
    2429    MLog lout("log/cosy.log", kTRUE);
     30    lout.EnableOutputDevice(MLog::eStdout);
    2531
    2632    clog("Starting Cosy at " << time.GetTimeStr() << " ...");
     
    3743    // Create the Network. Device: /dev/dpm_00, Rate: 500kbps
    3844    //
     45    clog("- Constructing MCosy.");
    3946    MCosy *cosy = new MCosy("/dev/dpm_00", 500, lout);
     47
     48    clog("- Starting MCosy.");
    4049    cosy->Start();
    4150
  • trunk/MagicSoft/Cosy/videodev/Camera.cc

    r1111 r1266  
    154154    // map file (device) into memory
    155155    //
    156     pMapBuffer = mmap(0, iBufferSize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
     156    pMapBuffer = (char*)mmap(0, iBufferSize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
    157157
    158158    if ((int)pMapBuffer == -1)
  • trunk/MagicSoft/Cosy/videodev/Camera.h

    r1111 r1266  
    1010#include <TROOT.h>
    1111#include <pthread.h>
     12#include <unistd.h>
    1213#include <sys/time.h>
    1314#endif
  • trunk/MagicSoft/Mars/Changelog

    r1265 r1266  
    11                                                                  -*-*- END -*-*-
     2
     3 2002/04/04: Thomas Bretz
     4
     5   * mbase/MLog.cc:
     6     - stripped last character (CR) from output redirected to GUI   
     7
     8
    29
    310 2002/03/21: Thomas Bretz
  • trunk/MagicSoft/Mars/mbase/MLog.cc

    r1080 r1266  
    142142    if (fDevice&eGui && fgui)
    143143    {
    144         char *dummy = new char[len+1];
    145         memcpy(dummy, fBase, len);
    146         *(dummy+len)='\0';
     144        char *dummy = new char[len];
     145        memcpy(dummy, fBase, len-1);
     146        *(dummy+len-1)='\0';
    147147        fgui->AddEntry(dummy, fGuiLineId);
    148148        fgui->SetTopEntry(fGuiLineId++);
Note: See TracChangeset for help on using the changeset viewer.