Go to the documentation of this file.
10 #include <QMessageBox>
31 sol::error err = result;
32 throw std::runtime_error(std::string(
"Error in Library part:\n") + err.what());
38 sol::error err = result;
39 throw std::runtime_error(std::string(
"Error in Global part:\n") + err.what());
46 sol::error err = result;
47 throw std::runtime_error(std::string(
"Error in Function part:\n") + err.what());
53 QString lua_function, QString lua_library)
54 : _global_code(lua_global.toStdString())
55 , _function_code(lua_function.toStdString())
56 , _library_code(lua_library.toStdString())
78 sol::error err = result;
79 throw std::runtime_error(err.what());
82 catch (std::exception& err)
84 QMessageBox::warning(
nullptr,
"Error in Reactive Script", QString(err.what()),
104 auto str =
name.as<std::string>();
106 if (it ==
plotData()->numeric.end())
108 return sol::make_object(
_lua_engine, sol::lua_nil);
110 auto series = std::make_unique<TimeseriesRef>(&(it->second));
123 if (
name.is<std::string>() ==
false)
125 return sol::make_object(
_lua_engine, sol::lua_nil);
127 auto str_name =
name.as<std::string>();
131 return sol::object(
_lua_engine, sol::in_place, series);
143 if (
name.is<std::string>() ==
false)
145 return sol::make_object(
_lua_engine, sol::lua_nil);
147 auto str_name =
name.as<std::string>();
151 return sol::object(
_lua_engine, sol::in_place, series);
160 auto GetSeriesNames = [
this]() {
161 std::vector<std::string> names;
164 names.push_back(it.first);
168 _lua_engine.set_function(
"GetSeriesNames", GetSeriesNames);
bool xmlSaveState(QDomDocument &doc, QDomElement &parent_element) const override
Override this method to save the status of the plugin to XML.
std::vector< std::string > _created_curves
std::string _function_code
std::string _library_code
sol::usertype< CreatedSeriesXY > _created_scatter
sol::protected_function _lua_function
CreatedSeriesBase(PlotDataMapRef *data_map, const std::string &name, bool timeseries)
CreatedSeriesTime(PlotDataMapRef *data_map, const std::string &name)
std::pair< double, double > at(unsigned i) const
sol::usertype< CreatedSeriesTime > _created_timeseries
const char * name() const override
Name of the plugin type, NOT the particular instance.
sol::usertype< TimeseriesRef > _timeseries_ref
CreatedSeriesXY(PlotDataMapRef *data_map, const std::string &name)
void calculate() override
TimeseriesMap numeric
Numerical timeseries.
PJ::PlotDataXY * _plot_data
TimeseriesRef(PlotData *data)
const T & move(const T &v)
PJ::PlotData * _plot_data
PlotDataXY & getOrCreateScatterXY(const std::string &name, PlotGroup::Ptr group={})
void setTimeTracker(double time_tracker_value)
void push_back(double x, double y)
PlotData & getOrCreateNumeric(const std::string &name, PlotGroup::Ptr group={})
auto format(const text_style &ts, const S &format_str, const Args &... args) -> std::basic_string< Char >
int getIndexFromX(double x) const
virtual size_t size() const
virtual void pushBack(const Point &p)
ReactiveLuaFunction(PlotDataMapRef *data_map, QString lua_global, QString lua_function, QString lua_library)
bool xmlLoadState(const QDomElement &parent_element) override
Override this method to load the status of the plugin from XML.
const Point & at(size_t index) const
void set(unsigned index, double x, double y)
std::pair< double, double > at(unsigned i) const
double atTime(double t) const
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon May 26 2025 02:22:38