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

Method store

src/openms_gui/source/VISUAL/TOPPASScene.cpp:675–807  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673 }
674
675 bool TOPPASScene::store(const String& file)
676 {
677 Param save_param;
678
679 save_param.setValue("info:version", VersionInfo::getVersion());
680 save_param.setValue("info:num_vertices", vertices_.size());
681 save_param.setValue("info:num_edges", edges_.size());
682 save_param.setValue("info:description", String("<![CDATA[") + String(this->description_text_) + String("]]>"));
683
684 // store all vertices (together with all parameters)
685 foreach(TOPPASVertex * tv, vertices_)
686 {
687 String id(tv->getTopoNr() - 1);
688
689 // common for all vertices
690 save_param.setValue("vertices:" + id + ":recycle_output", tv->isRecyclingEnabled() ? "true" : "false");
691
692 // vertex subclasses
693 TOPPASInputFileListVertex* iflv = qobject_cast<TOPPASInputFileListVertex*>(tv);
694 if (iflv)
695 {
696 // store file names relative to toppas file
697 QDir save_dir(File::path(file).toQString());
698 const QStringList& files_qt = iflv->getFileNames();
699 std::vector<std::string> files;
700 foreach(const QString &file_qt, files_qt)
701 {
702 files.push_back(save_dir.relativeFilePath(file_qt).toStdString());
703 }
704 save_param.setValue("vertices:" + id + ":toppas_type", "input file list");
705 save_param.setValue("vertices:" + id + ":file_names", files);
706 save_param.setValue("vertices:" + id + ":x_pos", tv->x());
707 save_param.setValue("vertices:" + id + ":y_pos", tv->y());
708 continue;
709 }
710
711 TOPPASOutputFileListVertex* oflv = qobject_cast<TOPPASOutputFileListVertex*>(tv);
712 if (oflv)
713 {
714 save_param.setValue("vertices:" + id + ":toppas_type", "output file list");
715 save_param.setValue("vertices:" + id + ":x_pos", tv->x());
716 save_param.setValue("vertices:" + id + ":y_pos", tv->y());
717 save_param.setValue("vertices:" + id + ":output_folder_name", oflv->getOutputFolderName().toStdString());
718 continue;
719 }
720
721 TOPPASToolVertex* ttv = qobject_cast<TOPPASToolVertex*>(tv);
722 if (ttv)
723 {
724 save_param.setValue("vertices:" + id + ":toppas_type", "tool");
725 save_param.setValue("vertices:" + id + ":tool_name", ttv->getName());
726 save_param.setValue("vertices:" + id + ":tool_type", ttv->getType());
727 save_param.insert("vertices:" + id + ":parameters:", ttv->getParam());
728 save_param.setValue("vertices:" + id + ":x_pos", tv->x());
729 save_param.setValue("vertices:" + id + ":y_pos", tv->y());
730 continue;
731 }
732

Callers

nothing calls this directly

Calls 3

StringClass · 0.50
setValueMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected