Changeset 86 in pacpussensors for trunk


Ignore:
Timestamp:
Jun 3, 2015, 3:42:58 PM (9 years ago)
Author:
phudelai
Message:

Socket:

  • Despecialisation de PacpusUDPSocket (anciennement spécialisée Airplug)
  • Ajout d'une classe UDPSocket

CanDriver:

  • Préparation au code du driver CAN Softing
  • Ajout des libs pour la compilation
Location:
trunk
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CanGateway/driver/CanDriver.h

    r59 r86  
    1515
    1616
    17 
    1817#ifndef _CANDRIVER_H_
    1918#define _CANDRIVER_H_
    2019
    2120
    22 #define VECTOR_CAN_DRIVER     1
    23 #define NI_CAN_DRIVER         2
    24 #define VECTOR_CANXL_DRIVER         3
    25 #define  PEAK_CAN_DRIVER 4
    26 #define  IGEP_CAN_DRIVER 5     
    27 #define  PEAK_CAN_DRIVER 6
     21#define VECTOR_CAN_DRIVER       1
     22#define NI_CAN_DRIVER           2
     23#define VECTOR_CANXL_DRIVER     3
     24#define PEAK_CAN_DRIVER         4
     25#define IGEP_CAN_DRIVER         5       
     26#define PEAK_CAN_DRIVER_WIN     6
     27#define SOFTING_CAN_DRIVER      7
     28
    2829
    2930#if CAN_DRIVER_TYPE == VECTOR_CAN_DRIVER
     
    3334#include "NiCanDriver.h"
    3435#define CanDriverType NiCanDriver
     36#elif CAN_DRIVER_TYPE == VECTOR_CANXL_DRIVER
     37#include "XLVectorCanDriver.h"
     38#define CanDriverType XLVectorCanDriver
    3539#elif CAN_DRIVER_TYPE == PEAK_CAN_DRIVER
    3640#include "PeakCanDriver.h"
    3741#define CanDriverType PeakCanDriver
     42#elif CAN_DRIVER_TYPE == IGEP_CAN_DRIVER
     43#include "igepCanDriver.h"
     44#define CanDriverType igepCanDriver
    3845#elif CAN_DRIVER_TYPE == PEAK_CAN_DRIVER_WIN
    3946#include "PeakCanDriverWin.h"
    4047#define CanDriverType PeakCanDriverWin
    41 #elif CAN_DRIVER_TYPE == IGEP_CAN_DRIVER
    42 #include "igepCanDriver.h"
    43 #define CanDriverType igepCanDriver
    44 #elif CAN_DRIVER_TYPE == VECTOR_CANXL_DRIVER
    45 #include "XLVectorCanDriver.h"
    46 #define CanDriverType XLVectorCanDriver
     48#elif CAN_DRIVER_TYPE == SOFTING_CAN_DRIVER
     49#include "SoftingCanDriver.h"
     50#define CanDriverType SoftingCanDriver
    4751#else
    4852#define CanDriverType CanDriverUnknown
  • trunk/PacpusSocket/PacpusUDPSocket.cpp

    r85 r86  
    4747
    4848
     49////////////////////////////////////////////////////////////////////////////////
     50// AddOutputs
     51////////////////////////////////////////////////////////////////////////////////
     52void PacpusUDPSocket::addOutputs()
     53{
     54        addOutput<QString, PacpusUDPSocket>("udpSocketOutput");
     55}
     56
     57
    4958//////////////////////////////////////////////////////////////////////////
    5059// Called by the ComponentManager to pass the XML parameters to the
     
    96105           
    97106        connect(udpSocket_, SIGNAL(readyRead()), this, SLOT(readPendingDatagrams()));
    98 }
    99 
    100 
     107       
     108        updSocketOutput_ = getTypedOutput<QString, PacpusUDPSocket>("udpSocketOutput");
     109}
     110
     111
     112//////////////////////////////////////////////////////////////////////////
     113// Send datagram QString
     114//////////////////////////////////////////////////////////////////////////
    101115void PacpusUDPSocket::sendDatagrams(QString frame)
    102116{
     
    119133
    120134
     135//////////////////////////////////////////////////////////////////////////
     136// Send datagram QByteArray
     137//////////////////////////////////////////////////////////////////////////
    121138void PacpusUDPSocket::sendDatagrams(QByteArray frame)
    122139{
     
    139156
    140157
     158//////////////////////////////////////////////////////////////////////////
     159// Called when the socket receive a new datagram
     160//////////////////////////////////////////////////////////////////////////
    141161void PacpusUDPSocket::readPendingDatagrams()
    142162{
     
    164184                        }
    165185                       
    166                         // Output
     186                        if (updSocketOutput_ && updSocketOutput_->hasConnection())
     187                                updSocketOutput_->send(QString(datagram.data()));
    167188                }
    168189                else
  • trunk/PacpusSocket/PacpusUDPSocket.h

    r85 r86  
    8383    virtual void stopActivity();
    8484    virtual COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config);
     85       
     86        OutputInterface<QString, PacpusUDPSocket>* udpSocketOutput_;
    8587
    8688    QUdpSocket * udpSocket_;
Note: See TracChangeset for help on using the changeset viewer.