Changeset 99 in pacpussensors for trunk/Gps/gpsComponent.h
- Timestamp:
- 10/15/15 14:47:01 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Gps/gpsComponent.h
r59 r99 21 21 #include <QSemaphore> 22 22 #include <QThread> 23 #include <QByteArray> 24 #include <QString> 23 25 24 26 #ifdef WIN32 25 27 # include "../driver/win32SerialPort.h" 26 28 //# include "network/gpsServerSocket.h" 27 #else 29 #else 28 30 # include "../driver/PosixSerialPort.h" 29 31 #endif … … 41 43 # endif 42 44 #else 43 // On other platforms, simply ignore this 45 // On other platforms, simply ignore this 44 46 # define GPS_API /* nothing */ 45 47 #endif … … 58 60 { 59 61 Q_OBJECT 60 62 61 63 public: 62 GpsComponent(QString name); 63 ~GpsComponent(); 64 64 GpsComponent(QString name); 65 ~GpsComponent(); 66 65 67 virtual void stopActivity(); /*!< to stop the processing thread */ 66 68 virtual void startActivity(); /*!< to start the processing thread */ 67 virtual ComponentBase::COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config); 69 virtual ComponentBase::COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config); 68 70 69 71 … … 71 73 void disableSocketServer(); /*!< to disable the socket server interface */ 72 74 73 void setPortCOM(const char * port); 75 void setPortCOM(const char * port); 74 76 75 77 76 77 public slots: 78 79 public slots: 78 80 void unlockProcessing(int v); /*!< to unlock the processing thread */ 79 81 80 82 protected: 81 83 private: 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 */ 85 87 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 */ 87 89 88 90 #ifdef WIN32 … … 104 106 static FrameTypeMap frameTypes[MAX_FRAMES]; 105 107 106 NMEA0183 nmea0183_; 107 QSemaphore semaphore_; 108 NMEA0183 nmea0183_; 109 QSemaphore semaphore_; 108 110 109 FRAME* currentFrame_; 111 FRAME* currentFrame_; 110 112 111 FRAME frameToDecode_; 113 FRAME frameToDecode_; 112 114 113 115 road_time_t lastPpsTime_; 114 116 115 bool newFrameToDecode_; 116 bool startOfFrame_; 117 bool endOfFrame_; 117 bool newFrameToDecode_; 118 bool startOfFrame_; 119 bool endOfFrame_; 118 120 int nextByteToProcess_; 119 121 120 122 121 123 unsigned int ppsIndex_; 122 124 123 125 DbiteFile ppshdFile; /*!< pointer to the pps dbt file */ 124 126 DbiteFile ggahdFile; /*!< pointer to the gga dbt file */ … … 139 141 bool ggaRecording; 140 142 bool gsaRecording; 141 bool gstRecording; 143 bool gstRecording; 142 144 bool gsvRecording; 143 145 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_; 150 152 151 153 ShMem * shMem_; 152 154 153 155 /// For the socket server 154 156 /* Qt3 version - 17/12/2007 155 BOOL socketServerEnabled; 156 void *frameToSend; 157 BOOL socketServerEnabled; 158 void *frameToSend; 157 159 QCustomEvent *evt; 158 160 */ 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 163 165 */ 164 166 template<typename T> … … 168 170 if (socketServerEnabled) 169 171 { 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); 175 177 } 176 178 */
Note:
See TracChangeset
for help on using the changeset viewer.