Changeset 91 in pacpussensors for trunk/CanGateway/CanGateway.cpp


Ignore:
Timestamp:
Jul 28, 2015, 4:28:08 PM (9 years ago)
Author:
DHERBOMEZ Gérald
Message:

Small corrections during tests: CAN reading OK under Windows with Kvaser Leaf Light.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CanGateway/CanGateway.cpp

    r44 r91  
    9191                        qFatal("Failed to open the CAN interface port %s in %s mode",port_, accessMode_);
    9292        }
     93        else if (source_ == "kvaser")
     94        {
     95                canIf_.setSource(Win32CanInterface::KvaserCard);
     96                // open interface
     97                if (canIf_.openInterface(channel_,speed_)==0)
     98                        qFatal("Failed to open the CAN interface num %d at speed %d",channel_,speed_);
     99        }
    93100        else
    94101        {
     
    112119        canIf_.stop();
    113120
    114         if ((source_ == "vector")||(source_=="peak")||(source_=="vectorXL")||(source_=="igep"))
     121        if ((source_ == "vector")||(source_=="peak")||(source_=="vectorXL")||(source_=="igep")||(source_=="kvaser"))
    115122                canIf_.closeInterface(channel_);
    116123       
     
    151158        }
    152159        setRecording( config.getProperty("recording") == "true" ? true : false );
     160
     161        verbose_ = config.getProperty("verbose") == "true" ? true : false;
    153162
    154163        return ComponentBase::CONFIGURED_OK;
     
    193202                }
    194203
    195         //displayData(incomingCanFrames_[counter_].frame.data, incomingCanFrames_[counter_].frame.dlc, incomingCanFrames_[counter_].frame.id);
     204        if (verbose_) displayData(incomingCanFrames_[counter_].frame.data, incomingCanFrames_[counter_].frame.dlc, incomingCanFrames_[counter_].frame.id);
    196205        if (isRecording())
    197206        {
Note: See TracChangeset for help on using the changeset viewer.