12 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
18 #include <QtWidgets/QGraphicsScene>
19 #include <QtCore/QProcess>
24 class TOPPASToolVertex;
25 class TOPPASMergerVertex;
26 class TOPPASOutputFileListVertex;
28 class TOPPASResources;
39 virtual void start(
const QString & program,
const QStringList & arguments, OpenMode mode = ReadWrite);
102 ST_REFRESH_REMAINSINVALID
144 void paste(QPointF pos = QPointF());
260 void logTOPPOutput(
const QString & out);
A FakeProcess class.
Definition: TOPPASScene.h:35
virtual void start(const QString &program, const QStringList &arguments, OpenMode mode=ReadWrite)
A more convenient string class.
Definition: String.h:34
An edge representing a data flow in TOPPAS.
Definition: TOPPASEdge.h:36
A special vertex that allows to merge several inputs.
Definition: TOPPASMergerVertex.h:34
A vertex representing an output file list.
Definition: TOPPASOutputFileListVertex.h:25
A dictionary mapping string keys to lists of TOPPASResource objects.
Definition: TOPPASResources.h:32
Definition: TOPPASScene.h:61
bool askForOutputDir(bool always_ask=true)
Shows a dialog that allows to specify the output directory. If always_ask == false,...
void logToolFinished()
Writes the "tool finished" message to the logfile (and to stdout if no gui available)
RefreshStatus
Pipeline status after refreshParameters() was called.
Definition: TOPPASScene.h:98
@ ST_REFRESH_CHANGED
some parameters were updated, but pipeline is ok
Definition: TOPPASScene.h:100
@ ST_REFRESH_CHANGEINVALID
updating made pipeline invalid
Definition: TOPPASScene.h:101
@ ST_REFRESH_NOCHANGE
no updates required
Definition: TOPPASScene.h:99
void logToolCrashed()
Writes the "tool crashed" message to the logfile (and to stdout if no gui available)
void setPipelineRunning(bool b=true)
void changedParameter(const bool invalidates_running_pipeline)
Invoked by TTV or other vertices if a parameter was edited.
void setOutDir(const QString &dir)
Sets the name of the directory for output files.
void itemReleased()
Called when an item is released.
void terminateCurrentPipeline()
Kills all connected TOPP processes.
void dryRunFinished(int, QProcess::ExitStatus)
Emitted when in dry run mode and asked to run a TOPP tool (to fake success)
int allowed_threads_
maximum number of allowed threads
Definition: TOPPASScene.h:337
void writeToLogFile_(const QString &text)
Writes the text to the logfile.
void setSaveFileName(const String &name)
Sets the file name.
EdgeContainer edges_
The list of all edges.
Definition: TOPPASScene.h:305
~TOPPASScene() override
Destructor.
void messageReady(const QString &msg)
Emitted when there is an important message that needs to be printed in TOPPAS.
TOPPASEdge * hover_edge_
The hovering edge which is currently being created.
Definition: TOPPASScene.h:307
TOPPASVertex * getVertexAt_(const QPointF &pos)
Returns the vertex in the foreground at position pos , if existent, otherwise 0.
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override
VertexIterator verticesBegin()
Returns begin() iterator of all vertices.
void logOutputFileWritten(const String &file)
Writes the "output file written" message to the logfile (and to stdout if no gui available)
void setDescription(const QString &desc)
when description is updated by user, use this to update the description for later storage in file
void snapToGrid()
Makes all vertices snap to the grid.
const QString & getOutDir() const
Returns the name of the directory for output files.
bool error_occured_
true if an error occurred during pipeline execution
Definition: TOPPASScene.h:323
const QString & getTempDir() const
Returns the name of the directory for temporary files.
bool isEdgeAllowed_(TOPPASVertex *u, TOPPASVertex *v)
Returns whether an edge between node u and v would be allowed.
QList< TOPPProcess > topp_processes_queue_
The queue of pending TOPP processes.
Definition: TOPPASScene.h:327
TOPPASVertex * potential_target_
The current potential target vertex of the hovering edge.
Definition: TOPPASScene.h:309
void processFinished()
Called by a finished QProcess to indicate that we are free to start a new one.
void setChanged(bool b)
Sets the changed flag.
bool user_specified_out_dir_
Indicates if the output directory has been specified by the user already.
Definition: TOPPASScene.h:325
bool saveIfChanged()
Saves the pipeline if it has been changed since the last save.
void moveSelectedItems(qreal dx, qreal dy)
Moves all selected items by dx, dy.
void updateHoveringEdgePos(const QPointF &new_pos)
Called when the position of the hovering edge changes.
void runPipeline()
Runs the pipeline.
void quitWithError()
dirty solution: when using ExecutePipeline this slot is called when the pipeline crashes....
void selectionCopied(TOPPASScene *ts)
Emitted when a selection is copied to the clipboard.
void setAllowedThreads(int num_threads)
sets the maximum number of jobs
void include(TOPPASScene *new_scene, QPointF pos=QPointF())
Includes the pipeline scene.
ActionMode action_mode_
The current action mode.
Definition: TOPPASScene.h:301
TOPPASEdge * getHoveringEdge()
returns the hovering edge
bool dry_run_
dry run mode (no tools are actually called)
Definition: TOPPASScene.h:331
void copySelected()
Copies all currently selected edges and vertices.
VertexContainer::const_iterator ConstVertexIterator
A const iterator for vertices.
Definition: TOPPASScene.h:117
bool isDryRun() const
determine dry run status (are tools actually called?)
void addVertex(TOPPASVertex *tv)
Adds a vertex.
bool gui_
Are we in a GUI or is the scene used by ExecutePipeline (at the command line)?
Definition: TOPPASScene.h:315
ActionMode
The current action mode (creation of a new edge, or panning of the widget)
Definition: TOPPASScene.h:90
@ AM_NEW_EDGE
Definition: TOPPASScene.h:91
void connectMergerVertexSignals(TOPPASMergerVertex *tmv)
Connects the signals to slots.
void connectToolVertexSignals(TOPPASToolVertex *ttv)
Connects the signals to slots.
void logToolFailed()
Writes the "tool failed" message to the logfile (and to stdout if no gui available)
void setClipboard(TOPPASScene *clipboard)
Sets the clipboard content.
void topoSort(bool resort_all=true)
Performs a topological sort of all vertices.
TOPPASScene * clipboard_
Stores the clipboard content when requested from TOPPASBase.
Definition: TOPPASScene.h:329
QList< TOPPASEdge * > EdgeContainer
The container for edges.
Definition: TOPPASScene.h:107
void enqueueProcess(const TOPPProcess &process)
Enqueues the process, it will be run when the currently pending processes have finished.
EdgeContainer::const_iterator ConstEdgeIterator
A const iterator for edges.
Definition: TOPPASScene.h:111
void openInTOPPView(QStringList all_files)
Emitted when files are triggered for opening in TOPPView.
VertexContainer vertices_
The list of all vertices.
Definition: TOPPASScene.h:303
void finishHoveringEdge()
Called when the new edge is being "released".
bool changed_
Flag that indicates if the pipeline has been changed since the last save.
Definition: TOPPASScene.h:319
void mainWindowNeedsUpdate()
Emitted when the main window needs to be updated.
VertexIterator verticesEnd()
Returns end() iterator of all vertices.
bool isPipelineRunning() const
Returns if a pipeline is currently running.
int threads_active_
currently running processes...
Definition: TOPPASScene.h:333
QString tmp_path_
The path for temporary files.
Definition: TOPPASScene.h:313
void paste(QPointF pos=QPointF())
Pastes the copied items.
bool sanityCheck_(bool allowUserOverride)
void pipelineErrorSlot(const QString &msg="")
Called by vertices at which an error occurred during pipeline execution.
QString getDescription() const
workflow description (to be displayed in TOPPAS window)
bool isGUIMode() const
is TOPPASScene run in GUI or non-GUI (ExecutePipeline) mode, i.e. are MessageBoxes allowed?
QString description_text_
description text
Definition: TOPPASScene.h:335
bool running_
Indicates if a pipeline is currently running.
Definition: TOPPASScene.h:321
void resetProcessesQueue()
Resets the processes queue.
void logToolStarted()
Writes the "tool started" message to the logfile (and to stdout if no gui available)
RefreshStatus refreshParameters()
Refreshes the parameters of the TOPP tools in this workflow.
void entirePipelineFinished()
Emitted when the entire pipeline execution is finished.
void addHoveringEdge(const QPointF &pos)
Called when a new out edge is supposed to be created.
void createResources(TOPPASResources &resources)
Create resources from the current workflow.
void addEdge(TOPPASEdge *te)
Adds an edge.
void checkIfWeAreDone()
Checks whether all output vertices are finished, and if yes, emits entirePipelineFinished() (called b...
String file_name_
The file name of this pipeline.
Definition: TOPPASScene.h:311
EdgeIterator edgesEnd()
Returns end() iterator of all edges.
void runNextProcess()
Runs the next process in the queue, if any.
void resetDownstream(TOPPASVertex *vertex)
Called when user fires "Resume" action, to clear downstream nodes from previous results.
const String & getSaveFileName()
Returns the file name.
void requestClipboardContent()
Requests the clipboard content from TOPPASBase, will be stored in clipboard_.
void connectOutputVertexSignals(TOPPASOutputFileListVertex *oflv)
Connects the signals to slots.
ActionMode getActionMode()
Returns the action mode.
bool wasChanged() const
Returns whether the workflow has been changed since the latest "save".
void unselectAll()
Unselects all items.
VertexContainer::iterator VertexIterator
A mutable iterator for vertices.
Definition: TOPPASScene.h:115
void updateEdgeColors()
Updates all edge colors (color of green and yellow edges can change when edges are added/removed)
QString out_dir_
The directory where the output files will be written.
Definition: TOPPASScene.h:317
void loadResources(const TOPPASResources &resources)
Loads the resources into the input nodes of this workflow.
EdgeContainer::iterator EdgeIterator
A mutable iterator for edges.
Definition: TOPPASScene.h:109
void connectVertexSignals(TOPPASVertex *tv)
Connects the signals to slots.
void itemClicked()
Called when an item is clicked.
bool store(const String &file)
Stores the pipeline to file, returns true on success.
void load(const String &file)
Loads the pipeline from file.
TOPPASToolVertex * resume_source_
last node where 'resume' was started
Definition: TOPPASScene.h:339
void connectEdgeSignals(TOPPASEdge *e)
Connects the signals to slots.
void abortPipeline()
Terminates the currently running pipeline.
void setActionMode(ActionMode mode)
Sets the action mode.
void changedOutputFolder()
Invoked by OutfilelistVertex of user changed the folder name.
TOPPASScene(QObject *parent, const QString &tmp_path, bool gui=true)
Constructor.
EdgeIterator edgesBegin()
Returns begin() iterator of all edges.
QList< TOPPASVertex * > VertexContainer
The container for vertices.
Definition: TOPPASScene.h:113
void removeSelected()
Removes all currently selected edges and vertices.
void pipelineExecutionFailed()
Emitted when the pipeline execution has failed.
bool dfsVisit_(TOPPASVertex *vertex)
DFS helper method. Returns true, if a back edge has been discovered.
void saveMe()
Emitted when the pipeline should be saved (showing a save as file dialog and so on)
The base class of the different vertex classes.
Definition: TOPPASVertex.h:78
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Stores the information for a TOPP process.
Definition: TOPPASScene.h:68
TOPPASToolVertex * tv
The tool which is started (used to call its slots)
Definition: TOPPASScene.h:85
QString command
The command.
Definition: TOPPASScene.h:81
QStringList args
The arguments.
Definition: TOPPASScene.h:83
QProcess * proc
The process.
Definition: TOPPASScene.h:79
TOPPProcess(QProcess *p, const QString &cmd, const QStringList &arg, TOPPASToolVertex *const tool)
Constructor.
Definition: TOPPASScene.h:70