- Timestamp:
- Oct 23, 2013, 9:34:23 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/PacpusLib/ComponentManager.cpp
r182 r184 16 16 17 17 using namespace pacpus; 18 using namespace pacpus;19 18 20 19 DECLARE_STATIC_LOGGER("pacpus.core.ComponentManager"); … … 183 182 } 184 183 184 bool ComponentManager::checkComponentConnection(const QString& componentName, const QString& connectionName) 185 { 186 if (NULL == getComponent(componentName)) { 187 LOG_WARN("cannot make connection : component " << componentName << " not found"); 188 return false; 189 } 190 if (NULL == getComponent(componentName)->getOutput(connectionName)) { 191 LOG_WARN("cannot make connection : component " << componentName << " does not have input/output " << connectionName); 192 return false; 193 } 194 return true; 195 } 196 185 197 bool ComponentManager::createConnection(const QString& outputSignature, const QString& inputSignature, const QString& type, int priority = 0) 186 198 { 199 // FIXME: use 2 signatures (output component + output connection) instead of 1 separated by a (".") dot 187 200 QStringList output = outputSignature.split("."); 188 201 QStringList input = inputSignature.split("."); 189 202 190 if (getComponent(output[0])==NULL) { 191 LOG_WARN("cannot make connection : component " << output[0] << " not found"); 192 return false;} 193 if (getComponent(output[0])->getOutput(output[1]) == NULL) { 194 LOG_WARN("cannot make connection : component " << output[0] << " doesn't have output " << output[1]); 195 return false;} 196 if (getComponent(input[0])==NULL) { 197 LOG_WARN("cannot make connection : component " << input[0] << " not found"); 198 return false;} 199 if (getComponent(input[0])->getInput(input[1]) == NULL) { 200 LOG_WARN("cannot make connection : component " << input[0] << " doesn't have intput " << input[1]); 201 return false;} 202 203 if (!checkComponentConnection(output[0], output[1])) { 204 return false; 205 } 206 if (!checkComponentConnection(input[0], input[1])) { 207 return false; 208 } 203 209 // NOTE Create communicationInterface if needed ?? 204 210 return connectInterface( … … 207 213 priority 208 214 ); 209 210 215 } 211 216
Note:
See TracChangeset
for help on using the changeset viewer.