pqLogViewerDialog.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
5 #ifndef pqLogViewerDialog_h
6 #define pqLogViewerDialog_h
7 
8 #include "pqComponentsModule.h"
10 
11 #include <QComboBox>
12 #include <QDialog>
13 #include <QMap>
14 #include <QPair>
15 
16 #include "vtkLogger.h"
17 #include "vtkSMSession.h"
18 
19 #include <array>
20 
21 namespace Ui
22 {
23 class pqLogViewerDialog;
24 }
25 
35 class PQCOMPONENTS_EXPORT pqLogViewerDialog : public QDialog
36 {
37  Q_OBJECT
38 
39 public:
40  pqLogViewerDialog(QWidget* parent = nullptr);
41  ~pqLogViewerDialog() override;
42  typedef QDialog Superclass;
43 
47  void refresh();
48 
52  void clear();
53 
57  void addLogView();
58 
59 protected:
60  // Override to handle custom close button icon in tab widget
61  bool eventFilter(QObject* obj, QEvent* event) override;
62 
63 private Q_SLOTS:
64  void linkedScroll(double time);
65 
66  // Set the verbosity of logs on a given process
67  void setProcessVerbosity(int process, int index);
68 
69 private: // NOLINT(readability-redundant-access-specifiers)
70  Q_DISABLE_COPY(pqLogViewerDialog)
71 
72  // Add a log view to the window
73  void appendLogView(pqSingleLogViewerWidget* logView);
74 
75  void recordRefTimes();
76  void initializeRankComboBox();
77  void initializeVerbosityComboBoxes();
78  void initializeVerbosities(QComboBox* combobox);
79 
80  void updateCategory(int category, bool promote);
81 
82  void updateCategories();
83 
84  // Convert combobox index to verbosity
85  vtkLogger::Verbosity getVerbosity(int index);
86 
87  // Convert verbosity to combobox index
88  int getVerbosityIndex(vtkLogger::Verbosity verbosity);
89 
91  QList<pqSingleLogViewerWidget*> LogViews;
92  QVector<int> RankNumbers;
93  QList<vtkSmartPointer<vtkSMProxy>> LogRecorderProxies;
94  using LogLocation = QPair<vtkSmartPointer<vtkSMProxy>, int>;
95  QMap<LogLocation, double> RefTimes;
96  std::array<bool, 5> CategoryPromoted;
97 };
98 
99 #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.