curvelist_panel.h
Go to the documentation of this file.
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5  */
6 
7 #ifndef CURVE_SELECTOR_H
8 #define CURVE_SELECTOR_H
9 
10 #include <QWidget>
11 #include <QAction>
12 #include <QListWidget>
13 #include <QMouseEvent>
14 #include <QStandardItemModel>
15 #include <QTableView>
16 #include <QItemSelection>
17 #include <unordered_set>
18 
20 #include "tree_completer.h"
21 #include "curvetree_view.h"
22 #include <array>
23 
24 namespace Ui
25 {
26 class CurveListPanel;
27 }
28 
29 class CurveListPanel : public QWidget
30 {
31  Q_OBJECT
32 
33 public:
34  explicit CurveListPanel(PlotDataMapRef& mapped_plot_data,
35  const TransformsMap& mapped_math_plots, QWidget* parent);
36 
37  ~CurveListPanel() override;
38 
39  void clear();
40 
41  bool addCurve(const std::string& plot_name);
42 
43  void addCustom(const QString& item_name);
44 
45  void refreshColumns();
46 
47  void removeCurve(const std::string& name);
48 
49  void rebuildEntireList(const std::vector<std::string>& names);
50 
51  void updateFilter();
52 
53  void changeFontSize(int point_size);
54 
55  bool is2ndColumnHidden() const;
56 
57  void update2ndColumnValues(double time);
58 
59  virtual void keyPressEvent(QKeyEvent* event) override;
60 
61  void updateAppearance();
62 
63 private slots:
64 
65  void on_lineEditFilter_textChanged(const QString& search_string);
66 
67  void removeSelectedCurves();
68 
69  void on_buttonAddCustom_clicked();
70 
71  void on_buttonEditCustom_clicked();
72 
73  void onCustomSelectionChanged(const QItemSelection& selected,
74  const QItemSelection& deselected);
75 
76  void on_checkBoxShowValues_toggled(bool show);
77 
78  void on_pushButtonTrash_clicked(bool checked);
79 
80 public slots:
81 
82  std::vector<std::string> getSelectedNames() const;
83 
84  void clearSelections();
85 
86  void on_stylesheetChanged(QString theme);
87 
88  void refreshValues();
89 
90 protected:
91 private:
92  Ui::CurveListPanel* ui;
93 
95 
96  void updateTreeModel();
97 
100  std::unordered_set<std::string> _tree_view_items;
101 
102  double _tracker_time = 0;
103 
105 
106  QString _style_dir;
107 
109 
110  QString getTreeName(QString name);
111 
112 signals:
113 
114  void hiddenItemsChanged();
115 
116  void createMathPlot(const std::string& linked_plot);
117 
118  void editMathPlot(const std::string& plot_name);
119 
120  void refreshMathPlot(const std::string& curve_name);
121 
122  void deleteCurves(const std::vector<std::string>& curve_names);
123 
124  void requestDeleteAll(int);
125 };
126 
127 #endif // CURVE_SELECTOR_H
std::unordered_map< std::string, std::shared_ptr< TransformFunction > > TransformsMap
CurveTreeView * _tree_view
const TransformsMap & _transforms_map
Ui::CurveListPanel * ui
float time
Definition: mqtt_test.py:17
CurveTreeView * _custom_view
void clear(lua_State *L, int table_index)
Definition: sol.hpp:11710
std::unordered_set< std::string > _tree_view_items
PlotDataMapRef & _plot_data


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Jun 19 2023 03:01:01