|
OpenMS
2.5.0
|
Go to the documentation of this file.
38 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
45 #include <QtWidgets/QMainWindow>
46 #include <QtWidgets/QMdiArea>
47 #include <QtWidgets/QButtonGroup>
48 #include <QtCore/QProcess>
49 #include <QtWidgets/QSplashScreen>
50 #include <QtNetwork/QNetworkReply>
59 class QTreeWidgetItem;
61 class QNetworkAccessManager;
69 class TOPPASLogWindow;
70 class TOPPASResources;
95 void loadPreferences(
String filename =
"");
97 void savePreferences();
99 void loadFiles(
const StringList& list, QSplashScreen* splash_screen);
103 void addTOPPASFile(
const String& file_name,
bool in_new_window =
true);
105 void openFileDialog();
107 void openExampleDialog();
109 void newPipeline(
const int id = -1);
111 void includePipeline();
113 void saveCurrentPipelineAs();
117 void exportAsImage();
119 void loadPipelineResourceFile();
121 void savePipelineResourceFile();
123 void openOnlinePipelineRepository();
125 void preferencesDialog();
127 void updateCurrentPath();
129 void updateTabBar(QMdiSubWindow* w);
131 void showAboutDialog();
140 void showStatusMessage(std::string msg,
OpenMS::UInt time);
142 void showCursorStatus(
double x,
double y);
146 void updateToolBar();
150 void abortPipeline();
160 void outputVertexFinished(
const String& file);
162 void updateTOPPOutputLog(
const QString& out);
164 void showPipelineFinishedLogMessage();
168 void sendClipboardContent();
170 void refreshParameters();
172 void openFilesInTOPPView(QStringList all_files);
174 void openToppasFile(QString filename);
180 void closeByTab(
int id);
183 void focusByTab(
int id);
189 void showAsWindow_(
TOPPASWidget* sw,
const String& caption,
const int special_id = -1);
191 void insertNewVertex_(
double x,
double y, QTreeWidgetItem* item =
nullptr);
193 void insertNewVertexInCenter_(QTreeWidgetItem* item);
196 void downloadTOPPASfromHomepage_(
const QUrl& url);
198 void toppasFileDownloaded_(QNetworkReply* r);
200 void TOPPASreadyRead();
203 void descriptionUpdated_();
239 QLabel* message_label_;
265 void closeEvent(QCloseEvent* event)
override;
266 void keyPressEvent(QKeyEvent* e)
override;
277 void showLogMessage_(LogState state,
const String& heading,
const String& body);
285 static int const IDINITIALUNTITLED = 1000;
294 static QString savePipelineAs(
TOPPASWidget* w, QString current_path);
297 static QString loadPipelineResourceFile(
TOPPASWidget* w, QString current_path);
300 static QString savePipelineResourceFile(
TOPPASWidget* w, QString current_path);
303 static QString refreshPipelineParameters(
TOPPASWidget* tw, QString current_path);
void toolStarted()
Called when a tool is started.
Definition: TOPPASBase.cpp:1352
void openFileDialog()
shows the dialog for opening files
Definition: TOPPASBase.cpp:532
static DateTime now()
Returns the current date and time.
static void startTOPPView(const QStringList &args)
Open TOPPView (e.g. from within TOPPAS)
void store(const String &filename, const Param ¶m) const
Write XML file.
static void openURL(const QString &target)
void showAboutDialog()
Shows the 'About' dialog.
Definition: TOPPASBase.cpp:1111
Management and storage of parameters / INI files.
Definition: Param.h:73
void showAsWindow_(TOPPASWidget *sw, const String &caption, const int special_id=-1)
Shows the widget as window in the workspace (the special_id is only used for the first untitled widge...
Definition: TOPPASBase.cpp:830
void setValue(const String &key, const DataValue &value, const String &description="", const StringList &tags=StringList())
Sets a value.
Param defaults_
Container for default parameters. This member should be filled in the constructor of derived classes!
Definition: DefaultParamHandler.h:156
updating made pipeline invalid
Definition: TOPPASScene.h:127
void print_usage(Logger::LogStream &stream=OpenMS_Log_info)
Definition: TOPPAS.cpp:100
QNetworkReply * network_reply_
the content of the network request
Definition: TOPPASBase.h:226
void savePipeline()
saves the pipeline (determined by Qt's sender mechanism)
Definition: TOPPASBase.cpp:618
bool isToolReady() const
underlying TOPP tool found and parameters fetched?! (done in C'Tor)
bool store(const String &file)
Stores the pipeline to file, returns true on success.
void sendClipboardContent()
Sends the clipboard content to the sender of the connected signal.
Definition: TOPPASBase.cpp:1471
String toString(bool full_precision=true) const
Conversion to String full_precision Controls number of fractional digits for all double types or list...
QListWidget * blocks_list_
List of ready analysis pipelines.
Definition: TOPPASBase.h:234
void closeEvent(QCloseEvent *event) override
Definition: TOPPASBase.cpp:900
static qreal z_value_
z-value counter for new inserted nodes (new nodes should be on top)
Definition: TOPPASBase.h:258
Tree view implementation for the list of TOPP tools.
Definition: TOPPASTreeView.h:54
void showLogMessage_(LogState state, const String &heading, const String &body)
Shows a log message in the log_ window.
Definition: TOPPASBase.cpp:1189
void addTOPPASFile(const String &file_name, bool in_new_window=true)
opens the file in a new window
Definition: TOPPASBase.cpp:545
const String & getSaveFileName()
Returns the file name.
int addTab(const String &text, int id)
Adds a new tab with the name text and the identifier id.
void showURL()
shows the URL stored in the data of the sender QAction
Definition: TOPPASBase.cpp:920
void openFilesInTOPPView(QStringList all_files)
Open files in a new TOPPView instance.
Definition: TOPPASBase.cpp:1541
void insert(std::ostream &s)
#define OPENMS_LOG_INFO
Macro if a information, e.g. a status should be reported.
Definition: LogStream.h:465
static QString refreshPipelineParameters(TOPPASWidget *tw, QString current_path)
Refreshes the TOPP tools parameters of the pipeline.
Definition: TOPPASBase.cpp:1492
bool exists(const String &key) const
Tests if a parameter is set (expecting its fully qualified name, e.g., TextExporter:1:proteins_only)
void newPipeline(const int id=-1)
shows the dialog for creating a new file (pass IDINITIALUNTITLED as id if its the first call)
Definition: TOPPASBase.cpp:612
void openExampleDialog()
shows the dialog for opening example files
Definition: TOPPASBase.cpp:521
A vertex representing a TOPP tool.
Definition: TOPPASToolVertex.h:59
void defaultsToParam_()
Updates the parameters after the defaults have been set in the constructor.
void includePipeline()
shows the dialog for including another workflow in the currently opened one
Definition: TOPPASBase.cpp:539
void updateMenu()
enable/disable menu entries depending on the current state
Definition: TOPPASBase.cpp:1116
void connectVertexSignals(TOPPASVertex *tv)
Connects the signals to slots.
void setCurrentId(int id)
Selects the tab with identifier id.
TOPPASScene * getScene()
Returns the scene.
#define OPENMS_LOG_ERROR
Macro to be used if non-fatal error are reported (processing continues)
Definition: LogStream.h:455
~TOPPASBase() override
Destructor.
Definition: TOPPASBase.cpp:283
void topoSort(bool resort_all=true)
Performs a topological sort of all vertices.
void exportAsImage()
exports the current pipeline as image
Definition: TOPPASBase.cpp:708
Exception indicating that an invalid parameter was handed over to an algorithm.
Definition: Exception.h:347
static ToolListType getUtilList()
Returns the list of official UTIL tools contained in the OpenMS/TOPP release.
void savePipelineResourceFile()
shows a file dialog for selecting the resource file to write to
Definition: TOPPASBase.cpp:795
Map class based on the STL map (containing several convenience functions)
Definition: Map.h:50
void insertNewVertexInCenter_(QTreeWidgetItem *item)
Inserts the item in the middle of the current window.
Definition: TOPPASBase.cpp:1449
TOPPASTabBar * tab_bar_
Tab bar. The address of the corresponding window to a tab is stored as an int in tabData()
Definition: TOPPASBase.h:229
Log Stream Class.
Definition: LogStream.h:311
TOPPASLogWindow * log_
Log output window.
Definition: TOPPASBase.h:208
A vertex representing an output file list.
Definition: TOPPASOutputFileListVertex.h:49
Main window of the TOPPAS tool.
Definition: TOPPASBase.h:77
void parseCommandLine(const int argc, const char **argv, const String &prefix="")
Parses command line arguments.
Warning.
Definition: TOPPASBase.h:273
Widget visualizing and allowing to edit TOPP pipelines.
Definition: TOPPASWidget.h:60
The file pendant of the Param class used to load and store the param datastructure as paramXML.
Definition: ParamXMLFile.h:49
void loadFiles(const StringList &list, QSplashScreen *splash_screen)
loads the files and updates the splash screen
Definition: TOPPASBase.cpp:510
QString getDescription() const
workflow description (to be displayed in TOPPAS window)
Convenience tab bar implementation.
Definition: TOPPASTabBar.h:59
void toolFailed()
Called when a tool execution fails.
Definition: TOPPASBase.cpp:1406
int getLine() const noexcept
Returns the line number where it occurred.
pipeline was not valid before and is invalid afterwards
Definition: TOPPASScene.h:128
void toolFinished()
Called when a tool is finished.
Definition: TOPPASBase.cpp:1370
void closeFile()
closes the active window
Definition: TOPPASBase.cpp:986
void setClipboard(TOPPASScene *clipboard)
Sets the clipboard content.
static StringList getTypes(const String &toolname)
get all types of a tool (empty if none)
void createResources(TOPPASResources &resources)
Create resources from the current workflow.
TOPPASScene * clipboard_scene_
The clipboard.
Definition: TOPPASBase.h:280
static const int IDINITIALUNTITLED
use this for the first call to newPipeline(), to ensure that the first empty (and unmodified) workspa...
Definition: TOPPASBase.h:285
void keyPressEvent(QKeyEvent *e) override
Definition: TOPPASBase.cpp:1214
Unable to create file exception.
Definition: Exception.h:636
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
void toppasFileDownloaded_(QNetworkReply *r)
triggered when download of .toppas file is finished, so we can store & open it
Definition: TOPPASBase.cpp:305
void showStatusMessage(std::string msg, OpenMS::UInt time)
Shows a status message in the status bar.
Definition: TOPPASBase.cpp:995
const char * what() const noexcept override
Returns the error message of the exception.
bool wasChanged()
Returns whether the workflow has been changed since the latest "save".
void refreshParameters()
Refreshes the parameters of the TOPP tools of the current workflow and stores an updated workflow inc...
Definition: TOPPASBase.cpp:1480
void toolCrashed()
Called when a tool crashes.
Definition: TOPPASBase.cpp:1388
const DataValue & getValue(const String &key) const
Returns a value of a parameter.
static String getOpenMSDataPath()
Returns the OpenMS data path (environment variable overwrites the default installation path)
void outputVertexFinished(const String &file)
Called when a file was successfully written to an output vertex.
Definition: TOPPASBase.cpp:1424
DateTime Class.
Definition: DateTime.h:54
QMdiArea * ws_
Main workspace.
Definition: TOPPASBase.h:219
A dictionary mapping string keys to lists of TOPPASResource objects.
Definition: TOPPASResources.h:55
TOPPASWidget * activeSubWindow_() const
returns a pointer to the active TOPPASWidget (0 if none is active)
Definition: TOPPASBase.cpp:942
const char * getFile() const noexcept
Returns the file where it occurred.
void setChanged(bool b)
Sets the changed flag.
QToolBar * tool_bar_
Definition: TOPPASBase.h:215
void loadPreferences(String filename="")
Loads the preferences from the filename given.
Definition: TOPPASBase.cpp:1032
QWebView * webview_
OpenMS homepage workflow browser.
Definition: TOPPASBase.h:222
String current_path_
Definition: TOPPASBase.h:249
bool saveIfChanged()
Saves the pipeline if it has been changed since the last save.
void savePreferences()
stores the preferences (used when this window is closed)
Definition: TOPPASBase.cpp:1089
void abortPipeline()
Terminates the currently running pipeline.
void abortPipeline()
Terminates the current pipeline.
Definition: TOPPASBase.cpp:1342
void connectToolVertexSignals(TOPPASToolVertex *ttv)
Connects the signals to slots.
Logger::LogStream OpenMS_Log_debug
Global static instance of a LogStream to capture messages classified as debug output....
VertexIterator verticesEnd()
Returns end() iterator of all vertices.
void runPipeline()
Runs the pipeline of the current window.
Definition: TOPPASBase.cpp:1333
void saveToClipboard(TOPPASScene *scene)
Saves scene to the clipboard.
Definition: TOPPASBase.cpp:1461
const char * tool_name
Definition: TOPPAS.cpp:94
void store(const QString &file_name)
Writes the dictionary to file file_name.
The base class of the different vertex classes.
Definition: TOPPASVertex.h:101
void updateTOPPOutputLog(const QString &out)
Called when a TOPP tool produces (error) output.
Definition: TOPPASBase.cpp:1430
void setParameters(const Param ¶m)
Sets the parameters.
void setValidStrings(const String &key, const std::vector< String > &strings)
Sets the valid strings for the parameter key.
void openOnlinePipelineRepository()
opens the OpenMS Homepage to download example workflows
Definition: TOPPASBase.cpp:393
static TOPPASTreeView * createTOPPToolsTreeWidget(QWidget *parent_widget=nullptr)
Creates and fills a tree widget with all available tools.
Definition: TOPPASBase.cpp:434
const String & getType() const
Returns the type of the tool.
#define OPENMS_LOG_DEBUG
Macro for general debugging information.
Definition: LogStream.h:470
static QString savePipelineAs(TOPPASWidget *w, QString current_path)
Definition: TOPPASBase.cpp:683
void setWindowId(Int id) override
setter from EnhancedTabBarWidgetInterface
void loadResources(const TOPPASResources &resources)
Loads the resources into the input nodes of this workflow.
void addVertex(TOPPASVertex *tv)
Adds a vertex.
static int node_offset_
Offset counter for new inserted nodes (to avoid invisible stacking)
Definition: TOPPASBase.h:255
TOPPASWidget * window_(int id) const
returns the window with id id
Definition: TOPPASBase.cpp:926
void downloadTOPPASfromHomepage_(const QUrl &url)
triggered when user clicks a link - if it ends in .TOPPAS we're done
Definition: TOPPASBase.cpp:365
QTextEdit implementation with a "clear" button in the context menu.
Definition: TOPPASLogWindow.h:50
Logger::LogStream OpenMS_Log_info
Global static instance of a LogStream to capture messages classified as information....
static ToolListType getTOPPToolList(const bool includeGenericWrapper=false)
Returns the list of official TOPP tools contained in the OpenMS/TOPP release.
void showPipelineFinishedLogMessage()
Called by the scene if the pipeline execution finishes successfully.
Definition: TOPPASBase.cpp:1444
QLabel * message_label_
Label for messages in the status bar.
Definition: TOPPASBase.h:240
void preferencesDialog()
shows the preferences dialog
Definition: TOPPASBase.cpp:824
void runPipeline()
Runs the pipeline.
void updateCurrentPath()
changes the current path according to the currently active window/layer
Definition: TOPPASBase.cpp:1230
Param copy(const String &prefix, bool remove_prefix=false) const
Returns a new Param object containing all entries that start with prefix.
bool hasSubstring(const String &string) const
true if String contains the string, false otherwise
LogState
Log message states.
Definition: TOPPASBase.h:270
void loadPipelineResourceFile()
shows a file dialog for selecting the resource file to load
Definition: TOPPASBase.cpp:770
void saveCurrentPipelineAs()
shows the dialog for saving the current file and updates the current tab caption
Definition: TOPPASBase.cpp:671
void getTime(UInt &hour, UInt &minute, UInt &second) const
Fills the arguments with the time.
Int getWindowId() override
getter from EnhancedTabBarWidgetInterface
void showCursorStatus(double x, double y)
shows x,y coordinates in the status bar
Definition: TOPPASBase.cpp:1009
static bool exists(const String &file)
Method used to test if a file exists.
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:91
void include(TOPPASScene *new_scene, QPointF pos=QPointF())
Includes the pipeline scene.
void load(const String &file)
Loads the pipeline from file.
QString toQString() const
Conversion to Qt QString.
double getClockTime() const
int main(int argc, const char **argv)
Definition: TOPPAS.cpp:115
QNetworkAccessManager * network_manager_
download .toppas files from homepage
Definition: TOPPASBase.h:224
RefreshStatus refreshParameters()
Refreshes the parameters of the TOPP tools in this workflow.
static bool removeDirRecursively(const String &dir_name)
Removes the subdirectories of the specified directory (absolute path). Returns true if successful.
A vertex representing an input file list.
Definition: TOPPASInputFileListVertex.h:49
void insertNewVertex_(double x, double y, QTreeWidgetItem *item=nullptr)
Inserts a new TOPP tool in the current window at (x,y)
Definition: TOPPASBase.cpp:1246
Base::iterator Iterator
Definition: Map.h:80
void setDescription(const QString &desc)
when description is updated by user, use this to update the description for later storage in file
QTextEdit * desc_
Workflow Description window.
Definition: TOPPASBase.h:210
void TOPPASreadyRead()
debug...
Definition: TOPPASBase.cpp:357
File not readable exception.
Definition: Exception.h:537
Exception base class.
Definition: Exception.h:89
VertexIterator verticesBegin()
Returns begin() iterator of all vertices.
A more convenient string class.
Definition: String.h:58
String getName() const override
returns the name of the TOPP tool
Extension to the QApplication for running TOPPs GUI tools.
Definition: QApplicationTOPP.h:50
no updates required
Definition: TOPPASScene.h:125
A container for all visual items of a TOPPAS workflow.
Definition: TOPPASScene.h:85
void descriptionUpdated_()
user edited the workflow description
Definition: TOPPASBase.cpp:294
UInt getTopoNr()
Returns the topological sort number.
File is empty.
Definition: Exception.h:594
void updateToolBar()
updates the toolbar
Definition: TOPPASBase.cpp:1014
Fatal error.
Definition: TOPPASBase.h:274
void updateTabBar(QMdiSubWindow *w)
brings the tab corresponding to the active window in front
Definition: TOPPASBase.cpp:1019
void load(const String &filename, Param ¶m)
Read XML file.
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
RefreshStatus
Pipeline status after refreshParameters() was called.
Definition: TOPPASScene.h:123
Notice.
Definition: TOPPASBase.h:272
void connectOutputVertexSignals(TOPPASOutputFileListVertex *oflv)
Connects the signals to slots.
Logger::LogStream OpenMS_Log_error
Global static instance of a LogStream to capture messages classified as errors. By default it is boun...
String tmp_path_
The path for temporary files.
Definition: TOPPASBase.h:252
Invalid value exception.
Definition: Exception.h:335
static String getVersion()
Return the version number of OpenMS.
StopWatch Class.
Definition: StopWatch.h:59
void removeId(int id)
Remove the tab with identifier id.
A special vertex that allows to merge several inputs.
Definition: TOPPASMergerVertex.h:58
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
void load(const QString &file_name)
Loads the dictionary from file file_name.
VertexContainer::iterator VertexIterator
A mutable iterator for vertices.
Definition: TOPPASScene.h:141
Base::const_iterator ConstIterator
Definition: Map.h:81
static String getUniqueName(bool include_hostname=true)
Returns a string, consisting of date, time, hostname, process id, and a incrementing number....
static String basename(const String &file)
Returns the basename of the file (without the path).
File not found exception.
Definition: Exception.h:523
A special vertex that allows to split a list of inputs.
Definition: TOPPASSplitterVertex.h:53
static void showAboutDialog(QWidget *parent, const QString &toolname)
Show the About-Dialog with License and Citation for all GUI tools.
Definition: QApplicationTOPP.cpp:131
QTreeWidget * tools_tree_view_
Tree view of all available TOPP tools.
Definition: TOPPASBase.h:232
void setMaxLength(int max_length)
set max_length
void closeByTab(int id)
Closes the window corresponding to the data of the tab with identifier id.
Definition: TOPPASBase.cpp:952
void updateEdgeColors()
Updates all edge colors (color of green and yellow edges can change when edges are added/removed)
void openToppasFile(QString filename)
Opens a toppas file.
Definition: TOPPASBase.cpp:1567
static String getTempDirectory()
The current OpenMS temporary data path (for temporary files)
Param param_
Container for current parameters.
Definition: DefaultParamHandler.h:149
Parse Error exception.
Definition: Exception.h:622
bool isPipelineRunning()
Returns if a pipeline is currently running.
void focusByTab(int id)
Raises the window corresponding to the data of the tab with identifier id.
Definition: TOPPASBase.cpp:967