Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
PJ::ReactiveLuaFunction Class Reference

#include <reactive_function.h>

Inheritance diagram for PJ::ReactiveLuaFunction:
Inheritance graph
[legend]

Public Member Functions

void calculate () override
 
const std::vector< std::string > & createdCurves () const
 
QString getFunctionCode ()
 
QString getGlobalCode ()
 
const char * name () const override
 Name of the plugin type, NOT the particular instance. More...
 
int numInputs () const override
 
int numOutputs () const override
 
 ReactiveLuaFunction (PlotDataMapRef *data_map, QString lua_global, QString lua_function, QString lua_library)
 
void reset () override
 
void setTimeTracker (double time_tracker_value)
 
bool xmlLoadState (const QDomElement &parent_element) override
 Override this method to load the status of the plugin from XML. More...
 
bool xmlSaveState (QDomDocument &doc, QDomElement &parent_element) const override
 Override this method to save the status of the plugin to XML. More...
 
- Public Member Functions inherited from PJ::TransformFunction
std::vector< const PlotData * > & dataSources ()
 
unsigned order () const
 
PlotDataMapRefplotData ()
 
virtual void setData (PlotDataMapRef *data, const std::vector< const PlotData * > &src_vect, std::vector< PlotData * > &dst_vect)
 
 TransformFunction ()
 
virtual ~TransformFunction ()=default
 
- Public Member Functions inherited from PJ::PlotJugglerPlugin
virtual const std::vector< QAction * > & availableActions ()
 
virtual bool isDebugPlugin ()
 
virtual QWidget * optionsWidget ()
 optionsWidget pointer to a persistent widget used to set the plugin options . More...
 
 PlotJugglerPlugin ()=default
 
QDomElement xmlSaveState (QDomDocument &doc) const
 

Protected Member Functions

void prepareLua ()
 

Protected Attributes

std::vector< std::string > _created_curves
 
sol::usertype< CreatedSeriesXY_created_scatter
 
sol::usertype< CreatedSeriesTime_created_timeseries
 
std::string _function_code
 
std::string _global_code
 
std::string _library_code
 
sol::state _lua_engine
 
sol::protected_function _lua_function
 
sol::usertype< TimeseriesRef_timeseries_ref
 
double _tracker_value = 0
 
- Protected Attributes inherited from PJ::TransformFunction
PlotDataMapRef_data
 
std::vector< PlotData * > _dst_vector
 
unsigned _order
 
std::vector< const PlotData * > _src_vector
 

Private Member Functions

void init ()
 

Additional Inherited Members

- Public Types inherited from PJ::TransformFunction
using Ptr = std::shared_ptr< TransformFunction >
 
- Signals inherited from PJ::TransformFunction
void parametersChanged ()
 

Detailed Description

Definition at line 66 of file reactive_function.h.

Constructor & Destructor Documentation

◆ ReactiveLuaFunction()

PJ::ReactiveLuaFunction::ReactiveLuaFunction ( PlotDataMapRef data_map,
QString  lua_global,
QString  lua_function,
QString  lua_library 
)

Definition at line 52 of file reactive_function.cpp.

Member Function Documentation

◆ calculate()

void PJ::ReactiveLuaFunction::calculate ( )
overridevirtual

Implements PJ::TransformFunction.

Definition at line 71 of file reactive_function.cpp.

◆ createdCurves()

const std::vector<std::string>& PJ::ReactiveLuaFunction::createdCurves ( ) const
inline

Definition at line 93 of file reactive_function.h.

◆ getFunctionCode()

QString PJ::ReactiveLuaFunction::getFunctionCode ( )
inline

Definition at line 107 of file reactive_function.h.

◆ getGlobalCode()

QString PJ::ReactiveLuaFunction::getGlobalCode ( )
inline

Definition at line 102 of file reactive_function.h.

◆ init()

void PJ::ReactiveLuaFunction::init ( )
private

Definition at line 14 of file reactive_function.cpp.

◆ name()

const char* PJ::ReactiveLuaFunction::name ( ) const
inlineoverridevirtual

Name of the plugin type, NOT the particular instance.

Implements PJ::TransformFunction.

Definition at line 72 of file reactive_function.h.

◆ numInputs()

int PJ::ReactiveLuaFunction::numInputs ( ) const
inlineoverridevirtual

Number of inputs. Return -1 if it is not a constant.

When numInputs() > 0, then the data will be initialized using the method: setDataSource(const std::vector<const PlotData*>& src_data)

When numInputs() == -1, then the number of inputs is undefined and the data will be initialized using the method_ setDataSource( PlotDataMapRef* data )

Implements PJ::TransformFunction.

Definition at line 77 of file reactive_function.h.

◆ numOutputs()

int PJ::ReactiveLuaFunction::numOutputs ( ) const
inlineoverridevirtual

Number of outputs. Define the size of the vector used in: calculate(std::vector<PlotData*>& dst_data)

Implements PJ::TransformFunction.

Definition at line 82 of file reactive_function.h.

◆ prepareLua()

void PJ::ReactiveLuaFunction::prepareLua ( )
protected

Definition at line 99 of file reactive_function.cpp.

◆ reset()

void PJ::ReactiveLuaFunction::reset ( )
overridevirtual

Clear the cache, state and any stored data

Reimplemented from PJ::TransformFunction.

Definition at line 62 of file reactive_function.cpp.

◆ setTimeTracker()

void PJ::ReactiveLuaFunction::setTimeTracker ( double  time_tracker_value)

Definition at line 66 of file reactive_function.cpp.

◆ xmlLoadState()

bool PJ::ReactiveLuaFunction::xmlLoadState ( const QDomElement &  parent_element)
overridevirtual

Override this method to load the status of the plugin from XML.

Reimplemented from PJ::PlotJugglerPlugin.

Definition at line 94 of file reactive_function.cpp.

◆ xmlSaveState()

bool PJ::ReactiveLuaFunction::xmlSaveState ( QDomDocument &  doc,
QDomElement &  parent_element 
) const
overridevirtual

Override this method to save the status of the plugin to XML.

Reimplemented from PJ::PlotJugglerPlugin.

Definition at line 89 of file reactive_function.cpp.

Member Data Documentation

◆ _created_curves

std::vector<std::string> PJ::ReactiveLuaFunction::_created_curves
protected

Definition at line 120 of file reactive_function.h.

◆ _created_scatter

sol::usertype<CreatedSeriesXY> PJ::ReactiveLuaFunction::_created_scatter
protected

Definition at line 127 of file reactive_function.h.

◆ _created_timeseries

sol::usertype<CreatedSeriesTime> PJ::ReactiveLuaFunction::_created_timeseries
protected

Definition at line 126 of file reactive_function.h.

◆ _function_code

std::string PJ::ReactiveLuaFunction::_function_code
protected

Definition at line 117 of file reactive_function.h.

◆ _global_code

std::string PJ::ReactiveLuaFunction::_global_code
protected

Definition at line 116 of file reactive_function.h.

◆ _library_code

std::string PJ::ReactiveLuaFunction::_library_code
protected

Definition at line 118 of file reactive_function.h.

◆ _lua_engine

sol::state PJ::ReactiveLuaFunction::_lua_engine
protected

Definition at line 122 of file reactive_function.h.

◆ _lua_function

sol::protected_function PJ::ReactiveLuaFunction::_lua_function
protected

Definition at line 123 of file reactive_function.h.

◆ _timeseries_ref

sol::usertype<TimeseriesRef> PJ::ReactiveLuaFunction::_timeseries_ref
protected

Definition at line 125 of file reactive_function.h.

◆ _tracker_value

double PJ::ReactiveLuaFunction::_tracker_value = 0
protected

Definition at line 115 of file reactive_function.h.


The documentation for this class was generated from the following files:


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Aug 11 2024 02:24:31