Class PlotData#

Inheritance Relationships#

Base Type#

Class Documentation#

class PlotData : public Karana::Core::Base#

Class that contains plot data and associated methods for potentially multiple plots.

Public Functions

PlotData(const std::vector<SinglePlotData> &plot_data, std::string_view host, std::string_view port, std::string_view target)#

PlotData constructor. The constructor is not meant to be called directly. Please use the create(…) method instead to create an instance.

Parameters:
  • plot_data – The data for the plots.

  • host – The host for the websocket.

  • port – The port for the websocket.

  • target – The target for the websocket.

~PlotData()#

Destructor.

void addPlot(SinglePlotData plot_data)#

Add a plot.

Parameters:

plot_data – The data for the plot to add.

void removePlot(size_t index)#

Remove the plot at index.

Parameters:

index – The index of the plot to remove.

void update()#

Get data from the SinglePlotData and send it via a websocket to the server.

void sendWebsocketMessage(const std::string &msg)#

Send a message over the websocket. This should be used with caution and only if you know exactly what type of messages are allowed to be sent.

Parameters:

msg – The message to send.

void shutdown()#

Shutdown the websocket client.

Public Members

std::vector<SinglePlotData> plot_fns#

The data for the plots.

Public Static Functions

static Karana::Core::ks_ptr<PlotData> create(const std::vector<SinglePlotData> &plot_data, std::string_view host, std::string_view port, std::string_view target)#

Create an instance of PlotData.

Parameters:
  • plot_data – The data for the plots.

  • host – The host for the websocket.

  • port – The port for the websocket.

  • target – The target for the websocket.

Returns:

A pointer to the newly created PlotData.