Changeset 181 in pacpusframework for trunk


Ignore:
Timestamp:
Oct 21, 2013, 1:30:41 PM (11 years ago)
Author:
Marek Kurdej
Message:

Minor fixes. Clean-up.

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/ProducerConsumerExample/CMakeLists.txt

    r163 r181  
    4343    ConsumerExample.h
    4444    ${PROJECT_NAME}.xml
     45    ${EXPORT_HDR}
    4546)
    4647set(PROJECT_SRCS
     
    6667# ========================================
    6768qt_wrap_cpp(
    68      PROJECT_MOC_SRCS
    69      "${FILES_TO_MOC}"
     69    PROJECT_MOC_SRCS
     70    ${FILES_TO_MOC}
    7071 )
    7172
    7273qt_wrap_ui(
    7374    PROJECT_UI_SRCS
    74     "${UI_FILES}"
     75    ${UI_FILES}
    7576)
    7677
  • trunk/include/Pacpus/DbitePlayer/DbtPlyFileManager.h

    r89 r181  
    3131
    3232#include <QThread>
     33#include <string>
    3334
    3435class QSemaphore;
     
    8283public Q_SLOTS:
    8384    /// slot activated by the engine when it computes new DBT time
    84     void  playData(road_time_t tDbt,road_time_t tNow, bool reverse);
     85    void playData(road_time_t tDbt,road_time_t tNow, bool reverse);
    8586
    8687    /// put the file descriptor to the beginning of the file
     
    9899    DbtPlyEngine * mEngine;
    99100
    100     /// the absolute path of the DBT file
    101     QString dbtProperty_;
    102     /// @todo Documentation
    103     QStringList mDbtFilenameList;
     101    QStringList getDbiteFilenameList() const;
    104102
    105103    /// The directory where the DBT file is located
    106104    QString mDbtDataPath;
    107 
    108     /// Display or not the graphical interface
    109     bool mShowGui;
    110105
    111106    /// @todo Documentation
     
    141136
    142137private:
    143     // reading backward?
     138    /// dbt property value
     139    std::string dbtProperty_;
     140    /// @todo Documentation
     141    QStringList mDbtFilenameList;
     142
     143    /// reading backward?
    144144    bool reverse_;
    145145
  • trunk/include/Pacpus/PacpusTools

    • Property svn:global-ignores set to
      PacpusToolsConfig.h
  • trunk/include/Pacpus/kernel

    • Property svn:global-ignores set to
      PacpusLibConfig.h
  • trunk/include/Pacpus/kernel/ComponentBase.h

    r177 r181  
    192192    std::string mName;
    193193    std::string mTypeName;
    194     bool mHasGui;
    195     bool mVerbose;
    196     int mVerbosityLevel;
     194   
     195    /// Whether to display or not the graphical interface (GUI)
     196    bool hasGui() const;
     197    bool isOutputVerbose() const;
     198    int getVerbosityLevel() const;
    197199   
    198200private:
     
    208210
    209211private:
     212    bool mHasGui;
     213    bool mVerbose;
     214    int mVerbosityLevel;
     215
    210216    boost::program_options::options_description mOptionsDescription;
    211217
  • trunk/include/Pacpus/kernel/pacpus.h

    r89 r181  
    5858#endif
    5959
     60struct donnees_gps
     61{
     62    long  ind_qualite;
     63    double x, y;
     64    double lon, lat;
     65    float a, b, phi, sigma_lat, sigma_lon;
     66    road_time_t time;
     67    double alt_msl, d_geoidal;
     68};
     69
     70struct donnees_abs_zy
     71{
     72    float dArD, dArG;
     73    float speed;
     74    road_time_t time;
     75};
     76
     77struct donnees_gyro
     78{
     79    // les mesures sont prises par rapport au point C
     80    // position de la centrale inertielle
     81    // vitesse de lacet (rad.s-1) dans le repère de la masse suspendue
     82    float psi_s;
     83    road_time_t time;
     84};
     85
     86/// Definition of the structure which will be sent for each positioning
     87/// requests -> MapMatching.cpp
     88struct s_MatchedPosition
     89{
     90    int                         state;      /* Etat du serveur de position absolue hybridée*/
     91    double                      x_match;        /* Position Matchée         */
     92    double                      y_match;        /*  en x et y                           */
     93    double                      x;                      /* Position du véhicule         */
     94    double                      y;                      /*      en x et y                               */
     95    double                      theta;          /* cap (par rapport à l'est) dans le système de la carte */
     96    double                      v;                      /* vitesse horizontale par rapport à la terre  */
     97    unsigned long       ID;                     /* ID de la route à laquelle appartient la position matchée */
     98    road_time_t         time;
     99    int                         way;            /* Sens de la route parcourue 1=W2E, 2=E2W*/
     100    double                      dist;           /* abscisse curviligne par rapport au début de la route */
     101    double                      pxx, pyy, pxy; /* covariance de l'erreur en position absolue*/
     102    double                      ptheta;         /*covariance de l'erreur en cap*/
     103    double      error;
     104    donnees_gyro gyro; 
     105    donnees_abs_zy odo;
     106};
     107
    60108#endif // DEF_PACPUS_H
  • trunk/src/DBITEPlayerLib/DbtPlyEngine.cpp

    r179 r181  
    2727static const SpeedType kMinSpeed = 1.0 / 32;
    2828static const SpeedType kMaxSpeed = 32;
     29
     30static const PlayMode kDefaultPlayMode = PlayModeLastData;
    2931
    3032////////////////////////////////////////////////////////////////////////////////
     
    4951    addParameters()
    5052        ("datadir", po::value<string>(&mDataDir)->required(), "set root data directory")
    51         ("replay_mode", po::value<int>(&reinterpret_cast<int&>(replayMode_))->default_value(PlayModeLastData), "set data replay mode")
     53        ("replay_mode", po::value<unsigned>(&reinterpret_cast<unsigned&>(replayMode_))->default_value(kDefaultPlayMode), "set data replay mode")
    5254        ("log-config-file", po::value<string>(&mLoggerConfigFile), "set logger configuration file path")
    5355    ;
  • trunk/src/DBITEPlayerLib/DbtPlyFileManager.cpp

    r176 r181  
    2121DECLARE_STATIC_LOGGER("pacpus.core.DbtPlyFileManager");
    2222
    23 const char * kPropertyVerbose = "verbose";
    24 const int kPropertyVerboseDefaultValue = 1;
    25 
    26 const char * kPropertyDbiteFileName = "dbt";
    27 
    2823// It is the maximum time elapsed between the computation of the tDbt and the data replay in microseconds
    2924static const int kMaxPendingTimeFromEngineMicrosecs = 10000;
     25
     26static const char kFilenameSeparator = '|';
    3027
    3128////////////////////////////////////////////////////////////////////////////////
     
    4037    tMin_ = numeric_limits<road_time_t>::max();
    4138    tMax_ = numeric_limits<road_time_t>::min();
     39
     40    namespace po = boost::program_options;
     41    addParameters()
     42        ("dbt", po::value<std::string>(&dbtProperty_)->required(), "set path to input DbiteFile(s) (*.dbt), separate files by '|'")
     43    ;
     44}
     45
     46QStringList DbtPlyFileManager::getDbiteFilenameList() const
     47{
     48    return mDbtFilenameList;
    4249}
    4350
     
    8289            this, SLOT (beginfile()));
    8390
    84 
    8591    // get the properties in the XML node
    86     /////////////////////////////////////////
    87     {
    88         QString verbose = config.getProperty(kPropertyVerbose);
    89         if (verbose.isNull()) {
    90             LOG_INFO("property " << kPropertyVerbose << " not set."
    91                      << " Set to default = " << kPropertyVerboseDefaultValue
    92                      );
    93             // default value
    94             mVerbose = kPropertyVerboseDefaultValue;
    95         } else {
    96             verbose = verbose.toLower();
    97             LOG_DEBUG("property " << kPropertyVerbose << "=\""
    98                       << verbose.toStdString() << "\"");
    99             mVerbose = verbose.toInt();
    100             LOG_DEBUG("property interpreted as " << kPropertyVerbose << "=\""
    101                       << mVerbose << "\"");
    102         }
    103     }
    104 
    105     /////////////////////////////////////////
    106     dbtProperty_ = config.getProperty(kPropertyDbiteFileName);
    107     mShowGui = config.getProperty("ui").toInt();
    10892    mDbtDataPath = mEngine->getDataDir();
    109 
    110     mDbtFilenameList = dbtProperty_.split("|");
     93    mDbtFilenameList = QString(dbtProperty_.c_str()).split(kFilenameSeparator);
    11194
    11295    for (int i = 0; i < mDbtFilenameList.size(); ++i) {
     
    159142/// Starts activity of the file manager
    160143void DbtPlyFileManager::startActivity()
    161 { 
     144{
    162145    // graphical user interface
    163     if (mShowGui) {
     146    if (hasGui()) {
    164147        displayUI();
    165148    }
  • trunk/src/PacpusLib/ComponentBase.cpp

    r180 r181  
    1313#include <string>
    1414#include <vector>
     15
     16const bool kPropertyVerboseDefaultValue = false;
    1517
    1618namespace po = boost::program_options;
     
    178180    LOG_WARN("Component " << getName() << " does not containt output " << outputName);
    179181    return NULL;
     182}
     183
     184bool ComponentBase::hasGui() const
     185{
     186    return mHasGui;
     187}
     188
     189bool ComponentBase::isOutputVerbose() const
     190{
     191    return mVerbose || (getVerbosityLevel() > 0);
     192}
     193
     194int ComponentBase::getVerbosityLevel() const
     195{
     196    return mVerbosityLevel;
    180197}
    181198
Note: See TracChangeset for help on using the changeset viewer.