pqLogViewerDialog.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqLogViewerDialog.h
5 
6  Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
7  All rights reserved.
8 
9  ParaView is a free software; you can redistribute it and/or modify it
10  under the terms of the ParaView license version 1.2.
11 
12  See License_v1.2.txt for the full ParaView license.
13  A copy of this license can be obtained by contacting
14  Kitware Inc.
15  28 Corporate Drive
16  Clifton Park, NY 12065
17  USA
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 ========================================================================*/
32 
33 #ifndef pqLogViewerDialog_h
34 #define pqLogViewerDialog_h
35 
36 #include "pqComponentsModule.h"
38 
39 #include <QComboBox>
40 #include <QDialog>
41 #include <QMap>
42 #include <QPair>
43 
44 #include "vtkLogger.h"
45 #include "vtkSMSession.h"
46 
47 #include <array>
48 
49 namespace Ui
50 {
51 class pqLogViewerDialog;
52 }
53 
63 class PQCOMPONENTS_EXPORT pqLogViewerDialog : public QDialog
64 {
65  Q_OBJECT
66 
67 public:
68  pqLogViewerDialog(QWidget* parent = nullptr);
69  ~pqLogViewerDialog() override;
70  typedef QDialog Superclass;
71 
75  void refresh();
76 
80  void clear();
81 
85  void addLogView();
86 
87 protected:
88  // Override to handle custom close button icon in tab widget
89  bool eventFilter(QObject* obj, QEvent* event) override;
90 
91 private Q_SLOTS:
92  void linkedScroll(double time);
93 
94  // Set the verbosity of logs on a given process
95  void setProcessVerbosity(int process, int index);
96 
97 private: // NOLINT(readability-redundant-access-specifiers)
98  Q_DISABLE_COPY(pqLogViewerDialog)
99 
100  // Add a log view to the window
101  void appendLogView(pqSingleLogViewerWidget* logView);
102 
103  void recordRefTimes();
104  void initializeRankComboBox();
105  void initializeVerbosityComboBoxes();
106  void initializeVerbosities(QComboBox* combobox);
107 
108  void updateCategory(int category, bool promote);
109 
110  void updateCategories();
111 
112  // Convert combobox index to verbosity
113  vtkLogger::Verbosity getVerbosity(int index);
114 
115  // Convert verbosity to combobox index
116  int getVerbosityIndex(vtkLogger::Verbosity verbosity);
117 
119  QList<pqSingleLogViewerWidget*> LogViews;
120  QVector<int> RankNumbers;
121  QList<vtkSmartPointer<vtkSMProxy>> LogRecorderProxies;
122  using LogLocation = QPair<vtkSmartPointer<vtkSMProxy>, int>;
123  QMap<LogLocation, double> RefTimes;
124  std::array<bool, 5> CategoryPromoted;
125 };
126 
127 #endif // pqLogViewerDialog_h
A single log viewer widget which has a reference to the log recorder proxy.
#define PQCOMPONENTS_EXPORT
A window for showing multiple log viewers.