Go to the documentation of this file.
10 #include <QMessageBox>
32 throw std::runtime_error(std::string(
"Error in Library part:\n") + err.
what());
39 throw std::runtime_error(std::string(
"Error in Global part:\n") + err.
what());
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())
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())
110 auto series = std::make_unique<TimeseriesRef>(&(it->second));
123 if (
name.is<std::string>() ==
false)
127 auto str_name =
name.as<std::string>();
143 if (
name.is<std::string>() ==
false)
147 auto str_name =
name.as<std::string>();
160 auto GetSeriesNames = [
this]() {
161 std::vector<std::string> names;
164 names.push_back(it.first);
virtual const char * what() const noexcept override
bool xmlSaveState(QDomDocument &doc, QDomElement &parent_element) const override
Override this method to save the status of the plugin to XML.
state_view & set_function(Key &&key, Args &&... args)
std::vector< std::string > _created_curves
std::string _function_code
basic_object< reference > object
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
constexpr std::in_place_t in_place
sol::usertype< CreatedSeriesTime > _created_timeseries
const char * name() const override
Name of the plugin type, NOT the particular instance.
protected_function_result safe_script(lua_Reader reader, void *data, Fx &&on_error, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
protected_function_result script(const string_view &code, Fx &&on_error, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
sol::usertype< TimeseriesRef > _timeseries_ref
CreatedSeriesXY(PlotDataMapRef *data_map, const std::string &name)
bool valid() const noexcept
void calculate() override
TimeseriesMap numeric
Numerical timeseries.
PJ::PlotDataXY * _plot_data
TimeseriesRef(PlotData *data)
const T & move(const T &v)
PJ::PlotData * _plot_data
usertype< Class > new_usertype(Args &&... args)
PlotDataXY & getOrCreateScatterXY(const std::string &name, PlotGroup::Ptr group={})
constexpr lua_nil_t lua_nil
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
void open_libraries(Args &&... args)
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
object make_object(lua_State *L_, T &&value)
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 Nov 11 2024 03:23:46