toolbox_base.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 PJ_TOOLBOX_BASE_H
8 #define PJ_TOOLBOX_BASE_H
9 
10 #include <QAction>
11 
12 #include <functional>
13 #include "PlotJuggler/plotdata.h"
14 #include "PlotJuggler/pj_plugin.h"
17 
18 namespace PJ
19 {
21 {
22  Q_OBJECT
23 
24 public:
25  ToolboxPlugin() = default;
26 
27  virtual void init(PlotDataMapRef& src_data, TransformsMap& transform_map) = 0;
28 
29  virtual ~ToolboxPlugin() = default;
30 
32  {
35  };
36 
37  virtual std::pair<QWidget*, WidgetType> providedWidget() const = 0;
38 
40  {
41  _parser_factories = parsers;
42  }
43 
45  {
46  return _parser_factories;
47  }
48 
49 public slots:
50 
51  virtual bool onShowWidget() = 0;
52 
53 signals:
54 
55  void plotCreated(std::string plot_name, bool is_custom = true);
56 
57  void importData(PlotDataMapRef& new_data, bool remove_old);
58 
59  void closed();
60 
61 private:
63 };
64 
65 using ToolboxPluginPtr = std::shared_ptr<ToolboxPlugin>;
66 
67 } // namespace PJ
68 
69 QT_BEGIN_NAMESPACE
70 #define Toolbox_iid "facontidavide.PlotJuggler3.Toolbox"
71 Q_DECLARE_INTERFACE(PJ::ToolboxPlugin, Toolbox_iid)
72 QT_END_NAMESPACE
73 
74 #endif
PJ::ToolboxPlugin::plotCreated
void plotCreated(std::string plot_name, bool is_custom=true)
PJ::ToolboxPlugin::FLOATING
@ FLOATING
Definition: toolbox_base.h:33
PJ::TransformsMap
std::unordered_map< std::string, std::shared_ptr< TransformFunction > > TransformsMap
Definition: transform_function.h:85
PJ::PlotJugglerPlugin
The PlotJugglerPlugin is the base class of all the plugins.
Definition: pj_plugin.h:22
PJ::ToolboxPlugin::FIXED
@ FIXED
Definition: toolbox_base.h:34
Toolbox_iid
#define Toolbox_iid
Definition: toolbox_base.h:70
transform_function.h
PJ::ToolboxPlugin::_parser_factories
ParserFactories * _parser_factories
Definition: toolbox_base.h:62
PJ::ToolboxPlugin::parserFactories
const ParserFactories * parserFactories() const
Definition: toolbox_base.h:44
PJ::ToolboxPlugin::ToolboxPlugin
ToolboxPlugin()=default
PJ::ToolboxPlugin::WidgetType
WidgetType
Definition: toolbox_base.h:31
PJ::ToolboxPlugin::providedWidget
virtual std::pair< QWidget *, WidgetType > providedWidget() const =0
PJ::ToolboxPlugin::importData
void importData(PlotDataMapRef &new_data, bool remove_old)
PJ::ToolboxPlugin::setParserFactories
void setParserFactories(ParserFactories *parsers)
Definition: toolbox_base.h:39
plotdata.h
pj_plugin.h
PJ::ToolboxPluginPtr
std::shared_ptr< ToolboxPlugin > ToolboxPluginPtr
Definition: toolbox_base.h:65
PJ::ParserFactories
std::map< QString, std::shared_ptr< ParserFactoryPlugin > > ParserFactories
Definition: messageparser_base.h:157
PJ::ToolboxPlugin::~ToolboxPlugin
virtual ~ToolboxPlugin()=default
PJ::ToolboxPlugin
Definition: toolbox_base.h:20
PJ
Definition: dataloader_base.h:16
PJ::ToolboxPlugin::onShowWidget
virtual bool onShowWidget()=0
PJ::PlotDataMapRef
Definition: plotdata.h:34
PJ::ToolboxPlugin::closed
void closed()
messageparser_base.h
PJ::ToolboxPlugin::init
virtual void init(PlotDataMapRef &src_data, TransformsMap &transform_map)=0


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