OpenMS
TOPPASOutputFileListVertex.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Chris Bielow $
6 // $Authors: Johannes Junker, Chris Bielow $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 // OpenMS_GUI config
12 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
13 
15 
16 namespace OpenMS
17 {
23  class OPENMS_GUI_DLLAPI TOPPASOutputFileListVertex :
24  public TOPPASVertex
25  {
26  Q_OBJECT
27 
28 public:
29 
35  ~TOPPASOutputFileListVertex() override = default;
39  String getName() const override;
40  // documented in base class
41  void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) override;
42  // documented in base class
43  QRectF boundingRect() const override;
44  // documented in base class
45  void reset(bool reset_all_files = false) override;
47  void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*) override;
49  void run() override;
57  void setTopoNr(UInt nr) override;
59  void openContainingFolder() const;
62  void setOutputFolderName(const QString& name);
64  const QString& getOutputFolderName() const;
65 
66 public slots:
67 
68  //documented in base class
69  void inEdgeHasChanged() override;
70 
71 signals:
73  void outputFileWritten(const String& file);
74 
77 
78 protected:
79 
80  // custom output folder name
82 
83  static bool copy_(const QString & from, const QString & to);
84  // convenience members, not required for operation, but for progress during copying
85  int files_written_ = 0;
86  int files_total_ = 0;
87  };
88 }
89 
A more convenient string class.
Definition: String.h:34
A vertex representing an output file list.
Definition: TOPPASOutputFileListVertex.h:25
TOPPASOutputFileListVertex & operator=(const TOPPASOutputFileListVertex &rhs)
Assignment operator.
void reset(bool reset_all_files=false) override
const QString & getOutputFolderName() const
return the output folder where results are written
TOPPASOutputFileListVertex()=default
Default constructor.
TOPPASOutputFileListVertex(const TOPPASOutputFileListVertex &rhs)
Copy constructor.
String getFullOutputDirectory() const
Returns the full directory (including preceding output path as selected by user)
void openContainingFolder() const
Opens the folders of the output files.
String getOutputDir() const
Returns the directory where the output files are stored.
QString output_folder_name_
Definition: TOPPASOutputFileListVertex.h:81
~TOPPASOutputFileListVertex() override=default
Destructor.
void outputFileWritten(const String &file)
Emitted when an output file was written.
static bool copy_(const QString &from, const QString &to)
STATIC(!) function which calls QFile::copy(); needs to be static, since we need to pass a function po...
String getName() const override
returns "OutputVertex"
void setOutputFolderName(const QString &name)
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *) override
opens the folder containing the output data
QRectF boundingRect() const override
Returns the bounding rectangle of this item.
String createOutputDir() const
Creates the output directory for this node.
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
void setTopoNr(UInt nr) override
Sets the topological sort number and removes invalidated tmp files.
void run() override
Called when the parent node has finished execution.
void outputFolderNameChanged()
Emitted when user has changed the output folder name (i.e. output dir needs to be newly created and p...
The base class of the different vertex classes.
Definition: TOPPASVertex.h:77
unsigned int UInt
Unsigned integer type.
Definition: Types.h:68
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22