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 
70 
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
CurveListPanel::addCurve
bool addCurve(const std::string &plot_name)
Definition: curvelist_panel.cpp:92
CurveListPanel::createMathPlot
void createMathPlot(const std::string &linked_plot)
CurveListPanel::refreshValues
void refreshValues()
Definition: curvelist_panel.cpp:284
CurveListPanel::updateTreeModel
void updateTreeModel()
CurveListPanel::is2ndColumnHidden
bool is2ndColumnHidden() const
Definition: curvelist_panel.cpp:272
CurveListPanel::_tree_view_items
std::unordered_set< std::string > _tree_view_items
Definition: curvelist_panel.h:100
CurveListPanel::removeSelectedCurves
void removeSelectedCurves()
Definition: curvelist_panel.cpp:443
CurveListPanel::editMathPlot
void editMathPlot(const std::string &plot_name)
CurveListPanel::updateAppearance
void updateAppearance()
Definition: curvelist_panel.cpp:138
CurveListPanel::~CurveListPanel
~CurveListPanel() override
Definition: curvelist_panel.cpp:79
curvetree_view.h
CurveListPanel::on_pushButtonTrash_clicked
void on_pushButtonTrash_clicked(bool checked)
Definition: curvelist_panel.cpp:552
CurveListPanel::keyPressEvent
virtual void keyPressEvent(QKeyEvent *event) override
Definition: curvelist_panel.cpp:255
CurveListPanel::ui
Ui::CurveListPanel * ui
Definition: curvelist_panel.h:92
PJ::TransformsMap
std::unordered_map< std::string, std::shared_ptr< TransformFunction > > TransformsMap
Definition: transform_function.h:85
CurveListPanel::_column_width_dirty
bool _column_width_dirty
Definition: curvelist_panel.h:108
CurveListPanel::hiddenItemsChanged
void hiddenItemsChanged()
CurveListPanel::clearSelections
void clearSelections()
Definition: curvelist_panel.cpp:515
CurveListPanel::getTreeName
QString getTreeName(QString name)
Definition: curvelist_panel.cpp:408
CurveTreeView
Definition: curvetree_view.h:14
CurveListPanel
Definition: curvelist_panel.h:29
custom_function.h
CurveListPanel::update2ndColumnValues
void update2ndColumnValues(double time)
Definition: curvelist_panel.cpp:278
CurveListPanel::on_buttonEditCustom_clicked
void on_buttonEditCustom_clicked()
Definition: curvelist_panel.cpp:498
tree_completer.h
CurveListPanel::updateFilter
void updateFilter()
Definition: curvelist_panel.cpp:250
CurveListPanel::_custom_view
CurveTreeView * _custom_view
Definition: curvelist_panel.h:98
Ui
Definition: cheatsheet_dialog.h:6
CurveListPanel::addCustom
void addCustom(const QString &item_name)
Definition: curvelist_panel.cpp:132
CurveListPanel::deleteCurves
void deleteCurves(const std::vector< std::string > &curve_names)
CurveListPanel::getSelectedNames
std::vector< std::string > getSelectedNames() const
Definition: curvelist_panel.cpp:507
CurveListPanel::_transforms_map
const TransformsMap & _transforms_map
Definition: curvelist_panel.h:104
CurveListPanel::on_buttonAddCustom_clicked
void on_buttonAddCustom_clicked()
Definition: curvelist_panel.cpp:467
CurveListPanel::on_checkBoxShowValues_toggled
void on_checkBoxShowValues_toggled(bool show)
Definition: curvelist_panel.cpp:545
CurveListPanel::removeCurve
void removeCurve(const std::string &name)
Definition: curvelist_panel.cpp:459
mqtt_test.time
float time
Definition: mqtt_test.py:17
CurveListPanel::refreshColumns
void refreshColumns()
Definition: curvelist_panel.cpp:240
CurveListPanel::on_lineEditFilter_textChanged
void on_lineEditFilter_textChanged(const QString &search_string)
Definition: curvelist_panel.cpp:424
CurveListPanel::_style_dir
QString _style_dir
Definition: curvelist_panel.h:106
CurveListPanel::_tree_view
CurveTreeView * _tree_view
Definition: curvelist_panel.h:99
CurveListPanel::changeFontSize
void changeFontSize(int point_size)
Definition: curvelist_panel.cpp:263
CurveListPanel::onCustomSelectionChanged
void onCustomSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
Definition: curvelist_panel.cpp:486
CurveListPanel::rebuildEntireList
void rebuildEntireList(const std::vector< std::string > &names)
CurveListPanel::_tracker_time
double _tracker_time
Definition: curvelist_panel.h:102
CurveListPanel::on_stylesheetChanged
void on_stylesheetChanged(QString theme)
Definition: curvelist_panel.cpp:521
CurveListPanel::requestDeleteAll
void requestDeleteAll(int)
PJ::PlotDataMapRef
Definition: plotdata.h:34
CurveListPanel::CurveListPanel
CurveListPanel(PlotDataMapRef &mapped_plot_data, const TransformsMap &mapped_math_plots, QWidget *parent)
Definition: curvelist_panel.cpp:32
CurveListPanel::_plot_data
PlotDataMapRef & _plot_data
Definition: curvelist_panel.h:94
CurveListPanel::clear
void clear()
Definition: curvelist_panel.cpp:84
CurveListPanel::refreshMathPlot
void refreshMathPlot(const std::string &curve_name)


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Aug 11 2024 02:24:22