PicoScenes API Docs
 
Loading...
Searching...
No Matches
WebPlotService.hxx
Go to the documentation of this file.
1//
2// PlotService.hxx
3// PlotService接口定义
4//
5
6#ifndef PICOSCENES_PLATFORM_PLOTSERVICE_HXX
7#define PICOSCENES_PLATFORM_PLOTSERVICE_HXX
8
9#include <memory>
10#include <string>
11#include <vector>
12#include <complex>
13#include <utility>
14
16public:
17
18 enum class PlotCategory {
21 Plugin
22 };
23
24 enum class ChartType {
25 Line,
27 };
28
29 struct PlotConfig {
30 std::string xAxisLabel{"xLabel"};
31 std::string yAxisLabel{"yLabel"};
32 double xMin{0};
33 double xMax{100};
34 double yMin{0};
35 double yMax{100};
36 };
37
38 static std::shared_ptr<WebPlotService> getInstance();
39
40 // 幅度、相位的plot方法
41 bool plot(const PlotCategory category, const std::string& chartname, const ChartType charttype, const std::vector<std::vector<std::pair<int16_t, double>>>& data) {
42 return plot(category, chartname, charttype, data, PlotConfig());
43 }
44 // RSS的plot方法
45 bool plot(const PlotCategory category, const std::string& chartname, const ChartType charttype, const std::vector<std::deque<std::pair<double, double>>>& data) {
46 return plot(category, chartname, charttype, data, PlotConfig());
47 }
48 // EVM、CFO、SFO的plot方法
49 bool plot(const PlotCategory category, const std::string& chartname, const ChartType charttype, const std::deque<std::pair<double, double>>& data) {
50 return plot(category, chartname, charttype, data, PlotConfig());
51 }
52
53 virtual bool plot(PlotCategory category, const std::string& chartname, ChartType charttype, const std::vector<std::vector<std::pair<int16_t, double>>>& data, const PlotConfig& config) = 0;
54
55 virtual bool plot(PlotCategory category, const std::string& chartname, ChartType charttype, const std::vector<std::deque<std::pair<double, double>>>& data, const PlotConfig& config) = 0;
56
57 virtual bool plot(PlotCategory category, const std::string& chartname, ChartType charttype, const std::deque<std::pair<double, double>>& data, const PlotConfig& config) = 0;
58
59 virtual ~WebPlotService() = default;
60};
61
62#endif // PICOSCENES_PLATFORM_PLOTSERVICE_HXX
virtual bool plot(PlotCategory category, const std::string &chartname, ChartType charttype, const std::deque< std::pair< double, double > > &data, const PlotConfig &config)=0
bool plot(const PlotCategory category, const std::string &chartname, const ChartType charttype, const std::vector< std::vector< std::pair< int16_t, double > > > &data)
virtual bool plot(PlotCategory category, const std::string &chartname, ChartType charttype, const std::vector< std::vector< std::pair< int16_t, double > > > &data, const PlotConfig &config)=0
virtual bool plot(PlotCategory category, const std::string &chartname, ChartType charttype, const std::vector< std::deque< std::pair< double, double > > > &data, const PlotConfig &config)=0
static std::shared_ptr< WebPlotService > getInstance()
bool plot(const PlotCategory category, const std::string &chartname, const ChartType charttype, const std::deque< std::pair< double, double > > &data)
bool plot(const PlotCategory category, const std::string &chartname, const ChartType charttype, const std::vector< std::deque< std::pair< double, double > > > &data)
virtual ~WebPlotService()=default