MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / sanityCheck_

Method sanityCheck_

src/openms_gui/source/VISUAL/TOPPASScene.cpp:2028–2203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2026 }
2027
2028 bool TOPPASScene::sanityCheck_(bool allowUserOverride)
2029 {
2030 QStringList strange_vertices;
2031
2032 // ----- are there any input nodes and are files specified? ----
2033
2034 /// check if we have any input nodes
2035 QVector<TOPPASInputFileListVertex*> input_nodes;
2036 foreach(TOPPASVertex* tv, vertices_)
2037 {
2038 TOPPASInputFileListVertex* iflv = qobject_cast<TOPPASInputFileListVertex*>(tv);
2039 if (iflv)
2040 {
2041 input_nodes.push_back(iflv);
2042 }
2043 }
2044 if (input_nodes.empty())
2045 {
2046 if (allowUserOverride)
2047 {
2048 QMessageBox::warning(nullptr, "No input files", "The pipeline does not contain any input file nodes!");
2049 }
2050 else
2051 {
2052 std::cerr << "The pipeline does not contain any input file nodes!" << std::endl;
2053 }
2054 return false;
2055 }
2056
2057 /// warn about empty input nodes
2058 foreach(TOPPASInputFileListVertex* iflv, input_nodes)
2059 {
2060 if ((iflv->outgoingEdgesCount() > 0) && (iflv->getFileNames().empty())) // allow disconnected input node with empty file list
2061 {
2062 strange_vertices.push_back(QString::number(iflv->getTopoNr()));
2063 }
2064 }
2065 if (!strange_vertices.empty())
2066 {
2067 if (allowUserOverride)
2068 {
2069 QMessageBox::warning(views().first(), "Empty input file nodes",
2070 QString("Node")
2071 + (strange_vertices.size() > 1 ? "s " : " ")
2072 + strange_vertices.join(", ")
2073 + (strange_vertices.size() > 1 ? " have " : " has ")
2074 + " an empty input file list!");
2075 }
2076 else
2077 {
2078 std::cerr << "Pipeline contains input file nodes without specified files!" << std::endl;
2079 }
2080 return false;
2081 }
2082
2083 /// check if input files exist
2084 strange_vertices.clear();
2085 foreach(TOPPASInputFileListVertex* iflv, input_nodes)

Callers

nothing calls this directly

Calls 4

QStringClass · 0.50
emptyMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected