- Timestamp:
- Oct 31, 2013, 9:48:29 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/Pacpus/kernel/ComponentManager.h
r198 r207 83 83 * @return True if the component exists and has been started, otherwise false. 84 84 */ 85 bool start(const QString & component);85 bool start(const QString & component); 86 86 87 87 /** Stop all the components … … 119 119 bool createComponent(const QString& type, const QString& name); 120 120 121 bool checkComponentConnection(const QString& componentName, const QString& connectionName); 121 bool checkComponent(const QString & componentName); 122 bool checkComponentInput(const QString & componentName, const QString & inputName); 123 bool checkComponentOutput(const QString & componentName, const QString & outputName); 124 122 125 bool createConnection(const QString& type, const QString& name, const QString& , int ); 123 126 -
trunk/src/PacpusLib/ComponentManager.cpp
r206 r207 21 21 22 22 using namespace pacpus; 23 24 //template <typename _Elem, typename _Traits, typename _ListElem>25 //std::basic_ostream<_Elem, _Traits> & operator<<(std::basic_ostream<_Elem, _Traits> & os, const QList<_ListElem> & list)26 //{27 // typedef QList<_ListElem> ListType;28 // for (ListType::const_iterator it = list.cbegin(), itend = list.cend(); it != itend; ++it) {29 // os << *it << "\n";30 // }31 // return os;32 //}33 23 34 24 template <typename _Elem, typename _Traits, typename _ListElem> … … 246 236 } 247 237 248 bool ComponentManager::checkComponent Connection(const QString& componentName, const QString& connectionName)238 bool ComponentManager::checkComponent(const QString & componentName) 249 239 { 250 240 if (NULL == getComponent(componentName)) { 251 LOG_WARN("cannot make connection : component " << componentName << " not found"); 252 return false; 253 } 254 if (NULL == getComponent(componentName)->getOutput(connectionName)) { 255 LOG_WARN("cannot make connection : component " << componentName << " does not have input/output " << connectionName); 241 LOG_WARN("component " << componentName << " does not exist"); 242 return false; 243 } 244 return true; 245 } 246 247 bool ComponentManager::checkComponentInput(const QString & componentName, const QString & inputName) 248 { 249 if (!checkComponent(componentName)) { 250 return false; 251 } 252 if (NULL == getComponent(componentName)->getInput(inputName)) { 253 LOG_WARN("cannot make connection: component " << componentName << " does not have input " << inputName); 254 return false; 255 } 256 return true; 257 } 258 259 bool ComponentManager::checkComponentOutput(const QString & componentName, const QString & outputName) 260 { 261 if (!checkComponent(componentName)) { 262 return false; 263 } 264 if (NULL == getComponent(componentName)->getOutput(outputName)) { 265 LOG_WARN("cannot make connection: component " << componentName << " does not have output " << outputName); 256 266 return false; 257 267 } … … 265 275 QStringList input = inputSignature.split("."); 266 276 267 if (!checkComponent Connection(output[0], output[1])) {268 return false; 269 } 270 if (!checkComponent Connection(input[0], input[1])) {277 if (!checkComponentOutput(output[0], output[1])) { 278 return false; 279 } 280 if (!checkComponentInput(input[0], input[1])) { 271 281 return false; 272 282 } … … 400 410 401 411 if (!createConnection(connectionOutput, connectionInput, connectionType,connectionPriority)) { 402 LOG_ERROR("cannot create connection '" << connectionOutput +"=>"+connectionInput << "'");412 LOG_ERROR("cannot create connection '" << connectionOutput + " => " + connectionInput << "'"); 403 413 continue; 404 414 }
Note:
See TracChangeset
for help on using the changeset viewer.