Changeset 181 in pacpusframework for trunk/src/DBITEPlayerLib


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

Minor fixes. Clean-up.

Location:
trunk/src/DBITEPlayerLib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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    }
Note: See TracChangeset for help on using the changeset viewer.