| 328 | } |
| 329 | |
| 330 | TOPPASEdge::EdgeStatus TOPPASEdge::getToolToolStatus_(TOPPASToolVertex* source_tool, int source_param_index, TOPPASToolVertex* target_tool, int target_param_index) |
| 331 | { |
| 332 | if (source_param_index < 0) |
| 333 | { |
| 334 | return ES_NO_SOURCE_PARAM; |
| 335 | } |
| 336 | if (target_param_index < 0) |
| 337 | { |
| 338 | return ES_NO_TARGET_PARAM; |
| 339 | } |
| 340 | |
| 341 | QVector<TOPPASToolVertex::IOInfo> source_output_files; |
| 342 | source_tool->getOutputParameters(source_output_files); |
| 343 | if (source_param_index >= source_output_files.size()) |
| 344 | { |
| 345 | return ES_TOOL_API_CHANGED; |
| 346 | } |
| 347 | |
| 348 | QVector<TOPPASToolVertex::IOInfo> target_input_files; |
| 349 | target_tool->getInputParameters(target_input_files); |
| 350 | if (target_param_index >= target_input_files.size()) |
| 351 | { |
| 352 | return ES_TOOL_API_CHANGED; |
| 353 | } |
| 354 | |
| 355 | const TOPPASToolVertex::IOInfo& source_param = source_output_files[source_param_index]; |
| 356 | StringList source_param_types = source_param.valid_types; |
| 357 | |
| 358 | const TOPPASToolVertex::IOInfo& target_param = target_input_files[target_param_index]; |
| 359 | StringList target_param_types = target_param.valid_types; |
| 360 | |
| 361 | if (source_param_types.empty() || target_param_types.empty()) |
| 362 | { |
| 363 | // no type specified --> allow edge |
| 364 | return ES_VALID; |
| 365 | } |
| 366 | else |
| 367 | { |
| 368 | // check file type compatibility |
| 369 | bool found_match = false; |
| 370 | for (StringList::iterator s_it = source_param_types.begin(); s_it != source_param_types.end(); ++s_it) |
| 371 | { |
| 372 | String ext_1 = *s_it; |
| 373 | ext_1.toLower(); |
| 374 | found_match = false; |
| 375 | for (StringList::iterator t_it = target_param_types.begin(); t_it != target_param_types.end(); ++t_it) |
| 376 | { |
| 377 | String ext_2 = *t_it; |
| 378 | ext_2.toLower(); |
| 379 | if (ext_1 == ext_2) |
| 380 | { |
| 381 | found_match = true; |
| 382 | break; |
| 383 | } |
| 384 | } |
| 385 | if (found_match) |
| 386 | { |
| 387 | break; |
nothing calls this directly
no test coverage detected