Changeset 99 in pacpussensors for trunk/Wifibot/wifibot.cpp
- Timestamp:
- Oct 15, 2015, 2:47:01 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Wifibot/wifibot.cpp
r22 r99 5 5 // author: Pierre Hudelaine 6 6 // Copyright Heudiasyc UMR UTC/CNRS 7253 7 // 7 // 8 8 // version: $Id: $ 9 9 // … … 22 22 // Construct the factory 23 23 ////////////////////////////////////////////////////////////////////////// 24 static ComponentFactory <Wifibot> sFactory("Wifibot"); 24 static ComponentFactory <Wifibot> sFactory("Wifibot"); 25 25 26 26 ////////////////////////////////////////////////////////////////////////// … … 28 28 ////////////////////////////////////////////////////////////////////////// 29 29 Wifibot::Wifibot(QString name) 30 : ComponentBase( name ) 30 : ComponentBase( name ) 31 31 { 32 33 } 32 33 } 34 34 35 35 … … 37 37 // Destructor 38 38 ////////////////////////////////////////////////////////////////////////// 39 Wifibot::~Wifibot() 39 Wifibot::~Wifibot() 40 40 { 41 41 42 42 } 43 43 44 44 ////////////////////////////////////////////////////////////////////////// 45 // Called by the ComponentManager to pass the XML parameters to the 46 // component 45 // Called by the ComponentManager to pass the XML parameters to the 46 // component 47 47 ////////////////////////////////////////////////////////////////////////// 48 ComponentBase::COMPONENT_CONFIGURATION Wifibot::configureComponent( XmlComponentConfig config ) 49 { 48 ComponentBase::COMPONENT_CONFIGURATION Wifibot::configureComponent( XmlComponentConfig config ) 49 { 50 50 QString pacpusSocket = config.getProperty("socketComponent"); 51 ComponentManager * mgr = ComponentManager::getInstance();52 pacpusSocket_ = dynamic_cast<Pacpus Socket *>(mgr->getComponent(pacpusSocket));51 //ComponentManager * mgr = ComponentManager::getInstance(); 52 pacpusSocket_ = dynamic_cast<PacpusUDPSocket *>(ComponentManager::getInstance()->getComponent(pacpusSocket).get()); 53 53 if (!pacpusSocket_) { 54 54 qWarning() << "Failed to get component " << pacpusSocket; 55 55 return ComponentBase::NOT_CONFIGURED; 56 56 } 57 58 return ComponentBase::CONFIGURED_OK; 59 } 57 58 return ComponentBase::CONFIGURED_OK; 59 } 60 60 61 61 … … 64 64 // Called by the ComponentManager to start the component 65 65 ////////////////////////////////////////////////////////////////////////// 66 void Wifibot::startActivity() 67 { 66 void Wifibot::startActivity() 67 { 68 68 dualshock = new PS3remote(pacpusSocket_); 69 69 dualshock->start();
Note:
See TracChangeset
for help on using the changeset viewer.