Changeset 288 in pacpusframework for trunk/src/DBITEPlayerLib/DbtPlyUserInterface.cpp
- Timestamp:
- Mar 26, 2014, 9:27:30 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/DBITEPlayerLib/DbtPlyUserInterface.cpp
r152 r288 61 61 ComponentBase::COMPONENT_CONFIGURATION DbtPlyUserInterface::configureComponent(XmlComponentConfig /*config*/) 62 62 { 63 using boost::dynamic_pointer_cast; 64 63 65 ComponentManager * mgr = ComponentManager::getInstance(); 64 mEngine = dynamic_ cast<DbtPlyEngine *>(mgr->getComponent("dbiteEngine"));65 if ( NULL ==mEngine) {66 mEngine = dynamic_pointer_cast<DbtPlyEngine>(mgr->getComponent("dbiteEngine")); 67 if (!mEngine) { 66 68 LOG_FATAL("cannot get a pointer of the 'dbiteEngine' component"); 67 69 return CONFIGURED_FAILED; … … 275 277 componentTableWidget->setItem(idx, 0, new QTableWidgetItem(componentName)); 276 278 277 ComponentBase * component = mgr->getComponent(componentName); 278 if (component) { 279 COMPONENT_STATE state = component->getState(); 280 281 QString stateString; 282 switch (state) { 283 case STOPPED: 284 stateString = tr("Stopped"); 285 break; 286 case NOT_MONITORED: 287 stateString = tr("Not monitored"); 288 break; 289 case MONITOR_OK: 290 stateString = tr("Monitor OK"); 291 break; 292 case MONITOR_NOK: 293 stateString = tr("Monitor wrong"); 294 break; 295 296 default: 297 stateString = tr("UNKNOWN"); 298 break; 299 } 300 componentTableWidget->setItem(idx, 1, new QTableWidgetItem(stateString)); 301 302 // TODO: ADD component type and some detailed information (e.g. parameters) 303 //QString componentInfo = component->getDetails(); 304 //componentTableWidget->setItem(idx, 2, new QTableWidgetItem(componentInfo)); 279 ComponentSharedPointer component = mgr->getComponent(componentName); 280 if (!component) { 281 continue; 305 282 } 283 284 COMPONENT_STATE state = component->getState(); 285 286 QString stateString; 287 switch (state) { 288 case STOPPED: 289 stateString = tr("Stopped"); 290 break; 291 case NOT_MONITORED: 292 stateString = tr("Not monitored"); 293 break; 294 case MONITOR_OK: 295 stateString = tr("Monitor OK"); 296 break; 297 case MONITOR_NOK: 298 stateString = tr("Monitor wrong"); 299 break; 300 301 default: 302 stateString = tr("UNKNOWN"); 303 break; 304 } 305 componentTableWidget->setItem(idx, 1, new QTableWidgetItem(stateString)); 306 307 // TODO: ADD component type and some detailed information (e.g. parameters) 308 //QString componentInfo = component->getDetails(); 309 //componentTableWidget->setItem(idx, 2, new QTableWidgetItem(componentInfo)); 306 310 } 307 311 } … … 309 313 void DbtPlyUserInterface::connectButtons() 310 314 { 315 // FIXME: use Qt5 connect style 311 316 connect(playBut, SIGNAL(clicked()), 312 mEngine , SLOT(playEvent()));317 mEngine.get(), SLOT(playEvent())); 313 318 connect(pauseBut, SIGNAL(clicked()), 314 mEngine , SLOT(pauseEvent()));319 mEngine.get(), SLOT(pauseEvent())); 315 320 connect(stopBut, SIGNAL(clicked()), 316 mEngine , SLOT(stopEvent()));321 mEngine.get(), SLOT(stopEvent())); 317 322 connect(speedUpBut, SIGNAL(clicked()), 318 mEngine , SLOT(speedUpEvent()));323 mEngine.get(), SLOT(speedUpEvent())); 319 324 connect(speedDownBut, SIGNAL(clicked()), 320 mEngine , SLOT(speedDownEvent()));325 mEngine.get(), SLOT(speedDownEvent())); 321 326 } 322 327 323 328 void DbtPlyUserInterface::connectDisplay() 324 329 { 325 connect(mEngine , SIGNAL(displayStateSig(DbtPlyEngineState *, float)),330 connect(mEngine.get(), SIGNAL(displayStateSig(DbtPlyEngineState *, float)), 326 331 this, SLOT(displayStateSlot(DbtPlyEngineState *, float))); 327 332 328 connect (mEngine , SIGNAL(timeMinMax(road_time_t, road_time_t)),333 connect (mEngine.get(), SIGNAL(timeMinMax(road_time_t, road_time_t)), 329 334 this, SLOT(displayMinMaxTime(road_time_t , road_time_t))); 330 connect (mEngine , SIGNAL(curReplayTime(road_time_t)),335 connect (mEngine.get(), SIGNAL(curReplayTime(road_time_t)), 331 336 this, SLOT(displayTime(road_time_t))); 332 337 connect (rev, SIGNAL(toggled(bool)), 333 mEngine , SLOT(changeDirection(bool)));338 mEngine.get(), SLOT(changeDirection(bool))); 334 339 } 335 340 … … 337 342 { 338 343 connect (timeSlider, SIGNAL(sliderPressed()), 339 mEngine , SLOT(pauseEvent()));344 mEngine.get(), SLOT(pauseEvent())); 340 345 connect (timeSlider, SIGNAL(sliderReleased()), 341 mEngine , SLOT(playEvent()));346 mEngine.get(), SLOT(playEvent())); 342 347 } 343 348
Note:
See TracChangeset
for help on using the changeset viewer.