38 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
44 #include <QtWidgets/QGraphicsScene>
45 #include <QtCore/QProcess>
50 class TOPPASToolVertex;
51 class TOPPASMergerVertex;
52 class TOPPASOutputFileListVertex;
54 class TOPPASResources;
65 virtual void start(
const QString & program,
const QStringList & arguments, OpenMode mode = ReadWrite);
128 ST_REFRESH_REMAINSINVALID
170 void paste(QPointF pos = QPointF());
286 void logTOPPOutput(
const QString & out);
A FakeProcess class.
Definition: TOPPASScene.h:61
virtual void start(const QString &program, const QStringList &arguments, OpenMode mode=ReadWrite)
A more convenient string class.
Definition: String.h:61
An edge representing a data flow in TOPPAS.
Definition: TOPPASEdge.h:62
A special vertex that allows to merge several inputs.
Definition: TOPPASMergerVertex.h:60
A vertex representing an output file list.
Definition: TOPPASOutputFileListVertex.h:51
A dictionary mapping string keys to lists of TOPPASResource objects.
Definition: TOPPASResources.h:57
A container for all visual items of a TOPPAS workflow.
Definition: TOPPASScene.h:87
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:124
@ ST_REFRESH_CHANGED
some parameters were updated, but pipeline is ok
Definition: TOPPASScene.h:126
@ ST_REFRESH_CHANGEINVALID
updating made pipeline invalid
Definition: TOPPASScene.h:127
@ ST_REFRESH_NOCHANGE
no updates required
Definition: TOPPASScene.h:125
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:363
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:331
~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:333
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:349
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:353
TOPPASVertex * potential_target_
The current potential target vertex of the hovering edge.
Definition: TOPPASScene.h:335
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:351
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:327
bool wasChanged()
Returns whether the workflow has been changed since the latest "save".
TOPPASEdge * getHoveringEdge()
returns the hovering edge
bool dry_run_
dry run mode (no tools are actually called)
Definition: TOPPASScene.h:357
void copySelected()
Copies all currently selected edges and vertices.
VertexContainer::const_iterator ConstVertexIterator
A const iterator for vertices.
Definition: TOPPASScene.h:143
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:341
ActionMode
The current action mode (creation of a new edge, or panning of the widget)
Definition: TOPPASScene.h:116
@ AM_NEW_EDGE
Definition: TOPPASScene.h:117
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:355
QList< TOPPASEdge * > EdgeContainer
The container for edges.
Definition: TOPPASScene.h:133
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:137
void openInTOPPView(QStringList all_files)
Emitted when files are triggered for opening in TOPPView.
VertexContainer vertices_
The list of all vertices.
Definition: TOPPASScene.h:329
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:345
void mainWindowNeedsUpdate()
Emitted when the main window needs to be updated.
VertexIterator verticesEnd()
Returns end() iterator of all vertices.
int threads_active_
currently running processes...
Definition: TOPPASScene.h:359
QString tmp_path_
The path for temporary files.
Definition: TOPPASScene.h:339
void paste(QPointF pos=QPointF())
Pastes the copied items.
bool sanityCheck_(bool allowUserOverride)
bool isPipelineRunning()
Returns if a pipeline is currently running.
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:361
bool running_
Indicates if a pipeline is currently running.
Definition: TOPPASScene.h:347
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:337
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 pipelineErrorSlot(const QString msg="")
Called by vertices at which an error occurred during pipeline execution.
void connectOutputVertexSignals(TOPPASOutputFileListVertex *oflv)
Connects the signals to slots.
ActionMode getActionMode()
Returns the action mode.
void unselectAll()
Unselects all items.
VertexContainer::iterator VertexIterator
A mutable iterator for vertices.
Definition: TOPPASScene.h:141
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:343
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:135
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:365
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:139
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:104
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
Stores the information for a TOPP process.
Definition: TOPPASScene.h:94
TOPPASToolVertex * tv
The tool which is started (used to call its slots)
Definition: TOPPASScene.h:111
QString command
The command.
Definition: TOPPASScene.h:107
QStringList args
The arguments.
Definition: TOPPASScene.h:109
QProcess * proc
The process.
Definition: TOPPASScene.h:105
TOPPProcess(QProcess *p, const QString &cmd, const QStringList &arg, TOPPASToolVertex *const tool)
Constructor.
Definition: TOPPASScene.h:96