1 #ifndef DATA_STREAMER_TEMPLATE_H 2 #define DATA_STREAMER_TEMPLATE_H 5 #include <unordered_set> 28 virtual bool start(QStringList*) = 0;
71 #define DataStream_iid "com.icarustechnology.PlotJuggler.DataStreamer" 83 std::lock_guard<std::mutex> lock(
mutex() );
85 it.second.setMaximumRangeX( range );
87 for (
auto& it:
dataMap().user_defined) {
88 it.second.setMaximumRangeX( range );
97 std::vector<QString> added_curves;
100 const std::string&
name = it.first;
101 if( it.second.size()>0 && destination.
numeric.count(name) == 0)
103 added_curves.push_back( QString::fromStdString( name ) );
109 const std::string&
name = it.first;
110 auto& source_plot = it.second;
111 auto plot_with_same_name = destination.
numeric.find(name);
114 if( plot_with_same_name == destination.
numeric.end() )
116 plot_with_same_name = destination.
numeric.emplace(
117 std::piecewise_construct,
118 std::forward_as_tuple(name),
119 std::forward_as_tuple(name)
122 auto& destination_plot = plot_with_same_name->second;
123 for (
size_t i=0;
i< source_plot.size();
i++)
125 destination_plot.pushBack( source_plot.at(
i) );
132 const std::string&
name = it.first;
133 auto& source_plot = it.second;
134 auto plot_with_same_name = destination.
user_defined.find(name);
137 if( plot_with_same_name == destination.
user_defined.end() )
140 std::piecewise_construct,
141 std::forward_as_tuple(name),
142 std::forward_as_tuple(name)
145 auto& destination_plot = plot_with_same_name->second;
146 for (
size_t i=0;
i< source_plot.size();
i++)
148 destination_plot.pushBack( source_plot.at(
i) );
std::unordered_map< std::string, PlotData > numeric
PlotDataMapRef & dataMap()
const PlotDataMapRef & dataMap() const
virtual void shutdown()=0
std::unordered_map< std::string, PlotDataAny > user_defined
virtual const char * name() const =0
virtual bool isRunning() const =0
void setMaximumRange(double range)
QAction * _start_streamer
virtual bool start(QStringList *)=0
The DataStreamer base class to create your own plugin.
virtual std::vector< QString > appendData(PlotDataMapRef &destination)