Changeset 42 in pacpussensors for trunk/Sick/SickLMSSensor.h


Ignore:
Timestamp:
04/01/14 14:47:39 (10 years ago)
Author:
cfougera
Message:

Last version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Sick/SickLMSSensor.h

    r37 r42  
    116116     *
    117117     * 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.
    118120     */
    119121    void reconstituteMessage(const char * packet, const int length, road_time_t time);
    120122
    121     // decoupe le message en scan
    122123    /**
    123124     * @brief processScanData Parse information and process every needed values.
     
    136137
    137138public 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     */
    139143    void customEvent(QEvent * e);
     144
     145    /**
     146     * @brief Configure the object, not used for the moment.
     147     */
    140148    void configure();
    141149   
    142150public:
    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;
    145155
    146156private:
    147     // to recognize between several sensors
     157    /// Name is used to recognize between several sensors and store data into .dbt and utc files.
    148158    QString name_;
    149159
    150     // The SickLMS IP or hostname
     160    /// The IP address of the remote Sick LDMRS sensor we are connected to.
    151161    QString ipaddr_;
    152162
    153     // The SickLMS port
     163    /// The SickLDMRS port
    154164    int port_;
    155165
    156     bool recording_; // Enable storing in DBT
     166    /// Enable storing in DBT + UTC files
     167    bool recording_;
    157168
    158169    scanCfg mainCfg;
    159170
     171    /// Append new data into the private MessagePacket @b pendingBytes.
    160172    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    */
    163177    void askScanCfg();
    164178
     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     */
    165185    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     */
    166192    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     */
    167199    long xstol(std::string str);
    168200
    169     std::string kSickMemoryName;
    170     std::string kSickDbtFileName;
    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.
    173205    std::list<MessageLMS> msgList;
    174206
     207    /// Received raw data is appended into this MessagePacket.
    175208    MessagePacket pendingBytes;
    176209
    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     */
    178217    void writeData(MessageLMS &msg);
    179218
    180     // SickLMS_dbt dbtData_;
    181     pacpus::DbiteFile dbtFile_;
    182     std::ofstream dataFile_;
     219    pacpus::DbiteFile dbtFile_; //!< DBT file.
     220    std::ofstream dataFile_; //!< UTC file.
    183221
    184222#ifdef SickLMS_SH_MEM
Note: See TracChangeset for help on using the changeset viewer.