Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Classes | Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

TOPPASToolVertex Class Reference
[TOPPAS]

A vertex representing a TOPP tool. More...

#include <OpenMS/VISUAL/TOPPASToolVertex.h>

Inheritance diagram for TOPPASToolVertex:
TOPPASVertex QObject QGraphicsItem

List of all members.

Classes

struct  IOInfo
 Stores the information for input/output files/lists. More...

Public Types

enum  TOOLSTATUS {
  TOOL_READY, TOOL_SCHEDULED, TOOL_RUNNING, TOOL_SUCCESS,
  TOOL_CRASH, TOOLSTATUS_SIZE
}
 

current status of the vertex

More...

Public Slots

void executionFinished (int ec, QProcess::ExitStatus es)
 Called when the execution of this tool has finished.
void forwardTOPPOutput ()
 Called when the running TOPP tool produces output.
void toolStartedSlot ()
 Called when the tool is started.
void toolFinishedSlot ()
 Called when the tool has finished.
void toolCrashedSlot ()
 Called when the tool has crashed.
void toolFailedSlot ()
 Called when the tool has failed.
virtual void toolScheduledSlot ()
 Called when the tool was scheduled for running.
virtual void inEdgeHasChanged ()
 Called by an incoming edge when it has changed.
virtual void outEdgeHasChanged ()
 Called by an outgoing edge when it has changed.

Signals

void toolStarted ()
 Emitted when the tool is started.
void toolFinished ()
 Emitted when the tool is finished.
void toolCrashed ()
 Emitted when the tool crashes.
void toolFailed (const QString &message="")
 Emitted when the tool execution fails.
void toppOutputReady (const QString &out)
 Emitted from forwardTOPPOutput() to forward the signal outside.

Public Member Functions

 TOPPASToolVertex ()
 Default constructor.
 TOPPASToolVertex (const String &name, const String &type="")
 Constructor.
 TOPPASToolVertex (const TOPPASToolVertex &rhs)
 Copy constructor.
virtual ~TOPPASToolVertex ()
 Destructor.
TOPPASToolVertexoperator= (const TOPPASToolVertex &rhs)
 Assignment operator.
virtual String getName () const
 returns the name of the TOPP tool
const StringgetType () const
 Returns the type of the tool.
void getInputParameters (QVector< IOInfo > &input_infos)
 Fills input_infos with the required input file/list parameters together with their valid types.
void getOutputParameters (QVector< IOInfo > &output_infos)
 Fills output_infos with the required output file/list parameters together with their valid types.
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 Paints the item.
virtual QRectF boundingRect () const
 Returns the bounding rectangle of this item.
virtual QPainterPath shape () const
 Returns a more precise shape.
virtual void setTopoNr (UInt nr)
 Sets the topological sort number (overridden in tool and output vertices).
virtual void reset (bool reset_all_files=false)
 Resets the status.
void setParam (const Param &param)
 Sets the Param object of this tool.
const ParamgetParam ()
 Returns the Param object of this tool.
void run ()
 Checks if all parent nodes have finished the tool execution and, if so, runs the tool.
bool updateCurrentOutputFileNames (const RoundPackages &pkg, String &error_message)
TOOLSTATUS getStatus () const
 return if tool failed or is ready etc.
void editParam ()
 Lets the user edit the parameters of the tool.
int numIterations ()
 Returns the number of iterations this tool has to perform.
String getFullOutputDirectory () const
 Returns the full directory (including preceding tmp path).
String getOutputDir () const
 Returns the directory where this tool stores its output files.
void createDirs ()
 Creates all necessary directories.
void openContainingFolder ()
 Opens the folder where the file is contained.
void openInTOPPView ()
 Opens the files in TOPPView.
bool refreshParameters ()
 Refreshes the parameters of this tool, returns if their has been a change.
bool isToolReady () const
 underlying TOPP tool found and parameters fetched?! (done in C'Tor)
void toggleBreakpoint ()
 Toggle breakpoint.
virtual void emitToolStarted ()
 Called when the QProcess in the queue is called: emits 'toolStarted()'.
virtual bool invertRecylingMode ()
 invert status of recycling (overriding base class)

Protected Member Functions

bool doesParamChangeInvalidate_ ()
 determines if according to current status_, a parameter change would invalidate the pipeline status (e.g., because this node was already processed)
bool renameOutput_ ()
 renames SUFFICES of the output files created by the TOPP tool by inspecting file content
bool initParam_ (const QString &old_ini_file="")
 Initializes the parameters with standard values (from -write_ini), uses the parameters from the old_ini_file if given, returns if parameters have changed (if old_ini_file was given).
void getParameters_ (QVector< IOInfo > &io_infos, bool input_params)
 Fills io_infos with the required input/output file/list parameters. If input_params is true, input params are returned, otherwise output params.
void writeParam_ (const Param &param, const QString &ini_file)
 Writes param to the ini_file.
QString toolnameWithWhitespacesForFancyWordWrapping_ (QPainter *painter, const QString &str)
 Helper method for finding good boundaries for wrapping the tool name. Returns a string with whitespaces at the preferred boundaries.
void smartFileNames_ (std::vector< QStringList > &filenames)
reimplemented Qt events

void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *e)

Protected Attributes

String name_
 The name of the tool.
String type_
 The type of the tool, or "" if it does not have a type.
String tmp_path_
 The temporary path.
Param param_
 The parameters of the tool.
TOOLSTATUS status_
 current status of the tool
bool tool_ready_
 tool initialization status: if C'tor was successful in finding the TOPP tool, this is set to 'true'
bool breakpoint_set_
 Breakpoint set?

Static Protected Attributes

static UInt uid_
 UID for output files.

Detailed Description

A vertex representing a TOPP tool.

Besides TOPPASScene, this class contains most of the remaining functionality of TOPPAS regarding the execution of pipelines. Once a pipeline run is started from TOPPASScene, the execution is propagated from tool to tool and the TOPP tools are actually called from here.


Member Enumeration Documentation

enum TOOLSTATUS

current status of the vertex

Enumerator:
TOOL_READY 
TOOL_SCHEDULED 
TOOL_RUNNING 
TOOL_SUCCESS 
TOOL_CRASH 
TOOLSTATUS_SIZE 

Constructor & Destructor Documentation

Default constructor.

TOPPASToolVertex ( const String name,
const String type = "" 
)

Constructor.

TOPPASToolVertex ( const TOPPASToolVertex rhs  ) 

Copy constructor.

virtual ~TOPPASToolVertex (  )  [virtual]

Destructor.


Member Function Documentation

virtual QRectF boundingRect (  )  const [virtual]

Returns the bounding rectangle of this item.

Implements TOPPASVertex.

void createDirs (  ) 

Creates all necessary directories.

bool doesParamChangeInvalidate_ (  )  [protected]

determines if according to current status_, a parameter change would invalidate the pipeline status (e.g., because this node was already processed)

void editParam (  ) 

Lets the user edit the parameters of the tool.

virtual void emitToolStarted (  )  [virtual]

Called when the QProcess in the queue is called: emits 'toolStarted()'.

void executionFinished ( int  ec,
QProcess::ExitStatus  es 
) [slot]

Called when the execution of this tool has finished.

void forwardTOPPOutput (  )  [slot]

Called when the running TOPP tool produces output.

String getFullOutputDirectory (  )  const

Returns the full directory (including preceding tmp path).

void getInputParameters ( QVector< IOInfo > &  input_infos  ) 

Fills input_infos with the required input file/list parameters together with their valid types.

virtual String getName (  )  const [virtual]
String getOutputDir (  )  const

Returns the directory where this tool stores its output files.

void getOutputParameters ( QVector< IOInfo > &  output_infos  ) 

Fills output_infos with the required output file/list parameters together with their valid types.

const Param& getParam (  ) 

Returns the Param object of this tool.

void getParameters_ ( QVector< IOInfo > &  io_infos,
bool  input_params 
) [protected]

Fills io_infos with the required input/output file/list parameters. If input_params is true, input params are returned, otherwise output params.

TOOLSTATUS getStatus (  )  const

return if tool failed or is ready etc.

const String& getType (  )  const
virtual void inEdgeHasChanged (  )  [virtual, slot]

Called by an incoming edge when it has changed.

Reimplemented from TOPPASVertex.

bool initParam_ ( const QString &  old_ini_file = ""  )  [protected]

Initializes the parameters with standard values (from -write_ini), uses the parameters from the old_ini_file if given, returns if parameters have changed (if old_ini_file was given).

virtual bool invertRecylingMode (  )  [virtual]

invert status of recycling (overriding base class)

Reimplemented from TOPPASVertex.

bool isToolReady (  )  const

underlying TOPP tool found and parameters fetched?! (done in C'Tor)

Referenced by TOPPASBase::insertNewVertex_().

void mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  e  )  [protected]

Reimplemented from TOPPASVertex.

int numIterations (  ) 

Returns the number of iterations this tool has to perform.

void openContainingFolder (  ) 

Opens the folder where the file is contained.

void openInTOPPView (  ) 

Opens the files in TOPPView.

TOPPASToolVertex& operator= ( const TOPPASToolVertex rhs  ) 

Assignment operator.

virtual void outEdgeHasChanged (  )  [virtual, slot]

Called by an outgoing edge when it has changed.

Reimplemented from TOPPASVertex.

virtual void paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget widget 
) [virtual]

Paints the item.

Implements TOPPASVertex.

bool refreshParameters (  ) 

Refreshes the parameters of this tool, returns if their has been a change.

bool renameOutput_ (  )  [protected]

renames SUFFICES of the output files created by the TOPP tool by inspecting file content

virtual void reset ( bool  reset_all_files = false  )  [virtual]

Resets the status.

Reimplemented from TOPPASVertex.

void run (  )  [virtual]

Checks if all parent nodes have finished the tool execution and, if so, runs the tool.

Reimplemented from TOPPASVertex.

void setParam ( const Param param  ) 

Sets the Param object of this tool.

virtual void setTopoNr ( UInt  nr  )  [virtual]

Sets the topological sort number (overridden in tool and output vertices).

Reimplemented from TOPPASVertex.

virtual QPainterPath shape (  )  const [virtual]

Returns a more precise shape.

Implements TOPPASVertex.

void smartFileNames_ ( std::vector< QStringList > &  filenames  )  [protected]

smart naming of round-based filenames when basename is not unique we take the preceding directory name

void toggleBreakpoint (  ) 

Toggle breakpoint.

void toolCrashed (  )  [signal]

Emitted when the tool crashes.

void toolCrashedSlot (  )  [slot]

Called when the tool has crashed.

void toolFailed ( const QString &  message = ""  )  [signal]

Emitted when the tool execution fails.

void toolFailedSlot (  )  [slot]

Called when the tool has failed.

void toolFinished (  )  [signal]

Emitted when the tool is finished.

void toolFinishedSlot (  )  [slot]

Called when the tool has finished.

QString toolnameWithWhitespacesForFancyWordWrapping_ ( QPainter *  painter,
const QString &  str 
) [protected]

Helper method for finding good boundaries for wrapping the tool name. Returns a string with whitespaces at the preferred boundaries.

virtual void toolScheduledSlot (  )  [virtual, slot]

Called when the tool was scheduled for running.

void toolStarted (  )  [signal]

Emitted when the tool is started.

void toolStartedSlot (  )  [slot]

Called when the tool is started.

void toppOutputReady ( const QString &  out  )  [signal]

Emitted from forwardTOPPOutput() to forward the signal outside.

bool updateCurrentOutputFileNames ( const RoundPackages pkg,
String error_message 
)

Updates the vector containing the lists of current output files for all output parameters using the input files as guidance Returns true on success, on failure the error_message is filled

void writeParam_ ( const Param param,
const QString &  ini_file 
) [protected]

Writes param to the ini_file.


Member Data Documentation

bool breakpoint_set_ [protected]

Breakpoint set?

String name_ [protected]

The name of the tool.

Param param_ [protected]

The parameters of the tool.

TOOLSTATUS status_ [protected]

current status of the tool

String tmp_path_ [protected]

The temporary path.

bool tool_ready_ [protected]

tool initialization status: if C'tor was successful in finding the TOPP tool, this is set to 'true'

String type_ [protected]

The type of the tool, or "" if it does not have a type.

UInt uid_ [static, protected]

UID for output files.


OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:58 using doxygen 1.7.1