Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
TOPPASBase.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2015.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Johannes Junker $
32 // $Authors: Johannes Junker, Chris Bielow $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_VISUAL_APPLICATIONS_TOPPASBASE_H
36 #define OPENMS_VISUAL_APPLICATIONS_TOPPASBASE_H
37 
38 // OpenMS_GUI config
40 
41 //OpenMS
44 
45 //QT
46 #include <QtGui/QMainWindow>
47 #include <QtGui/QWorkspace>
48 #include <QtGui/QButtonGroup>
49 #include <QtCore/QProcess>
50 #include <QtGui/QSplashScreen>
51 
52 class QToolBar;
53 class QListWidget;
54 class QTextEdit;
55 class QWorkspace;
56 class QLabel;
57 class QWidget;
58 class QTreeWidget;
59 class QTreeWidgetItem;
60 class QWebView;
61 class QNetworkAccessManager;
62 class QNetworkReply;
63 
64 namespace OpenMS
65 {
66  class TOPPASWidget;
67  class TOPPASScene;
68  class TOPPASTabBar;
69  class TOPPASLogWindow;
70  class TOPPASResources;
71 
77  class OPENMS_GUI_DLLAPI TOPPASBase :
78  public QMainWindow,
79  public DefaultParamHandler
80  {
81  Q_OBJECT
82 
83 public:
84 
86  TOPPASBase(QWidget* parent = 0);
88  virtual ~TOPPASBase();
89 
95  void loadPreferences(String filename = "");
97  void savePreferences();
99  void loadFiles(const StringList& list, QSplashScreen* splash_screen);
100 
101 public slots:
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();
115  void savePipeline();
117  void exportAsImage();
119  void loadPipelineResourceFile();
121  void savePipelineResourceFile();
123  void openOnlinePipelineRepository();
125  void preferencesDialog();
127  void updateCurrentPath();
129  void updateTabBar(QWidget* w);
131  void showAboutDialog();
133  void showURL();
140  void showStatusMessage(std::string msg, OpenMS::UInt time);
142  void showCursorStatus(double x, double y);
144  void closeFile();
146  void updateToolBar();
148  void runPipeline();
150  void abortPipeline();
152  void toolStarted();
154  void toolFinished();
156  void toolCrashed();
158  void toolFailed();
160  void outputVertexFinished(const String& file);
162  void updateTOPPOutputLog(const QString& out);
164  void showPipelineFinishedLogMessage();
166  void saveToClipboard(TOPPASScene* scene);
168  void sendClipboardContent();
170  void refreshParameters();
172  void openFilesInTOPPView(QStringList all_files);
174  void openToppasFile(QString filename);
175 protected slots:
176 
180  void closeByTab(int id);
183  void focusByTab(int id);
185 
187  void updateMenu();
189  void showAsWindow_(TOPPASWidget* sw, const String& caption, const int special_id = -1);
191  void insertNewVertex_(double x, double y, QTreeWidgetItem* item = 0);
193  void insertNewVertexInCenter_(QTreeWidgetItem* item);
194 
196  void downloadTOPPASfromHomepage_(const QUrl& url);
198  void toppasFileDownloaded_(QNetworkReply* r);
199 
201  void descriptionUpdated_();
202 
203 protected:
204 
209 
213  QToolBar* tool_bar_;
215 
218 
220  QWebView* webview_;
222  QNetworkAccessManager* network_manager_;
223 
226 
231 
235  QLabel* message_label_;
238 
240  TOPPASWidget* window_(int id) const;
241 
242 
246 
249 
251  static int node_offset_;
252 
254  static qreal z_value_;
255 
257  TOPPASWidget* activeWindow_() const;
258 
260 
261  void closeEvent(QCloseEvent* event);
262  void keyPressEvent(QKeyEvent* e);
264 
266  enum LogState
267  {
270  LS_ERROR
271  };
273  void showLogMessage_(LogState state, const String& heading, const String& body);
274 
277 
278 
279 public:
281  static int const IDINITIALUNTITLED = 1000;
282 
284 
285  static TOPPASTreeView* createTOPPToolsTreeWidget(QWidget* parent_widget = 0);
287 
290  static QString savePipelineAs(TOPPASWidget* w, QString current_path);
291 
293  static QString loadPipelineResourceFile(TOPPASWidget* w, QString current_path);
294 
296  static QString savePipelineResourceFile(TOPPASWidget* w, QString current_path);
297 
299  static QString refreshPipelineParameters(TOPPASWidget* tw, QString current_path);
301  }; //class
302 
303 } //namespace
304 
305 #endif // OPENMS_APPLICATIONS_TOPPASBASE_H
Notice.
Definition: TOPPASBase.h:268
A container for all visual items of a TOPPAS workflow.
Definition: TOPPASScene.h:86
A more convenient string class.
Definition: String.h:57
QWorkspace * ws_
Main workspace.
Definition: TOPPASBase.h:217
Tree view implementation for the list of TOPP tools.
Definition: TOPPASTreeView.h:55
QNetworkAccessManager * network_manager_
download .toppas files from homepage
Definition: TOPPASBase.h:222
Warning.
Definition: TOPPASBase.h:269
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
static qreal z_value_
z-value counter for new inserted nodes (new nodes should be on top)
Definition: TOPPASBase.h:254
String tmp_path_
The path for temporary files.
Definition: TOPPASBase.h:248
Widget visualizing and allowing to edit TOPP pipelines.
Definition: TOPPASWidget.h:61
QToolBar * tool_bar_
Definition: TOPPASBase.h:213
Main window of the TOPPAS tool.
Definition: TOPPASBase.h:77
TOPPASLogWindow * log_
Log output window.
Definition: TOPPASBase.h:206
TOPPASScene * clipboard_scene_
The clipboard.
Definition: TOPPASBase.h:276
QListWidget * blocks_list_
List of ready analysis pipelines.
Definition: TOPPASBase.h:230
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:74
TOPPASTabBar * tab_bar_
Tab bar. The address of the corresponding window to a tab is stored as an int in tabData() ...
Definition: TOPPASBase.h:225
QTextEdit * desc_
Workflow Description window.
Definition: TOPPASBase.h:208
LogState
Log message states.
Definition: TOPPASBase.h:266
String current_path_
Definition: TOPPASBase.h:245
QWebView * webview_
OpenMS homepage workflow browser.
Definition: TOPPASBase.h:220
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
QTextEdit implementation with a "clear" button in the context menu.
Definition: TOPPASLogWindow.h:51
QTreeWidget * tools_tree_view_
Tree view of all available TOPP tools.
Definition: TOPPASBase.h:228
Convenience tab bar implementation.
Definition: TOPPASTabBar.h:60
static int node_offset_
Offset counter for new inserted nodes (to avoid invisible stacking)
Definition: TOPPASBase.h:251

OpenMS / TOPP release 2.0.0 Documentation generated on Sat May 16 2015 16:13:36 using doxygen 1.8.9.1