Changeset 99 in pacpussensors for trunk/Gps/gpsComponent.h


Ignore:
Timestamp:
10/15/15 14:47:01 (9 years ago)
Author:
nguyenhu
Message:

compilation under linux with 0.2.X framework

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gps/gpsComponent.h

    r59 r99  
    2121#include <QSemaphore>
    2222#include <QThread>
     23#include <QByteArray>
     24#include <QString>
    2325
    2426#ifdef WIN32
    2527#   include "../driver/win32SerialPort.h"
    2628//#   include "network/gpsServerSocket.h"
    27 #else 
     29#else
    2830#   include "../driver/PosixSerialPort.h"
    2931#endif
     
    4143#   endif
    4244#else
    43     // On other platforms, simply ignore this 
     45    // On other platforms, simply ignore this
    4446#   define GPS_API /* nothing */
    4547#endif
     
    5860{
    5961  Q_OBJECT
    60    
     62
    6163public:
    62   GpsComponent(QString name); 
    63   ~GpsComponent(); 
    64  
     64  GpsComponent(QString name);
     65  ~GpsComponent();
     66
    6567  virtual void stopActivity(); /*!< to stop the processing thread */
    6668  virtual void startActivity(); /*!< to start the processing thread */
    67   virtual ComponentBase::COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config); 
     69  virtual ComponentBase::COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config);
    6870
    6971
     
    7173  void disableSocketServer(); /*!< to disable the socket server interface */
    7274
    73   void setPortCOM(const char * port); 
     75  void setPortCOM(const char * port);
    7476
    7577
    76  
    77 public slots: 
     78
     79public slots:
    7880  void unlockProcessing(int v); /*!< to unlock the processing thread */
    7981
    8082protected:
    8183private:
    82   void run(); /*!< the main loop of the thread */ 
    83   int frameType(const QByteArray& frame); /*!< to get the type of the frame */ 
    84   int decodeFrame(int type); /*!< parse the string in the NMEA0183 class to get the frame informations */ 
     84  void run(); /*!< the main loop of the thread */
     85  int frameType(const QByteArray& frame); /*!< to get the type of the frame */
     86  int decodeFrame(int type); /*!< parse the string in the NMEA0183 class to get the frame informations */
    8587  bool currentFrameIsPps(); /*!< checks if a frame is an out-of-band pps signal */
    86   bool analyzeFrame(); /*!< reconstruct the entire frame starting from the received pieces */ 
     88  bool analyzeFrame(); /*!< reconstruct the entire frame starting from the received pieces */
    8789
    8890#ifdef WIN32
     
    104106  static FrameTypeMap frameTypes[MAX_FRAMES];
    105107
    106   NMEA0183 nmea0183_; 
    107   QSemaphore semaphore_; 
     108  NMEA0183 nmea0183_;
     109  QSemaphore semaphore_;
    108110
    109   FRAME* currentFrame_; 
     111  FRAME* currentFrame_;
    110112
    111   FRAME frameToDecode_; 
     113  FRAME frameToDecode_;
    112114
    113115  road_time_t lastPpsTime_;
    114116
    115   bool newFrameToDecode_; 
    116   bool startOfFrame_; 
    117   bool endOfFrame_; 
     117  bool newFrameToDecode_;
     118  bool startOfFrame_;
     119  bool endOfFrame_;
    118120  int nextByteToProcess_;
    119121
    120122
    121123  unsigned int ppsIndex_;
    122  
     124
    123125  DbiteFile ppshdFile; /*!< pointer to the pps dbt file */
    124126  DbiteFile ggahdFile; /*!< pointer to the gga dbt file */
     
    139141  bool ggaRecording;
    140142  bool gsaRecording;
    141   bool gstRecording; 
     143  bool gstRecording;
    142144  bool gsvRecording;
    143145  bool hdtRecording;
    144   bool rmcRecording; 
    145   bool rotRecording; 
    146   bool vtgRecording; 
    147   bool zdaRecording; 
    148  
    149   QString portName_; 
     146  bool rmcRecording;
     147  bool rotRecording;
     148  bool vtgRecording;
     149  bool zdaRecording;
     150
     151  QString portName_;
    150152
    151153  ShMem * shMem_;
    152  
     154
    153155  /// For the socket server
    154156  /* Qt3 version - 17/12/2007
    155   BOOL socketServerEnabled; 
    156   void *frameToSend; 
     157  BOOL socketServerEnabled;
     158  void *frameToSend;
    157159  QCustomEvent *evt;
    158160  */
    159  
    160   /* 
    161   * VC6 doesn't support out-of-class template defintions 
    162   * see on http://support.microsoft.com kb q243451 and more particulary 241949 
     161
     162  /*
     163  * VC6 doesn't support out-of-class template defintions
     164  * see on http://support.microsoft.com kb q243451 and more particulary 241949
    163165  */
    164166  template<typename T>
     
    168170    if (socketServerEnabled)
    169171    {
    170       frameToSend = new T; 
    171       *(T*)frameToSend = frame; 
    172       evt = new QCustomEvent(QEvent::User + type); 
    173       evt->setData(frameToSend); 
    174       postEvent(serverSocket,evt); 
     172      frameToSend = new T;
     173      *(T*)frameToSend = frame;
     174      evt = new QCustomEvent(QEvent::User + type);
     175      evt->setData(frameToSend);
     176      postEvent(serverSocket,evt);
    175177    }
    176178    */
Note: See TracChangeset for help on using the changeset viewer.