Changeset 288 in pacpusframework for trunk/src/DBITEPlayerLib/DbtPlyEngine.cpp
- Timestamp:
- Mar 26, 2014, 9:27:30 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/DBITEPlayerLib/DbtPlyEngine.cpp
r277 r288 10 10 #include <Pacpus/kernel/Log.h> 11 11 12 #include < cassert>12 #include <boost/assert.hpp> 13 13 #include <limits> 14 14 #include <QDir> … … 226 226 void DbtPlyEngine::playEvent() 227 227 { 228 using boost::dynamic_pointer_cast; 229 228 230 LOG_DEBUG("Clicked: play"); 229 231 230 232 // get user interface 231 233 ComponentManager * mgr = ComponentManager::getInstance(); 232 DbtPlyUserInterface * ui = dynamic_cast<DbtPlyUserInterface *>(mgr->getComponent("dbiteUserInterface"));233 assert(ui);234 boost::shared_ptr<DbtPlyUserInterface> ui = dynamic_pointer_cast<DbtPlyUserInterface>(mgr->getComponent("dbiteUserInterface")); 235 BOOST_ASSERT(ui); 234 236 // get time value from slider 235 237 lastTDbt_ = ui->getTime() + tDbtMin_; … … 268 270 void DbtPlyEngine::setState(DbtPlyEngineState * newState) 269 271 { 270 assert(newState);272 BOOST_ASSERT(newState); 271 273 LOG_DEBUG(mCurrentState->toString() << " => " << newState->toString()); 272 274 mCurrentState = newState; … … 284 286 mSpeed = kMaxSpeed; 285 287 } 286 assert(kMinSpeed <= mSpeed);287 assert(mSpeed <= kMaxSpeed);288 BOOST_ASSERT(kMinSpeed <= mSpeed); 289 BOOST_ASSERT(mSpeed <= kMaxSpeed); 288 290 LOG_INFO("event: Speed Up, speed = " << mSpeed); 289 291 Q_EMIT displayStateSig(mCurrentState, mSpeed); … … 296 298 mSpeed = kMinSpeed; 297 299 } 298 assert(kMinSpeed <= mSpeed);299 assert(mSpeed <= kMaxSpeed);300 BOOST_ASSERT(kMinSpeed <= mSpeed); 301 BOOST_ASSERT(mSpeed <= kMaxSpeed); 300 302 LOG_INFO("event: Speed Up, speed = " << mSpeed); 301 303 Q_EMIT displayStateSig(mCurrentState, mSpeed); … … 304 306 void DbtPlyEngine::reset() 305 307 { 308 using boost::dynamic_pointer_cast; 309 306 310 lastTNow_ = road_time(); 307 311 lastTDbt_ = tDbtMin_; … … 311 315 // get user interface 312 316 ComponentManager * mgr = ComponentManager::getInstance(); 313 DbtPlyUserInterface * ui = dynamic_cast<DbtPlyUserInterface *>(mgr->getComponent("dbiteUserInterface"));314 assert(ui);317 boost::shared_ptr<DbtPlyUserInterface> ui = dynamic_pointer_cast<DbtPlyUserInterface>(mgr->getComponent("dbiteUserInterface")); 318 BOOST_ASSERT(ui); 315 319 // reset time value of the slider 316 320 ui->resetTime();
Note:
See TracChangeset
for help on using the changeset viewer.