function_editor.h
Go to the documentation of this file.
1 #ifndef AddCustomPlotDialog_H
2 #define AddCustomPlotDialog_H
3 
4 #include <QDialog>
5 #include <QTimer>
6 #include <QListWidgetItem>
7 #include <unordered_map>
8 #include "PlotJuggler/plotdata.h"
9 #include "custom_function.h"
10 #include "qwt_plot_curve.h"
11 #include "ui_function_editor.h"
12 #include "plotwidget.h"
14 
15 #include "QLuaCompleter"
16 #include "QSyntaxStyle"
17 
18 class FunctionEditorWidget : public QWidget
19 {
20  Q_OBJECT
21 
22 public:
23  explicit FunctionEditorWidget(PlotDataMapRef& plotMapData,
24  const TransformsMap& mapped_custom_plots,
25  QWidget* parent);
26 
27  virtual ~FunctionEditorWidget() override;
28 
29  void setLinkedPlotName(const QString& linkedPlotName);
30 
32  {
35  };
36 
37  void clear();
38 
39  QString getLinkedData() const;
40 
41  const PlotData& getPlotData() const;
42 
43  void createNewPlot();
44 
46 
47  bool eventFilter(QObject* obj, QEvent* event) override;
48 
49  void saveSettings();
50 
51 public slots:
52  void on_stylesheetChanged(QString theme);
53 
54 private slots:
55 
56  void on_snippetsListSaved_currentRowChanged(int currentRow);
57 
58  void on_snippetsListSaved_doubleClicked(const QModelIndex& index);
59 
60  void on_nameLineEdit_textChanged(const QString& arg1);
61 
62  void savedContextMenu(const QPoint& pos);
63 
65 
67 
69 
70  void onRenameSaved();
71 
73 
75 
77 
79 
80  void on_listSourcesChanged();
81 
82  void on_lineEditSource_textChanged(const QString& text);
83 
84  void onUpdatePreview();
85 
86  void onUpdatePreviewBatch();
87 
89 
91 
93 
94  void on_lineEditTab2Filter_textChanged(const QString& arg1);
95 
97 
98  void on_suffixLineEdit_textChanged(const QString& arg1);
99 
100  void on_tabWidget_currentChanged(int index);
101 
103 
105 
107 
108 private:
109  void importSnippets(const QByteArray& xml_text);
110 
111  QByteArray exportSnippets() const;
112 
113  bool addToSaved(const QString& name, const SnippetData& snippet);
114 
115  void updatePreview();
116 
117  // QTimer _update_preview_timer;
118 
121  Ui::FunctionEditor* ui;
122 
123  int _v_count;
124 
126 
127  QStringList _dragging_curves;
128 
131 
133 
136 
138 
141 
142  void setSemaphore(QLabel* semaphore, QString errors);
143 
144 signals:
145  void accept(std::vector<CustomPlotPtr> plot);
146  void closed();
147 };
148 
149 #endif // AddCustomPlotDialog_H
FunctionEditorWidget::on_pushButtonHelpTab2_clicked
void on_pushButtonHelpTab2_clicked()
Definition: function_editor.cpp:944
FunctionEditorWidget::on_tabWidget_currentChanged
void on_tabWidget_currentChanged(int index)
Definition: function_editor.cpp:964
delayed_callback.hpp
PJ::TimeseriesBase
Definition: timeseries.h:16
FunctionEditorWidget::on_listAdditionalSources_itemSelectionChanged
void on_listAdditionalSources_itemSelectionChanged()
Definition: function_editor.cpp:710
FunctionEditorWidget::getLinkedData
QString getLinkedData() const
Definition: function_editor.cpp:237
FunctionEditorWidget::on_pushButtonCreate_clicked
void on_pushButtonCreate_clicked()
Definition: function_editor.cpp:615
FunctionEditorWidget::on_buttonSaveFunctions_clicked
void on_buttonSaveFunctions_clicked()
Definition: function_editor.cpp:501
plotwidget.h
FunctionEditorWidget::_update_preview_tab2
DelayedCallback _update_preview_tab2
Definition: function_editor.h:140
FunctionEditorWidget::lua_completer_batch_
QLuaCompleter * lua_completer_batch_
Definition: function_editor.h:135
FunctionEditorWidget::on_stylesheetChanged
void on_stylesheetChanged(QString theme)
Definition: function_editor.cpp:37
FunctionEditorWidget::accept
void accept(std::vector< CustomPlotPtr > plot)
FunctionEditorWidget::_update_preview_tab1
DelayedCallback _update_preview_tab1
Definition: function_editor.h:139
FunctionEditorWidget::eventFilter
bool eventFilter(QObject *obj, QEvent *event) override
Definition: function_editor.cpp:281
FunctionEditorWidget::onLineEditTab2FilterChanged
void onLineEditTab2FilterChanged()
Definition: function_editor.cpp:897
QLuaCompleter
Class, that describes completer with glsl specific types and functions.
Definition: QLuaCompleter.hpp:10
FunctionEditorWidget::saveSettings
void saveSettings()
Definition: function_editor.cpp:178
FunctionEditorWidget::on_globalVarsTextBatch_textChanged
void on_globalVarsTextBatch_textChanged()
Definition: function_editor.cpp:976
FunctionEditorWidget::setLinkedPlotName
void setLinkedPlotName(const QString &linkedPlotName)
Definition: function_editor.cpp:221
FunctionEditorWidget::createNewPlot
void createNewPlot()
Definition: function_editor.cpp:242
FunctionEditorWidget::onUpdatePreviewBatch
void onUpdatePreviewBatch()
Definition: function_editor.cpp:857
PJ::TransformsMap
std::unordered_map< std::string, std::shared_ptr< TransformFunction > > TransformsMap
Definition: transform_function.h:85
FunctionEditorWidget::onRenameSaved
void onRenameSaved()
Definition: function_editor.cpp:591
FunctionEditorWidget::CREATE
@ CREATE
Definition: function_editor.h:33
FunctionEditorWidget::getPlotData
const PlotData & getPlotData() const
FunctionEditorWidget::on_suffixLineEdit_textChanged
void on_suffixLineEdit_textChanged(const QString &arg1)
Definition: function_editor.cpp:959
FunctionEditorWidget::_plot_map_data
PlotDataMapRef & _plot_map_data
Definition: function_editor.h:119
FunctionEditorWidget::on_pushButtonHelp_clicked
void on_pushButtonHelp_clicked()
Definition: function_editor.cpp:887
FunctionEditorWidget::on_functionText_textChanged
void on_functionText_textChanged()
Definition: function_editor.cpp:986
PlotWidget
Definition: plotwidget.h:38
FunctionEditorWidget::_v_count
int _v_count
Definition: function_editor.h:123
FunctionEditorWidget::on_nameLineEdit_textChanged
void on_nameLineEdit_textChanged(const QString &arg1)
Definition: function_editor.cpp:460
custom_function.h
CustomPlotPtr
std::shared_ptr< CustomFunction > CustomPlotPtr
Definition: custom_function.h:15
FunctionEditorWidget::on_listSourcesChanged
void on_listSourcesChanged()
Definition: function_editor.cpp:696
FunctionEditorWidget::on_buttonSaveCurrent_clicked
void on_buttonSaveCurrent_clicked()
Definition: function_editor.cpp:535
FunctionEditorWidget::ui
Ui::FunctionEditor * ui
Definition: function_editor.h:121
FunctionEditorWidget::~FunctionEditorWidget
virtual ~FunctionEditorWidget() override
Definition: function_editor.cpp:212
FunctionEditorWidget::_preview_widget
PlotWidget * _preview_widget
Definition: function_editor.h:130
PJ::DelayedCallback
Definition: delayed_callback.hpp:17
FunctionEditorWidget::on_globalVarsText_textChanged
void on_globalVarsText_textChanged()
Definition: function_editor.cpp:981
FunctionEditorWidget::on_lineEditSource_textChanged
void on_lineEditSource_textChanged(const QString &text)
Definition: function_editor.cpp:734
FunctionEditorWidget::on_pushButtonCancel_pressed
void on_pushButtonCancel_pressed()
Definition: function_editor.cpp:686
FunctionEditorWidget::on_snippetsListSaved_doubleClicked
void on_snippetsListSaved_doubleClicked(const QModelIndex &index)
Definition: function_editor.cpp:423
FunctionEditorWidget::_dragging_curves
QStringList _dragging_curves
Definition: function_editor.h:127
FunctionEditorWidget::savedContextMenu
void savedContextMenu(const QPoint &pos)
Definition: function_editor.cpp:432
FunctionEditorWidget::_transform_maps
const TransformsMap & _transform_maps
Definition: function_editor.h:120
FunctionEditorWidget::updatePreview
void updatePreview()
Definition: function_editor.cpp:739
FunctionEditorWidget::importSnippets
void importSnippets(const QByteArray &xml_text)
Definition: function_editor.cpp:350
FunctionEditorWidget::_tab2_filter
DelayedCallback _tab2_filter
Definition: function_editor.h:137
FunctionEditorWidget::_snipped_saved
SnippetsMap _snipped_saved
Definition: function_editor.h:125
plotdata.h
FunctionEditorWidget::on_snippetsListSaved_currentRowChanged
void on_snippetsListSaved_currentRowChanged(int currentRow)
Definition: function_editor.cpp:390
FunctionEditorWidget::setSemaphore
void setSemaphore(QLabel *semaphore, QString errors)
Definition: function_editor.cpp:744
FunctionEditorWidget::onUpdatePreview
void onUpdatePreview()
Definition: function_editor.cpp:775
FunctionEditorWidget::closed
void closed()
FunctionEditorWidget::on_pushButtonDeleteCurves_clicked
void on_pushButtonDeleteCurves_clicked()
Definition: function_editor.cpp:716
FunctionEditorWidget::MODIFY
@ MODIFY
Definition: function_editor.h:34
FunctionEditorWidget::editExistingPlot
void editExistingPlot(CustomPlotPtr data)
Definition: function_editor.cpp:249
SnippetData
Definition: custom_function.h:19
FunctionEditorWidget
Definition: function_editor.h:18
FunctionEditorWidget::_editor_mode
EditorMode _editor_mode
Definition: function_editor.h:132
FunctionEditorWidget::_local_plot_data
PlotDataMapRef _local_plot_data
Definition: function_editor.h:129
FunctionEditorWidget::exportSnippets
QByteArray exportSnippets() const
Definition: function_editor.cpp:382
FunctionEditorWidget::FunctionEditorWidget
FunctionEditorWidget(PlotDataMapRef &plotMapData, const TransformsMap &mapped_custom_plots, QWidget *parent)
Definition: function_editor.cpp:53
SnippetsMap
std::map< QString, SnippetData > SnippetsMap
Definition: custom_function.h:28
mqtt_test.data
dictionary data
Definition: mqtt_test.py:22
FunctionEditorWidget::on_functionTextBatch_textChanged
void on_functionTextBatch_textChanged()
Definition: function_editor.cpp:954
qwt_plot_curve.h
PJ::PlotDataMapRef
Definition: plotdata.h:34
FunctionEditorWidget::EditorMode
EditorMode
Definition: function_editor.h:31
FunctionEditorWidget::on_lineEditTab2Filter_textChanged
void on_lineEditTab2Filter_textChanged(const QString &arg1)
Definition: function_editor.cpp:949
FunctionEditorWidget::lua_completer_
QLuaCompleter * lua_completer_
Definition: function_editor.h:134
FunctionEditorWidget::clear
void clear()
Definition: function_editor.cpp:226
FunctionEditorWidget::addToSaved
bool addToSaved(const QString &name, const SnippetData &snippet)
Definition: function_editor.cpp:563
FunctionEditorWidget::on_buttonLoadFunctions_clicked
void on_buttonLoadFunctions_clicked()
Definition: function_editor.cpp:473


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:44