lua_custom_function.h
Go to the documentation of this file.
1 #ifndef LUA_CUSTOM_FUNCTION_H
2 #define LUA_CUSTOM_FUNCTION_H
3 
4 #include "custom_function.h"
5 #include "sol.hpp"
6 
7 #include <mutex>
8 
10 {
11 public:
13 
14  void initEngine() override;
15 
16  void calculatePoints(const std::vector<const PlotData*>& channels_data,
17  size_t point_index, std::vector<PlotData::Point>& points) override;
18 
19  QString language() const override
20  {
21  return "LUA";
22  }
23 
24  const char* name() const override
25  {
26  return "LuaCustomFunction";
27  }
28 
29  bool xmlLoadState(const QDomElement& parent_element) override;
30 
31  std::string getError(sol::error err);
32 
33 private:
36  std::vector<double> _chan_values;
37  std::mutex mutex_;
38  int global_lines_ = 0;
39  int function_lines_ = 0;
40 };
41 
42 #endif // LUA_CUSTOM_FUNCTION_H
sol::basic_protected_function
Definition: forward.hpp:1159
LuaCustomFunction::initEngine
void initEngine() override
Definition: lua_custom_function.cpp:25
LuaCustomFunction
Definition: lua_custom_function.h:9
LuaCustomFunction::_lua_engine
sol::state _lua_engine
Definition: lua_custom_function.h:34
LuaCustomFunction::name
const char * name() const override
Name of the plugin type, NOT the particular instance.
Definition: lua_custom_function.h:24
LuaCustomFunction::function_lines_
int function_lines_
Definition: lua_custom_function.h:39
LuaCustomFunction::language
QString language() const override
Definition: lua_custom_function.h:19
LuaCustomFunction::getError
std::string getError(sol::error err)
Definition: lua_custom_function.cpp:169
LuaCustomFunction::LuaCustomFunction
LuaCustomFunction(SnippetData snippet={})
Definition: lua_custom_function.cpp:4
LuaCustomFunction::xmlLoadState
bool xmlLoadState(const QDomElement &parent_element) override
Override this method to load the status of the plugin from XML.
Definition: lua_custom_function.cpp:162
custom_function.h
LuaCustomFunction::global_lines_
int global_lines_
Definition: lua_custom_function.h:38
sol.hpp
CustomFunction::snippet
const SnippetData & snippet() const
Definition: custom_function.cpp:64
LuaCustomFunction::_lua_function
sol::protected_function _lua_function
Definition: lua_custom_function.h:35
LuaCustomFunction::calculatePoints
void calculatePoints(const std::vector< const PlotData * > &channels_data, size_t point_index, std::vector< PlotData::Point > &points) override
Definition: lua_custom_function.cpp:55
sol::error
Definition: sol.hpp:4573
CustomFunction
Definition: custom_function.h:40
SnippetData
Definition: custom_function.h:19
sol::state
Definition: sol.hpp:28238
LuaCustomFunction::_chan_values
std::vector< double > _chan_values
Definition: lua_custom_function.h:36
LuaCustomFunction::mutex_
std::mutex mutex_
Definition: lua_custom_function.h:37


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