Changeset 42 in pacpussensors for trunk/Sick/SickLMSSensor.h
- Timestamp:
- 04/01/14 14:47:39 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Sick/SickLMSSensor.h
r37 r42 116 116 * 117 117 * A message starts with a <STX> (0x02 in ASCII) char and ends with <ETX> (0x03 in ASCII). 118 * This function stores packets until a complete message is received. In this case, the 119 * message is added to the list of MessageLMS, msgList. 118 120 */ 119 121 void reconstituteMessage(const char * packet, const int length, road_time_t time); 120 122 121 // decoupe le message en scan122 123 /** 123 124 * @brief processScanData Parse information and process every needed values. … … 136 137 137 138 public Q_SLOTS: 138 //Fonction qui permet de trier les données reçues et de les enregistrer dans une structure point, puis dans un fichier binaire .dbt 139 /** 140 * @brief customEvent allows to receive the incoming data and store them into known structures. 141 * @param e Event that carries the Ethernet packets and receiving time. 142 */ 139 143 void customEvent(QEvent * e); 144 145 /** 146 * @brief Configure the object, not used for the moment. 147 */ 140 148 void configure(); 141 149 142 150 public: 143 SickSocket * S_socket; //on déclare pointeur de socket 144 // SickComponent * myParent; 151 /** 152 * @brief S_socket, used to receive and send data to the remote sensor. 153 */ 154 SickSocket * S_socket; 145 155 146 156 private: 147 // to recognize between several sensors157 /// Name is used to recognize between several sensors and store data into .dbt and utc files. 148 158 QString name_; 149 159 150 // The SickLMS IP or hostname160 /// The IP address of the remote Sick LDMRS sensor we are connected to. 151 161 QString ipaddr_; 152 162 153 // The SickLMS port163 /// The SickLDMRS port 154 164 int port_; 155 165 156 bool recording_; // Enable storing in DBT 166 /// Enable storing in DBT + UTC files 167 bool recording_; 157 168 158 169 scanCfg mainCfg; 159 170 171 /// Append new data into the private MessagePacket @b pendingBytes. 160 172 void storePendingBytes(road_time_t time); 161 void fillDataHeader(MessageLMS & msg); 162 void fillScanHeader(MessageLMS & msg); 173 174 /** Ask for scan configuration (frequency and angular resolution) . [See §5.2 of the documentation : telegrams]{TL_LMS1xx_5xx_TiM3xx_JEF300_JEF500_en_8014631_20120508.pdf} 175 Data is parsed in customEvent slot. 176 */ 163 177 void askScanCfg(); 164 178 179 /** 180 * @brief findSTX looks for the first character of the message <STX>. 181 * @param packets Raw data received. 182 * @param size Size of the raw data array (\c packets). 183 * @return Index of the <STX> character in \c packets. 184 */ 165 185 int findSTX(const char* packets, const unsigned int size ); 186 187 /** 188 * @brief splitMessage Split message into arrays of string to parse. 189 * @param message Contains raw data and is modified to store the vector of strings. 190 * @return Size of the vector. 191 */ 166 192 int splitMessage(MessageLMS* message); 193 194 /** 195 * @brief xstol convert hexadecimal values coded in ASCII to integer. 196 * @param str String to convert (Hexadecimal value) 197 * @return long integer value (to cast as needed) 198 */ 167 199 long xstol(std::string str); 168 200 169 std::string kSick MemoryName;170 std::string kSick DbtFileName;171 std::string kSickUtcFileName; 172 201 std::string kSickDbtFileName; //!< Name of the DBT file. 202 std::string kSickUtcFileName; //!< Name of the UTC file. 203 204 /// List of messages to process. 173 205 std::list<MessageLMS> msgList; 174 206 207 /// Received raw data is appended into this MessagePacket. 175 208 MessagePacket pendingBytes; 176 209 177 // write the data on the disk in the dbt file and the associated binary file 210 /** 211 * @brief Write data into .dbt + .utc files. 212 * @param msg 213 * 214 * SickLMS_dbt structure is filled and stored into the DBT file. 215 * The arrays of points' distance is then stored into the UTC file, depending on data received. 216 */ 178 217 void writeData(MessageLMS &msg); 179 218 180 // SickLMS_dbt dbtData_; 181 pacpus::DbiteFile dbtFile_; 182 std::ofstream dataFile_; 219 pacpus::DbiteFile dbtFile_; //!< DBT file. 220 std::ofstream dataFile_; //!< UTC file. 183 221 184 222 #ifdef SickLMS_SH_MEM
Note:
See TracChangeset
for help on using the changeset viewer.